public static bool Any(Level level, Character actor, Ability ability, IEnumerable<Character> targets) { foreach (var target in targets) { if (target != null && ability.CanUse(level, actor, target)) { actor.currentTarget = target; return true; } } return false; }
public static bool FoePartyLeaderTarget(Level level, Character actor, Ability ability) { var leader = level.Allies.Where(x => x.IsAlive).FirstOrDefault(); if (leader == null) return false; var target = leader.currentTarget; if (target == null) return false; if (!target.Faction.IsHostile(actor.Faction)) return false; if (ability.CanUse(level, actor, target)) { actor.currentTarget = target; return true; } return false; }
public Action2(Condition2 condition, Ability ability) { Condition = condition; Ability = ability; }