From bb9d23d68641f5faa24410e2699cb3cbd601f7e7 Mon Sep 17 00:00:00 2001 From: Sollace Date: Thu, 8 Oct 2020 10:12:24 +0200 Subject: [PATCH] Some slight balancing changes to the energy bar --- .../unicopia/ability/UnicornCastingAbility.java | 2 +- .../unicopia/entity/player/MagicReserves.java | 3 ++- .../unicopia/entity/player/PlayerLevelStore.java | 2 +- .../com/minelittlepony/unicopia/entity/player/Pony.java | 6 +++++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/ability/UnicornCastingAbility.java b/src/main/java/com/minelittlepony/unicopia/ability/UnicornCastingAbility.java index b73a6bd5..7ac64367 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/UnicornCastingAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/UnicornCastingAbility.java @@ -62,7 +62,7 @@ public class UnicornCastingAbility implements Ability { @Override public void preApply(Pony player, AbilitySlot slot) { - player.getMagicalReserves().getEnergy().add(3); + player.getMagicalReserves().getEnergy().multiply(3.3F); player.spawnParticles(MagicParticleEffect.UNICORN, 5); } diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/MagicReserves.java b/src/main/java/com/minelittlepony/unicopia/entity/player/MagicReserves.java index 07a746f6..14ad9026 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/MagicReserves.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/MagicReserves.java @@ -50,7 +50,8 @@ public interface MagicReserves { * Multiplies the current value. */ default void multiply(float scalar) { - set(get() * scalar); + float newVal = get() * scalar; + set(newVal > -0.0001F && newVal < 0.0001F ? 0 : newVal); } /** diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerLevelStore.java b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerLevelStore.java index 9ff88bce..950a40a0 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerLevelStore.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerLevelStore.java @@ -24,7 +24,7 @@ class PlayerLevelStore implements Levelled.LevelStore { @Override public void add(int levels) { if (levels > 0) { - pony.getMagicalReserves().getMana().set(pony.getMagicalReserves().getEnergy().getMax()); + pony.getMagicalReserves().getMana().add(pony.getMagicalReserves().getMana().getMax() / 2); pony.getWorld().playSound(null, pony.getOrigin(), SoundEvents.ENTITY_PLAYER_LEVELUP, SoundCategory.PLAYERS, 1, 2); } Levelled.LevelStore.super.add(levels); diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java b/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java index 915c85fb..9e1f2569 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java @@ -296,7 +296,11 @@ public class Pony implements Caster, Equine, Transmi } mana.getExertion().add(-10); - mana.getEnergy().add(-1); + if (mana.getEnergy().get() > 5) { + mana.getEnergy().multiply(0.8F); + } else { + mana.getEnergy().add(-1); + } if (!getSpecies().canFly() || !gravity.isFlying()) { mana.getMana().add(60);