static void AttackPlayer(Monster monster, Player player) { if (AI.AreNeighboring(monster, player)) { CombatSystem.Hit(monster, player); } else { AI.MoveTowards(monster, player); } }
static void RunFromPlayer(Monster monster, Player player) { if (AI.CanMove(monster)) { AI.MoveAwayFrom(monster, player); } else if (AI.AreNeighboring(monster, player)) { CombatSystem.Hit(monster, player); } else { // stand still } }