v3.0.1: necros now damage immovable chars that are on their summon pos

This commit is contained in:
Evan Debenham
2025-03-07 13:52:23 -05:00
parent c50f9d301c
commit 123bb44121
2 changed files with 10 additions and 16 deletions

View File

@@ -194,14 +194,6 @@ public class Necromancer extends Mob {
public void summonMinion(){ public void summonMinion(){
if (Actor.findChar(summoningPos) != null) { 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; int pushPos = pos;
for (int c : PathFinder.NEIGHBOURS8) { for (int c : PathFinder.NEIGHBOURS8) {
if (Actor.findChar(summoningPos + c) == null if (Actor.findChar(summoningPos + c) == null
@@ -212,6 +204,11 @@ public class Necromancer extends Mob {
} }
} }
//no push if char is immovable
if (Char.hasProp(Actor.findChar(summoningPos), Property.IMMOVABLE)){
pushPos = pos;
}
//push enemy, or wait a turn if there is no valid pushing position //push enemy, or wait a turn if there is no valid pushing position
if (pushPos != pos) { if (pushPos != pos) {
Char ch = Actor.findChar(summoningPos); Char ch = Actor.findChar(summoningPos);

View File

@@ -104,14 +104,6 @@ public class SpectralNecromancer extends Necromancer {
public void summonMinion() { public void summonMinion() {
if (Actor.findChar(summoningPos) != null) { if (Actor.findChar(summoningPos) != null) {
//cancel if character cannot be moved
if (Char.hasProp(Actor.findChar(summoningPos), Property.IMMOVABLE)){
summoning = false;
((SpectralNecromancerSprite)sprite).finishSummoning();
spend(TICK);
return;
}
int pushPos = pos; int pushPos = pos;
for (int c : PathFinder.NEIGHBOURS8) { for (int c : PathFinder.NEIGHBOURS8) {
if (Actor.findChar(summoningPos + c) == null if (Actor.findChar(summoningPos + c) == null
@@ -122,6 +114,11 @@ public class SpectralNecromancer extends Necromancer {
} }
} }
//no push if char is immovable
if (Char.hasProp(Actor.findChar(summoningPos), Property.IMMOVABLE)){
pushPos = pos;
}
//push enemy, or wait a turn if there is no valid pushing position //push enemy, or wait a turn if there is no valid pushing position
if (pushPos != pos) { if (pushPos != pos) {
Char ch = Actor.findChar(summoningPos); Char ch = Actor.findChar(summoningPos);