Example #1
0
        private void StartNewBattle()
        {
            MapGenerator mapGen = new MapGenerator(_randomator, _myInterface, _myDrawer);

            _currentMap      = mapGen.GenerateBasicGrasslands(Constants.MapSize, Constants.MapSize);
            this._playerTeam = _currentMap.TeamRosterGetTeamFrom(0);

            _currentMap.SetTile(new Coords(0, 0), new Tile(_currentMap, new Coords(CoordsType.Tile, 0, 0), Constants.TileGeneratorGrass));
            _currentMap.SetTile(new Coords(0, 1), new Tile(_currentMap, new Coords(CoordsType.Tile, 0, 1), Constants.TileGeneratorGrass));
            _currentMap.SetTile(new Coords(3, 3), new Tile(_currentMap, new Coords(CoordsType.Tile, 3, 3), Constants.TileGeneratorGrass));
            _currentMap.AnalyzeTileAccessibility();

            _scheduler = new Scheduler(_currentMap);
            _ledger    = new Ledger(_scheduler);

            _myInterface.MyDrawer = _myDrawer;

            Creature hero1 = _currentMap.CreateCreature(new Coords(CoordsType.Tile, 0, 0), _currentMap.TeamRosterGetTeamFrom(0),
                                                        Constants.CreatureGeneratorHero, new BrainPlayerControlled(), _myDrawer, _myInterface);

            Creature hero2 = _currentMap.CreateCreature(new Coords(CoordsType.Tile, 0, 1), _currentMap.TeamRosterGetTeamFrom(0),
                                                        Constants.CreatureGeneratorHero, new BrainPlayerControlled(), _myDrawer, _myInterface);

            hero2.SkillPointsAdd(5);

            _currentMap.CreateItem(hero1, Constants.ItemGeneratorSword);
            _currentMap.CreateItem(hero2, Constants.ItemGeneratorSword);
            _currentMap.CreateItem(hero2, Constants.ItemGeneratorBow);
        }
 public void PopulateMapWithItems(MapBattle map)
 {
     for (int i = 0; i < map.BoundX; ++i)
     {
         for (int j = 0; j < map.BoundY; ++j)
         {
             UInt32 dicethrow = _randomator.NSidedDice(200, 1);
             if (dicethrow == 19 && map.TileIsPassable(new Coords(i, j)))
             {
                 map.CreateItem(new Coords(i, j), Constants.ItemGeneratorShield);
             }
         }
     }
 }