v3.1.0: fixed unintentional change to enemy reach logic
This commit is contained in:
+9
-6
@@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
|
|||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
|
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire;
|
||||||
@@ -166,9 +167,10 @@ public abstract class ChampionEnemy extends Buff {
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
boolean[] passable = BArray.not(Dungeon.level.solid, null);
|
boolean[] passable = BArray.not(Dungeon.level.solid, null);
|
||||||
|
for (Char ch : Actor.chars()) {
|
||||||
//our own tile is always passable
|
//our own tile is always passable
|
||||||
passable[target.pos] = true;
|
passable[ch.pos] = ch == target;
|
||||||
|
}
|
||||||
|
|
||||||
PathFinder.buildDistanceMap(enemy.pos, passable, 4);
|
PathFinder.buildDistanceMap(enemy.pos, passable, 4);
|
||||||
|
|
||||||
@@ -214,9 +216,10 @@ public abstract class ChampionEnemy extends Buff {
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
boolean[] passable = BArray.not(Dungeon.level.solid, null);
|
boolean[] passable = BArray.not(Dungeon.level.solid, null);
|
||||||
|
for (Char ch : Actor.chars()) {
|
||||||
//our own tile is always passable
|
//our own tile is always passable
|
||||||
passable[target.pos] = true;
|
passable[ch.pos] = ch == target;
|
||||||
|
}
|
||||||
|
|
||||||
PathFinder.buildDistanceMap(enemy.pos, passable, 2);
|
PathFinder.buildDistanceMap(enemy.pos, passable, 2);
|
||||||
|
|
||||||
|
|||||||
+5
-2
@@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
|
|||||||
|
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
||||||
@@ -78,8 +79,10 @@ public class GnollExile extends Gnoll {
|
|||||||
if (Dungeon.level.distance( pos, enemy.pos ) <= 2){
|
if (Dungeon.level.distance( pos, enemy.pos ) <= 2){
|
||||||
boolean[] passable = BArray.not(Dungeon.level.solid, null);
|
boolean[] passable = BArray.not(Dungeon.level.solid, null);
|
||||||
|
|
||||||
//our own tile is always passable
|
for (Char ch : Actor.chars()) {
|
||||||
passable[pos] = true;
|
//our own tile is always passable
|
||||||
|
passable[ch.pos] = ch == this;
|
||||||
|
}
|
||||||
|
|
||||||
PathFinder.buildDistanceMap(enemy.pos, passable, 2);
|
PathFinder.buildDistanceMap(enemy.pos, passable, 2);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user