Example #1
0
        public override IState CalculateNextState(GameState state, TestBot bot)
        {
            // Target Enemy ?

            // if (costToMine + 25 >= life)
            // Heal

            // else
            // mine

            // if capturing a mine will kill you
            if(state.myHero.life < 26)
                return new GoHeal();


            // Max mine of hero
            var maxMines = 0;
            foreach (var hero in state.heroes)
            {
                if (maxMines < hero.mineCount)
                    maxMines = hero.mineCount;
            }

            if (state.myHero.mineCount + 3 <= maxMines)
            {
                if(state.myHero.life >= 75)
                    return new AttackWinner();
                else
                    return new GoHeal();
            }

            return this;
        }
Example #2
0
        public override IState CalculateNextState(GameState state, TestBot bot)
        {
            // Done Healing or no Cash
            if (state.myHero.life > 85 || state.myHero.gold == 0)
            {
                // Check if there is a good enemy to steal
                var maxMines = 0;
                foreach (var hero in state.heroes)
                {
                    if (maxMines < hero.mineCount)
                        maxMines = hero.mineCount;
                }

                // Go steal if he has more mine than you
                if (state.myHero.mineCount + 3 <= maxMines)
                {
                    return new AttackWinner();
                }

                // No worthy opponent, go capture mines
                return new CaptureMine();
            }

            // Go Heal
            return this;
        }
Example #3
0
        public override IState CalculateNextState(GameState state, TestBot bot)
        {
            var enemy = GetEnemy(state);

            if (enemy.mineCount <= state.myHero.mineCount)
            {
                if(state.myHero.life > 25)
                    return new CaptureMine();
                return new GoHeal();
            }
            else if(enemy.life > state.myHero.life)
                return new GoHeal();

            return this;
        }
Example #4
0
 public override Pos GetGoal(GameState state, TestBot bot)
 {
     var enemy = GetEnemy(state);
     return enemy.pos;
 }
Example #5
0
 public override Pos GetGoal(GameState state, TestBot bot)
 {
     throw new System.NotImplementedException();
 }
Example #6
0
 public override Pos GetGoal(GameState state, TestBot bot)
 {
     Console.WriteLine("Capturing mine");
     return bot.GetClosestMine(state.myHero.pos, state.board);
 }
Example #7
0
 public virtual IState CalculateNextState(GameState state, TestBot bot)
 {
     return this;
 }
Example #8
0
 public abstract Pos GetGoal(GameState state, TestBot bot);
Example #9
0
 public override Pos GetGoal(GameState state, TestBot bot)
 {
     // Go to tavern
     return bot.GetClosestTavern(state.myHero.pos);
 }