Пример #1
0
        static List <NetSkill> WillDoTwoCastSimulation(CardAI ai,
                                                       CardAIPlanData data,
                                                       List <NetSkill> consideredSkills)
        {
            List <NetSkill> supportSkills = new List <NetSkill>();

            //if there is no skills which can be used there is no activity to consider
            if (consideredSkills == null || consideredSkills.Count < 1)
            {
                return(supportSkills);
            }

            NetBattlefield bf = null;

            foreach (var v in consideredSkills)
            {
                if (v.IsCastingSpell())
                {
                    if (bf == null)
                    {
                        bf = ProduceFakeBFIfNeeded(ai.playerID, data.bf);
                    }

                    List <int> pos = v.FindValidTargets(bf, -1);
                    if (pos != null)
                    {
                        if (pos.FindIndex(o => bf.IsBattleSlot(o) &&
                                          !bf.IsSlotFree(o) &&
                                          bf.IsSameSideSlot(ai.playerID, o)) == -1)
                        {
                            //this skill does not have allied targets
                            continue;
                        }

                        supportSkills.Add(v);
                    }
                }
            }

            return(supportSkills);
        }