v1.4.2: fixed missing logic for necro summoning

This commit is contained in:
Evan Debenham
2022-10-27 16:52:27 -04:00
parent 9ae5836f98
commit 4a3d11d06a
2 changed files with 19 additions and 0 deletions

View File

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

View File

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