From 5ee47ba2a9c48cd7ebe1d4362a40957fbde59752 Mon Sep 17 00:00:00 2001 From: Floral <49110090+floral-qua-floral@users.noreply.github.com> Date: Thu, 21 Nov 2024 19:04:45 -0500 Subject: [PATCH] Renamed transition phases to be more descriptive. Added Aquatic Actions and Submerged+Swim actions. --- .../definitions/CharacterDefinition.java | 6 +- .../definitions/PowerUpDefinition.java | 4 + .../definitions/actions/ActionDefinition.java | 41 +++------ .../actions/AquaticActionDefinition.java | 77 ++++++++++++++++ .../definitions/actions/CharaStat.java | 4 + .../actions/GroundedActionDefinition.java | 6 +- .../definitions/actions/StatCategory.java | 3 + .../floralquafloral/mariodata/MarioData.java | 3 +- .../mariodata/MarioPlayerData.java | 15 +++- .../moveable/MarioMainClientData.java | 9 +- .../registries/RegistryManager.java | 4 + .../states/action/ParsedAction.java | 17 ++-- .../states/action/TransitionPhase.java | 6 +- .../action/baseactions/ActionDebug.java | 6 +- .../action/baseactions/ActionDebugAlt.java | 6 +- .../action/baseactions/GroundPound.java | 6 +- .../action/baseactions/GroundPoundWindup.java | 6 +- .../states/action/baseactions/Mounted.java | 6 +- .../action/baseactions/airborne/Backflip.java | 2 +- .../baseactions/airborne/DoubleJump.java | 5 +- .../action/baseactions/airborne/DuckFall.java | 7 +- .../action/baseactions/airborne/DuckJump.java | 7 +- .../action/baseactions/airborne/Fall.java | 7 +- .../action/baseactions/airborne/Jump.java | 7 +- .../action/baseactions/airborne/LongJump.java | 6 +- .../action/baseactions/airborne/PJump.java | 3 +- .../action/baseactions/airborne/Sideflip.java | 2 +- .../action/baseactions/airborne/Stomp.java | 2 +- .../baseactions/airborne/TripleJump.java | 5 +- .../action/baseactions/aquatic/Submerged.java | 88 +++++++++++++++++++ .../action/baseactions/aquatic/Swim.java | 18 ++++ .../baseactions/grounded/ActionBasic.java | 11 +-- .../baseactions/grounded/DuckSlide.java | 7 +- .../baseactions/grounded/DuckWaddle.java | 7 +- .../grounded/GroundPoundLanding.java | 7 +- .../action/baseactions/grounded/PRun.java | 7 +- .../action/baseactions/grounded/Skid.java | 7 +- .../character/basecharacters/Luigi.java | 7 ++ .../character/basecharacters/Mario.java | 7 ++ .../character/basecharacters/Toadette.java | 7 ++ .../powerup/basepowerups/SmallForm.java | 4 + .../powerup/basepowerups/SuperForm.java | 4 + mod/src/main/resources/fabric.mod.json | 3 +- 43 files changed, 353 insertions(+), 109 deletions(-) create mode 100644 api/src/main/java/com/floralquafloral/definitions/actions/AquaticActionDefinition.java create mode 100644 mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/aquatic/Submerged.java create mode 100644 mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/aquatic/Swim.java diff --git a/api/src/main/java/com/floralquafloral/definitions/CharacterDefinition.java b/api/src/main/java/com/floralquafloral/definitions/CharacterDefinition.java index 4f3802d..4d05556 100644 --- a/api/src/main/java/com/floralquafloral/definitions/CharacterDefinition.java +++ b/api/src/main/java/com/floralquafloral/definitions/CharacterDefinition.java @@ -1,5 +1,9 @@ package com.floralquafloral.definitions; +import org.jetbrains.annotations.NotNull; + +import java.util.Map; + public interface CharacterDefinition extends MarioMajorStateDefinition { - + @NotNull Map getPoweredUpPlayermodels(); } diff --git a/api/src/main/java/com/floralquafloral/definitions/PowerUpDefinition.java b/api/src/main/java/com/floralquafloral/definitions/PowerUpDefinition.java index e7fdf36..6f2dcb1 100644 --- a/api/src/main/java/com/floralquafloral/definitions/PowerUpDefinition.java +++ b/api/src/main/java/com/floralquafloral/definitions/PowerUpDefinition.java @@ -6,7 +6,11 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.util.Map; + public interface PowerUpDefinition extends MarioMajorStateDefinition { + @NotNull Map getCharacterPlayermodels(); + void acquirePower(MarioData data); void losePower(MarioData data); diff --git a/api/src/main/java/com/floralquafloral/definitions/actions/ActionDefinition.java b/api/src/main/java/com/floralquafloral/definitions/actions/ActionDefinition.java index f070a48..2a9f18d 100644 --- a/api/src/main/java/com/floralquafloral/definitions/actions/ActionDefinition.java +++ b/api/src/main/java/com/floralquafloral/definitions/actions/ActionDefinition.java @@ -2,25 +2,16 @@ import com.floralquafloral.mariodata.MarioClientSideData; import com.floralquafloral.definitions.MarioStateDefinition; +import com.floralquafloral.mariodata.MarioData; import com.floralquafloral.mariodata.MarioTravelData; +import net.minecraft.sound.SoundEvents; import net.minecraft.util.Identifier; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.util.List; public interface ActionDefinition extends MarioStateDefinition { - default void boogersaur() { - Logger logger = LoggerFactory.getLogger("qua_mario_api"); - - logger.info("Boogersaur running!"); - Identifier tester = Identifier.of("qua_mario:stinker"); - logger.info("tester: {}", tester); - } - - @Nullable String getAnimationName(); @Nullable CameraAnimationSet getCameraAnimations(); @@ -39,9 +30,9 @@ default void boogersaur() { * POST-MOVE transitions are meant to be used for transitions based on Mario's position. For instance, falling is a * post-move transition. */ - List getPreTickTransitions(); - List getPostTickTransitions(); - List getPostMoveTransitions(); + List getPreTravelTransitions(); + List getInputTransitions(); + List getWorldCollisionTransitions(); List getTransitionInjections(); @@ -164,19 +155,15 @@ public BumpingRule(int ceilingBumpStrength, int floorBumpStrength, int wallBumpS this.WALLS = wallBumpStrength; } } -// enum BumpType { -// NONE(0, 0), -// HIT_CEILINGS(2, 0), -// GROUND_POUND(0, 2), -// SPIN_JUMP(2, 1); -// -// public final int HIT_CEILING_STRENGTH; -// public final int HIT_FLOOR_STRENGTH; -// BumpType(int hitCeilingStrength, int hitFloorStrength) { -// this.HIT_CEILING_STRENGTH = hitCeilingStrength; -// this.HIT_FLOOR_STRENGTH = hitFloorStrength; -// } -// } + + abstract class CommonTransitions { + public static final ActionTransitionDefinition ENTER_WATER = new ActionTransitionDefinition( + "qua_mario:submerged", + data -> data.getInputs().SPIN.isPressed(), + data -> {}, + (data, isSelf, seed) -> data.playSoundEvent(SoundEvents.AMBIENT_UNDERWATER_ENTER, seed) + ); + } class ActionTransitionDefinition { @FunctionalInterface public interface TransitionEvaluator { diff --git a/api/src/main/java/com/floralquafloral/definitions/actions/AquaticActionDefinition.java b/api/src/main/java/com/floralquafloral/definitions/actions/AquaticActionDefinition.java new file mode 100644 index 0000000..45c3d8a --- /dev/null +++ b/api/src/main/java/com/floralquafloral/definitions/actions/AquaticActionDefinition.java @@ -0,0 +1,77 @@ +package com.floralquafloral.definitions.actions; + +import com.floralquafloral.mariodata.MarioTravelData; +import net.minecraft.util.math.Vec3d; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.joml.Vector2d; + +public abstract class AquaticActionDefinition implements ActionDefinition { + public abstract static class AquaticTransitions { + public static final ActionTransitionDefinition EXIT_WATER = new ActionTransitionDefinition( + "qua_mario:fall", + data -> data.getInputs().SPIN.isPressed() + ); + } + + public abstract static class AquaticStats { + public final CharaStat GRAVITY = new CharaStat(0, StatCategory.AQUATIC_GRAVITY); + public final CharaStat TERMINAL_VELOCITY = new CharaStat(0, StatCategory.AQUATIC_TERMINAL_VELOCITY); + + public final CharaStat DRAG = new CharaStat(0.07, StatCategory.WATER_DRAG); + public final CharaStat DRAG_MIN = new CharaStat(0.01, StatCategory.WATER_DRAG); + } + + private final @Nullable CharaStat ACTION_GRAVITY = getGravity() == 0 ? null : new CharaStat(getGravity(), StatCategory.AQUATIC_GRAVITY); + private final @Nullable CharaStat ACTION_TERMINAL_VELOCITY = getGravity() == 0 ? null : new CharaStat(getTerminalVelocity(), StatCategory.AQUATIC_TERMINAL_VELOCITY); + private final @Nullable CharaStat ACTION_DRAG = getDrag() == 0 ? null : new CharaStat(getDrag(), StatCategory.WATER_DRAG); + private final @Nullable CharaStat ACTION_DRAG_MINIMUM = getDrag() == 0 ? null : new CharaStat(getDragMinimum(), StatCategory.WATER_DRAG); + + public abstract double getGravity(); + public abstract double getTerminalVelocity(); + public abstract double getDrag(); + public abstract double getDragMinimum(); + + @Override + public void travelHook(MarioTravelData data) { + if(ACTION_TERMINAL_VELOCITY != null) { + double yVel = data.getYVel(); + double terminalVelocity = ACTION_TERMINAL_VELOCITY.get(data); + + if(yVel > terminalVelocity) { + assert ACTION_GRAVITY != null; + yVel += ACTION_GRAVITY.get(data); + + data.setYVel(Math.max(terminalVelocity, yVel)); + } + } + if(ACTION_DRAG_MINIMUM != null) { + assert ACTION_DRAG != null; + applyAquaticDrag(data, ACTION_DRAG, ACTION_DRAG_MINIMUM); + } + } + + public abstract void aquaticTravel(MarioTravelData data); + + public static void applyAquaticDrag(MarioTravelData data, CharaStat drag, CharaStat dragMin) { + double dragValue = drag.get(data); + boolean dragInverted = dragValue < 0; + double slipFactor = 1.0; + double dragMinValue = dragMin.get(data) * slipFactor; + if(!dragInverted) dragValue *= slipFactor; + + + Vec3d deltaVelocities = new Vec3d( + -dragValue * data.getForwardVel(), + -dragValue * data.getYVel(), + -dragValue * data.getStrafeVel() + ); + double dragVelocitySquared = deltaVelocities.lengthSquared(); + if(dragVelocitySquared != 0 && dragVelocitySquared < dragMinValue * dragMinValue) + deltaVelocities = deltaVelocities.normalize().multiply(dragMinValue); + + data.setForwardVel(data.getForwardVel() + deltaVelocities.x); + data.setYVel(data.getYVel() + deltaVelocities.y); + data.setStrafeVel(data.getStrafeVel() + deltaVelocities.z); + } +} diff --git a/api/src/main/java/com/floralquafloral/definitions/actions/CharaStat.java b/api/src/main/java/com/floralquafloral/definitions/actions/CharaStat.java index 4e2ae6b..e13f333 100644 --- a/api/src/main/java/com/floralquafloral/definitions/actions/CharaStat.java +++ b/api/src/main/java/com/floralquafloral/definitions/actions/CharaStat.java @@ -4,6 +4,10 @@ import java.util.Set; +/** + * Represents a numerical value that might vary depending on character and power-up form. + * This is used for movement, speed thresholds, and damage calculations. + */ public class CharaStat { public final double BASE; public final Set CATEGORIES; diff --git a/api/src/main/java/com/floralquafloral/definitions/actions/GroundedActionDefinition.java b/api/src/main/java/com/floralquafloral/definitions/actions/GroundedActionDefinition.java index 238f221..67cacb8 100644 --- a/api/src/main/java/com/floralquafloral/definitions/actions/GroundedActionDefinition.java +++ b/api/src/main/java/com/floralquafloral/definitions/actions/GroundedActionDefinition.java @@ -14,7 +14,7 @@ public abstract class GroundedActionDefinition implements ActionDefinition { public static final CharaStat ZERO = new CharaStat(0.0); public abstract static class GroundedTransitions { - public static final CharaStat P_SPEED = new CharaStat(0.665, P_RUNNING, FORWARD, SPEED); + public static final CharaStat P_SPEED = new CharaStat(0.5875, P_RUNNING, FORWARD, SPEED); public static void performJump(MarioTravelData data, CharaStat velocityStat, @Nullable CharaStat addendStat) { if(data.getMario().isMainPlayer() || !data.getMario().getWorld().isClient) { double jumpVel = velocityStat.get(data); @@ -62,7 +62,7 @@ public static void performJump(MarioTravelData data, CharaStat velocityStat, @Nu public abstract void groundedTravel(MarioTravelData data); - public void groundAccel( +public static void groundAccel( MarioTravelData data, CharaStat forwardAccel, CharaStat forwardTarget, CharaStat strafeAccel, CharaStat strafeTarget, double forwardAngleContribution, double strafeAngleContribution, CharaStat redirectDelta @@ -76,7 +76,7 @@ public void groundAccel( ); } - public void applyDrag( + public static void applyDrag( MarioTravelData data, CharaStat drag, CharaStat dragMin, double forwardAngleContribution, double strafeAngleContribution, diff --git a/api/src/main/java/com/floralquafloral/definitions/actions/StatCategory.java b/api/src/main/java/com/floralquafloral/definitions/actions/StatCategory.java index 94952ad..4d3a580 100644 --- a/api/src/main/java/com/floralquafloral/definitions/actions/StatCategory.java +++ b/api/src/main/java/com/floralquafloral/definitions/actions/StatCategory.java @@ -22,13 +22,16 @@ public enum StatCategory { DRAG, FRICTION, // Mostly for Luigi? + WATER_DRAG, JUMP_VELOCITY, JUMP_CAP, JUMPING_GRAVITY, NORMAL_GRAVITY, + AQUATIC_GRAVITY, TERMINAL_VELOCITY, + AQUATIC_TERMINAL_VELOCITY, STOMP_BASE_DAMAGE, STOMP_ARMOR_MULTIPLIER, diff --git a/api/src/main/java/com/floralquafloral/mariodata/MarioData.java b/api/src/main/java/com/floralquafloral/mariodata/MarioData.java index 0ca165a..5ba21f4 100644 --- a/api/src/main/java/com/floralquafloral/mariodata/MarioData.java +++ b/api/src/main/java/com/floralquafloral/mariodata/MarioData.java @@ -14,7 +14,8 @@ public interface MarioData { int getBumpStrengthModifier(); boolean isSneakProhibited(); - + boolean isSubmerged(); + boolean isWading(); boolean isEnabled(); Identifier getActionID(); diff --git a/mod/src/main/java/com/floralquafloral/mariodata/MarioPlayerData.java b/mod/src/main/java/com/floralquafloral/mariodata/MarioPlayerData.java index 6f97c99..fcf2777 100644 --- a/mod/src/main/java/com/floralquafloral/mariodata/MarioPlayerData.java +++ b/mod/src/main/java/com/floralquafloral/mariodata/MarioPlayerData.java @@ -10,11 +10,14 @@ import com.floralquafloral.definitions.actions.StatCategory; import net.minecraft.block.BlockState; import net.minecraft.client.MinecraftClient; +import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.client.sound.*; import net.minecraft.entity.attribute.EntityAttributeInstance; import net.minecraft.entity.attribute.EntityAttributeModifier; import net.minecraft.entity.attribute.EntityAttributes; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.fluid.Fluids; +import net.minecraft.registry.tag.FluidTags; import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvent; import net.minecraft.util.Identifier; @@ -30,8 +33,6 @@ public abstract class MarioPlayerData implements MarioData { ATTACK_SLOWDOWN_ID, -0.5, EntityAttributeModifier.Operation.ADD_MULTIPLIED_TOTAL ); - - private boolean enabled; private final boolean IS_CLIENT; private ParsedAction action; @@ -111,6 +112,16 @@ public int getBumpStrengthModifier() { return this.powerUp.BUMP_STRENGTH_MODIFIER + this.character.BUMP_STRENGTH_MODIFIER; } + @Override + public boolean isSubmerged() { + return this.mario.isSubmergedInWater(); + } + + @Override + public boolean isWading() { + return this.mario.getFluidHeight(FluidTags.WATER) > 0.3; + } + public float getVoicePitch() { return this.powerUp.VOICE_PITCH; } diff --git a/mod/src/main/java/com/floralquafloral/mariodata/moveable/MarioMainClientData.java b/mod/src/main/java/com/floralquafloral/mariodata/moveable/MarioMainClientData.java index 7e07ca6..c431326 100644 --- a/mod/src/main/java/com/floralquafloral/mariodata/moveable/MarioMainClientData.java +++ b/mod/src/main/java/com/floralquafloral/mariodata/moveable/MarioMainClientData.java @@ -41,7 +41,7 @@ public MarioMainClientData(ClientPlayerEntity mario) { @Override public void setAction(ParsedAction action, long seed) { - MarioQuaMario.LOGGER.warn("Triggered setAction with transitions for the main client. This is abnormal!"); + MarioQuaMario.LOGGER.warn("Triggered setAction with transitions on the main client. This is abnormal!"); super.setAction(action, seed); } @@ -98,9 +98,10 @@ public void setAction(ParsedAction action, long seed) { // TODO: Levitation effect functionality - getAction().attemptTransitions(this, TransitionPhase.PRE_TICK); + getAction().attemptTransitions(this, TransitionPhase.WORLD_COLLISION); + getAction().attemptTransitions(this, TransitionPhase.PRE_TRAVEL); getAction().travelHook(this); - getAction().attemptTransitions(this, TransitionPhase.POST_TICK); + getAction().attemptTransitions(this, TransitionPhase.INPUT); getTimers().jumpLandingTime--; getTimers().doubleJumpLandingTime--; @@ -132,7 +133,7 @@ public void setAction(ParsedAction action, long seed) { } } - getAction().attemptTransitions(this, TransitionPhase.POST_MOVE); +// getAction().attemptTransitions(this, TransitionPhase.WORLD_COLLISION); applyModifiedVelocity(); diff --git a/mod/src/main/java/com/floralquafloral/registries/RegistryManager.java b/mod/src/main/java/com/floralquafloral/registries/RegistryManager.java index 66c355a..ed6a2e2 100644 --- a/mod/src/main/java/com/floralquafloral/registries/RegistryManager.java +++ b/mod/src/main/java/com/floralquafloral/registries/RegistryManager.java @@ -1,6 +1,7 @@ package com.floralquafloral.registries; import com.floralquafloral.MarioQuaMario; +import com.floralquafloral.definitions.actions.AquaticActionDefinition; import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.definitions.actions.ActionDefinition; import com.floralquafloral.definitions.actions.AirborneActionDefinition; @@ -109,6 +110,9 @@ private static void registerActions() { for(AirborneActionDefinition definition : getEntrypoints("mario-actions-airborne", AirborneActionDefinition.class)) { parseAction(definition, transitionInjections); } + for(AquaticActionDefinition definition : getEntrypoints("mario-actions-aquatic", AquaticActionDefinition.class)) { + parseAction(definition, transitionInjections); + } for(ParsedAction action : ACTIONS) { MarioQuaMario.LOGGER.info("Parsing and populating Action Transitions for {}...", action.ID); diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/ParsedAction.java b/mod/src/main/java/com/floralquafloral/registries/states/action/ParsedAction.java index 8a533fb..27762d7 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/action/ParsedAction.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/ParsedAction.java @@ -37,7 +37,8 @@ public ParsedAction(ActionDefinition definition) { this.ANIMATION = definition.getAnimationName(); this.CAMERA_ANIMATIONS = definition.getCameraAnimations(); this.SNEAK_LEGALITY = definition.getSneakLegalityRule(); - this.SLIDING_STATUS = definition.getActionSlidingStatus(); + ActionDefinition.SlidingStatus status = definition.getActionSlidingStatus(); + this.SLIDING_STATUS = status == null ? ActionDefinition.SlidingStatus.NOT_SLIDING : status; Identifier stompID = definition.getStompType(); this.STOMP = stompID == null ? null : RegistryManager.STOMP_TYPES.get(stompID); this.BUMPING_RULE = definition.getBumpingRule(); @@ -57,8 +58,6 @@ public void travelHook(MarioTravelData data) { public boolean attemptTransitions(MarioMainClientData data, TransitionPhase phase) { for(ParsedTransition transition : this.TRANSITION_LISTS.get(phase)) { if(transition.EVALUATOR.shouldTransition(data)) { - // Send C2S packet to tell the server! - long seed = RandomSeed.getSeed(); if(transition.EXECUTOR_TRAVELLERS != null) transition.EXECUTOR_TRAVELLERS.execute(data); if(transition.EXECUTOR_CLIENTS != null) transition.EXECUTOR_CLIENTS.execute(data, true, seed); @@ -72,9 +71,9 @@ public boolean attemptTransitions(MarioMainClientData data, TransitionPhase phas public boolean transitionTo(MarioPlayerData data, ParsedAction toAction, long seed) { if( - transitionTo(data, toAction, TransitionPhase.PRE_TICK, seed) || - transitionTo(data, toAction, TransitionPhase.POST_TICK, seed) || - transitionTo(data, toAction, TransitionPhase.POST_MOVE, seed) + transitionTo(data, toAction, TransitionPhase.PRE_TRAVEL, seed) || + transitionTo(data, toAction, TransitionPhase.INPUT, seed) || + transitionTo(data, toAction, TransitionPhase.WORLD_COLLISION, seed) ) return true; MarioQuaMario.LOGGER.warn("{} attempted an invalid action transition: {} -> {}", data.getMario().getName().getString(), this.ID, toAction.ID); @@ -94,11 +93,11 @@ public void populateTransitionLists(Map parseTransitionDefinitions( diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/TransitionPhase.java b/mod/src/main/java/com/floralquafloral/registries/states/action/TransitionPhase.java index e18be28..2a4c91c 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/action/TransitionPhase.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/TransitionPhase.java @@ -1,7 +1,7 @@ package com.floralquafloral.registries.states.action; public enum TransitionPhase { - PRE_TICK, - POST_TICK, - POST_MOVE + PRE_TRAVEL, + INPUT, + WORLD_COLLISION } diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/ActionDebug.java b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/ActionDebug.java index 27387eb..dd1710f 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/ActionDebug.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/ActionDebug.java @@ -51,7 +51,7 @@ public void serverTick(MarioAuthoritativeData data) { } @Override - public List getPreTickTransitions() { + public List getPreTravelTransitions() { return List.of( new ActionTransitionDefinition( "qua_mario:debug_alt", @@ -69,12 +69,12 @@ public List getPreTickTransitions() { } @Override - public List getPostTickTransitions() { + public List getInputTransitions() { return List.of(); } @Override - public List getPostMoveTransitions() { + public List getWorldCollisionTransitions() { return List.of(); } diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/ActionDebugAlt.java b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/ActionDebugAlt.java index 8c820cc..71dd2dd 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/ActionDebugAlt.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/ActionDebugAlt.java @@ -54,7 +54,7 @@ public void serverTick(MarioAuthoritativeData data) { } @Override - public List getPreTickTransitions() { + public List getPreTravelTransitions() { return List.of( new ActionTransitionDefinition( "qua_mario:debug", @@ -70,12 +70,12 @@ public List getPreTickTransitions() { } @Override - public List getPostTickTransitions() { + public List getInputTransitions() { return List.of(); } @Override - public List getPostMoveTransitions() { + public List getWorldCollisionTransitions() { return List.of(); } diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/GroundPound.java b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/GroundPound.java index c4d5069..b5f8f8c 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/GroundPound.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/GroundPound.java @@ -60,15 +60,15 @@ public class GroundPound implements ActionDefinition { } - @Override public List getPreTickTransitions() { + @Override public List getPreTravelTransitions() { return List.of(); } - @Override public List getPostTickTransitions() { + @Override public List getInputTransitions() { return List.of(); } - @Override public List getPostMoveTransitions() { + @Override public List getWorldCollisionTransitions() { return List.of( new ActionTransitionDefinition( "qua_mario:ground_pound_landing", diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/GroundPoundWindup.java b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/GroundPoundWindup.java index c260943..2c3ff39 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/GroundPoundWindup.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/GroundPoundWindup.java @@ -60,7 +60,7 @@ public void serverTick(MarioAuthoritativeData data) { } @Override - public List getPreTickTransitions() { + public List getPreTravelTransitions() { return List.of( new ActionTransitionDefinition("qua_mario:ground_pound", data -> data.getTimers().actionTimer > 4 @@ -69,12 +69,12 @@ public List getPreTickTransitions() { } @Override - public List getPostTickTransitions() { + public List getInputTransitions() { return List.of(); } @Override - public List getPostMoveTransitions() { + public List getWorldCollisionTransitions() { return List.of(); } diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/Mounted.java b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/Mounted.java index b49668c..7b843e0 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/Mounted.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/Mounted.java @@ -54,7 +54,7 @@ public void serverTick(MarioAuthoritativeData data) { } @Override - public List getPreTickTransitions() { + public List getPreTravelTransitions() { return List.of( new ActionTransitionDefinition("qua_mario:backflip", data -> !data.getMario().hasVehicle() && ((MarioPlayerData) data).attemptDismount @@ -82,7 +82,7 @@ public List getPreTickTransitions() { } @Override - public List getPostTickTransitions() { + public List getInputTransitions() { return List.of(new ActionTransitionDefinition("qua_mario:mounted", (data) -> (!((MarioPlayerData) data).attemptDismount) && data.getInputs().DUCK.isHeld() && data.getInputs().JUMP.isPressed(), data -> ((MarioPlayerData) data).attemptDismount = true, @@ -91,7 +91,7 @@ public List getPostTickTransitions() { } @Override - public List getPostMoveTransitions() { + public List getWorldCollisionTransitions() { return List.of(); } diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Backflip.java b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Backflip.java index 4c47f8a..ae4078e 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Backflip.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Backflip.java @@ -54,7 +54,7 @@ else airborneAccel(data, ); } - @Override public List getPostTickTransitions() { + @Override public List getInputTransitions() { return List.of( AerialTransitions.GROUND_POUND, AerialTransitions.makeJumpCapTransition(this, 0.765) diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/DoubleJump.java b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/DoubleJump.java index 401c4d0..eda7bdb 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/DoubleJump.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/DoubleJump.java @@ -24,7 +24,7 @@ public class DoubleJump extends Jump { public static CharaStat DOUBLE_JUMP_SPEED_THRESHOLD = new CharaStat(0, StatCategory.WALKING, StatCategory.FORWARD, StatCategory.THRESHOLD); - @Override public List getPostTickTransitions() { + @Override public List getInputTransitions() { return List.of( AerialTransitions.GROUND_POUND, AerialTransitions.makeJumpCapTransition(this, 0.285) @@ -32,8 +32,9 @@ public class DoubleJump extends Jump { } @Override - public List getPostMoveTransitions() { + public List getWorldCollisionTransitions() { return List.of( + CommonTransitions.ENTER_WATER, AerialTransitions.TRIPLE_JUMPABLE_LANDING ); } diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/DuckFall.java b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/DuckFall.java index 9e6ce37..1ffcfa9 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/DuckFall.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/DuckFall.java @@ -16,7 +16,7 @@ public class DuckFall extends Fall { return SneakLegalityRule.SLIP; } - @Override public List getPreTickTransitions() { + @Override public List getPreTravelTransitions() { return List.of( new ActionTransitionDefinition("qua_mario:fall", DuckWaddle.UNDUCK.EVALUATOR @@ -24,12 +24,13 @@ public class DuckFall extends Fall { ); } - @Override public List getPostTickTransitions() { + @Override public List getInputTransitions() { return List.of(); } - @Override public List getPostMoveTransitions() { + @Override public List getWorldCollisionTransitions() { return List.of( + CommonTransitions.ENTER_WATER, AerialTransitions.DUCKING_LANDING ); } diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/DuckJump.java b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/DuckJump.java index 2fcd2ae..6eab1f3 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/DuckJump.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/DuckJump.java @@ -16,7 +16,7 @@ public class DuckJump extends Jump { return SneakLegalityRule.ALLOW; } - @Override public List getPreTickTransitions() { + @Override public List getPreTravelTransitions() { return List.of( new ActionTransitionDefinition("qua_mario:jump", DuckWaddle.UNDUCK.EVALUATOR @@ -24,15 +24,16 @@ public class DuckJump extends Jump { ); } - @Override public List getPostTickTransitions() { + @Override public List getInputTransitions() { return List.of( AerialTransitions.makeJumpCapTransition(this, 0.14) ); } @Override - public List getPostMoveTransitions() { + public List getWorldCollisionTransitions() { return List.of( + CommonTransitions.ENTER_WATER, AerialTransitions.DUCKING_LANDING ); } diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Fall.java b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Fall.java index a628701..5bc47c2 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Fall.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Fall.java @@ -58,18 +58,19 @@ public class Fall extends AirborneActionDefinition { } - @Override public List getPreTickTransitions() { + @Override public List getPreTravelTransitions() { return List.of(); } - @Override public List getPostTickTransitions() { + @Override public List getInputTransitions() { return List.of( AerialTransitions.GROUND_POUND ); } - @Override public List getPostMoveTransitions() { + @Override public List getWorldCollisionTransitions() { return List.of( + CommonTransitions.ENTER_WATER, AerialTransitions.BASIC_LANDING ); } diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Jump.java b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Jump.java index 11c5b49..0f3a707 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Jump.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Jump.java @@ -58,21 +58,22 @@ public class Jump extends AirborneActionDefinition { } - @Override public List getPreTickTransitions() { + @Override public List getPreTravelTransitions() { return List.of( ); } - @Override public List getPostTickTransitions() { + @Override public List getInputTransitions() { return List.of( AerialTransitions.GROUND_POUND, AerialTransitions.makeJumpCapTransition(this, 0.39) ); } - @Override public List getPostMoveTransitions() { + @Override public List getWorldCollisionTransitions() { return List.of( + CommonTransitions.ENTER_WATER, AerialTransitions.DOUBLE_JUMPABLE_LANDING ); } diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/LongJump.java b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/LongJump.java index f7c12b7..91bcced 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/LongJump.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/LongJump.java @@ -65,15 +65,15 @@ public class LongJump extends AirborneActionDefinition { } - @Override public List getPreTickTransitions() { + @Override public List getPreTravelTransitions() { return List.of(); } - @Override public List getPostTickTransitions() { + @Override public List getInputTransitions() { return List.of(); } - @Override public List getPostMoveTransitions() { + @Override public List getWorldCollisionTransitions() { return List.of( AerialTransitions.DUCKING_LANDING, AerialTransitions.DOUBLE_JUMPABLE_LANDING); diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/PJump.java b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/PJump.java index 0697f8e..df10f7f 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/PJump.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/PJump.java @@ -17,8 +17,9 @@ public class PJump extends Jump { } @Override - public List getPostMoveTransitions() { + public List getWorldCollisionTransitions() { return List.of( + CommonTransitions.ENTER_WATER, new ActionTransitionDefinition("qua_mario:p_run", (data) -> data.getMario().isOnGround() && data.getForwardVel() >= ActionBasic.RUN_SPEED.getAsThreshold(data), AerialTransitions.DOUBLE_JUMPABLE_LANDING.EXECUTOR_TRAVELLERS, diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Sideflip.java b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Sideflip.java index 621e982..433831d 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Sideflip.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Sideflip.java @@ -44,7 +44,7 @@ public void airborneTravel(MarioTravelData data) { if(data.getYVel() < 0.1) airborneAccel(data); } - @Override public List getPostTickTransitions() { + @Override public List getInputTransitions() { return List.of( AerialTransitions.GROUND_POUND, AerialTransitions.makeJumpCapTransition(this, 0.65) diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Stomp.java b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Stomp.java index c1a0e7e..fcedb56 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Stomp.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Stomp.java @@ -11,7 +11,7 @@ public class Stomp extends Jump { return Identifier.of(MarioQuaMario.MOD_ID, "stomp"); } - @Override public List getPostTickTransitions() { + @Override public List getInputTransitions() { return List.of( AerialTransitions.GROUND_POUND, AerialTransitions.makeJumpCapTransition(this, 0.65) diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/TripleJump.java b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/TripleJump.java index bd5ad99..3b806c0 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/TripleJump.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/TripleJump.java @@ -34,7 +34,7 @@ public class TripleJump extends Jump { public static CharaStat TRIPLE_JUMP_SPEED_THRESHOLD = new CharaStat(0.34, StatCategory.RUNNING, StatCategory.FORWARD, StatCategory.THRESHOLD); - @Override public List getPostTickTransitions() { + @Override public List getInputTransitions() { return List.of( AerialTransitions.GROUND_POUND, AerialTransitions.makeJumpCapTransition(this, 0.65) @@ -61,8 +61,9 @@ private ActionTransitionInjection makeInjectionFrom(String otherAction) { } @Override - public List getPostMoveTransitions() { + public List getWorldCollisionTransitions() { return List.of( + CommonTransitions.ENTER_WATER, AerialTransitions.BASIC_LANDING ); } diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/aquatic/Submerged.java b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/aquatic/Submerged.java new file mode 100644 index 0000000..5b66889 --- /dev/null +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/aquatic/Submerged.java @@ -0,0 +1,88 @@ +package com.floralquafloral.registries.states.action.baseactions.aquatic; + +import com.floralquafloral.MarioQuaMario; +import com.floralquafloral.definitions.actions.AquaticActionDefinition; +import com.floralquafloral.definitions.actions.CharaStat; +import com.floralquafloral.mariodata.MarioAuthoritativeData; +import com.floralquafloral.mariodata.MarioClientSideData; +import com.floralquafloral.mariodata.MarioTravelData; +import net.minecraft.util.Identifier; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; + +public class Submerged extends AquaticActionDefinition { + @Override public @NotNull Identifier getID() { + return Identifier.of(MarioQuaMario.MOD_ID, "submerged"); + } + + @Override public @Nullable String getAnimationName() { + return "submerged"; + } + + @Override public @Nullable CameraAnimationSet getCameraAnimations() { + return null; + } + + @Override public SneakLegalityRule getSneakLegalityRule() { + return SneakLegalityRule.PROHIBIT; + } + + @Override public SlidingStatus getActionSlidingStatus() { + return SlidingStatus.NOT_SLIDING; + } + + @Override public @Nullable Identifier getStompType() { + return null; + } + + @Override public BumpingRule getBumpingRule() { + return null; + } + + @Override public double getGravity() { + return 0.0; + } + + @Override public double getTerminalVelocity() { + return 0.0; + } + + @Override public double getDrag() { + return 0.0; + } + + @Override public double getDragMinimum() { + return 0.0; + } + + @Override public void aquaticTravel(MarioTravelData data) { + + } + + @Override public void clientTick(MarioClientSideData data, boolean isSelf) { + + } + @Override public void serverTick(MarioAuthoritativeData data) { + + } + + @Override public List getPreTravelTransitions() { + return List.of(); + } + + @Override public List getInputTransitions() { + return List.of(); + } + + @Override public List getWorldCollisionTransitions() { + return List.of( + AquaticTransitions.EXIT_WATER + ); + } + + @Override public List getTransitionInjections() { + return List.of(); + } +} diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/aquatic/Swim.java b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/aquatic/Swim.java new file mode 100644 index 0000000..a79b3b7 --- /dev/null +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/aquatic/Swim.java @@ -0,0 +1,18 @@ +package com.floralquafloral.registries.states.action.baseactions.aquatic; + +import com.floralquafloral.MarioQuaMario; +import net.minecraft.util.Identifier; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class Swim extends Submerged { + @Override + public @NotNull Identifier getID() { + return Identifier.of(MarioQuaMario.MOD_ID, "swim"); + } + + @Override + public @Nullable String getAnimationName() { + return "swim"; + } +} diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/ActionBasic.java b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/ActionBasic.java index 32e6027..d69133a 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/ActionBasic.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/ActionBasic.java @@ -45,8 +45,8 @@ public class ActionBasic extends GroundedActionDefinition { public static final CharaStat OVERBACKPEDAL_ACCEL = new CharaStat(0.04, WALKING, BACKWARD, OVERSPEED_CORRECTION); public static final CharaStat UNDERBACKPEDAL_ACCEL = new CharaStat(0.055, WALKING, BACKWARD, ACCELERATION, FRICTION); - public static final CharaStat RUN_ACCEL = new CharaStat(0.0102, RUNNING, FORWARD, ACCELERATION); - public static final CharaStat RUN_SPEED = new CharaStat(0.575, RUNNING, FORWARD, SPEED); + public static final CharaStat RUN_ACCEL = new CharaStat(0.0175, RUNNING, FORWARD, ACCELERATION); + public static final CharaStat RUN_SPEED = new CharaStat(0.55, RUNNING, FORWARD, SPEED); public static final CharaStat RUN_REDIRECTION = new CharaStat(2.76, RUNNING, FORWARD, REDIRECTION); public static final CharaStat OVERRUN_ACCEL = new CharaStat(0.0175, RUNNING, FORWARD, OVERSPEED_CORRECTION); @@ -165,7 +165,7 @@ else if(data.getForwardVel() < BACKPEDAL_SPEED.getAsLimit(data)) { } @Override - public List getPreTickTransitions() { + public List getPreTravelTransitions() { return List.of( GroundedTransitions.DUCK_WADDLE, Skid.SKID_TRANSITION, @@ -178,15 +178,16 @@ public List getPreTickTransitions() { } @Override - public List getPostTickTransitions() { + public List getInputTransitions() { return List.of( GroundedTransitions.JUMP ); } @Override - public List getPostMoveTransitions() { + public List getWorldCollisionTransitions() { return List.of( + CommonTransitions.ENTER_WATER, GroundedTransitions.FALL ); } diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/DuckSlide.java b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/DuckSlide.java index d20efc3..74c3cc1 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/DuckSlide.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/DuckSlide.java @@ -65,7 +65,7 @@ public void groundedTravel(MarioTravelData data) { } @Override - public List getPreTickTransitions() { + public List getPreTravelTransitions() { return List.of( DuckWaddle.UNDUCK, new ActionTransitionDefinition("qua_mario:duck_waddle", @@ -74,7 +74,7 @@ public List getPreTickTransitions() { ); } - @Override public List getPostTickTransitions() { + @Override public List getInputTransitions() { return List.of( new ActionTransitionDefinition("qua_mario:long_jump", data -> @@ -98,8 +98,9 @@ public List getPreTickTransitions() { } @Override - public List getPostMoveTransitions() { + public List getWorldCollisionTransitions() { return List.of( + CommonTransitions.ENTER_WATER, DuckWaddle.DUCK_FALL ); } diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/DuckWaddle.java b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/DuckWaddle.java index c837dd6..d99f970 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/DuckWaddle.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/DuckWaddle.java @@ -103,14 +103,14 @@ public void groundedTravel(MarioTravelData data) { } @Override - public List getPreTickTransitions() { + public List getPreTravelTransitions() { return List.of( UNDUCK ); } @Override - public List getPostTickTransitions() { + public List getInputTransitions() { return List.of( BACKFLIP, DUCK_JUMP @@ -118,8 +118,9 @@ public List getPostTickTransitions() { } @Override - public List getPostMoveTransitions() { + public List getWorldCollisionTransitions() { return List.of( + CommonTransitions.ENTER_WATER, DUCK_FALL ); } diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/GroundPoundLanding.java b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/GroundPoundLanding.java index 95fc4df..050692f 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/GroundPoundLanding.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/GroundPoundLanding.java @@ -46,7 +46,7 @@ public void groundedTravel(MarioTravelData data) { } @Override - public List getPreTickTransitions() { + public List getPreTravelTransitions() { return List.of( new ActionTransitionDefinition("qua_mario:ground_pound", data -> data.getTimers().actionTimer > 3 && data.getInputs().DUCK.isHeld() && ((MarioMainClientData) data).canRepeatPound @@ -58,14 +58,15 @@ public List getPreTickTransitions() { } @Override - public List getPostTickTransitions() { + public List getInputTransitions() { return List.of( ); } @Override - public List getPostMoveTransitions() { + public List getWorldCollisionTransitions() { return List.of( + CommonTransitions.ENTER_WATER, new ActionTransitionDefinition("qua_mario:ground_pound", data -> GroundedTransitions.FALL.EVALUATOR.shouldTransition(data) && data.getInputs().DUCK.isHeld() ), diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/PRun.java b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/PRun.java index 3fbfc09..b582d98 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/PRun.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/PRun.java @@ -59,7 +59,7 @@ public void groundedTravel(MarioTravelData data) { } @Override - public List getPreTickTransitions() { + public List getPreTravelTransitions() { return List.of( GroundedTransitions.DUCK_WADDLE, new ActionTransitionDefinition("qua_mario:basic", @@ -74,7 +74,7 @@ public List getPreTickTransitions() { } @Override - public List getPostTickTransitions() { + public List getInputTransitions() { return List.of( new ActionTransitionDefinition("qua_mario:p_jump", GroundedTransitions.JUMP.EVALUATOR, @@ -85,8 +85,9 @@ public List getPostTickTransitions() { } @Override - public List getPostMoveTransitions() { + public List getWorldCollisionTransitions() { return List.of( + CommonTransitions.ENTER_WATER, GroundedTransitions.FALL ); } diff --git a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/Skid.java b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/Skid.java index 69b3f75..6e13e52 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/Skid.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/Skid.java @@ -68,7 +68,7 @@ public void groundedTravel(MarioTravelData data) { } @Override - public List getPreTickTransitions() { + public List getPreTravelTransitions() { return List.of( GroundedTransitions.DUCK_WADDLE, new ActionTransitionDefinition("qua_mario:basic", @@ -78,7 +78,7 @@ public List getPreTickTransitions() { } @Override - public List getPostTickTransitions() { + public List getInputTransitions() { return List.of( new ActionTransitionDefinition("qua_mario:sideflip", data -> data.getForwardVel() < Sideflip.SIDEFLIP_THRESHOLD.get(data) && data.getInputs().JUMP.isPressed(), @@ -97,8 +97,9 @@ public List getPostTickTransitions() { } @Override - public List getPostMoveTransitions() { + public List getWorldCollisionTransitions() { return List.of( + CommonTransitions.ENTER_WATER, GroundedTransitions.FALL ); } diff --git a/mod/src/main/java/com/floralquafloral/registries/states/character/basecharacters/Luigi.java b/mod/src/main/java/com/floralquafloral/registries/states/character/basecharacters/Luigi.java index a34ac84..4e39e92 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/character/basecharacters/Luigi.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/character/basecharacters/Luigi.java @@ -14,6 +14,13 @@ import static com.floralquafloral.definitions.actions.StatCategory.*; public class Luigi implements CharacterDefinition { + @Override public @NotNull Map getPoweredUpPlayermodels() { + return Map.of( + "qua_mario:small", "Small Luigi", + "qua_mario:super", "Super Luigi" + ); + } + @Override public void populateStatModifiers(Map, Double> modifiers) { // Luigi walks and runs faster diff --git a/mod/src/main/java/com/floralquafloral/registries/states/character/basecharacters/Mario.java b/mod/src/main/java/com/floralquafloral/registries/states/character/basecharacters/Mario.java index ceeb02a..e940c8d 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/character/basecharacters/Mario.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/character/basecharacters/Mario.java @@ -12,6 +12,13 @@ import java.util.Set; public class Mario implements CharacterDefinition { + @Override public @NotNull Map getPoweredUpPlayermodels() { + return Map.of( + "qua_mario:small", "Small Mario", + "qua_mario:super", "Super Mario" + ); + } + @Override public void populateStatModifiers(Map, Double> modifiers) { diff --git a/mod/src/main/java/com/floralquafloral/registries/states/character/basecharacters/Toadette.java b/mod/src/main/java/com/floralquafloral/registries/states/character/basecharacters/Toadette.java index 2ba2483..35bb704 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/character/basecharacters/Toadette.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/character/basecharacters/Toadette.java @@ -12,6 +12,13 @@ import java.util.Set; public class Toadette implements CharacterDefinition { + @Override public @NotNull Map getPoweredUpPlayermodels() { + return Map.of( + "qua_mario:small", "Small Toadette", + "qua_mario:super", "Super Toadette" + ); + } + @Override public void populateStatModifiers(Map, Double> modifiers) { diff --git a/mod/src/main/java/com/floralquafloral/registries/states/powerup/basepowerups/SmallForm.java b/mod/src/main/java/com/floralquafloral/registries/states/powerup/basepowerups/SmallForm.java index 54519e2..07304a7 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/powerup/basepowerups/SmallForm.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/powerup/basepowerups/SmallForm.java @@ -15,6 +15,10 @@ import java.util.Set; public class SmallForm implements PowerUpDefinition { + @Override public @NotNull Map getCharacterPlayermodels() { + return Map.of(); + } + @Override public @NotNull Identifier getID() { return Identifier.of(MarioQuaMario.MOD_ID, "small"); } diff --git a/mod/src/main/java/com/floralquafloral/registries/states/powerup/basepowerups/SuperForm.java b/mod/src/main/java/com/floralquafloral/registries/states/powerup/basepowerups/SuperForm.java index c5b953c..3ba32f7 100644 --- a/mod/src/main/java/com/floralquafloral/registries/states/powerup/basepowerups/SuperForm.java +++ b/mod/src/main/java/com/floralquafloral/registries/states/powerup/basepowerups/SuperForm.java @@ -15,6 +15,10 @@ import java.util.Set; public class SuperForm implements PowerUpDefinition { + @Override public @NotNull Map getCharacterPlayermodels() { + return Map.of(); + } + @Override public @NotNull Identifier getID() { return Identifier.of(MarioQuaMario.MOD_ID, "super"); } diff --git a/mod/src/main/resources/fabric.mod.json b/mod/src/main/resources/fabric.mod.json index ce09a19..b0b14c5 100644 --- a/mod/src/main/resources/fabric.mod.json +++ b/mod/src/main/resources/fabric.mod.json @@ -44,7 +44,8 @@ "com.floralquafloral.registries.states.action.baseactions.airborne.TripleJump" ], "mario-actions-aquatic": [ - + "com.floralquafloral.registries.states.action.baseactions.aquatic.Submerged", + "com.floralquafloral.registries.states.action.baseactions.aquatic.Swim" ], "mario-power-ups": [