Beispiel #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);
        }
        /// <summary>
        /// Target any enemy character
        /// </summary>
        /// <param name="bf"></param>
        /// <param name="ns"></param>
        /// <param name="bfPosition"></param>
        /// <returns></returns>
        static public List <int> Trg_RangeTargeting_Unblocked(NetBattlefield bf, NetSkill ns, int bfPosition)
        {
            if (bf == null || ns == null)
            {
                return(null);
            }

            NetCard nc = bf.GetCardByID(ns.OwnerCardID);

            if (nc == null)
            {
                return(null);
            }

            //this skill should work only when activated from battlefield
            if (!bf.IsBattleSlot(bfPosition))
            {
                return(null);
            }

            return(SubskillScript.TrgU_FallbackTargets(bf, ns, nc));
        }