v0.3.0e: cleaned up the gnoll trickster's code, enforces parity with scorpios

This commit is contained in:
Evan Debenham 2015-06-17 10:52:25 -04:00 committed by Evan Debenham
parent 14a2d4d8b2
commit 5ed738a5eb

View File

@ -467,18 +467,14 @@ public class Ghost extends NPC {
@Override @Override
protected boolean canAttack( Char enemy ) { protected boolean canAttack( Char enemy ) {
Ballistica attack = new Ballistica( pos, enemy.pos, Ballistica.PROJECTILE ); Ballistica attack = new Ballistica( pos, enemy.pos, Ballistica.PROJECTILE);
if (!Level.adjacent(pos, enemy.pos) && attack.collisionPos == enemy.pos){ return !Level.adjacent( pos, enemy.pos ) && attack.collisionPos == enemy.pos;
combo++;
return true;
} else {
return false;
}
} }
@Override @Override
public int attackProc( Char enemy, int damage ) { public int attackProc( Char enemy, int damage ) {
//The gnoll's attacks get more severe the more the player lets it hit them //The gnoll's attacks get more severe the more the player lets it hit them
combo++;
int effect = Random.Int(4)+combo; int effect = Random.Int(4)+combo;
if (effect > 2) { if (effect > 2) {
@ -499,8 +495,8 @@ public class Ghost extends NPC {
@Override @Override
protected boolean getCloser( int target ) { protected boolean getCloser( int target ) {
combo = 0; //if he's moving, he isn't attacking, reset combo. combo = 0; //if he's moving, he isn't attacking, reset combo.
if (enemy != null && Level.adjacent(pos, enemy.pos)) { if (state == HUNTING) {
return getFurther( target ); return enemySeen && getFurther( target );
} else { } else {
return super.getCloser( target ); return super.getCloser( target );
} }