"It has been 0 days since the last incident" sign (#70099)

Adds a fun sign to various places in engineering which tracks how many days (read: rounds) it has been since last time the engine delaminated.
This commit is contained in:
Jacquerel
2022-09-29 01:51:59 +03:00
committed by GitHub
parent a247e90697
commit 72a207cc04
11 changed files with 126 additions and 11 deletions

View File

@@ -1,6 +1,7 @@
#define FILE_RECENT_MAPS "data/RecentMaps.json"
#define KEEP_ROUNDS_MAP 3
#define ROUNDCOUNT_ENGINE_JUST_EXPLODED 0
SUBSYSTEM_DEF(persistence)
name = "Persistence"
@@ -21,7 +22,7 @@ SUBSYSTEM_DEF(persistence)
var/list/picture_logging_information = list()
var/list/obj/structure/sign/picture_frame/photo_frames
var/list/obj/item/storage/photo_album/photo_albums
var/rounds_since_engine_exploded = 0
/datum/controller/subsystem/persistence/Initialize()
LoadPoly()
@@ -32,6 +33,7 @@ SUBSYSTEM_DEF(persistence)
LoadPhotoPersistence()
LoadRandomizedRecipes()
load_custom_outfits()
load_delamination_counter()
load_adventures()
return SS_INIT_SUCCESS
@@ -45,6 +47,7 @@ SUBSYSTEM_DEF(persistence)
SaveRandomizedRecipes()
SaveScars()
save_custom_outfits()
save_delamination_counter()
/datum/controller/subsystem/persistence/proc/LoadPoly()
for(var/mob/living/simple_animal/parrot/poly/P in GLOB.alive_mob_list)
@@ -460,3 +463,18 @@ SUBSYSTEM_DEF(persistence)
data += list(outfit.get_json_data())
WRITE_FILE(file, json_encode(data))
/// Location where we save the information about how many rounds it has been since the engine blew up
#define DELAMINATION_COUNT_FILEPATH "data/rounds_since_delamination.txt"
/datum/controller/subsystem/persistence/proc/load_delamination_counter()
if (!fexists(DELAMINATION_COUNT_FILEPATH))
return
rounds_since_engine_exploded = text2num(file2text(DELAMINATION_COUNT_FILEPATH))
for (var/obj/structure/sign/delamination_counter/sign as anything in GLOB.map_delamination_counters)
sign.update_count(rounds_since_engine_exploded)
/datum/controller/subsystem/persistence/proc/save_delamination_counter()
rustg_file_write("[rounds_since_engine_exploded + 1]", DELAMINATION_COUNT_FILEPATH)
#undef DELAMINATION_COUNT_FILEPATH