Skip to content

Commit

Permalink
Implemented armor protection checks and stomp damage formula. Attempt…
Browse files Browse the repository at this point in the history
…ed to balance it based on vanilla swords - taking into account attack speed, crits, & material cost
  • Loading branch information
floral-qua-floral committed Nov 9, 2024
1 parent 399dcb6 commit 3af2880
Show file tree
Hide file tree
Showing 18 changed files with 151 additions and 181 deletions.
4 changes: 1 addition & 3 deletions src/main/java/com/floralquafloral/MarioCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ private static int executeStomp(CommandContext<ServerCommandSource> context, boo
ParsedStomp stompType = RegistryEntryReferenceArgumentType.getRegistryEntry(context, "stomp", RegistryManager.STOMP_TYPES_KEY).value();

stomper.teleport((ServerWorld) target.getWorld(), target.getX(), target.getY() + target.getHeight(), target.getZ(), target.getPitch(), target.getYaw());
long seed = RandomSeed.getSeed();
StompHandler.networkStomp(stomper, target, stompType, false, seed);
stompType.executeServer((MarioServerData) MarioDataManager.getMarioData(stomper), target, false, seed);
stompType.executeServer((MarioServerData) MarioDataManager.getMarioData(stomper), target, true, false, RandomSeed.getSeed());

return sendFeedback(context, "Made " + stomper.getName().getString() + " perform a stomp of type " + stompType.ID + " on " + target.getName().getString());
}
Expand Down
116 changes: 0 additions & 116 deletions src/main/java/com/floralquafloral/VoiceLine.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ public MarioMainClientData(ClientPlayerEntity mario) {
}

@Override public void setAction(ParsedAction action, long seed) {
this.setActionTransitionless(action);
}

@Override public void setActionTransitionless(ParsedAction action) {
MarioQuaMario.LOGGER.info("MarioMainClientData setAction to " + action.ID);
if(action != getAction()) getTimers().actionTimer = 0;
if(this.getAction().ANIMATION != null)
Expand Down
20 changes: 0 additions & 20 deletions src/main/java/com/floralquafloral/mixin/GameOptionsMixin.java

This file was deleted.

21 changes: 21 additions & 0 deletions src/main/java/com/floralquafloral/mixin/LivingEntityMixin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.floralquafloral.mixin;

import com.floralquafloral.MarioQuaMario;
import com.floralquafloral.registries.stomp.ParsedStomp;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.damage.DamageSource;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(LivingEntity.class)
public class LivingEntityMixin {
@Inject(method = "applyArmorToDamage", at = @At("RETURN"), cancellable = true)
private void addStompPiercingDamage(DamageSource source, float amount, CallbackInfoReturnable<Float> cir) {
if(source instanceof ParsedStomp.StompDamageSource stompDamageSource) {
MarioQuaMario.LOGGER.info("Added piercing damage from Stomp: {}", stompDamageSource.getPiercing());
cir.setReturnValue(cir.getReturnValue() + stompDamageSource.getPiercing());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ public void slideOffLedges(CallbackInfoReturnable<Boolean> cir) {
public void uwuuber(CallbackInfo ci) {
MarioData data = MarioDataManager.getMarioData(this);
if(data.isClient() && !data.getAction().SLIDING_STATUS.doViewBobbing()) {
// prevStrideDistance = 0;
strideDistance = prevStrideDistance * 0.6F;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ public static void performJump(MarioTravelData data, CharaStat velocityStat, @Nu
}

@Override public final void travelHook(MarioTravelData data) {
if(data.isClient())
if(data.isClient()) {
AirborneActionDefinition.jumpCapped = false;
data.setYVel(data.getYVel() + AirborneActionDefinition.AerialStats.GRAVITY.get(data));
}
else
data.setYVel(-0.1);
AirborneActionDefinition.jumpCapped = false;

this.groundedTravel(data);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class LongJump extends AirborneActionDefinition {
public static final CharaStat LONG_JUMP_THRESHOLD = new CharaStat(0.285, StatCategory.THRESHOLD);

@Override public SneakLegalityRule getSneakLegalityRule() {
return SneakLegalityRule.ALLOW;
return SneakLegalityRule.PROHIBIT;
}
@Override public SlidingStatus getConstantSlidingStatus() {
return SlidingStatus.NOT_SLIDING;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.floralquafloral.registries.states.action.baseactions.airborne;

import com.floralquafloral.MarioQuaMario;
import com.floralquafloral.registries.states.action.baseactions.grounded.DuckWaddle;
import com.floralquafloral.stats.CharaStat;
import com.floralquafloral.stats.StatCategory;
import net.minecraft.util.Identifier;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

public class Stomp extends Jump {
@Override public @NotNull Identifier getID() {
return Identifier.of(MarioQuaMario.MOD_ID, "stomp");
}

public static final CharaStat CAP = new CharaStat(0.65, StatCategory.JUMP_CAP);

@Override protected @Nullable CharaStat getJumpCap() {
return CAP;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public List<ActionTransitionDefinition> getPostTickTransitions() {
new ActionTransitionDefinition("qua_mario:p_run",
(data) -> data.getForwardVel() >= RUN_SPEED.getAsThreshold(data),
data -> data.setForwardVel(Math.max(PRun.P_SPEED.get(data), data.getForwardVel())),
(data, isSelf, seed) -> data.playSoundEvent(SoundEvents.ENTITY_ARROW_SHOOT, seed)
null
)
);
}
Expand Down
Loading

0 comments on commit 3af2880

Please sign in to comment.