v2.2.0: sad ghost now avoids heaps and level exit while wandering
This commit is contained in:
+13
@@ -61,12 +61,25 @@ public class Ghost extends NPC {
|
|||||||
|
|
||||||
flying = true;
|
flying = true;
|
||||||
|
|
||||||
|
WANDERING = new Wandering();
|
||||||
state = WANDERING;
|
state = WANDERING;
|
||||||
|
|
||||||
//not actually large of course, but this makes the ghost stick to the exit room
|
//not actually large of course, but this makes the ghost stick to the exit room
|
||||||
properties.add(Property.LARGE);
|
properties.add(Property.LARGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected class Wandering extends Mob.Wandering{
|
||||||
|
@Override
|
||||||
|
protected int randomDestination() {
|
||||||
|
int pos = super.randomDestination();
|
||||||
|
//cannot wander onto heaps or the level exit
|
||||||
|
if (Dungeon.level.heaps.get(pos) != null || pos == Dungeon.level.exit()){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return pos;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean act() {
|
protected boolean act() {
|
||||||
if (Dungeon.hero.buff(AscensionChallenge.class) != null){
|
if (Dungeon.hero.buff(AscensionChallenge.class) != null){
|
||||||
|
|||||||
Reference in New Issue
Block a user