"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

@@ -44046,6 +44046,7 @@
dir = 1;
pixel_y = 23
},
/obj/structure/sign/delamination_counter/directional/west,
/turf/open/floor/engine,
/area/station/engineering/supermatter)
"kDL" = (
@@ -92531,6 +92532,7 @@
/obj/structure/cable,
/obj/effect/landmark/start/hangover,
/obj/effect/decal/cleanable/dirt,
/obj/structure/sign/delamination_counter/directional/north,
/turf/open/floor/iron,
/area/station/engineering/break_room)
"wyN" = (

View File

@@ -68827,6 +68827,7 @@
/obj/effect/turf_decal/stripes/line{
dir = 6
},
/obj/structure/sign/delamination_counter/directional/north,
/turf/open/floor/iron/white/textured,
/area/station/command/heads_quarters/ce)
"vkC" = (
@@ -77017,6 +77018,15 @@
/obj/machinery/light/directional/south,
/turf/open/floor/plating,
/area/station/maintenance/department/electrical)
"xFM" = (
/obj/effect/turf_decal/stripes/line{
dir = 1
},
/obj/machinery/light/directional/north,
/obj/machinery/atmospherics/pipe/smart/manifold4w/cyan/visible,
/obj/structure/sign/delamination_counter/directional/north,
/turf/open/floor/engine,
/area/station/engineering/supermatter/room)
"xFU" = (
/obj/structure/barricade/wooden,
/obj/structure/sign/warning/gas_mask/directional/south{
@@ -238445,7 +238455,7 @@ cjD
spF
cjD
wuo
pry
xFM
kUz
mLV
gka

View File

@@ -48571,6 +48571,17 @@
},
/turf/open/floor/wood,
/area/station/command/heads_quarters/hos)
"nPw" = (
/obj/machinery/door/poddoor/shutters/preopen{
dir = 8;
id = "ceprivate";
name = "Chief Engineer's Privacy Shutters"
},
/obj/machinery/door/firedoor,
/obj/effect/turf_decal/caution/stand_clear,
/obj/structure/sign/delamination_counter/directional/north,
/turf/open/floor/iron/dark,
/area/station/engineering/lobby)
"nPz" = (
/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2,
/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4,
@@ -49197,6 +49208,14 @@
/obj/structure/window/reinforced/spawner/north,
/turf/open/floor/plating,
/area/station/maintenance/fore)
"obh" = (
/obj/effect/turf_decal/stripes/line{
dir = 1
},
/obj/machinery/atmospherics/pipe/smart/manifold4w/cyan/visible,
/obj/structure/sign/delamination_counter/directional/north,
/turf/open/floor/engine,
/area/station/engineering/supermatter/room)
"obi" = (
/obj/effect/decal/cleanable/dirt,
/obj/structure/cable,
@@ -121114,7 +121133,7 @@ sXJ
sXJ
alL
jjs
xDj
nPw
piN
xDj
eHc
@@ -121907,7 +121926,7 @@ lGp
xlD
lGp
lOX
hqW
obh
hNj
piD
uyK

View File

@@ -23069,6 +23069,7 @@
name = "Engineering Security Doors"
},
/obj/effect/turf_decal/caution/stand_clear,
/obj/structure/sign/delamination_counter/directional/north,
/turf/open/floor/iron/dark,
/area/station/engineering/break_room)
"iug" = (
@@ -34114,6 +34115,7 @@
dir = 4;
name = "Gas to Chamber"
},
/obj/structure/sign/delamination_counter/directional/north,
/turf/open/floor/engine,
/area/station/engineering/supermatter)
"mkO" = (

View File

@@ -12222,6 +12222,7 @@
},
/obj/machinery/newscaster/directional/south,
/obj/structure/reagent_dispensers/water_cooler,
/obj/structure/sign/delamination_counter/directional/west,
/turf/open/floor/iron,
/area/station/engineering/break_room)
"eqA" = (
@@ -17565,6 +17566,7 @@
dir = 10;
network = list("ss13","engine","engineering")
},
/obj/structure/sign/delamination_counter/directional/south,
/turf/open/floor/engine,
/area/station/engineering/supermatter)
"gpR" = (

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

View File

@@ -24,3 +24,61 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/sign/calendar, 32)
. += span_info("Events:")
for(var/holidayname in SSevents.holidays)
. += span_info("[holidayname]")
/**
* List of delamination counter signs on the map.
* Required as persistence subsystem loads after the ones present at mapload, and to reset to 0 upon explosion.
*/
GLOBAL_LIST_EMPTY(map_delamination_counters)
/obj/structure/sign/delamination_counter
name = "delamination counter"
sign_change_name = "Flip Sign- Supermatter Delamination"
desc = "A pair of flip signs describe how long it's been since the last delamination incident."
icon_state = "days_since_explosion"
is_editable = TRUE
var/since_last = 0
MAPPING_DIRECTIONAL_HELPERS(/obj/structure/sign/delamination_counter, 32)
/obj/structure/sign/delamination_counter/Initialize(mapload)
. = ..()
GLOB.map_delamination_counters += src
if (!mapload)
update_count(SSpersistence.rounds_since_engine_exploded)
/obj/structure/sign/delamination_counter/Destroy()
GLOB.map_delamination_counters -= src
return ..()
/obj/structure/sign/delamination_counter/proc/update_count(new_count)
since_last = min(new_count, 99)
update_appearance()
/obj/structure/sign/delamination_counter/update_overlays()
. = ..()
var/ones = since_last % 10
var/mutable_appearance/ones_overlay = mutable_appearance('icons/obj/signs.dmi', "days_[ones]")
ones_overlay.pixel_x = 4
. += ones_overlay
var/tens = (since_last / 10) % 10
var/mutable_appearance/tens_overlay = mutable_appearance('icons/obj/signs.dmi', "days_[tens]")
tens_overlay.pixel_x = -5
. += tens_overlay
/obj/structure/sign/delamination_counter/examine(mob/user)
. = ..()
. += span_info("It has been [since_last] day\s since the last delamination event at a Nanotrasen facility.")
switch (since_last)
if (0)
. += span_info("In case you didn't notice.")
if(1)
. += span_info("Let's do better today.")
if(2 to 5)
. += span_info("There's room for improvement.")
if(6 to 10)
. += span_info("Good work!")
if(11 to INFINITY)
. += span_info("Incredible!")

View File

@@ -18,15 +18,19 @@ GLOBAL_LIST_INIT(sm_delam_list, list(
/// Called when the count down has been finished, do the nasty work.
/// [/obj/machinery/power/supermatter_crystal/proc/count_down]
/datum/sm_delam/proc/delaminate(obj/machinery/power/supermatter_crystal/sm)
if (sm.is_main_engine)
SSpersistence.rounds_since_engine_exploded = ROUNDCOUNT_ENGINE_JUST_EXPLODED
for (var/obj/structure/sign/delamination_counter/sign as anything in GLOB.map_delamination_counters)
sign.update_count(ROUNDCOUNT_ENGINE_JUST_EXPLODED)
qdel(sm)
/// Whatever we're supposed to do when a delam is currently in progress.
/// Whatever we're supposed to do when a delam is currently in progress.
/// Mostly just to tell people how useless engi is, and play some alarm sounds.
/// Returns TRUE if we just told people a delam is going on. FALSE if its healing or we didnt say anything.
/// [/obj/machinery/power/supermatter_crystal/proc/process_atmos]
/datum/sm_delam/proc/delam_progress(obj/machinery/power/supermatter_crystal/sm)
if(sm.damage <= sm.warning_point) // Damage is too low, lets not
return FALSE
return FALSE
if (sm.damage >= sm.emergency_point && sm.damage_archived < sm.emergency_point)
sm.investigate_log("has entered the emergency point.", INVESTIGATE_ENGINE)

View File

@@ -66,7 +66,7 @@
SSsupermatter_cascade.can_fire = TRUE
SSsupermatter_cascade.cascade_initiated = TRUE
effect_crystal_mass(sm, rift)
qdel(sm)
return ..()
/datum/sm_delam/cascade/examine(obj/machinery/power/supermatter_crystal/sm)
return list(span_bolddanger("The crystal is vibrating at immense speeds, warping space around it!"))

View File

@@ -12,7 +12,7 @@
return FALSE
sm.radio.talk_into(
sm,
"Warning: Critical coolant mass reached.",
"Warning: Critical coolant mass reached.",
sm.damage > sm.emergency_point ? sm.emergency_channel : sm.warning_channel
)
@@ -26,7 +26,7 @@
effect_anomaly(sm)
if(!effect_singulo(sm))
effect_explosion(sm)
qdel(sm)
return ..()
/// When we have too much power.
/datum/sm_delam/tesla
@@ -54,7 +54,7 @@
effect_anomaly(sm)
effect_tesla(sm)
effect_explosion(sm)
qdel(sm)
return ..()
/// Default delam.
/datum/sm_delam/explosive
@@ -71,4 +71,4 @@
if(sm.is_main_engine)
effect_anomaly(sm)
effect_explosion(sm)
qdel(sm)
return ..()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 42 KiB