-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skidding sounds implemented. Starting to work on Airborne states.
- Loading branch information
1 parent
b2232f5
commit fc0392f
Showing
8 changed files
with
103 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
src/main/java/com/floralquafloral/registries/states/action/AirborneActionDefinition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package com.floralquafloral.registries.states.action; | ||
|
||
import com.floralquafloral.mariodata.client.Input; | ||
import com.floralquafloral.mariodata.client.MarioClientData; | ||
import com.floralquafloral.stats.CharaStat; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public abstract class AirborneActionDefinition implements ActionDefinition { | ||
public static boolean jumpCapped; | ||
|
||
public abstract static class AerialTransitions { | ||
public static final ActionTransitionDefinition BASIC_LANDING = new ActionTransitionDefinition( | ||
"qua_mario:basic", | ||
(data) -> data.getMario().isOnGround() | ||
); | ||
public static final ActionTransitionDefinition DOUBLE_JUMPABLE_LANDING = new ActionTransitionDefinition( | ||
"qua_mario:basic", | ||
BASIC_LANDING.EVALUATOR, | ||
(data, isSelf, seed) -> { | ||
if(isSelf && data instanceof MarioClientData clientData) | ||
clientData.jumpLandingTime = 5; | ||
}, | ||
(data, seed) -> { | ||
|
||
} | ||
); | ||
public static final ActionTransitionDefinition TRIPLE_JUMPABLE_LANDING = new ActionTransitionDefinition( | ||
"qua_mario:basic", | ||
BASIC_LANDING.EVALUATOR, | ||
(data, isSelf, seed) -> { | ||
if(isSelf && data instanceof MarioClientData clientData) | ||
clientData.doubleJumpLandingTime = 5; | ||
}, | ||
(data, seed) -> { | ||
|
||
} | ||
); | ||
} | ||
|
||
private final @NotNull CharaStat GRAVITY = getGravity(); | ||
private final @NotNull CharaStat JUMP_GRAVITY = getJumpGravity(); | ||
private final @Nullable CharaStat JUMP_CAP = getJumpCap(); | ||
//TODO: Make Grounded states use CharaStats as well! | ||
|
||
protected abstract @NotNull CharaStat getGravity(); | ||
protected abstract @NotNull CharaStat getJumpGravity(); | ||
protected abstract @Nullable CharaStat getJumpCap(); | ||
|
||
@Override public final void selfTick(MarioClientData data) { | ||
double yVel = data.getYVel(); | ||
boolean aboveJumpCap = JUMP_CAP != null && yVel > JUMP_CAP.getValue(data); | ||
|
||
CharaStat useGravity = aboveJumpCap ? JUMP_GRAVITY : GRAVITY; | ||
yVel += useGravity.getValue(data); | ||
if(aboveJumpCap && !Input.JUMP.isHeld() && !jumpCapped) { | ||
yVel = JUMP_CAP.getValue(data); | ||
jumpCapped = true; | ||
} | ||
|
||
data.setYVel(yVel); | ||
aerialSelfTick(); | ||
} | ||
|
||
public abstract void aerialSelfTick(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-3.23 KB
(79%)
src/main/resources/assets/qua_mario/sounds/sfx/movement/skid_ice.ogg
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters