mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-20 07:12:55 +00:00
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:
@@ -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)
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user