Removed "CrunchyLegs.exe" from the Strong Legs upgrade.

Upgrade nbow removes a portion of your fall distance when falling, thus increasing how far you have to fall in order to receive damage from falling. No longer *directly* decreases fall damage as a result.
This commit is contained in:
WayofTime 2021-01-23 11:01:51 -05:00
parent 37051b4e34
commit 3dfb8e5f55
3 changed files with 36 additions and 15 deletions

View file

@ -92,13 +92,7 @@ public class LivingArmorRegistrar
}
return 0;
}));
public static final LivingUpgradeRegistryObject<LivingUpgrade> UPGRADE_JUMP = UPGRADES.register("jump", () -> parseDefinition("jump").withArmorProvider((player, stats, source, upgrade, level) -> {
if (source == DamageSource.FALL)
{
return upgrade.getBonusValue("fall", level).doubleValue();
}
return 0;
}));
public static final LivingUpgradeRegistryObject<LivingUpgrade> UPGRADE_JUMP = UPGRADES.register("jump", () -> parseDefinition("jump"));
public static final LivingUpgradeRegistryObject<LivingUpgrade> UPGRADE_HEALTH = UPGRADES.register("health", () -> parseDefinition("health").withAttributeProvider((stats, attributeMap, uuid, upgrade, level) -> {
attributeMap.put(Attributes.MAX_HEALTH, new AttributeModifier(uuid, "Health Modifier", upgrade.getBonusValue("hp", level).intValue(), AttributeModifier.Operation.ADDITION));

View file

@ -360,13 +360,31 @@ public class GenericHandler
{
if (event.getEntity().world.isRemote)
{
if (event.getEntityLiving() instanceof PlayerEntity)
{
PlayerEntity player = (PlayerEntity) event.getEntityLiving();
if (LivingUtil.hasFullSet(player))
{
LivingStats stats = LivingStats.fromPlayer(player, true);
if (!player.isOnGround() && player.getMotion().getY() < 0)
{
int jumpLevel = stats.getLevel(LivingArmorRegistrar.UPGRADE_JUMP.get().getKey());
double fallDistanceMultiplier = LivingArmorRegistrar.UPGRADE_JUMP.get().getBonusValue("fall", jumpLevel).doubleValue();
player.fallDistance = (float) Math.max(0, player.fallDistance + fallDistanceMultiplier * player.getMotion().getY());
// System.out.println("Player's motion: " + player.getMotion().getY() + ", Player's fall reduction multiplier: " + fallDistanceMultiplier + ", Player's final fall distance: " + player.fallDistance);
}
return;
}
}
}
if (event.getEntityLiving() instanceof PlayerEntity)
{
PlayerEntity player = (PlayerEntity) event.getEntityLiving();
float percentIncrease = 0;
// System.out.println("Player's motion: " + player.getMotion().getY() + ", Player's final fall distance: " + player.fallDistance);
if (LivingUtil.hasFullSet(player))
{
LivingStats stats = LivingStats.fromPlayer(player, true);
@ -405,6 +423,15 @@ public class GenericHandler
LivingUtil.applyNewExperience(player, LivingArmorRegistrar.UPGRADE_SPEED.get(), distance);
}
if (!player.isOnGround() && player.getMotion().getY() < 0)
{
int jumpLevel = stats.getLevel(LivingArmorRegistrar.UPGRADE_JUMP.get().getKey());
double fallDistanceMultiplier = LivingArmorRegistrar.UPGRADE_JUMP.get().getBonusValue("fall", jumpLevel).doubleValue();
player.fallDistance = (float) Math.max(0, player.fallDistance + fallDistanceMultiplier * player.getMotion().getY());
// System.out.println("Player's motion: " + player.getMotion().getY() + ", Player's fall reduction multiplier: " + fallDistanceMultiplier + ", Player's final fall distance: " + player.fallDistance);
}
if (player.getFireTimer() > 0)
{
LivingUtil.applyNewExperience(player, LivingArmorRegistrar.UPGRADE_FIRE_RESIST.get(), 1);

View file

@ -26,16 +26,16 @@
1.3
],
"fall": [
0.1,
0.2,
0.3,
0.33,
0.4,
0.45,
0.5,
0.6,
0.7,
0.55,
0.60,
0.65,
0.75,
0.8,
0.85
0.85,
0.95
]
}
}