From 85ca0d52720e8584bfa58813ed07a90dbf0e8f04 Mon Sep 17 00:00:00 2001 From: cacogen <25089914+cacogen@users.noreply.github.com> Date: Sat, 13 Jul 2019 09:11:23 +1200 Subject: [PATCH] Adds stats to creation/destruction of cleanable decals and trash on station (#44989) * Adds stat tracking to mess on station * Checks for maint to make sure stats aren't counting maint trash which is irrelevant to the janitor * adds mapload arg to init * asdasd --- code/game/objects/effects/decals/cleanable.dm | 10 ++++++++++ code/game/objects/items/stacks/sheets/glass.dm | 11 +++++++++++ code/game/objects/items/trash.dm | 12 ++++++++++++ code/modules/projectiles/ammunition/_ammunition.dm | 7 +++++++ code/modules/projectiles/guns/ballistic.dm | 3 +++ 5 files changed, 43 insertions(+) diff --git a/code/game/objects/effects/decals/cleanable.dm b/code/game/objects/effects/decals/cleanable.dm index efc8ea06781..87c5785ba5e 100644 --- a/code/game/objects/effects/decals/cleanable.dm +++ b/code/game/objects/effects/decals/cleanable.dm @@ -25,6 +25,16 @@ if(LAZYLEN(diseases_to_add)) AddComponent(/datum/component/infective, diseases_to_add) + var/turf/T = get_turf(src) + if(is_station_level(T.z)) + SSblackbox.record_feedback("tally", "station_mess_created", 1, name) + +/obj/effect/decal/cleanable/Destroy() + var/turf/T = get_turf(src) + if(is_station_level(T.z)) + SSblackbox.record_feedback("tally", "station_mess_destroyed", 1, name) + return ..() + /obj/effect/decal/cleanable/proc/replace_decal(obj/effect/decal/cleanable/C) // Returns true if we should give up in favor of the pre-existing decal if(mergeable_decal) return TRUE diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm index a553d4ac7c2..b6561c12c10 100644 --- a/code/game/objects/items/stacks/sheets/glass.dm +++ b/code/game/objects/items/stacks/sheets/glass.dm @@ -270,6 +270,17 @@ GLOBAL_LIST_INIT(plastitaniumglass_recipes, list( if (icon_prefix) icon_state = "[icon_prefix][icon_state]" + var/turf/T = get_turf(src) + if(is_station_level(T.z)) + SSblackbox.record_feedback("tally", "station_mess_created", 1, name) + +/obj/item/shard/Destroy() + . = ..() + + var/turf/T = get_turf(src) + if(is_station_level(T.z)) + SSblackbox.record_feedback("tally", "station_mess_destroyed", 1, name) + /obj/item/shard/afterattack(atom/A as mob|obj, mob/user, proximity) . = ..() if(!proximity || !(src in user)) diff --git a/code/game/objects/items/trash.dm b/code/game/objects/items/trash.dm index 063601887cc..60a3bff5e80 100644 --- a/code/game/objects/items/trash.dm +++ b/code/game/objects/items/trash.dm @@ -7,6 +7,18 @@ w_class = WEIGHT_CLASS_TINY resistance_flags = FLAMMABLE +/obj/item/trash/Initialize(mapload) + var/turf/T = get_turf(src) + if(is_station_level(T.z)) + SSblackbox.record_feedback("tally", "station_mess_created", 1, name) + return ..() + +/obj/item/trash/Destroy() + var/turf/T = get_turf(src) + if(is_station_level(T.z)) + SSblackbox.record_feedback("tally", "station_mess_destroyed", 1, name) + return ..() + /obj/item/trash/raisins name = "\improper 4no raisins" icon_state= "4no_raisins" diff --git a/code/modules/projectiles/ammunition/_ammunition.dm b/code/modules/projectiles/ammunition/_ammunition.dm index 3b183d4619c..e868f8621ea 100644 --- a/code/modules/projectiles/ammunition/_ammunition.dm +++ b/code/modules/projectiles/ammunition/_ammunition.dm @@ -34,6 +34,13 @@ setDir(pick(GLOB.alldirs)) update_icon() +/obj/item/ammo_casing/Destroy() + . = ..() + + var/turf/T = get_turf(src) + if(!BB && is_station_level(T.z)) + SSblackbox.record_feedback("tally", "station_mess_destroyed", 1, name) + /obj/item/ammo_casing/update_icon() ..() icon_state = "[initial(icon_state)][BB ? "-live" : ""]" diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index 2f2b016e69a..60f690baca1 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -316,6 +316,9 @@ CB.forceMove(drop_location()) CB.bounce_away(FALSE, NONE) num_unloaded++ + var/turf/T = get_turf(drop_location()) + if(is_station_level(T.z)) + SSblackbox.record_feedback("tally", "station_mess_created", 1, CB.name) if (num_unloaded) to_chat(user, "You unload [num_unloaded] [cartridge_wording]\s from [src].") playsound(user, eject_sound, eject_sound_volume, eject_sound_vary)