v1.4.2: fixed missing logic for necro summoning
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user