Adds a tram collision indicator board (#70812)

<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
Based off the delamination counter, adds a tram hit counter sign. Every
time the tram hits someone, a signal is sent and the sign increments.


<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

![tramhitcounter2](https://user-images.githubusercontent.com/83487515/197989631-eecbd50a-7f9e-4c19-9070-f88967a77a4a.gif)

## Why It's Good For The Game
Showing how many people have been hit by the tram is an amusing
statistic to display.
<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->

## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and it's effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

🆑 LT3
add: A tram collision counter has been added, hopefully encouraging
employees to be more careful. Don't become a statistic!
/🆑

<!-- Both 🆑's are required for the changelog to work! You can put
your name to the right of the first 🆑 if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
This commit is contained in:
lessthanthree
2022-11-16 01:19:21 +00:00
committed by GitHub
co-authored by LemonInTheDark Mothblocks
parent f1eb280149
commit 8fe69d7bb0
5 changed files with 68 additions and 1 deletions
+5 -1
View File
@@ -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
@@ -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"
@@ -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.")
@@ -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)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB