private void DoBattle(List <NpcBase> playerList, List <NpcBase> enemyList) { NpcBase defender; NpcBase fighter = orderList[combatant]; if (fighter.stats.GetNpcCurrentHealth() > 0) { battleStatus = EBattleStatus.NpcAttacking; if (fighter.GetPlayerTeam()) { int position = UnityEngine.Random.Range(0, enemyList.Count); defender = enemyList[position]; fighter.AttackEnemy(defender, () => { if (defender.stats.GetNpcCurrentHealth() <= 0) { enemyList.Remove(defender); } NextCombatant(); }); print(fighter.stats.npcName + " has attacked " + defender.stats.npcName); } else { int position = UnityEngine.Random.Range(0, playerList.Count); defender = playerList[position]; fighter.AttackEnemy(defender, () => { if (defender.GetNpcCurrentHealth() <= 0) { defender.GetAnimator().SetBool("isDead", true); playerList.Remove(defender); } NextCombatant(); }); print(fighter.stats.npcName + " has attacked " + defender.stats.npcName); } } else { NextCombatant(); } }