public override PlanStep DecideWhatToDo() { //Vector2 PlayerLoc = StealthManager.Instance.PlayerLoc; if (HaveConfirmedTile && !WaitingforGoAhead && !HasAPlan) {//plan could make enemy face different direction in navigation to player, so shouldn't unconfirm the tile if (StealthMethod.CheckLOS(map, Me.TilePosition, StealthManager.Instance.PlayerLoc) && StealthMethod.CheckFOV(Me.TilePosition, StealthManager.Instance.PlayerLoc, Me.Direction)) { //player in sight, so move confirmed location to him MoveConfirmedPosition(StealthManager.Instance.PlayerLoc); //All behaviour for when seeing the enemy if (RectMethod.DistanceBetweenLocations (Me.TilePosition, StealthManager.Instance.PlayerLoc) == 1) { return(AttackAdjacentEnemy()); } else { return(base.DecideWhatToDo());//act using the usual protocol. } } //if not in sight, then UNCONFIRM else { CancelConfirmedPosition(); // behaviour for not } } // no confirmed tile, but on alert return(base.DecideWhatToDo()); }