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; }
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; }
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; }
public override Pos GetGoal(GameState state, TestBot bot) { var enemy = GetEnemy(state); return enemy.pos; }
public override Pos GetGoal(GameState state, TestBot bot) { throw new System.NotImplementedException(); }
public override Pos GetGoal(GameState state, TestBot bot) { Console.WriteLine("Capturing mine"); return bot.GetClosestMine(state.myHero.pos, state.board); }
public virtual IState CalculateNextState(GameState state, TestBot bot) { return this; }
public abstract Pos GetGoal(GameState state, TestBot bot);
public override Pos GetGoal(GameState state, TestBot bot) { // Go to tavern return bot.GetClosestTavern(state.myHero.pos); }