/// <summary> /// Find the attack in the list of attacks and calculate the damage /// then call the attack function of the area manager. /// </summary> public override void OnAction() { if (areaManager != null) { string attackName = option.optionText; AttackStruct attack = attacks.GetAttack(attackName); int damage = CalculateDamage(attack.damage, attack.physicalOrMagic); areaManager.Attack(damage, attack.manacost); } }