mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-08 06:26:43 +01:00
Remove the active spell when applying the race change potion effect
This commit is contained in:
parent
7e19fd08c5
commit
dd294f4f86
1 changed files with 10 additions and 7 deletions
|
@ -3,8 +3,8 @@ package com.minelittlepony.unicopia.entity.effect;
|
|||
import javax.annotation.Nullable;
|
||||
|
||||
import com.minelittlepony.unicopia.Race;
|
||||
import com.minelittlepony.unicopia.ability.magic.Caster;
|
||||
import com.minelittlepony.unicopia.entity.Equine;
|
||||
import com.minelittlepony.unicopia.entity.PonyContainer;
|
||||
import com.minelittlepony.unicopia.entity.player.MagicReserves;
|
||||
import com.minelittlepony.unicopia.entity.player.Pony;
|
||||
import com.minelittlepony.unicopia.util.MagicalDamageSource;
|
||||
|
@ -100,12 +100,15 @@ public class RaceChangeStatusEffect extends StatusEffect {
|
|||
}
|
||||
|
||||
if (stage == Stage.DEATH) {
|
||||
PonyContainer.of(entity).map(PonyContainer::get).ifPresent(e -> {
|
||||
e.setSpecies(species);
|
||||
if (e instanceof Pony) {
|
||||
((Pony)e).setDirty();
|
||||
}
|
||||
});
|
||||
|
||||
eq.setSpecies(species);
|
||||
if (eq instanceof Caster) {
|
||||
((Caster<?>)eq).setSpell(null);
|
||||
}
|
||||
|
||||
if (eq instanceof Pony) {
|
||||
((Pony)eq).setDirty();
|
||||
}
|
||||
entity.damage(MagicalDamageSource.TRIBE_SWAP, Float.MAX_VALUE);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue