public override int GetValue(CardInstance _source, object _target = null) { int sum = 0; foreach (CardTarget ct in CardsToCount.OfType <CardTarget>()) { sum += ct.GetValidTargetsInPlay(_source).Count(); } return(sum * Multiplier); }
public IList <CardInstance> GetAffectedCardInstances(CardInstance _source, Ability _ability) { List <CardInstance> temp = new List <CardInstance> (); if (Affected == null) { return(null); } MagicEngine engine = MagicEngine.CurrentEngine; foreach (CardTarget ct in Affected.OfType <CardTarget>()) { foreach (CardInstance ci in ct.GetValidTargetsInPlay(_source)) { temp.Add(ci); } } return(temp.Count > 0 ? temp : null); }