public IEnumerable <Action> Do(HeroController controller, TurnState turn, TacticScore tacticScore)
        {
            var targetX = (turn.My.Hero.AttackRange - 1) + turn.Enemy.Hero.X;
            var targetY = (turn.My.Hero.AttackRange - 1) + turn.Enemy.Hero.Y;

            yield return(() => controller.Move(targetX, targetY, "Back off baby"));
        }
        public IEnumerable <Action> Do(HeroController controller, TurnState turn, TacticScore tacticScore)
        {
            var healingPotions = turn.Game.Items
                                 .Where(x => x.IsPotion == 1 && x.Health > 0 && x.ItemCost <= turn.Gold)
                                 .OrderByDescending(x => x.Health)
                                 .ToList();

            yield return(() => controller.Buy(healingPotions.First().ItemName, "Ahh that's better. Come on!"));
        }
        public IEnumerable <Action> Do(HeroController controller, TurnState turn, TacticScore tacticScore)
        {
            var myVunerableUnits =
                turn.My.UnitsInRangeOf(turn.My.Hero)
                .Where(u => u.Health <= turn.My.Hero.AttackDamage)
                .OrderBy(u => u.Health)
                .ToUnitCollection();

            yield return(() => controller.Attack(myVunerableUnits.First(), "No You Don't"));
        }
        public IEnumerable <Action> Do(HeroController controller, TurnState turn, TacticScore tacticScore)
        {
            IEnumerable <Item> itemsIWant = turn.My.Hero.IsRanged
                ? turn.Game.Items.Where(x => x.IsPotion == 0 && x.Damage > 0 && x.ItemCost <= turn.Gold).ToList()
                : turn.Game.Items.Where(x => x.IsPotion == 0 && x.Health > 0 && x.ItemCost <= turn.Gold).ToList();

            foreach (var item in itemsIWant)
            {
                yield return(() => controller.Buy(item.ItemName, "Ho ho ho."));
            }
        }
        public IEnumerable <Action> Do(HeroController controller, TurnState turn, TacticScore tacticScore)
        {
            var target = turn.Enemy;

            var threat       = new ThreatTable(target);
            var sorted       = threat.OrderBy(x => x.Value);
            var keyValuePair = sorted.Last();
            var unit         = keyValuePair.Key;

            foreach (var item in sorted)
            {
                Console.Error.WriteLine(item.ToDebugString());
            }

            yield return(() => controller.Attack(unit, "Smackdown."));
        }
        public IEnumerable <Action> Do(HeroController controller, TurnState turn, TacticScore tacticScore)
        {
            var msg = turn.Enemy.Hero.HealthPercentage > 30 ? "FIGHT ME." : "You die now.";

            yield return(() => controller.AttackNearest("HERO", msg));
        }
        public IEnumerable <Action> Do(HeroController controller, TurnState turn, TacticScore tacticScore)
        {
            var leader = turn.My.Trash.FurthestForwardsOrDefault() ?? turn.My.Tower;

            yield return(() => controller.MoveBehind(leader, 2, "March!"));
        }
 public IEnumerable <Action> Do(HeroController controller, TurnState turn, TacticScore tacticScore)
 {
     yield return(() => controller.Move(turn.My.Tower));
 }
 public IEnumerable <Action> Do(HeroController controller, TurnState turn, TacticScore tacticScore)
 {
     yield return(() => controller.AttackNearest("HERO"));
 }
 public IEnumerable <Action> Do(HeroController controller, TurnState turn, TacticScore tacticScore)
 {
     yield return(() => controller.Attack(turn.Enemy.Hero, "You can't hide from me"));
 }