public static void SkillActivation(Function servantNpFunction, PartyMember partyMember, List <PartyMember> party, List <EnemyMob> enemies, int enemyPosition)
 {
     if (IsPartyFunction(servantNpFunction)) // Target party members for buffs/debuffs
     {
         ApplyServantStatus.ApplyFuncTargetType(partyMember, servantNpFunction, party);
     }
     else if (IsEnemyFunction(servantNpFunction)) // Target enemies for buffs/debuffs
     {
         ApplyEnemyStatus.ApplyFuncTargetType(enemyPosition, servantNpFunction, partyMember.Servant.NpLevel, enemies);
     }
 }
        /// <summary>
        /// Buff a party member with the desired skill based on the servant's list of available skills
        /// </summary>
        /// <param name="partyMemberActor">The acting party member that is giving the status effect</param>
        /// <param name="actorSkillPositionNumber">Skill position number (left = 1, middle = 2, right = 3)</param>
        /// <param name="party">The targeted party members that are receiving the status effect</param>
        /// <param name="enemies">The targeted enemies that are receiving the status effect</param>
        /// <param name="partyMemberPosition">The position the selected party member is currently sitting (1-6)</param>
        /// <param name="enemyPosition">The position the selected enemy is currently sitting (1-3)</param>
        public void SkillActivation(PartyMember partyMemberActor, int actorSkillPositionNumber, List <PartyMember> party,
                                    List <EnemyMob> enemies, int partyMemberPosition = 3, int enemyPosition = 3)
        {
            if (partyMemberActor.SkillCooldowns.Exists(s => s.SkillId == actorSkillPositionNumber) ||
                party.IndexOf(partyMemberActor) > 2 ||
                party.IndexOf(partyMemberActor) == -1)
            {
                return; // don't activate again
            }

            // Get highest priority skill
            Skill skill = partyMemberActor
                          .ServantNiceInfo
                          .Skills
                          .FindAll(s => s.Num == actorSkillPositionNumber)
                          .Aggregate((agg, next) =>
                                     next.Priority >= agg.Priority ? next : agg);

            int currentSkillLevel = partyMemberActor.Servant.SkillLevels[actorSkillPositionNumber - 1];

            // Target party members for buffs/debuffs
            List <Function> partyBuffServantFunctions = GetPartyBuffServantFunctions(skill);

            if (partyBuffServantFunctions?.Count > 0)
            {
                foreach (Function servantFunction in partyBuffServantFunctions)
                {
                    ApplyServantStatus.ApplyFuncTargetType(partyMemberPosition, partyMemberActor, servantFunction, currentSkillLevel, party);
                }
            }

            // Target enemies for buffs/debuffs
            List <Function> enemyServantFunctions = GetEnemyServantFunctions(skill);

            if (enemyServantFunctions?.Count > 0)
            {
                foreach (Function servantFunction in enemyServantFunctions)
                {
                    ApplyEnemyStatus.ApplyFuncTargetType(enemyPosition, servantFunction, currentSkillLevel, enemies);
                }
            }

            if (partyBuffServantFunctions?.Count > 0 || enemyServantFunctions?.Count > 0)
            {
                partyMemberActor.SkillCooldowns.Add(new SkillCooldown
                {
                    SkillId  = actorSkillPositionNumber,
                    Cooldown = skill.Cooldown[currentSkillLevel - 1]
                });
            }
        }
        /// <summary>
        /// Buff a party member with the desired skill based on the mystic code's list of available skills
        /// </summary>
        /// <param name="mysticCode">The acting mystic code skill that is giving the buff</param>
        /// <param name="mysticCodeSkillPositionNumber">Skill position number (left = 1, middle = 2, right = 3)</param>
        /// <param name="party">The targeted party members that are receiving the buff</param>
        /// <param name="enemies">The targeted enemies that are receiving the status effect</param>
        /// <param name="partyMemberPosition">The position the selected party member is currently sitting (1-6)</param>
        /// <param name="enemyPosition">The position the selected enemy is currently sitting (1-3)</param>
        /// <param name="reservePartyMemberIndex">The position of the reserved (4-6) party member when selection the party roster</param>
        public void SkillActivation(MysticCode mysticCode, int mysticCodeSkillPositionNumber, List <PartyMember> party,
                                    List <EnemyMob> enemies, int partyMemberPosition = 3, int enemyPosition = 3, int reservePartyMemberIndex = -1)
        {
            if (mysticCode.SkillCooldowns.Exists(s => s.SkillId == mysticCodeSkillPositionNumber))
            {
                return; // don't activate again
            }

            Skill skill = mysticCode.MysticCodeInfo.Skills[mysticCodeSkillPositionNumber - 1];

            List <Function> mysticCodePartyBuffFunctions = GetPartyBuffServantFunctions(skill);

            if (mysticCodePartyBuffFunctions?.Count > 0)
            {
                foreach (Function mysticCodeFunction in mysticCodePartyBuffFunctions)
                {
                    ApplyServantStatus.ApplyFuncTargetType(partyMemberPosition, mysticCode, mysticCodeFunction, party, reservePartyMemberIndex);
                }
            }

            List <Function> mysticCodeEnemyServantFunctions = GetEnemyServantFunctions(skill);

            if (mysticCodeEnemyServantFunctions?.Count > 0)
            {
                foreach (Function mysticCodeFunction in mysticCodeEnemyServantFunctions)
                {
                    ApplyEnemyStatus.ApplyFuncTargetType(enemyPosition, mysticCode, mysticCodeFunction, enemies);
                }
            }

            if (mysticCodePartyBuffFunctions?.Count > 0 || mysticCodeEnemyServantFunctions?.Count > 0)
            {
                mysticCode.SkillCooldowns.Add(new SkillCooldown
                {
                    SkillId  = mysticCodeSkillPositionNumber,
                    Cooldown = skill.Cooldown[mysticCode.MysticCodeLevel - 1]
                });
            }
        }