static CardAIPlanData ProduceSingleRefination(CardAI ai, CardAIPlanData entryState, CardAIPlanData plan) { NetBattlefield bf = entryState.bf; NetSkill ns = bf.GetSkillByID(plan.GetTopCardPlay().skill); //cast form the source plan data so that it is not casted "after" action we want to reiterate to different targets CardAIPlanData d = CastSkillOnece(ai, ns, ns.GetOwner(bf), entryState, bf.CloneAndRemember(), plan.GetTopCardPlay().targetEnumerator); if (d.valid && plan.value < d.value) { d.SetEnumerator(plan.GetTopCardPlay().targetEnumerator); } return(d); }
static public List <CardAIPlanData> ProduceCastPlans(CardAI ai, CardAIPlanData data, List <NetSkill> skills, int count) { List <CardAIPlanData> plans = new List <CardAIPlanData>(skills.Count); NetBattlefield bf = data.bf; for (int i = 0; i < skills.Count; i++) { NetSkill ns = skills[i]; IEnumerator <List <int> > targetEnumerator = null; for (int k = 0; k < count; k++) { CardAIPlanData d = CastSkillOnece(ai, ns, ns.GetOwner(bf), data, bf.CloneAndRemember(), targetEnumerator); if (d.valid) { if (targetEnumerator == null) { targetEnumerator = d.GetTopCardPlay().targetEnumerator; } plans.Add(d); } } } return(plans); }