Some slight balancing changes to the energy bar

This commit is contained in:
Sollace 2020-10-08 10:12:24 +02:00
parent dc6371ccf0
commit bb9d23d686
4 changed files with 9 additions and 4 deletions

View file

@ -62,7 +62,7 @@ public class UnicornCastingAbility implements Ability<Hit> {
@Override
public void preApply(Pony player, AbilitySlot slot) {
player.getMagicalReserves().getEnergy().add(3);
player.getMagicalReserves().getEnergy().multiply(3.3F);
player.spawnParticles(MagicParticleEffect.UNICORN, 5);
}

View file

@ -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);
}
/**

View file

@ -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);

View file

@ -296,7 +296,11 @@ public class Pony implements Caster<PlayerEntity>, Equine<PlayerEntity>, 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);