예제 #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;
        }
예제 #2
0
파일: GoHeal.cs 프로젝트: maperr/blitz2016
        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;
        }
예제 #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;
        }
예제 #4
0
 public override Pos GetGoal(GameState state, TestBot bot)
 {
     var enemy = GetEnemy(state);
     return enemy.pos;
 }
예제 #5
0
 public override Pos GetGoal(GameState state, TestBot bot)
 {
     throw new System.NotImplementedException();
 }
예제 #6
0
 public override Pos GetGoal(GameState state, TestBot bot)
 {
     Console.WriteLine("Capturing mine");
     return bot.GetClosestMine(state.myHero.pos, state.board);
 }
예제 #7
0
파일: IState.cs 프로젝트: maperr/blitz2016
 public virtual IState CalculateNextState(GameState state, TestBot bot)
 {
     return this;
 }
예제 #8
0
파일: IState.cs 프로젝트: maperr/blitz2016
 public abstract Pos GetGoal(GameState state, TestBot bot);
예제 #9
0
파일: GoHeal.cs 프로젝트: maperr/blitz2016
 public override Pos GetGoal(GameState state, TestBot bot)
 {
     // Go to tavern
     return bot.GetClosestTavern(state.myHero.pos);
 }