From e85b6a490bbbf950f5f27dbe1fd5310936a1692b Mon Sep 17 00:00:00 2001 From: Hatterhat Date: Mon, 3 Aug 2020 14:45:07 -0500 Subject: [PATCH 01/17] minimum spawns subsystem - squashed --- code/controllers/subsystem/minimum_spawns.dm | 124 ++++++++++++++++++ code/datums/ruins/lavaland.dm | 5 +- .../turfs/simulated/floor/plating/asteroid.dm | 1 + tgstation.dme | 1 + 4 files changed, 127 insertions(+), 4 deletions(-) create mode 100644 code/controllers/subsystem/minimum_spawns.dm diff --git a/code/controllers/subsystem/minimum_spawns.dm b/code/controllers/subsystem/minimum_spawns.dm new file mode 100644 index 0000000000..e45c05d88f --- /dev/null +++ b/code/controllers/subsystem/minimum_spawns.dm @@ -0,0 +1,124 @@ +SUBSYSTEM_DEF(min_spawns) + name = "Minimum Spawns" + init_order = INIT_ORDER_DEFAULT + flags = SS_BACKGROUND + wait = 2 + var/snaxi_snowflake_check = FALSE + var/list/active_spawns = list() // lavaland, snaxi, etc. primary spawn list + var/list/active_spawns_2 = list() // snaxi underground, etc. secondary spawn list + var/list/valid_mining_turfs = list() // lavaland/snaxi turfs + var/list/valid_mining_turfs_2 = list() // snaxi underground turfs + +GLOBAL_LIST_INIT(minimum_lavaland_spawns, list( + /obj/structure/spawner/lavaland, + /obj/structure/spawner/lavaland/goliath, + /obj/structure/spawner/lavaland/legion, + /mob/living/simple_animal/hostile/megafauna/dragon, + /mob/living/simple_animal/hostile/megafauna/colossus, + /mob/living/simple_animal/hostile/megafauna/bubblegum +)) + +GLOBAL_LIST_INIT(minimum_snow_spawns, list( + /obj/structure/spawner/ice_moon, + /obj/structure/spawner/ice_moon/polarbear +)) +GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( + /obj/structure/spawner/ice_moon/demonic_portal, + /obj/structure/spawner/ice_moon/demonic_portal/ice_whelp, + /obj/structure/spawner/ice_moon/demonic_portal/snowlegion +)) + +// step 1: check for which list(s) to use - done +// step 2: check for caves - done +// step 3: check for mobs - done +// step 4: start throwing shit down - done +// 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 + 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 + // 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)) + for(var/turf/TT in Z_TURFS(z_level)) + if(!isarea(TT.loc)) + continue + var/area/A = TT.loc + if(!A.mob_spawn_allowed) + continue + if(!istype(TT, /turf/open/floor/plating/asteroid)) + continue + valid_mining_turfs.Add(TT) + for(var/z_level in SSmapping.levels_by_trait(ZTRAIT_ICE_RUINS_UNDERGROUND)) + for(var/turf/TT in Z_TURFS(z_level)) + if(!isarea(TT.loc)) + continue + var/area/A = TT.loc + if(!A.mob_spawn_allowed) + continue + if(!istype(TT, /turf/open/floor/plating/asteroid)) + continue + valid_mining_turfs_2.Add(TT) + else + for(var/z_level in SSmapping.levels_by_trait(ZTRAIT_MINING)) + for(var/turf/TT in Z_TURFS(z_level)) + if(!isarea(TT.loc)) + continue + var/area/A = TT.loc + if(!A.mob_spawn_allowed) + continue + if(!istype(TT, /turf/open/floor/plating/asteroid)) + continue + valid_mining_turfs.Add(TT) + if(!valid_mining_turfs) + flags = SS_NO_FIRE + return + +/datum/controller/subsystem/min_spawns/fire(resumed) + if(active_spawns.len) + 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(36,RT)) //prevents mob clumps + if((ispath(MS_tospawn, /mob/living/simple_animal/hostile/megafauna) || ismegafauna(H)) && get_dist(src, H) <= 40) + 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) || istype(H, /obj/structure/spawner)) && get_dist(src, H) <= 24) + active_spawns.Add(MS_tospawn) + return //let's at least /try/ to space these out? + for(var/obj/structure/spawner/LT in urange(36,RT)) //prevents tendril/mega clumps + if((ispath(MS_tospawn, /mob/living/simple_animal/hostile/megafauna)) && get_dist(src, LT) <= 40) + 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) <= 24) + 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) + 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(36,RT)) //prevents mob clumps + if((ispath(MS2_tospawn, /mob/living/simple_animal/hostile/megafauna) || ismegafauna(H)) && get_dist(src, H) <= 40) + 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) || istype(H, /obj/structure/spawner)) && get_dist(src, H) <= 24) + active_spawns_2.Add(MS2_tospawn) + return //let's at least /try/ to space these out? + for(var/obj/structure/spawner/LT in urange(36,RT)) //prevents tendril/mega clumps + if((ispath(MS2_tospawn, /mob/living/simple_animal/hostile/megafauna)) && get_dist(src, LT) <= 40) + 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) <= 24) + 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 diff --git a/code/datums/ruins/lavaland.dm b/code/datums/ruins/lavaland.dm index 933eaf082e..3fa500b748 100644 --- a/code/datums/ruins/lavaland.dm +++ b/code/datums/ruins/lavaland.dm @@ -114,14 +114,12 @@ description = "..." suffix = "lavaland_surface_sloth.dmm" // Generates nothing but atmos runtimes and salt - cost = 0 /datum/map_template/ruin/lavaland/ratvar name = "Dead God" id = "ratvar" - description = "Ratvars final resting place." + description = "Ratvar's final resting place." suffix = "lavaland_surface_dead_ratvar.dmm" - cost = 0 allow_duplicates = FALSE /datum/map_template/ruin/lavaland/hierophant @@ -137,7 +135,6 @@ id = "blooddrunk" description = "A strange arrangement of stone tiles and an insane, beastly miner contemplating them." suffix = "lavaland_surface_blooddrunk1.dmm" - cost = 0 allow_duplicates = FALSE //will only spawn one variant of the ruin /datum/map_template/ruin/lavaland/blood_drunk_miner/guidance diff --git a/code/game/turfs/simulated/floor/plating/asteroid.dm b/code/game/turfs/simulated/floor/plating/asteroid.dm index 1fbeee7523..07e7d70e5a 100644 --- a/code/game/turfs/simulated/floor/plating/asteroid.dm +++ b/code/game/turfs/simulated/floor/plating/asteroid.dm @@ -337,6 +337,7 @@ T.ChangeTurf(turf_type, null, CHANGETURF_IGNORE_AIR) /// Spawns a random mob or megafauna in the tunnel + /turf/open/floor/plating/asteroid/airless/cave/proc/SpawnMonster(turf/T) if(!isarea(loc)) return diff --git a/tgstation.dme b/tgstation.dme index f6cc9ea78f..402e8ae513 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -313,6 +313,7 @@ #include "code\controllers\subsystem\materials.dm" #include "code\controllers\subsystem\medals.dm" #include "code\controllers\subsystem\minimaps.dm" +#include "code\controllers\subsystem\minimum_spawns.dm" #include "code\controllers\subsystem\minor_mapping.dm" #include "code\controllers\subsystem\mobs.dm" #include "code\controllers\subsystem\nightshift.dm" From 28c7ed87a2725bfeb6f31c39aef748d2465e242d Mon Sep 17 00:00:00 2001 From: Hatterhat Date: Thu, 6 Aug 2020 16:23:24 -0500 Subject: [PATCH 02/17] no whitespace --- code/game/turfs/simulated/floor/plating/asteroid.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/game/turfs/simulated/floor/plating/asteroid.dm b/code/game/turfs/simulated/floor/plating/asteroid.dm index 07e7d70e5a..1fbeee7523 100644 --- a/code/game/turfs/simulated/floor/plating/asteroid.dm +++ b/code/game/turfs/simulated/floor/plating/asteroid.dm @@ -337,7 +337,6 @@ T.ChangeTurf(turf_type, null, CHANGETURF_IGNORE_AIR) /// Spawns a random mob or megafauna in the tunnel - /turf/open/floor/plating/asteroid/airless/cave/proc/SpawnMonster(turf/T) if(!isarea(loc)) return From 76cad8f1bf36673d0fb7e97ae345d08e6f00890a Mon Sep 17 00:00:00 2001 From: Hatterhat Date: Thu, 6 Aug 2020 18:26:00 -0500 Subject: [PATCH 03/17] bdm always spawns, duplicate removal maintained --- code/datums/ruins/lavaland.dm | 1 + code/modules/mapping/ruins.dm | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/code/datums/ruins/lavaland.dm b/code/datums/ruins/lavaland.dm index 3fa500b748..a08b535aff 100644 --- a/code/datums/ruins/lavaland.dm +++ b/code/datums/ruins/lavaland.dm @@ -135,6 +135,7 @@ id = "blooddrunk" description = "A strange arrangement of stone tiles and an insane, beastly miner contemplating them." suffix = "lavaland_surface_blooddrunk1.dmm" + always_place = TRUE allow_duplicates = FALSE //will only spawn one variant of the ruin /datum/map_template/ruin/lavaland/blood_drunk_miner/guidance diff --git a/code/modules/mapping/ruins.dm b/code/modules/mapping/ruins.dm index 193106c294..b681c348e0 100644 --- a/code/modules/mapping/ruins.dm +++ b/code/modules/mapping/ruins.dm @@ -135,7 +135,12 @@ //That's done remove from priority even if it failed if(forced) //TODO : handle forced ruins with multiple variants + // this might work? forced_ruins -= current_pick + if(!current_pick.allow_duplicates) + for(var/datum/map_template/ruin/R in forced_ruins) + if(R.id == current_pick.id) + forced_ruins -= R forced = FALSE if(failed_to_place) From 8cd45c7275f5b17b78cf6f79400e4ad2b953012a Mon Sep 17 00:00:00 2001 From: Hatterhat Date: Sun, 16 Aug 2020 01:36:41 -0500 Subject: [PATCH 04/17] hey travis are you workin yet bro --- code/controllers/subsystem/minimum_spawns.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/controllers/subsystem/minimum_spawns.dm b/code/controllers/subsystem/minimum_spawns.dm index e45c05d88f..efc08284af 100644 --- a/code/controllers/subsystem/minimum_spawns.dm +++ b/code/controllers/subsystem/minimum_spawns.dm @@ -43,7 +43,7 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( active_spawns = GLOB.minimum_lavaland_spawns if(!active_spawns) flags = SS_NO_FIRE - return + return ..() // 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)) @@ -79,7 +79,9 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( valid_mining_turfs.Add(TT) if(!valid_mining_turfs) flags = SS_NO_FIRE - return + return ..() + return ..() + /datum/controller/subsystem/min_spawns/fire(resumed) if(active_spawns.len) From eb69035240e67d4fa175785c1f14b381c0e860b3 Mon Sep 17 00:00:00 2001 From: Hatterhat Date: Mon, 17 Aug 2020 12:39:49 -0500 Subject: [PATCH 05/17] holy shit i despise the copypaste on this one --- code/controllers/subsystem/minimum_spawns.dm | 30 ++++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/code/controllers/subsystem/minimum_spawns.dm b/code/controllers/subsystem/minimum_spawns.dm index efc08284af..5391339351 100644 --- a/code/controllers/subsystem/minimum_spawns.dm +++ b/code/controllers/subsystem/minimum_spawns.dm @@ -55,6 +55,8 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( continue if(!istype(TT, /turf/open/floor/plating/asteroid)) continue + if(/turf/open/lava in orange(9, TT)) + continue valid_mining_turfs.Add(TT) for(var/z_level in SSmapping.levels_by_trait(ZTRAIT_ICE_RUINS_UNDERGROUND)) for(var/turf/TT in Z_TURFS(z_level)) @@ -65,6 +67,8 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( continue if(!istype(TT, /turf/open/floor/plating/asteroid)) continue + if(/turf/open/lava in orange(9, TT)) + continue valid_mining_turfs_2.Add(TT) else for(var/z_level in SSmapping.levels_by_trait(ZTRAIT_MINING)) @@ -76,6 +80,8 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( continue if(!istype(TT, /turf/open/floor/plating/asteroid)) continue + if(/turf/open/lava in orange(9, TT)) + continue valid_mining_turfs.Add(TT) if(!valid_mining_turfs) flags = SS_NO_FIRE @@ -87,18 +93,18 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( if(active_spawns.len) 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(36,RT)) //prevents mob clumps - if((ispath(MS_tospawn, /mob/living/simple_animal/hostile/megafauna) || ismegafauna(H)) && get_dist(src, H) <= 40) + for(var/mob/living/simple_animal/hostile/H in urange(70,RT)) //prevents mob clumps + if((ispath(MS_tospawn, /mob/living/simple_animal/hostile/megafauna) || ismegafauna(H)) && get_dist(src, H) <= 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) || istype(H, /obj/structure/spawner)) && get_dist(src, H) <= 24) + 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(36,RT)) //prevents tendril/mega clumps - if((ispath(MS_tospawn, /mob/living/simple_animal/hostile/megafauna)) && get_dist(src, LT) <= 40) + 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) <= 24) + 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 @@ -106,18 +112,18 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( if(active_spawns_2.len) 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(36,RT)) //prevents mob clumps - if((ispath(MS2_tospawn, /mob/living/simple_animal/hostile/megafauna) || ismegafauna(H)) && get_dist(src, H) <= 40) + for(var/mob/living/simple_animal/hostile/H in urange(70,RT)) //prevents mob clumps + if((ispath(MS2_tospawn, /mob/living/simple_animal/hostile/megafauna) || ismegafauna(H)) && get_dist(src, H) <= 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) || istype(H, /obj/structure/spawner)) && get_dist(src, H) <= 24) + 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(36,RT)) //prevents tendril/mega clumps - if((ispath(MS2_tospawn, /mob/living/simple_animal/hostile/megafauna)) && get_dist(src, LT) <= 40) + 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) <= 24) + 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 From a7a58ce81d73fab29e6622372e6cb3ae83f9dd23 Mon Sep 17 00:00:00 2001 From: Hatterhat Date: Mon, 17 Aug 2020 18:30:00 -0500 Subject: [PATCH 06/17] this might work better --- code/controllers/subsystem/minimum_spawns.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/controllers/subsystem/minimum_spawns.dm b/code/controllers/subsystem/minimum_spawns.dm index 5391339351..b859a2e058 100644 --- a/code/controllers/subsystem/minimum_spawns.dm +++ b/code/controllers/subsystem/minimum_spawns.dm @@ -55,7 +55,7 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( continue if(!istype(TT, /turf/open/floor/plating/asteroid)) continue - if(/turf/open/lava in orange(9, TT)) + if(typesof(/turf/open/lava) in orange(9, TT)) continue valid_mining_turfs.Add(TT) for(var/z_level in SSmapping.levels_by_trait(ZTRAIT_ICE_RUINS_UNDERGROUND)) @@ -67,7 +67,7 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( continue if(!istype(TT, /turf/open/floor/plating/asteroid)) continue - if(/turf/open/lava in orange(9, TT)) + if(typesof(/turf/open/lava) in orange(9, TT)) continue valid_mining_turfs_2.Add(TT) else @@ -80,7 +80,7 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( continue if(!istype(TT, /turf/open/floor/plating/asteroid)) continue - if(/turf/open/lava in orange(9, TT)) + if(typesof(/turf/open/lava) in orange(9, TT)) continue valid_mining_turfs.Add(TT) if(!valid_mining_turfs) From 463ff6393e077be5536270997c9fc1dadb67207a Mon Sep 17 00:00:00 2001 From: Hatterhat Date: Thu, 20 Aug 2020 21:48:05 -0500 Subject: [PATCH 07/17] uhh remind me to poke at this again --- code/controllers/subsystem/minimum_spawns.dm | 63 ++++++++++---------- 1 file changed, 31 insertions(+), 32 deletions(-) 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 From f50390ef8068ba15d0d2c18bd6260d089542df40 Mon Sep 17 00:00:00 2001 From: Hatterhat Date: Sat, 22 Aug 2020 01:55:20 -0500 Subject: [PATCH 08/17] wow i hate this fucking subsystem --- code/controllers/subsystem/minimum_spawns.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/controllers/subsystem/minimum_spawns.dm b/code/controllers/subsystem/minimum_spawns.dm index ea419ce921..f89e72a982 100644 --- a/code/controllers/subsystem/minimum_spawns.dm +++ b/code/controllers/subsystem/minimum_spawns.dm @@ -1,7 +1,7 @@ SUBSYSTEM_DEF(min_spawns) name = "Minimum Spawns" // it should be more like "failsafe spawns" or "backup spawns" or something init_order = INIT_ORDER_DEFAULT - flags = SS_BACKGROUND + flags = SS_BACKGROUND | SS_NO_FIRE wait = 2 var/snaxi_snowflake_check = FALSE var/list/active_spawns = list() // lavaland, snaxi, etc. primary spawn list From 98935054bb59b1a7e86b06e5ab6f9cc2721ae91d Mon Sep 17 00:00:00 2001 From: Hatterhat Date: Sat, 22 Aug 2020 15:19:07 -0500 Subject: [PATCH 09/17] lets try not 2 overload it --- code/controllers/subsystem/minimum_spawns.dm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/code/controllers/subsystem/minimum_spawns.dm b/code/controllers/subsystem/minimum_spawns.dm index f89e72a982..4832f48950 100644 --- a/code/controllers/subsystem/minimum_spawns.dm +++ b/code/controllers/subsystem/minimum_spawns.dm @@ -1,8 +1,9 @@ SUBSYSTEM_DEF(min_spawns) name = "Minimum Spawns" // it should be more like "failsafe spawns" or "backup spawns" or something init_order = INIT_ORDER_DEFAULT - flags = SS_BACKGROUND | SS_NO_FIRE + flags = SS_BACKGROUND | SS_NO_FIRE | SS_ALWAYS_SHOW_STAT wait = 2 + var/where_we_droppin_boys_iterations = 0 var/snaxi_snowflake_check = FALSE var/list/active_spawns = list() // lavaland, snaxi, etc. primary spawn list var/list/active_spawns_2 = list() // snaxi underground, etc. secondary spawn list @@ -89,8 +90,17 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( return ..() /datum/controller/subsystem/min_spawns/proc/where_we_droppin_boys() + // let's figure out what megas we dont specifically need to spawn + if(!snaxi_snowflake_check) // all snaxi megas are spawned in specific ruins + for(var/mob/living/simple_animal/hostile/megafauna/M in GLOB.mob_list) + if(active_spawns.Find(M.type, 1, active_spawns.len)) + var/tocut = active_spawns.Find(M.type, 1, active_spawns.len) + active_spawns.Cut(tocut,tocut+1) while(active_spawns.len) + where_we_droppin_boys_iterations++ CHECK_TICK + if(where_we_droppin_boys >= 1250) + break 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 @@ -110,7 +120,10 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( // man the overhead on this is gonna SUCK new MS_tospawn(RT) while(active_spawns_2.len) + where_we_droppin_boys_iterations++ CHECK_TICK + if(where_we_droppin_boys_iterations >= 1250) + break 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 From 4364d2c85fc119b9317c3b206b85aaf4454b0814 Mon Sep 17 00:00:00 2001 From: Hatterhat Date: Sat, 22 Aug 2020 16:17:34 -0500 Subject: [PATCH 10/17] thanks travis --- code/controllers/subsystem/minimum_spawns.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/controllers/subsystem/minimum_spawns.dm b/code/controllers/subsystem/minimum_spawns.dm index 4832f48950..299a67e8ce 100644 --- a/code/controllers/subsystem/minimum_spawns.dm +++ b/code/controllers/subsystem/minimum_spawns.dm @@ -99,7 +99,7 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( while(active_spawns.len) where_we_droppin_boys_iterations++ CHECK_TICK - if(where_we_droppin_boys >= 1250) + if(where_we_droppin_boys_iterations >= 1250) break var/turf/RT = pick_n_take(valid_mining_turfs) //Pick a random mining Z-level turf var/MS_tospawn = pick_n_take(active_spawns) From 2c0964a138745e4d4dea9f492f3842c62dd7e1f9 Mon Sep 17 00:00:00 2001 From: Hatterhat Date: Fri, 28 Aug 2020 18:31:41 -0500 Subject: [PATCH 11/17] god this feels so much worse --- code/controllers/subsystem/minimum_spawns.dm | 25 +++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/code/controllers/subsystem/minimum_spawns.dm b/code/controllers/subsystem/minimum_spawns.dm index 299a67e8ce..9ddde80aa8 100644 --- a/code/controllers/subsystem/minimum_spawns.dm +++ b/code/controllers/subsystem/minimum_spawns.dm @@ -100,44 +100,51 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( where_we_droppin_boys_iterations++ CHECK_TICK if(where_we_droppin_boys_iterations >= 1250) + INIT_ANNOUNCE("Minimum Spawns subsystem stopped early on spawns list 1 - too many iterations!") break 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 - if((ispath(MS_tospawn, /mob/living/simple_animal/hostile/megafauna) || ismegafauna(H)) && get_dist(src, H) <= 70) + for(var/mob/living/simple_animal/hostile/megafauna/H in urange(70,RT)) //prevents mob clumps + if((istype(MS_tospawn, /mob/living/simple_animal/hostile/megafauna)) && get_dist(RT, H) <= 70) + // INIT_ANNOUNCE("MSTS failed - [MS_tospawn] too close to [H], [get_dist(RT, H)] tiles distance, [RT.x] [RT.y] [RT.z]") 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) || istype(H, /obj/structure/spawner)) && get_dist(src, H) <= 35) + if((istype(MS_tospawn, /obj/structure/spawner)) && get_dist(RT, H) <= 40) + // INIT_ANNOUNCE("MSTS failed - [MS_tospawn] too close to [H], [get_dist(RT, H)] tiles distance, [RT.x] [RT.y] [RT.z]") 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) + if((istype(MS_tospawn, /mob/living/simple_animal/hostile/megafauna)) && get_dist(RT, LT) <= 70) active_spawns.Add(MS_tospawn) + // INIT_ANNOUNCE("MSTS failed - [MS_tospawn] too close to [LT], [get_dist(RT, LT)] tiles distance, [RT.x] [RT.y] [RT.z]") 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) + if((istype(MS_tospawn, /obj/structure/spawner)) && get_dist(RT, LT) <= 40) active_spawns.Add(MS_tospawn) + // INIT_ANNOUNCE("MSTS failed - [MS_tospawn] too close to [LT], [get_dist(RT, LT)] tiles distance, [RT.x] [RT.y] [RT.z]") return //let's at least /try/ to space these out? // man the overhead on this is gonna SUCK + // INIT_ANNOUNCE("MSTS succeeded! - [MS_tospawn] spawning at [RT.x] [RT.y] [RT.z]") new MS_tospawn(RT) while(active_spawns_2.len) where_we_droppin_boys_iterations++ CHECK_TICK if(where_we_droppin_boys_iterations >= 1250) + INIT_ANNOUNCE("Minimum Spawns subsystem stopped early on active list 2 - too many iterations!") break 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 - if((ispath(MS2_tospawn, /mob/living/simple_animal/hostile/megafauna) || ismegafauna(H)) && get_dist(src, H) <= 70) + if((istype(MS2_tospawn, /mob/living/simple_animal/hostile/megafauna) || ismegafauna(H)) && get_dist(RT, H) <= 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) || istype(H, /obj/structure/spawner)) && get_dist(src, H) <= 35) + if((istype(MS2_tospawn, /obj/structure/spawner)) && get_dist(RT, H) <= 40) 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) + if((istype(MS2_tospawn, /mob/living/simple_animal/hostile/megafauna)) && get_dist(RT, 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) + if((istype(MS2_tospawn, /obj/structure/spawner)) && get_dist(RT, LT) <= 40) active_spawns.Add(MS2_tospawn) return //let's at least /try/ to space these out? // man the overhead on this is gonna SUCK From 34861d55a8c95e7fafd5b6ec84ed224c2eb20d84 Mon Sep 17 00:00:00 2001 From: Hatterhat Date: Sat, 29 Aug 2020 21:38:31 -0500 Subject: [PATCH 12/17] fuck it two megas standard --- code/controllers/subsystem/minimum_spawns.dm | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/code/controllers/subsystem/minimum_spawns.dm b/code/controllers/subsystem/minimum_spawns.dm index 9ddde80aa8..a14501375d 100644 --- a/code/controllers/subsystem/minimum_spawns.dm +++ b/code/controllers/subsystem/minimum_spawns.dm @@ -90,12 +90,6 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( return ..() /datum/controller/subsystem/min_spawns/proc/where_we_droppin_boys() - // let's figure out what megas we dont specifically need to spawn - if(!snaxi_snowflake_check) // all snaxi megas are spawned in specific ruins - for(var/mob/living/simple_animal/hostile/megafauna/M in GLOB.mob_list) - if(active_spawns.Find(M.type, 1, active_spawns.len)) - var/tocut = active_spawns.Find(M.type, 1, active_spawns.len) - active_spawns.Cut(tocut,tocut+1) while(active_spawns.len) where_we_droppin_boys_iterations++ CHECK_TICK @@ -145,7 +139,7 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( active_spawns_2.Add(MS2_tospawn) return //let's try not to dump megas too close to each other? if((istype(MS2_tospawn, /obj/structure/spawner)) && get_dist(RT, LT) <= 40) - active_spawns.Add(MS2_tospawn) + active_spawns_2.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) From 00bc4202f7939aaaf4137cb5cf164e39a727652c Mon Sep 17 00:00:00 2001 From: Hatterhat Date: Sat, 29 Aug 2020 23:08:51 -0500 Subject: [PATCH 13/17] what the fuck was i thinking coding this --- code/controllers/subsystem/minimum_spawns.dm | 50 ++++++++++++-------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/code/controllers/subsystem/minimum_spawns.dm b/code/controllers/subsystem/minimum_spawns.dm index a14501375d..3276c25c86 100644 --- a/code/controllers/subsystem/minimum_spawns.dm +++ b/code/controllers/subsystem/minimum_spawns.dm @@ -36,12 +36,12 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( // step 5: snaxi support - done? /datum/controller/subsystem/min_spawns/Initialize(start_timeofday) - 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)) + 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 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 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 @@ -102,20 +102,20 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( if((istype(MS_tospawn, /mob/living/simple_animal/hostile/megafauna)) && get_dist(RT, H) <= 70) // INIT_ANNOUNCE("MSTS failed - [MS_tospawn] too close to [H], [get_dist(RT, H)] tiles distance, [RT.x] [RT.y] [RT.z]") active_spawns.Add(MS_tospawn) - return //let's try not to dump megas too close to each other? + continue //let's try not to dump megas too close to each other? if((istype(MS_tospawn, /obj/structure/spawner)) && get_dist(RT, H) <= 40) // INIT_ANNOUNCE("MSTS failed - [MS_tospawn] too close to [H], [get_dist(RT, H)] tiles distance, [RT.x] [RT.y] [RT.z]") active_spawns.Add(MS_tospawn) - return //let's at least /try/ to space these out? + continue //let's at least /try/ to space these out? for(var/obj/structure/spawner/LT in urange(70,RT)) //prevents tendril/mega clumps if((istype(MS_tospawn, /mob/living/simple_animal/hostile/megafauna)) && get_dist(RT, LT) <= 70) - active_spawns.Add(MS_tospawn) // INIT_ANNOUNCE("MSTS failed - [MS_tospawn] too close to [LT], [get_dist(RT, LT)] tiles distance, [RT.x] [RT.y] [RT.z]") - return //let's try not to dump megas too close to each other? + active_spawns.Add(MS_tospawn) + continue //let's try not to dump megas too close to each other? if((istype(MS_tospawn, /obj/structure/spawner)) && get_dist(RT, LT) <= 40) - active_spawns.Add(MS_tospawn) // INIT_ANNOUNCE("MSTS failed - [MS_tospawn] too close to [LT], [get_dist(RT, LT)] tiles distance, [RT.x] [RT.y] [RT.z]") - return //let's at least /try/ to space these out? + active_spawns.Add(MS_tospawn) + continue //let's at least /try/ to space these out? // man the overhead on this is gonna SUCK // INIT_ANNOUNCE("MSTS succeeded! - [MS_tospawn] spawning at [RT.x] [RT.y] [RT.z]") new MS_tospawn(RT) @@ -125,21 +125,29 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( if(where_we_droppin_boys_iterations >= 1250) INIT_ANNOUNCE("Minimum Spawns subsystem stopped early on active list 2 - too many iterations!") break - var/turf/RT = pick_n_take(valid_mining_turfs_2) //Pick a random mining Z-level turf + var/turf/RT2 = 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 - if((istype(MS2_tospawn, /mob/living/simple_animal/hostile/megafauna) || ismegafauna(H)) && get_dist(RT, H) <= 70) + for(var/mob/living/simple_animal/hostile/H in urange(70,RT2)) //prevents mob clumps + if((istype(MS2_tospawn, /mob/living/simple_animal/hostile/megafauna) || ismegafauna(H)) && get_dist(RT2, H) <= 70) + // INIT_ANNOUNCE("MS2TS failed - [MS2_tospawn] too close to [H], [get_dist(RT2, H)] tiles distance, [RT2.x] [RT2.y] [RT2.z]") active_spawns_2.Add(MS2_tospawn) - return //let's try not to dump megas too close to each other? - if((istype(MS2_tospawn, /obj/structure/spawner)) && get_dist(RT, H) <= 40) + continue //let's try not to dump megas too close to each other? + if((istype(MS2_tospawn, /obj/structure/spawner)) && get_dist(RT2, H) <= 40) + // INIT_ANNOUNCE("MS2TS failed - [MS2_tospawn] too close to [H], [get_dist(RT2, H)] tiles distance, [RT2.x] [RT2.y] [RT2.z]") 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((istype(MS2_tospawn, /mob/living/simple_animal/hostile/megafauna)) && get_dist(RT, LT) <= 70) + continue //let's at least /try/ to space these out? + for(var/obj/structure/spawner/LT in urange(70,RT2)) //prevents tendril/mega clumps + if((istype(MS2_tospawn, /mob/living/simple_animal/hostile/megafauna)) && get_dist(RT2, LT) <= 70) + // INIT_ANNOUNCE("MS2TS failed - [MS2_tospawn] too close to [LT], [get_dist(RT2, LT)] tiles distance, [RT2.x] [RT2.y] [RT2.z]") active_spawns_2.Add(MS2_tospawn) - return //let's try not to dump megas too close to each other? - if((istype(MS2_tospawn, /obj/structure/spawner)) && get_dist(RT, LT) <= 40) + continue //let's try not to dump megas too close to each other? + if((istype(MS2_tospawn, /obj/structure/spawner)) && get_dist(RT2, LT) <= 40) + // INIT_ANNOUNCE("MS2TS failed - [MS2_tospawn] too close to [LT], [get_dist(RT2, LT)] tiles distance, [RT2.x] [RT2.y] [RT2.z]") active_spawns_2.Add(MS2_tospawn) - return //let's at least /try/ to space these out? + continue //let's at least /try/ to space these out? // man the overhead on this is gonna SUCK - new MS2_tospawn(RT) + // INIT_ANNOUNCE("MS2TS succeeded! - [MS2_tospawn] spawning at [RT2.x] [RT2.y] [RT2.z]") + new MS2_tospawn(RT2) + if(!active_spawns.len && !active_spawns_2.len) + // INIT_ANNOUNCE("Wrapping up! AS [active_spawns] AS2 [active_spawns_2]") + return // we're done here From 76df5b0efe6218fffb226983313834fa886d7bb7 Mon Sep 17 00:00:00 2001 From: Hatterhat Date: Sun, 6 Sep 2020 18:00:19 -0500 Subject: [PATCH 14/17] travis rerun and test messages gone --- code/controllers/subsystem/minimum_spawns.dm | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/code/controllers/subsystem/minimum_spawns.dm b/code/controllers/subsystem/minimum_spawns.dm index 3276c25c86..e30cec60ef 100644 --- a/code/controllers/subsystem/minimum_spawns.dm +++ b/code/controllers/subsystem/minimum_spawns.dm @@ -100,24 +100,19 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( var/MS_tospawn = pick_n_take(active_spawns) for(var/mob/living/simple_animal/hostile/megafauna/H in urange(70,RT)) //prevents mob clumps if((istype(MS_tospawn, /mob/living/simple_animal/hostile/megafauna)) && get_dist(RT, H) <= 70) - // INIT_ANNOUNCE("MSTS failed - [MS_tospawn] too close to [H], [get_dist(RT, H)] tiles distance, [RT.x] [RT.y] [RT.z]") active_spawns.Add(MS_tospawn) continue //let's try not to dump megas too close to each other? if((istype(MS_tospawn, /obj/structure/spawner)) && get_dist(RT, H) <= 40) - // INIT_ANNOUNCE("MSTS failed - [MS_tospawn] too close to [H], [get_dist(RT, H)] tiles distance, [RT.x] [RT.y] [RT.z]") active_spawns.Add(MS_tospawn) continue //let's at least /try/ to space these out? for(var/obj/structure/spawner/LT in urange(70,RT)) //prevents tendril/mega clumps if((istype(MS_tospawn, /mob/living/simple_animal/hostile/megafauna)) && get_dist(RT, LT) <= 70) - // INIT_ANNOUNCE("MSTS failed - [MS_tospawn] too close to [LT], [get_dist(RT, LT)] tiles distance, [RT.x] [RT.y] [RT.z]") active_spawns.Add(MS_tospawn) continue //let's try not to dump megas too close to each other? if((istype(MS_tospawn, /obj/structure/spawner)) && get_dist(RT, LT) <= 40) - // INIT_ANNOUNCE("MSTS failed - [MS_tospawn] too close to [LT], [get_dist(RT, LT)] tiles distance, [RT.x] [RT.y] [RT.z]") active_spawns.Add(MS_tospawn) continue //let's at least /try/ to space these out? // man the overhead on this is gonna SUCK - // INIT_ANNOUNCE("MSTS succeeded! - [MS_tospawn] spawning at [RT.x] [RT.y] [RT.z]") new MS_tospawn(RT) while(active_spawns_2.len) where_we_droppin_boys_iterations++ @@ -129,25 +124,19 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( var/MS2_tospawn = pick_n_take(active_spawns_2) for(var/mob/living/simple_animal/hostile/H in urange(70,RT2)) //prevents mob clumps if((istype(MS2_tospawn, /mob/living/simple_animal/hostile/megafauna) || ismegafauna(H)) && get_dist(RT2, H) <= 70) - // INIT_ANNOUNCE("MS2TS failed - [MS2_tospawn] too close to [H], [get_dist(RT2, H)] tiles distance, [RT2.x] [RT2.y] [RT2.z]") active_spawns_2.Add(MS2_tospawn) continue //let's try not to dump megas too close to each other? if((istype(MS2_tospawn, /obj/structure/spawner)) && get_dist(RT2, H) <= 40) - // INIT_ANNOUNCE("MS2TS failed - [MS2_tospawn] too close to [H], [get_dist(RT2, H)] tiles distance, [RT2.x] [RT2.y] [RT2.z]") active_spawns_2.Add(MS2_tospawn) continue //let's at least /try/ to space these out? for(var/obj/structure/spawner/LT in urange(70,RT2)) //prevents tendril/mega clumps if((istype(MS2_tospawn, /mob/living/simple_animal/hostile/megafauna)) && get_dist(RT2, LT) <= 70) - // INIT_ANNOUNCE("MS2TS failed - [MS2_tospawn] too close to [LT], [get_dist(RT2, LT)] tiles distance, [RT2.x] [RT2.y] [RT2.z]") active_spawns_2.Add(MS2_tospawn) continue //let's try not to dump megas too close to each other? if((istype(MS2_tospawn, /obj/structure/spawner)) && get_dist(RT2, LT) <= 40) - // INIT_ANNOUNCE("MS2TS failed - [MS2_tospawn] too close to [LT], [get_dist(RT2, LT)] tiles distance, [RT2.x] [RT2.y] [RT2.z]") active_spawns_2.Add(MS2_tospawn) continue //let's at least /try/ to space these out? // man the overhead on this is gonna SUCK - // INIT_ANNOUNCE("MS2TS succeeded! - [MS2_tospawn] spawning at [RT2.x] [RT2.y] [RT2.z]") new MS2_tospawn(RT2) if(!active_spawns.len && !active_spawns_2.len) - // INIT_ANNOUNCE("Wrapping up! AS [active_spawns] AS2 [active_spawns_2]") return // we're done here From 52678a7e2863783e334ca4dc9c027e7c9eac6d67 Mon Sep 17 00:00:00 2001 From: Hatterhat Date: Sun, 6 Sep 2020 18:51:13 -0500 Subject: [PATCH 15/17] doktor...turn off my cringe inhibitors........ --- code/controllers/subsystem/minimum_spawns.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/controllers/subsystem/minimum_spawns.dm b/code/controllers/subsystem/minimum_spawns.dm index e30cec60ef..275d6911ab 100644 --- a/code/controllers/subsystem/minimum_spawns.dm +++ b/code/controllers/subsystem/minimum_spawns.dm @@ -36,13 +36,13 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( // step 5: snaxi support - done? /datum/controller/subsystem/min_spawns/Initialize(start_timeofday) - if(SSmapping.levels_by_trait(ZTRAIT_ICE_RUINS)) + if(SSmapping.levels_by_trait(ZTRAIT_ICE_RUINS).len) active_spawns = GLOB.minimum_snow_surface_spawns active_spawns_2 = GLOB.minimum_snow_under_spawns snaxi_snowflake_check = TRUE - else if(SSmapping.levels_by_trait(ZTRAIT_LAVA_RUINS)) //todo: recognizing maps that aren't lavaland mining but are also not snaxi + else if(SSmapping.levels_by_trait(ZTRAIT_LAVA_RUINS).len) //todo: recognizing maps that aren't lavaland mining but are also not snaxi active_spawns = GLOB.minimum_lavaland_spawns - if(!active_spawns && !active_spawns_2) + else return ..() // call it a day i guess // borrowing this from auxbase code - see code\modules\mining\aux_base.dm if(snaxi_snowflake_check) @@ -83,7 +83,7 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( if(typesof(/turf/open/lava) in orange(9, TT)) continue valid_mining_turfs.Add(TT) - if(!valid_mining_turfs) + if(!valid_mining_turfs.len) return ..() // call it a day i guess // if we're at this point we might as well fucking hit it where_we_droppin_boys() From e157125033a3e12c28d350ff456a0e1152e939a3 Mon Sep 17 00:00:00 2001 From: Hatterhat Date: Mon, 7 Sep 2020 03:55:37 -0500 Subject: [PATCH 16/17] hrhnghnghn dreamcheckerrrrr --- code/controllers/subsystem/minimum_spawns.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/controllers/subsystem/minimum_spawns.dm b/code/controllers/subsystem/minimum_spawns.dm index 275d6911ab..88042eb8ea 100644 --- a/code/controllers/subsystem/minimum_spawns.dm +++ b/code/controllers/subsystem/minimum_spawns.dm @@ -36,11 +36,13 @@ GLOBAL_LIST_INIT(minimum_snow_under_spawns, list( // step 5: snaxi support - done? /datum/controller/subsystem/min_spawns/Initialize(start_timeofday) - if(SSmapping.levels_by_trait(ZTRAIT_ICE_RUINS).len) + var/list/snaxi_zs_list = SSmapping.levels_by_trait(ZTRAIT_ICE_RUINS) // boy if these things arent mutually exclusive + var/list/lavaland_zs_list = SSmapping.levels_by_trait(ZTRAIT_LAVA_RUINS) // i'm gonna fuckin scream + if(snaxi_zs_list.len) active_spawns = GLOB.minimum_snow_surface_spawns active_spawns_2 = GLOB.minimum_snow_under_spawns snaxi_snowflake_check = TRUE - else if(SSmapping.levels_by_trait(ZTRAIT_LAVA_RUINS).len) //todo: recognizing maps that aren't lavaland mining but are also not snaxi + else if(lavaland_zs_list.len) //todo: recognizing maps that aren't lavaland mining but are also not snaxi active_spawns = GLOB.minimum_lavaland_spawns else return ..() // call it a day i guess From 0310e3ebd5a9def090f078f6fb6021b80a820de9 Mon Sep 17 00:00:00 2001 From: Hatterhat Date: Thu, 1 Oct 2020 19:10:13 -0500 Subject: [PATCH 17/17] please travis stop crashing on me --- code/controllers/subsystem/minimum_spawns.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/controllers/subsystem/minimum_spawns.dm b/code/controllers/subsystem/minimum_spawns.dm index 88042eb8ea..caab2b1949 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" // it should be more like "failsafe spawns" or "backup spawns" or something + name = "Minimum Spawns" /// this hot steaming pile of garbage makes sure theres a minimum of tendrils scattered around init_order = INIT_ORDER_DEFAULT flags = SS_BACKGROUND | SS_NO_FIRE | SS_ALWAYS_SHOW_STAT wait = 2