예제 #1
0
        public CaveGenerator(int width, int height, String name, double fillPercentage, int smoothness, Quinoa quinoa)
        {
            header = new RegionHeader(name);
            region = new Region(width, height);
            header.setRegion(region);
            entrance = new RegionExit(width / 2, height / 2, 0, 0, "", ExitDecorator.UP_STAIR);
            exit = new RegionExit(width / 2, (height / 2) + 1, 0, 0, "", ExitDecorator.DOWN_STAIR);
            header.getExits().Add(entrance);
            header.getExits().Add(exit);
            region.setLightingModel(LightingModel.CAVE);
            this.quinoa = quinoa;
            this.fillPercentage = fillPercentage;
            this.smoothness = smoothness;

            chambers = new List<Chamber>();

            //fill with solid rock
            for (int x = 0; x < width; x++)
            {
                for (int y = 0; y < height; y++)
                {
                    region.setTerrain(x, y, new Terrain());
                    region.getTerrain(x, y).setCode(TerrainCode.ROCK);
                }
            }
        }
예제 #2
0
        public void followExit(RegionExit exit)
        {
            removePlayerFromRegion();
            quinoa.getMap().changeCurrentRegion(exit.getDestinationRegionID());
            spawnMonsters();

            if(quinoa.getCurrentRegionHeader().regionIsLoaded())
            {
                foreach(Monster tempMon in quinoa.getCurrentRegionHeader().getRegion().getMonsters())
                {
                    MonsterActionManager.updateRole(tempMon, quinoa);
                }
            }

            insertPlayerInRegion(exit.getDx(),exit.getDy());
        }