v2.3.0: adjusted DM pylons so dumb allies can atk them again when active
This commit is contained in:
@@ -75,8 +75,22 @@ public class Pylon extends Mob {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean act() {
|
protected boolean act() {
|
||||||
alerted = false;
|
//char logic
|
||||||
super.act();
|
if (fieldOfView == null || fieldOfView.length != Dungeon.level.length()){
|
||||||
|
fieldOfView = new boolean[Dungeon.level.length()];
|
||||||
|
}
|
||||||
|
Dungeon.level.updateFieldOfView( this, fieldOfView );
|
||||||
|
|
||||||
|
throwItems();
|
||||||
|
|
||||||
|
sprite.hideAlert();
|
||||||
|
sprite.hideLost();
|
||||||
|
|
||||||
|
//mob logic
|
||||||
|
enemy = chooseEnemy();
|
||||||
|
|
||||||
|
enemySeen = enemy != null && enemy.isAlive() && fieldOfView[enemy.pos] && enemy.invisible <= 0;
|
||||||
|
//end of char/mob logic
|
||||||
|
|
||||||
if (alignment == Alignment.NEUTRAL){
|
if (alignment == Alignment.NEUTRAL){
|
||||||
return true;
|
return true;
|
||||||
@@ -117,6 +131,8 @@ public class Pylon extends Mob {
|
|||||||
|
|
||||||
targetNeighbor = (targetNeighbor+1)%8;
|
targetNeighbor = (targetNeighbor+1)%8;
|
||||||
|
|
||||||
|
spend(TICK);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,6 +154,7 @@ public class Pylon extends Mob {
|
|||||||
|
|
||||||
public void activate(){
|
public void activate(){
|
||||||
alignment = Alignment.ENEMY;
|
alignment = Alignment.ENEMY;
|
||||||
|
state = HUNTING; //so allies know to attack it
|
||||||
((PylonSprite) sprite).activate();
|
((PylonSprite) sprite).activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user