From 8868ef2a89b0ccea0dc0fec87ab3035edccce1ae Mon Sep 17 00:00:00 2001 From: Putnam Date: Sun, 14 Mar 2021 21:06:53 -0700 Subject: [PATCH 1/4] Made slaughter demon have higher weight if there's more blood. --- .../antagonists/slaughter/slaughterevent.dm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/code/modules/antagonists/slaughter/slaughterevent.dm b/code/modules/antagonists/slaughter/slaughterevent.dm index 1c6412dcad..a7e99080c7 100644 --- a/code/modules/antagonists/slaughter/slaughterevent.dm +++ b/code/modules/antagonists/slaughter/slaughterevent.dm @@ -7,7 +7,21 @@ earliest_start = 1 HOURS min_players = 20 - +/datum/round_event_control/slaughter/canSpawnEvent() + var/t = /datum/round_event_control/slaughter + var/list/allowed_turf_typecache = typecacheof(/turf/open) - typecacheof(/turf/open/space) + var/list/allowed_z_cache = list() + for(var/z in SSmapping.levels_by_trait(ZTRAIT_STATION)) + allowed_z_cache[num2text(z)] = TRUE + for(var/obj/effect/decal/cleanable/C in world) + if(!C.loc || QDELETED(C)) + continue + if(!C.can_bloodcrawl_in()) + continue + if(!IsValidDebrisLocation(C.loc, allowed_turf_typecache, allowed_z_cache, C.type, FALSE)) + continue + weight += 0.05 + return ..() /datum/round_event/ghost_role/slaughter minimum_required = 1 From 254187bc2e4e1b15d2e200f04ea1d0ac575a66e9 Mon Sep 17 00:00:00 2001 From: Putnam Date: Wed, 24 Mar 2021 17:23:21 -0700 Subject: [PATCH 2/4] it's not a global proc --- code/modules/antagonists/slaughter/slaughterevent.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/antagonists/slaughter/slaughterevent.dm b/code/modules/antagonists/slaughter/slaughterevent.dm index a7e99080c7..21286cec3f 100644 --- a/code/modules/antagonists/slaughter/slaughterevent.dm +++ b/code/modules/antagonists/slaughter/slaughterevent.dm @@ -18,7 +18,7 @@ continue if(!C.can_bloodcrawl_in()) continue - if(!IsValidDebrisLocation(C.loc, allowed_turf_typecache, allowed_z_cache, C.type, FALSE)) + if(!SSpersistence.IsValidDebrisLocation(C.loc, allowed_turf_typecache, allowed_z_cache, C.type, FALSE)) continue weight += 0.05 return ..() From 18ce504f06feeaf6b7707008db5a909b626a5785 Mon Sep 17 00:00:00 2001 From: Putnam Date: Wed, 24 Mar 2021 17:24:13 -0700 Subject: [PATCH 3/4] oh and this should not go up infinitely --- code/modules/antagonists/slaughter/slaughterevent.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/antagonists/slaughter/slaughterevent.dm b/code/modules/antagonists/slaughter/slaughterevent.dm index 21286cec3f..c5fe37ec2e 100644 --- a/code/modules/antagonists/slaughter/slaughterevent.dm +++ b/code/modules/antagonists/slaughter/slaughterevent.dm @@ -9,6 +9,7 @@ /datum/round_event_control/slaughter/canSpawnEvent() var/t = /datum/round_event_control/slaughter + weight = initial(t.weight) var/list/allowed_turf_typecache = typecacheof(/turf/open) - typecacheof(/turf/open/space) var/list/allowed_z_cache = list() for(var/z in SSmapping.levels_by_trait(ZTRAIT_STATION)) From 7190ef5d62520af50f3feafa7795bdd90b4fe282 Mon Sep 17 00:00:00 2001 From: Putnam Date: Wed, 24 Mar 2021 18:25:12 -0700 Subject: [PATCH 4/4] why did i do it that way? --- code/modules/antagonists/slaughter/slaughterevent.dm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/modules/antagonists/slaughter/slaughterevent.dm b/code/modules/antagonists/slaughter/slaughterevent.dm index c5fe37ec2e..c8549d859c 100644 --- a/code/modules/antagonists/slaughter/slaughterevent.dm +++ b/code/modules/antagonists/slaughter/slaughterevent.dm @@ -8,8 +8,7 @@ min_players = 20 /datum/round_event_control/slaughter/canSpawnEvent() - var/t = /datum/round_event_control/slaughter - weight = initial(t.weight) + weight = initial(src.weight) var/list/allowed_turf_typecache = typecacheof(/turf/open) - typecacheof(/turf/open/space) var/list/allowed_z_cache = list() for(var/z in SSmapping.levels_by_trait(ZTRAIT_STATION))