예제 #1
0
        public override void PerformEffect(BattleGroupEntity targetGroup, Ability abilityData, int count)
        {
            List <AssignmentGroupEntity> targetLine = new List <AssignmentGroupEntity>();

            if (!CombatManager.CheckIfLineIsDead(targetGroup.frontline))
            {
                targetLine.AddRange(targetGroup.frontline);
            }
            else if (!CombatManager.CheckIfLineIsDead(targetGroup.supportline))
            {
                targetLine.AddRange(targetGroup.supportline);
            }

            if (!CombatManager.CheckIfLineIsDead(targetGroup.backline))
            {
                targetLine.AddRange(targetGroup.backline);
            }

            if (targetLine.Count > 0)
            {
                Random r      = new Random();
                int    target = -1;
                do
                {
                    target = r.Next(0, targetLine.Count);
                } while (targetLine[target].turnStartCount == 0);
                targetLine[target].TakeDamage(abilityData.power * count);
            }
        }