v0.8.2c: improved piranha surprise attack logic
This commit is contained in:
parent
eb65e2b356
commit
fc60397281
|
@ -86,13 +86,15 @@ public class Piranha extends Mob {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int defenseSkill( Char enemy ) {
|
public boolean surprisedBy(Char enemy) {
|
||||||
enemySeen = state != SLEEPING
|
if (enemy == Dungeon.hero){
|
||||||
&& this.enemy != null
|
if (fieldOfView == null || fieldOfView.length != Dungeon.level.length()){
|
||||||
&& fieldOfView != null
|
fieldOfView = new boolean[Dungeon.level.length()];
|
||||||
&& fieldOfView[this.enemy.pos]
|
Dungeon.level.updateFieldOfView( this, fieldOfView );
|
||||||
&& this.enemy.invisible == 0;
|
}
|
||||||
return super.defenseSkill( enemy );
|
return state == SLEEPING || !fieldOfView[enemy.pos] || enemy.invisible > 0;
|
||||||
|
}
|
||||||
|
return super.surprisedBy(enemy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue
Block a user