diff --git a/code/controllers/subsystem/minimum_spawns.dm b/code/controllers/subsystem/minimum_spawns.dm index b859a2e058..ea419ce921 100644 --- a/code/controllers/subsystem/minimum_spawns.dm +++ b/code/controllers/subsystem/minimum_spawns.dm @@ -1,5 +1,5 @@ SUBSYSTEM_DEF(min_spawns) - name = "Minimum Spawns" + name = "Minimum Spawns" // it should be more like "failsafe spawns" or "backup spawns" or something init_order = INIT_ORDER_DEFAULT flags = SS_BACKGROUND wait = 2 @@ -18,7 +18,7 @@ GLOBAL_LIST_INIT(minimum_lavaland_spawns, list( /mob/living/simple_animal/hostile/megafauna/bubblegum )) -GLOBAL_LIST_INIT(minimum_snow_spawns, list( +GLOBAL_LIST_INIT(minimum_snow_surface_spawns, list( /obj/structure/spawner/ice_moon, /obj/structure/spawner/ice_moon/polarbear )) @@ -35,15 +35,14 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( // step 5: snaxi support - done? /datum/controller/subsystem/min_spawns/Initialize(start_timeofday) - if(SSmapping.config.map_name == "Snow Taxi") //todo: recognizing maps that aren't lavaland mining but are also not snaxi - active_spawns = GLOB.minimum_snow_spawns + if(SSmapping.levels_by_trait(ZTRAIT_LAVA_RUINS)) //todo: recognizing maps that aren't lavaland mining but are also not snaxi + active_spawns = GLOB.minimum_lavaland_spawns + else if(SSmapping.levels_by_trait(ZTRAIT_ICE_RUINS)) + active_spawns = GLOB.minimum_snow_surface_spawns active_spawns_2 = GLOB.minimum_snow_under_spawns snaxi_snowflake_check = TRUE - else - active_spawns = GLOB.minimum_lavaland_spawns - if(!active_spawns) - flags = SS_NO_FIRE - return ..() + if(!active_spawns && !active_spawns_2) + return ..() // call it a day i guess // borrowing this from auxbase code - see code\modules\mining\aux_base.dm if(snaxi_snowflake_check) for(var/z_level in SSmapping.levels_by_trait(ZTRAIT_ICE_RUINS)) @@ -71,7 +70,7 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( continue valid_mining_turfs_2.Add(TT) else - for(var/z_level in SSmapping.levels_by_trait(ZTRAIT_MINING)) + for(var/z_level in SSmapping.levels_by_trait(ZTRAIT_LAVA_RUINS)) for(var/turf/TT in Z_TURFS(z_level)) if(!isarea(TT.loc)) continue @@ -84,13 +83,14 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( continue valid_mining_turfs.Add(TT) if(!valid_mining_turfs) - flags = SS_NO_FIRE - return ..() + return ..() // call it a day i guess + // if we're at this point we might as well fucking hit it + where_we_droppin_boys() return ..() - -/datum/controller/subsystem/min_spawns/fire(resumed) - if(active_spawns.len) +/datum/controller/subsystem/min_spawns/proc/where_we_droppin_boys() + while(active_spawns.len) + CHECK_TICK var/turf/RT = pick_n_take(valid_mining_turfs) //Pick a random mining Z-level turf var/MS_tospawn = pick_n_take(active_spawns) for(var/mob/living/simple_animal/hostile/H in urange(70,RT)) //prevents mob clumps @@ -100,16 +100,17 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( if((ispath(MS_tospawn, /obj/structure/spawner) || istype(H, /obj/structure/spawner)) && get_dist(src, H) <= 35) active_spawns.Add(MS_tospawn) return //let's at least /try/ to space these out? - for(var/obj/structure/spawner/LT in urange(70,RT)) //prevents tendril/mega clumps - if((ispath(MS_tospawn, /mob/living/simple_animal/hostile/megafauna)) && get_dist(src, LT) <= 70) - active_spawns.Add(MS_tospawn) - return //let's try not to dump megas too close to each other? - if((ispath(MS_tospawn, /obj/structure/spawner)) && get_dist(src, LT) <= 35) - active_spawns.Add(MS_tospawn) - return //let's at least /try/ to space these out? + for(var/obj/structure/spawner/LT in urange(70,RT)) //prevents tendril/mega clumps + if((ispath(MS_tospawn, /mob/living/simple_animal/hostile/megafauna)) && get_dist(src, LT) <= 70) + active_spawns.Add(MS_tospawn) + return //let's try not to dump megas too close to each other? + if((ispath(MS_tospawn, /obj/structure/spawner)) && get_dist(src, LT) <= 35) + active_spawns.Add(MS_tospawn) + return //let's at least /try/ to space these out? // man the overhead on this is gonna SUCK new MS_tospawn(RT) - if(active_spawns_2.len) + while(active_spawns_2.len) + CHECK_TICK var/turf/RT = pick_n_take(valid_mining_turfs_2) //Pick a random mining Z-level turf var/MS2_tospawn = pick_n_take(active_spawns_2) for(var/mob/living/simple_animal/hostile/H in urange(70,RT)) //prevents mob clumps @@ -119,14 +120,12 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( if((ispath(MS2_tospawn, /obj/structure/spawner) || istype(H, /obj/structure/spawner)) && get_dist(src, H) <= 35) active_spawns_2.Add(MS2_tospawn) return //let's at least /try/ to space these out? - for(var/obj/structure/spawner/LT in urange(70,RT)) //prevents tendril/mega clumps - if((ispath(MS2_tospawn, /mob/living/simple_animal/hostile/megafauna)) && get_dist(src, LT) <= 70) - active_spawns_2.Add(MS2_tospawn) - return //let's try not to dump megas too close to each other? - if((ispath(MS2_tospawn, /obj/structure/spawner)) && get_dist(src, LT) <= 35) - active_spawns.Add(MS2_tospawn) - return //let's at least /try/ to space these out? + for(var/obj/structure/spawner/LT in urange(70,RT)) //prevents tendril/mega clumps + if((ispath(MS2_tospawn, /mob/living/simple_animal/hostile/megafauna)) && get_dist(src, LT) <= 70) + active_spawns_2.Add(MS2_tospawn) + return //let's try not to dump megas too close to each other? + if((ispath(MS2_tospawn, /obj/structure/spawner)) && get_dist(src, LT) <= 35) + active_spawns.Add(MS2_tospawn) + return //let's at least /try/ to space these out? // man the overhead on this is gonna SUCK new MS2_tospawn(RT) - if(!active_spawns.len && !active_spawns_2.len) - flags = SS_NO_FIRE