v0.3.2: corrected some AI bugs
This commit is contained in:
parent
17524ad115
commit
b402e9a9cd
|
@ -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>();
|
||||
|
|
|
@ -388,6 +388,9 @@ public abstract class Mob extends Char {
|
|||
|
||||
public void aggro( Char ch ) {
|
||||
enemy = ch;
|
||||
if (state != PASSIVE){
|
||||
state = HUNTING;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue
Block a user