v0.3.2: corrected some AI bugs

This commit is contained in:
Evan Debenham 2015-09-30 14:59:14 -04:00
parent 17524ad115
commit b402e9a9cd
2 changed files with 7 additions and 1 deletions

View File

@ -118,7 +118,10 @@ public class Bee extends Mob {
else {
//if already targeting something, and that thing is still alive and near the pot, keeping targeting it.
if (enemy != null && enemy.isAlive() && Level.distance(enemy.pos, potPos) <= 3) return enemy;
if (enemy != null && enemy.isAlive()
&& Level.fieldOfView[enemy.pos] && enemy.invisible == 0
&& Level.distance(enemy.pos, potPos) <= 3)
return enemy;
//find all mobs near the pot
HashSet<Char> enemies = new HashSet<Char>();

View File

@ -388,6 +388,9 @@ public abstract class Mob extends Char {
public void aggro( Char ch ) {
enemy = ch;
if (state != PASSIVE){
state = HUNTING;
}
}
@Override