예제 #1
0
        public void GenerateHub()
        {
            Load();
            if (hub_rooms.Count == 0)
            {
                DungeonGenerator.MakeHub(rooms);
                Game.world.Draw();
                //AddPortal(rooms.Count - 1, EPortalStatus.NEXT_DUNGEON);
                Portal portal = new Portal(EPortalStatus.NEXT_DUNGEON);
                portal.SetPosition(12, 45);
                units.Add(portal);
                Game.world.Draw();
                DungeonGenerator.AddBridges(rooms, bridges, false);
                for (int i = 0; i < 5; ++i)
                {
                    Human human = new Human();
                    human.SetInRoom(DungeonGenerator.random.Next(0, 2));
                    human.Draw();
                    units.Add(human);
                }
                for (int i = 0; i < 3; ++i)
                {
                    Guardian guardian = new Guardian();
                    guardian.SetInRoom(rooms.Count - 1);
                    guardian.Draw();
                    units.Add(guardian);
                }
                Informant informant = new Informant();
                //informant.SetInRoom(0);
                informant.SetPosition(11, 8);
                units.Add(informant);

                EItemType[] types = { EItemType.ARMOR, EItemType.ITEM, EItemType.HELMET, EItemType.WEAPON };
                for (int i = 0; i < types.Length; ++i)
                {
                    Trader trader = new Trader(types[i]);
                    //trader.SetInRoom(DungeonGenerator.random.Next(0, 2));
                    trader.SetPosition(8, 5 + 4 * i);
                    trader.Draw();
                    units.Add(trader);
                }
                hub_bridges = bridges;
                hub_rooms   = rooms;
                hub_units   = units;
            }
            else
            {
                LoadHub();
                Game.world.Draw();
            }
        }