public void UseSkill(int skillID, int enemyIndex)
 {
     if (Player.HasSkill(skillID))
     {
         Skill         skill    = SkillFactory.Instance.FindSkill(skillID);
         BattleFactors playerBF = Player.BattleFactors;
         PlayerSkillEffectStatuses.ForEach(x => x.effector.Use(playerBF, null));
         if (skill.IsAoE)
         {
             var affectedTargets = MonsterBattleFactors.Where(x => x.healthPoint >= 0 && HitCheck(playerBF, x)).ToList();
             skill.Use(playerBF, affectedTargets);
             skill.SkillEffectors.OfType <SustainSkillEffector>().ToList().ForEach(effector =>
             {
                 SkillEffectStatus status = new SkillEffectStatus {
                     effector = effector, remainedRound = effector.SustainRound
                 };
                 if (effector is TargetSpeedPointSkillEffector || effector is TargetStopActionSkillEffector)
                 {
                     foreach (var affectedTarget in affectedTargets)
                     {
                         MonstersSkillEffectStatuses[MonsterBattleFactors.IndexOf(affectedTarget)].Add(status);
                     }
                 }
                 else
                 {
                     PlayerSkillEffectStatuses.Add(status);
                 }
             });
         }
         else
         {
             if (HitCheck(playerBF, MonsterBattleFactors[enemyIndex]))
             {
                 skill.Use(playerBF, new List <BattleFactors> {
                     MonsterBattleFactors[enemyIndex]
                 });
                 skill.SkillEffectors.OfType <SustainSkillEffector>().ToList().ForEach(x =>
                 {
                     SkillEffectStatus status = new SkillEffectStatus {
                         effector = x, remainedRound = x.SustainRound
                     };
                     if (x is TargetSpeedPointSkillEffector || x is TargetStopActionSkillEffector)
                     {
                         MonstersSkillEffectStatuses[enemyIndex].Add(status);
                     }
                     else
                     {
                         PlayerSkillEffectStatuses.Add(status);
                     }
                 });
             }
             else
             {
                 OnMiss?.Invoke(false, 0);
             }
         }
     }
     ProcessTurn();
 }
        public void ProcessTurn()
        {
            OnProcess?.Invoke();
            if (actionAgentList.Count > 0)
            {
                if (actionAgentList[0] == Player)
                {
                    OnPlayerActionRequest?.Invoke();
                    actionAgentList.Remove(Player);
                }
                else
                {
                    int enemyIndex = (int)actionAgentList[0];

                    BattleFactors monsterBF = MonsterBattleFactors[enemyIndex];
                    BattleFactors playerBF  = Player.BattleFactors;
                    PlayerSkillEffectStatuses.ForEach(x => x.effector.Use(playerBF, null));
                    if (HitCheck(monsterBF, playerBF))
                    {
                        Skill skill = Monsters[enemyIndex].Action();
                        if (skill == null)
                        {
                            Player.AbilityFactors.HP -= Math.Max(monsterBF.physicalAttackPoint - playerBF.physicalDefencePoint, 1);
                        }
                        else
                        {
                            skill.Use(monsterBF, new List <BattleFactors> {
                                playerBF
                            });
                            skill.SkillEffectors.OfType <SustainSkillEffector>().ToList().ForEach(x =>
                            {
                                SkillEffectStatus status = new SkillEffectStatus {
                                    effector = x, remainedRound = x.SustainRound
                                };
                                if (x is TargetSpeedPointSkillEffector || x is TargetStopActionSkillEffector)
                                {
                                    PlayerSkillEffectStatuses.Add(status);
                                }
                                else
                                {
                                    MonstersSkillEffectStatuses[enemyIndex].Add(status);
                                }
                            });
                        }
                    }
                    else
                    {
                        OnMiss?.Invoke(true, enemyIndex);
                    }
                    ProcessTurn();
                }
            }
            else
            {
                EndTurn();
            }
        }