diff --git a/_maps/map_files/tramstation/tramstation.dmm b/_maps/map_files/tramstation/tramstation.dmm index 9b60a24e5f2..9b692c931db 100644 --- a/_maps/map_files/tramstation/tramstation.dmm +++ b/_maps/map_files/tramstation/tramstation.dmm @@ -38867,6 +38867,10 @@ /obj/effect/turf_decal/trimline/brown/filled/line, /turf/open/floor/iron, /area/station/cargo/drone_bay) +"nRC" = ( +/obj/structure/sign/collision_counter, +/turf/closed/wall, +/area/station/medical/medbay/lobby) "nRO" = ( /obj/effect/turf_decal/trimline/neutral/filled/line{ dir = 8 @@ -166703,7 +166707,7 @@ nbS tqy qjf vJF -wyd +nRC wyd rks rks diff --git a/code/__DEFINES/dcs/signals/signals_tram.dm b/code/__DEFINES/dcs/signals/signals_tram.dm index 7a2459fb10a..8ab27b36fac 100644 --- a/code/__DEFINES/dcs/signals/signals_tram.dm +++ b/code/__DEFINES/dcs/signals/signals_tram.dm @@ -3,3 +3,6 @@ /// Sent from /obj/structure/industrial_lift/tram when it begins to travel. (obj/effect/landmark/tram/from_where, obj/effect/landmark/tram/to_where) #define COMSIG_TRAM_TRAVEL "tram_travel" + +/// Sent from /obj/structure/industrial_lift/tram when it hits someone: () +#define COMSIG_TRAM_COLLISION "tram_collided" diff --git a/code/game/objects/structures/signs/signs_interactive.dm b/code/game/objects/structures/signs/signs_interactive.dm index 74bc08eb898..16318972556 100644 --- a/code/game/objects/structures/signs/signs_interactive.dm +++ b/code/game/objects/structures/signs/signs_interactive.dm @@ -82,3 +82,61 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/sign/delamination_counter, 32) . += span_info("Good work!") if(11 to INFINITY) . += span_info("Incredible!") + +/obj/structure/sign/collision_counter + name = "incident counter" + sign_change_name = "Indicator board- Tram incidents" + desc = "A display that indicates how many tram related incidents have occured today." + icon_state = "tram_hits" + is_editable = TRUE + var/hit_count = 0 + var/tram_id = TRAM_LIFT_ID + +/obj/structure/sign/collision_counter/Initialize(mapload) + ..() + return INITIALIZE_HINT_LATELOAD + +/obj/structure/sign/collision_counter/LateInitialize() + . = ..() + for(var/obj/structure/industrial_lift/tram/tram as anything in GLOB.lifts) + if(tram.lift_id != tram_id) + continue + RegisterSignal(tram, COMSIG_TRAM_COLLISION, PROC_REF(new_hit)) + update_appearance() + +/obj/structure/sign/collision_counter/Destroy() + return ..() + +/obj/structure/sign/collision_counter/proc/new_hit() + SIGNAL_HANDLER + + hit_count++ + update_appearance() + +/obj/structure/sign/collision_counter/update_overlays() + . = ..() + + var/ones = hit_count % 10 + var/mutable_appearance/ones_overlay = mutable_appearance('icons/obj/signs.dmi', "hits_[ones]") + ones_overlay.pixel_x = 4 + . += ones_overlay + + var/tens = (hit_count / 10) % 10 + var/mutable_appearance/tens_overlay = mutable_appearance('icons/obj/signs.dmi', "hits_[tens]") + tens_overlay.pixel_x = -5 + . += tens_overlay + +/obj/structure/sign/collision_counter/examine(mob/user) + . = ..() + . += span_info("The station has had [hit_count] incident\s this shift.") + switch (hit_count) + if(0) + . += span_info("Fantastic! Champions of safety.") + if(1) + . += span_info("Let's do better tomorrow.") + if(2 to 5) + . += span_info("There's room for improvement.") + if(6 to 10) + . += span_info("Good work! Nanotrasen's finest!") + if(11 to INFINITY) + . += span_info("Incredible! You're probably reading this from medbay.") diff --git a/code/modules/industrial_lift/industrial_lift.dm b/code/modules/industrial_lift/industrial_lift.dm index a636a1050f7..f3b49519415 100644 --- a/code/modules/industrial_lift/industrial_lift.dm +++ b/code/modules/industrial_lift/industrial_lift.dm @@ -410,6 +410,8 @@ GLOBAL_LIST_EMPTY(lifts) var/datum/callback/land_slam = new(collided, TYPE_PROC_REF(/mob/living/, tram_slam_land)) collided.throw_at(throw_target, 200 * collision_lethality, 4 * collision_lethality, callback = land_slam) + SEND_SIGNAL(src, COMSIG_TRAM_COLLISION) + unset_movement_registrations(exited_locs) group_move(things_to_move, going) set_movement_registrations(entering_locs) diff --git a/icons/obj/signs.dmi b/icons/obj/signs.dmi index 25056052e94..dc8ecd10803 100644 Binary files a/icons/obj/signs.dmi and b/icons/obj/signs.dmi differ