Example #1
0
        public override AgentAction MakeMove()
        {
            if (ShouldPanic())
            {
                return(Panic());
            }
            if (TargetInBombRadius(myTile) || MischiefChance())
            {
                var tileToRun = GetTileToRunAfterBomb();
                if (tileToRun != null)
                {
                    return(GameLib.BombDirectionTo(myTile, pathfinder.NextTileOnPath(tileToRun.Value)));
                }
            }

            var target = ChooseTarget();

            if (target == default)
            {
                //взрываем себя если всё равно на следующий ход СМЕРТ
                return(IsTileDeadlyToGo(myTile) ? AgentAction.BombUp : AgentAction.DoNothing);
            }

            return(GameLib.DirectionTo(myTile, pathfinder.NextTileOnPath(target)));
        }
Example #2
0
        private AgentAction PlantBomb(HashSet <Tile> safeTiles)
        {
            var tileTo = pathfinder.NextTileOnPath(safeTiles.OrderBy(x => pathfinder.GetDistance(x)).First());

            return(GameLib.BombDirectionTo(myTile, tileTo));
        }