v3.1.0: fixed unintentional change to enemy reach logic

This commit is contained in:
Evan Debenham
2025-05-17 13:27:53 -04:00
parent fceee5726d
commit 815c0d80aa
2 changed files with 14 additions and 8 deletions

View File

@@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire;
@@ -166,9 +167,10 @@ public abstract class ChampionEnemy extends Buff {
return false;
} else {
boolean[] passable = BArray.not(Dungeon.level.solid, null);
//our own tile is always passable
passable[target.pos] = true;
for (Char ch : Actor.chars()) {
//our own tile is always passable
passable[ch.pos] = ch == target;
}
PathFinder.buildDistanceMap(enemy.pos, passable, 4);
@@ -214,9 +216,10 @@ public abstract class ChampionEnemy extends Buff {
return false;
} else {
boolean[] passable = BArray.not(Dungeon.level.solid, null);
//our own tile is always passable
passable[target.pos] = true;
for (Char ch : Actor.chars()) {
//our own tile is always passable
passable[ch.pos] = ch == target;
}
PathFinder.buildDistanceMap(enemy.pos, passable, 2);

View File

@@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
@@ -78,8 +79,10 @@ public class GnollExile extends Gnoll {
if (Dungeon.level.distance( pos, enemy.pos ) <= 2){
boolean[] passable = BArray.not(Dungeon.level.solid, null);
//our own tile is always passable
passable[pos] = true;
for (Char ch : Actor.chars()) {
//our own tile is always passable
passable[ch.pos] = ch == this;
}
PathFinder.buildDistanceMap(enemy.pos, passable, 2);