v0.3.0: tweaked charm mechanics for mobs, ranged enemies will now fail to attack when charmed.

This commit is contained in:
Evan Debenham 2015-03-25 13:13:54 -04:00 committed by Evan Debenham
parent ec2ba6afca
commit bc64d00e17
2 changed files with 3 additions and 3 deletions

View File

@ -255,7 +255,7 @@ public abstract class Mob extends Char {
}
protected boolean canAttack( Char enemy ) {
return Level.adjacent( pos, enemy.pos ) && !isCharmedBy( enemy );
return Level.adjacent( pos, enemy.pos );
}
protected boolean getCloser( int target ) {
@ -566,7 +566,7 @@ public abstract class Mob extends Char {
@Override
public boolean act( boolean enemyInFOV, boolean justAlerted ) {
enemySeen = enemyInFOV;
if (enemyInFOV && canAttack( enemy )) {
if (enemyInFOV && !isCharmedBy( enemy ) && canAttack( enemy )) {
return doAttack( enemy );

View File

@ -115,7 +115,7 @@ public class Tengu extends Mob {
@Override
protected boolean canAttack( Char enemy ) {
return Ballistica.cast( pos, enemy.pos, false, true ) == enemy.pos && !isCharmedBy( enemy );
return Ballistica.cast( pos, enemy.pos, false, true ) == enemy.pos;
}
@Override