diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Necromancer.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Necromancer.java index 7844e1102..71e347224 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Necromancer.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Necromancer.java @@ -21,6 +21,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs; +import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; @@ -211,6 +212,10 @@ public class Necromancer extends Mob { Char blocker = Actor.findChar(summoningPos); if (blocker.alignment != alignment){ blocker.damage( Random.NormalIntRange(2, 10), this ); + if (blocker == Dungeon.hero && !blocker.isAlive()){ + Badges.validateDeathFromEnemyMagic(); + Dungeon.fail(getClass()); + } } spend(TICK); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/SpectralNecromancer.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/SpectralNecromancer.java index d57ade752..a253a4041 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/SpectralNecromancer.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/SpectralNecromancer.java @@ -21,6 +21,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs; +import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; @@ -106,6 +107,15 @@ public class SpectralNecromancer extends Necromancer { @Override public void summonMinion() { if (Actor.findChar(summoningPos) != null) { + + //cancel if character cannot be moved + if (Char.hasProp(Actor.findChar(summoningPos), Property.IMMOVABLE)){ + summoning = false; + ((NecromancerSprite)sprite).finishSummoning(); + spend(TICK); + return; + } + int pushPos = pos; for (int c : PathFinder.NEIGHBOURS8) { if (Actor.findChar(summoningPos + c) == null @@ -129,6 +139,10 @@ public class SpectralNecromancer extends Necromancer { Char blocker = Actor.findChar(summoningPos); if (blocker.alignment != alignment){ blocker.damage( Random.NormalIntRange(2, 10), this ); + if (blocker == Dungeon.hero && !blocker.isAlive()){ + Badges.validateDeathFromEnemyMagic(); + Dungeon.fail(getClass()); + } } spend(TICK);