public override void Apply(ZoneGenContext zoneContext, IGenContext context, StablePriorityQueue <Priority, IGenStep> queue)
        {
            ItemSpawnStep <BaseMapGenContext> spawnStep = new ItemSpawnStep <BaseMapGenContext>();

            spawnStep.Spawns = Spawns.GetSpawnList(zoneContext.CurrentID);
            queue.Enqueue(Priority, spawnStep);
        }
Exemplo n.º 2
0
        private void addToQueue(ZoneGenContext zoneContext, IGenContext context, StablePriorityQueue <Priority, IGenStep> queue)
        {
            int id = zoneContext.CurrentID;

            IMonsterHouseBaseStep monsterHouseStep = HouseStepSpawns.Pick(context.Rand).CreateNew();
            SpawnList <MapItem>   itemListSlice    = Items.GetSpawnList(id);

            for (int jj = 0; jj < itemListSlice.Count; jj++)
            {
                monsterHouseStep.Items.Add(new MapItem(itemListSlice.GetSpawn(jj)), itemListSlice.GetSpawnRate(jj));
            }
            SpawnList <ItemTheme> itemThemeListSlice = ItemThemes.GetSpawnList(id);

            for (int jj = 0; jj < itemThemeListSlice.Count; jj++)
            {
                monsterHouseStep.ItemThemes.Add(itemThemeListSlice.GetSpawn(jj).Copy(), itemThemeListSlice.GetSpawnRate(jj));
            }
            SpawnList <MobSpawn> mobListSlice = Mobs.GetSpawnList(id);

            for (int jj = 0; jj < mobListSlice.Count; jj++)
            {
                MobSpawn newSpawn = mobListSlice.GetSpawn(jj).Copy();
                monsterHouseStep.Mobs.Add(newSpawn, mobListSlice.GetSpawnRate(jj));
            }
            SpawnList <MobTheme> mobThemeListSlice = MobThemes.GetSpawnList(id);

            for (int jj = 0; jj < mobThemeListSlice.Count; jj++)
            {
                monsterHouseStep.MobThemes.Add(mobThemeListSlice.GetSpawn(jj).Copy(), mobThemeListSlice.GetSpawnRate(jj));
            }

            queue.Enqueue(Priority, monsterHouseStep);
        }
Exemplo n.º 3
0
        public override void Apply(ZoneGenContext zoneContext, IGenContext context, StablePriorityQueue <Priority, IGenStep> queue)
        {
            TileSpawnStep <BaseMapGenContext> spawnStep = new TileSpawnStep <BaseMapGenContext>();

            SpawnList <EffectTile> spawner = Spawns.GetSpawnList(zoneContext.CurrentID);

            for (int ii = 0; ii < spawner.Count; ii++)
            {
                spawnStep.Spawns.Add(spawner.GetSpawn(ii), spawner.GetSpawnRate(ii));
            }

            queue.Enqueue(Priority, spawnStep);
        }
Exemplo n.º 4
0
        public override void Apply(ZoneGenContext zoneContext, IGenContext context, StablePriorityQueue <Priority, IGenStep> queue)
        {
            int id = zoneContext.CurrentID;

            foreach (int floorId in SpreadPlan.DropPoints)
            {
                if (floorId != zoneContext.CurrentID)
                {
                    continue;
                }
                foreach (IGenPriority vaultStep in VaultSteps)
                {
                    queue.Enqueue(vaultStep.Priority, vaultStep.GetItem());
                }

                {
                    SpawnList <MapItem> itemListSlice = Items.GetSpawnList(id);
                    PickerSpawner <ListMapGenContext, MapItem> constructedSpawns = new PickerSpawner <ListMapGenContext, MapItem>(new LoopedRand <MapItem>(itemListSlice, ItemAmount[id]));

                    List <IStepSpawner <ListMapGenContext, MapItem> > steps = new List <IStepSpawner <ListMapGenContext, MapItem> >();
                    steps.Add(constructedSpawns);
                    if (ItemSpawners.ContainsItem(id))
                    {
                        IStepSpawner <ListMapGenContext, MapItem> treasures = ItemSpawners[id].Copy();
                        steps.Add(treasures);
                    }
                    PresetMultiRand <IStepSpawner <ListMapGenContext, MapItem> > groupRand   = new PresetMultiRand <IStepSpawner <ListMapGenContext, MapItem> >(steps.ToArray());
                    RandomRoomSpawnStep <ListMapGenContext, MapItem>             detourItems = ItemPlacements[id].Copy();
                    detourItems.Spawn = new MultiStepSpawner <ListMapGenContext, MapItem>(groupRand);
                    queue.Enqueue(ItemPriority, detourItems);
                }


                SpawnList <MobSpawn> mobListSlice = Mobs.GetSpawnList(id);
                if (mobListSlice.CanPick)
                {
                    //secret enemies
                    SpecificTeamSpawner specificTeam = new SpecificTeamSpawner();

                    MobSpawn newSpawn = mobListSlice.Pick(context.Rand).Copy();
                    specificTeam.Spawns.Add(newSpawn);

                    //use bruteforce clone for this
                    PlaceRandomMobsStep <ListMapGenContext> secretMobPlacement = MobPlacements[id].Copy();
                    secretMobPlacement.Spawn = new LoopedTeamSpawner <ListMapGenContext>(specificTeam, MobAmount[id]);
                    queue.Enqueue(MobPriority, secretMobPlacement);
                }
            }
        }
Exemplo n.º 5
0
        public override void Apply(ZoneGenContext zoneContext, IGenContext context, StablePriorityQueue <Priority, IGenStep> queue)
        {
            MobSpawnStep <BaseMapGenContext> spawnStep = new MobSpawnStep <BaseMapGenContext>();

            PoolTeamSpawner spawner = new PoolTeamSpawner();

            spawner.Spawns    = Spawns.GetSpawnList(zoneContext.CurrentID);
            spawner.TeamSizes = TeamSizes.GetSpawnList(zoneContext.CurrentID);
            spawnStep.Spawns.Add(spawner, spawner.Spawns.SpawnTotal);

            SpawnList <SpecificTeamSpawner> specificSpawner = SpecificSpawns.GetSpawnList(zoneContext.CurrentID);

            for (int ii = 0; ii < specificSpawner.Count; ii++)
            {
                spawnStep.Spawns.Add(specificSpawner.GetSpawn(ii), specificSpawner.GetSpawnRate(ii));
            }

            queue.Enqueue(Priority, spawnStep);
        }
Exemplo n.º 6
0
        public override void Apply(ZoneGenContext zoneContext, IGenContext context, StablePriorityQueue <Priority, IGenStep> queue)
        {
            int id = zoneContext.CurrentID;

            foreach (int floorId in SpreadPlan.DropPoints)
            {
                if (floorId != zoneContext.CurrentID)
                {
                    continue;
                }
                {
                    SpawnList <AddBossRoomStep <ListMapGenContext> > bossListSlice = BossSteps.GetSpawnList(id);
                    if (!bossListSlice.CanPick)
                    {
                        return;
                    }
                    AddBossRoomStep <ListMapGenContext> bossStep = bossListSlice.Pick(context.Rand).Copy();
                    queue.Enqueue(BossRoomPriority, bossStep);
                }

                foreach (IGenPriority vaultStep in VaultSteps)
                {
                    queue.Enqueue(vaultStep.Priority, vaultStep.GetItem());
                }

                {
                    SpawnList <MapItem> itemListSlice = Items.GetSpawnList(id);
                    PickerSpawner <ListMapGenContext, MapItem> constructedSpawns = new PickerSpawner <ListMapGenContext, MapItem>(new LoopedRand <MapItem>(itemListSlice, ItemAmount[id]));

                    IStepSpawner <ListMapGenContext, MapItem> treasures = ItemSpawners[id].Copy();

                    PresetMultiRand <IStepSpawner <ListMapGenContext, MapItem> > groupRand = new PresetMultiRand <IStepSpawner <ListMapGenContext, MapItem> >(constructedSpawns, treasures);

                    RandomRoomSpawnStep <ListMapGenContext, MapItem> detourItems = ItemPlacements[id].Copy();
                    detourItems.Spawn = new MultiStepSpawner <ListMapGenContext, MapItem>(groupRand);
                    queue.Enqueue(RewardPriority, detourItems);
                }
            }
        }