Example #1
0
        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;
        }
Example #2
0
        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;
        }
Example #3
0
 public Action2(Condition2 condition, Ability ability)
 {
     Condition = condition;
     Ability = ability;
 }