From e787d301ac42bedc3d7ab770c786acc1dcd0526a Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 29 Mar 2023 23:22:13 +0200 Subject: [PATCH] [MIRROR] Tram signs malfunction during tram malfunction [MDB IGNORE] (#20119) * Tram signs malfunction during tram malfunction (#74210) ## About The Pull Request Tram signs will now display incorrect information when malfunctioning. ## Why It's Good For The Game For improved Frogger gameplay, no more being crafty and reading the indicator board to know if the tram is coming. ## Changelog :cl: LT3 add: Tram signs will now malfunction when the tram is malfunctioning /:cl: --------- Co-authored-by: san7890 * Tram signs malfunction during tram malfunction --------- Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com> Co-authored-by: san7890 --- code/modules/events/tram_malfunction.dm | 8 +++++++- .../industrial_lift/tram/tram_machinery.dm | 20 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/code/modules/events/tram_malfunction.dm b/code/modules/events/tram_malfunction.dm index 0ea765178d8..b5130a8c693 100644 --- a/code/modules/events/tram_malfunction.dm +++ b/code/modules/events/tram_malfunction.dm @@ -44,6 +44,9 @@ for(var/obj/machinery/door/window/tram/door as anything in GLOB.tram_doors) door.start_malfunction() + for(var/obj/machinery/destination_sign/sign as anything in GLOB.tram_signs) + sign.malfunctioning = TRUE + for(var/obj/structure/industrial_lift/tram as anything in GLOB.lifts) original_lethality = tram.collision_lethality tram.collision_lethality = original_lethality * 1.25 @@ -55,10 +58,13 @@ for(var/obj/machinery/door/window/tram/door as anything in GLOB.tram_doors) door.end_malfunction() + for(var/obj/machinery/destination_sign/sign as anything in GLOB.tram_signs) + sign.malfunctioning = FALSE + for(var/obj/structure/industrial_lift/tram as anything in GLOB.lifts) tram.collision_lethality = original_lethality - priority_announce("We've successfully reset the software of the tram, normal operations are now resuming. Sorry for any inconvienence this may have caused. We hope you have a good rest of your shift.", "CentCom Engineering Division") + priority_announce("We've successfully reset the software on the tram, normal operations are now resuming. Sorry for any inconvienence this may have caused.", "CentCom Engineering Division") #undef TRAM_MALFUNCTION_TIME_UPPER #undef TRAM_MALFUNCTION_TIME_LOWER diff --git a/code/modules/industrial_lift/tram/tram_machinery.dm b/code/modules/industrial_lift/tram/tram_machinery.dm index d663dd64b50..37ad1ce5198 100644 --- a/code/modules/industrial_lift/tram/tram_machinery.dm +++ b/code/modules/industrial_lift/tram/tram_machinery.dm @@ -579,6 +579,10 @@ GLOBAL_LIST_EMPTY(tram_doors) var/previous_destination /// The light mask overlay we use var/light_mask + /// Is this sign malfunctioning? + var/malfunctioning = FALSE + /// A default list of possible sign states + var/static/list/sign_states = list() /obj/machinery/destination_sign/north layer = BELOW_OBJ_LAYER @@ -607,6 +611,16 @@ GLOBAL_LIST_EMPTY(tram_doors) RegisterSignal(tram_part, COMSIG_TRAM_SET_TRAVELLING, PROC_REF(on_tram_travelling)) GLOB.tram_signs += src + sign_states = list( + "[base_icon_state][DESTINATION_WEST_ACTIVE]", + "[base_icon_state][DESTINATION_WEST_IDLE]", + "[base_icon_state][DESTINATION_EAST_ACTIVE]", + "[base_icon_state][DESTINATION_EAST_IDLE]", + "[base_icon_state][DESTINATION_CENTRAL_IDLE]", + "[base_icon_state][DESTINATION_CENTRAL_EASTBOUND_ACTIVE]", + "[base_icon_state][DESTINATION_CENTRAL_WESTBOUND_ACTIVE]", + ) + /obj/machinery/destination_sign/Destroy() GLOB.tram_signs -= src . = ..() @@ -646,6 +660,12 @@ GLOBAL_LIST_EMPTY(tram_doors) use_power(active_power_usage) + if(malfunctioning) + icon_state = "[pick(sign_states)]" + light_mask = "[pick(sign_states)]_e" + update_appearance() + return PROCESS_KILL + if(!tram.travelling) if(istype(tram.idle_platform, /obj/effect/landmark/tram/tramstation/west)) icon_state = "[base_icon_state][DESTINATION_WEST_IDLE]"