diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/DarkVortexSpell.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/DarkVortexSpell.java index bda10118..9402d692 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/DarkVortexSpell.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/DarkVortexSpell.java @@ -37,10 +37,6 @@ import net.minecraft.world.World.ExplosionSourceType; /** * More powerful version of the vortex spell which creates a black hole. - * - * TODO: Possible uses - * - Garbage bin - * - Link with a teleportation spell to create a wormhole */ public class DarkVortexSpell extends AttractiveSpell implements ProjectileDelegate.BlockHitListener { public static final SpellTraits DEFAULT_TRAITS = new SpellTraits.Builder() @@ -91,10 +87,6 @@ public class DarkVortexSpell extends AttractiveSpell implements ProjectileDelega source.asWorld().playSound(null, source.getOrigin(), USounds.AMBIENT_DARK_VORTEX_ADDITIONS, SoundCategory.AMBIENT, 1, 1); } - if (!source.subtractEnergyCost(-accumulatedMass)) { - setDead(); - } - if (!source.isClient() && source.asWorld().random.nextInt(300) == 0) { ParticleUtils.spawnParticle(source.asWorld(), LightningBoltParticleEffect.DEFAULT, getOrigin(source), Vec3d.ZERO); } @@ -102,6 +94,14 @@ public class DarkVortexSpell extends AttractiveSpell implements ProjectileDelega return super.tick(source, situation); } + @Override + protected void consumeManage(Caster source, long costMultiplier, float knowledge) { + if (!source.subtractEnergyCost(-accumulatedMass)) { + setDead(); + } + } + + @Override public boolean isFriendlyTogether(Affine other) { return accumulatedMass < 4; diff --git a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/ShieldSpell.java b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/ShieldSpell.java index 61cc6e79..71f5cede 100644 --- a/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/ShieldSpell.java +++ b/src/main/java/com/minelittlepony/unicopia/ability/magic/spell/effect/ShieldSpell.java @@ -97,20 +97,24 @@ public class ShieldSpell extends AbstractSpell { long costMultiplier = applyEntities(source); if (costMultiplier > 0) { - double cost = 2 - source.getLevel().getScaled(2); - - cost *= costMultiplier / ((1 + source.getLevel().get()) * 3F); - cost /= knowledge; - cost += getDrawDropOffRange(source) / 10F; - - if (!source.subtractEnergyCost(cost)) { - setDead(); - } + consumeManage(source, costMultiplier, knowledge); } return !isDead(); } + protected void consumeManage(Caster source, long costMultiplier, float knowledge) { + double cost = 2 - source.getLevel().getScaled(2); + + cost *= costMultiplier / ((1 + source.getLevel().get()) * 3F); + cost /= knowledge; + cost += getDrawDropOffRange(source) / 10F; + + if (!source.subtractEnergyCost(cost)) { + setDead(); + } + } + /** * Calculates the maximum radius of the shield. aka The area of effect. */