blackbox logging for biohazards (#23309)

* blackbox logging for biohazards

* guh it warned for the others but not this one

* Update code/__DEFINES/misc_defines.dm

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>

* define / lewc

---------

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
This commit is contained in:
Qwertytoforty
2024-01-06 18:45:43 -05:00
committed by GitHub
parent 8eba366cdf
commit 44cde7c753
8 changed files with 100 additions and 17 deletions

View File

@@ -30,6 +30,8 @@ SUBSYSTEM_DEF(events)
var/datum/event_meta/new_event = new
var/list/biohazards_this_round = list()
/datum/controller/subsystem/events/Initialize()
allEvents = subtypesof(/datum/event)

View File

@@ -128,6 +128,8 @@ SUBSYSTEM_DEF(ticker)
if(game_finished || force_ending)
current_state = GAME_STATE_FINISHED
if(GAME_STATE_FINISHED)
if(SSshuttle.emergency.mode >= SHUTTLE_ENDGAME && !mode.station_was_nuked)
event_blackbox(outcome = ROUND_END_CREW_TRANSFER)
current_state = GAME_STATE_FINISHED
Master.SetRunLevel(RUNLEVEL_POSTGAME) // This shouldnt process more than once, but you never know
auto_toggle_ooc(TRUE) // Turn it on
@@ -774,3 +776,77 @@ SUBSYSTEM_DEF(ticker)
QDEL_LIST_ASSOC_VAL(load_queries)
records.Cut()
flagged_antag_rollers.Cut()
/// This proc is for recording biohazard events, and blackboxing if they lived, died, or ended the round. This currently applies to: Terror spiders, Xenomorphs, and Blob.
/datum/controller/subsystem/ticker/proc/event_blackbox(outcome = ROUND_END_CREW_TRANSFER)
for(var/I in SSevents.biohazards_this_round)
switch(I)
if(TS_INFESTATION_GREEN_SPIDER, TS_INFESTATION_PRINCE_SPIDER, TS_INFESTATION_WHITE_SPIDER, TS_INFESTATION_PRINCESS_SPIDER, TS_INFESTATION_QUEEN_SPIDER)
var/output = "unknown spider type"
switch(I)
if(TS_INFESTATION_GREEN_SPIDER)
output = "Green Terrors"
if(TS_INFESTATION_PRINCE_SPIDER)
output = "Prince Terror"
if(TS_INFESTATION_WHITE_SPIDER)
output = "White Terrors"
if(TS_INFESTATION_PRINCESS_SPIDER)
output = "Princess Terrors"
if(TS_INFESTATION_QUEEN_SPIDER)
output = "Queen Terrors"
var/spiders = 0
for(var/mob/living/simple_animal/hostile/poison/terror_spider/S in GLOB.ts_spiderlist)
if(S.ckey)
spiders++
if(spiders >= 5 || (output == "Prince Terror" && spiders == 1)) //If a prince lives, record as win.
switch(outcome)
if(ROUND_END_NUCLEAR)
SSblackbox.record_feedback("tally", "Biohazard nuclear victories", 1, output)
if(ROUND_END_CREW_TRANSFER)
SSblackbox.record_feedback("tally", "Biohazard survives to normal round end", 1, output)
if(ROUND_END_FORCED)
SSblackbox.record_feedback("tally", "Biohazard survives to admin round end", 1, output)
else
switch(outcome)
if(ROUND_END_NUCLEAR)
SSblackbox.record_feedback("tally", "Biohazard dies station nuked", 1, output)
if(ROUND_END_CREW_TRANSFER)
SSblackbox.record_feedback("tally", "Biohazard dies normal end", 1, output)
if(ROUND_END_FORCED)
SSblackbox.record_feedback("tally", "Biohazard dies admin round end", 1, output)
if("Xenomorphs")
if(length(SSticker.mode.xenos) > 5)
switch(outcome)
if(ROUND_END_NUCLEAR)
SSblackbox.record_feedback("tally", "Biohazard nuclear victories", 1, "Xenomorphs")
if(ROUND_END_CREW_TRANSFER)
SSblackbox.record_feedback("tally", "Biohazard survives to normal round end", 1, "Xenomorphs")
if(ROUND_END_FORCED)
SSblackbox.record_feedback("tally", "Biohazard survives to admin round end", 1, "Xenomorphs")
else
switch(outcome)
if(ROUND_END_NUCLEAR)
SSblackbox.record_feedback("tally", "Biohazard dies station nuked", 1, "Xenomorphs")
if(ROUND_END_CREW_TRANSFER)
SSblackbox.record_feedback("tally", "Biohazard dies normal end", 1, "Xenomorphs")
if(ROUND_END_FORCED)
SSblackbox.record_feedback("tally", "Biohazard dies admin round end", 1, "Xenomorphs")
if("Blob")
if(length(SSticker.mode.blob_overminds))
switch(outcome)
if(ROUND_END_NUCLEAR)
SSblackbox.record_feedback("tally", "Biohazard nuclear victories", 1, "Blob")
if(ROUND_END_CREW_TRANSFER)
SSblackbox.record_feedback("tally", "Biohazard survives to normal round end", 1, "Blob")
if(ROUND_END_FORCED)
SSblackbox.record_feedback("tally", "Biohazard survives to admin round end", 1, "Blob")
else
switch(outcome)
if(ROUND_END_NUCLEAR)
SSblackbox.record_feedback("tally", "Biohazard dies station nuked", 1, "Blob")
if(ROUND_END_CREW_TRANSFER)
SSblackbox.record_feedback("tally", "Biohazard dies normal end", 1, "Blob")
if(ROUND_END_FORCED)
SSblackbox.record_feedback("tally", "Biohazard dies admin round end", 1, "Blob")