From e4d3993876d15db5e28f6ea6b86be7ada714d2f8 Mon Sep 17 00:00:00 2001
From: Crosarius <30341877+Crosarius@users.noreply.github.com>
Date: Thu, 2 Jan 2020 19:49:51 +1000
Subject: [PATCH] Forensics QOL Changes (#7758)
Makes it so that using the forensics item on certain machinery such as airlocks, alarms, APCs, buttons, windoors etc doesn't apply fingerprints/fibers. This is necessary because these machines will call add_fingerprint BEFORE the forensic kit is used, thus polluting the sample with your own fibers, which is extremely annoying
Also made it so that using a forensics item on a fire alarm or button doesn't make you trigger them, because that's also really annoying.
This is take 2 because the first time I messed up my branches/forks because my brain is smooth.
---
code/game/machinery/Sleeper.dm | 3 +-
code/game/machinery/alarm.dm | 5 ++-
code/game/machinery/atmoalter/canister.dm | 3 +-
code/game/machinery/door_control.dm | 4 +-
code/game/machinery/doors/airlock.dm | 5 ++-
code/game/machinery/doors/blast_door.dm | 3 +-
code/game/machinery/doors/door.dm | 3 +-
code/game/machinery/doors/firedoor.dm | 4 +-
code/game/machinery/doors/windowdoor.dm | 6 +--
code/game/machinery/firealarm.dm | 5 ++-
code/game/machinery/jukebox.dm | 3 +-
code/game/machinery/pipe/pipe_dispenser.dm | 5 ++-
.../objects/items/weapons/storage/storage.dm | 5 ++-
code/modules/power/apc.dm | 3 +-
html/changelogs/crosarius-forensics-QOL.yml | 43 +++++++++++++++++++
15 files changed, 80 insertions(+), 20 deletions(-)
create mode 100644 html/changelogs/crosarius-forensics-QOL.yml
diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm
index 728f1d899dc..05fffdac689 100644
--- a/code/game/machinery/Sleeper.dm
+++ b/code/game/machinery/Sleeper.dm
@@ -158,7 +158,8 @@
return attack_hand(user)
/obj/machinery/sleeper/attackby(var/obj/item/I, var/mob/user)
- add_fingerprint(user)
+ if(!istype(I, /obj/item/forensics))
+ add_fingerprint(user)
if(istype(I, /obj/item/reagent_containers/glass))
if(!beaker)
beaker = I
diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm
index 60060a84c07..049cc939636 100644
--- a/code/game/machinery/alarm.dm
+++ b/code/game/machinery/alarm.dm
@@ -746,7 +746,8 @@
return 1
/obj/machinery/alarm/attackby(obj/item/W as obj, mob/user as mob)
- src.add_fingerprint(user)
+ if(!istype(W, /obj/item/forensics))
+ src.add_fingerprint(user)
switch(buildstage)
if(2)
@@ -838,4 +839,4 @@ Just a object used in constructing air alarms
w_class = 2.0
matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50)
-// Fire Alarms moved to firealarm.dm
+// Fire Alarms moved to firealarm.dm
\ No newline at end of file
diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm
index 529196318bc..09b55dcb4ee 100644
--- a/code/game/machinery/atmoalter/canister.dm
+++ b/code/game/machinery/atmoalter/canister.dm
@@ -263,7 +263,8 @@ update_flag
if(!W.iswrench() && !istype(W, /obj/item/tank) && !istype(W, /obj/item/device/analyzer) && !istype(W, /obj/item/device/pda))
visible_message("\The [user] hits \the [src] with \a [W]!")
src.health -= W.force
- src.add_fingerprint(user)
+ if(!istype(W, /obj/item/forensics))
+ src.add_fingerprint(user)
healthcheck()
if(istype(user, /mob/living/silicon/robot) && istype(W, /obj/item/tank/jetpack))
diff --git a/code/game/machinery/door_control.dm b/code/game/machinery/door_control.dm
index 7ce7929d20e..bdd4f58b59b 100644
--- a/code/game/machinery/door_control.dm
+++ b/code/game/machinery/door_control.dm
@@ -24,6 +24,8 @@
to_chat(user, "Error, no route to host.")
/obj/machinery/button/remote/attackby(obj/item/W, mob/user as mob)
+ if(istype(W, /obj/item/forensics))
+ return
return src.attack_hand(user)
/obj/machinery/button/remote/emag_act(var/remaining_charges, var/mob/user)
@@ -209,4 +211,4 @@
if(!active || (stat & NOPOWER))
icon_state = "launcherbtt"
else
- icon_state = "launcheract"
+ icon_state = "launcheract"
\ No newline at end of file
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index b357b8664d6..18f3cd0fff4 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -1014,7 +1014,8 @@ About the new airlock wires panel:
return
if(istype(C, /obj/item/taperoll))
return
- src.add_fingerprint(user)
+ if(!istype(C, /obj/item/forensics))
+ src.add_fingerprint(user)
if (!repairing && (stat & BROKEN) && src.locked) //bolted and broken
if (!cut_bolts(C,user))
..()
@@ -1469,4 +1470,4 @@ About the new airlock wires panel:
#undef CYBORG_AIRLOCKCRUSH_RESISTANCE
#undef BOLTS_FINE
#undef BOLTS_EXPOSED
-#undef BOLTS_CUT
+#undef BOLTS_CUT
\ No newline at end of file
diff --git a/code/game/machinery/doors/blast_door.dm b/code/game/machinery/doors/blast_door.dm
index 4ed6d887fc1..55439f49a03 100644
--- a/code/game/machinery/doors/blast_door.dm
+++ b/code/game/machinery/doors/blast_door.dm
@@ -116,7 +116,8 @@
// Description: If we are clicked with crowbar or wielded fire axe, try to manually open the door.
// This only works on broken doors or doors without power. Also allows repair with Plasteel.
/obj/machinery/door/blast/attackby(obj/item/C as obj, mob/user as mob)
- src.add_fingerprint(user)
+ if(!istype(C, /obj/item/forensics))
+ src.add_fingerprint(user)
if((istype(C, /obj/item/material/twohanded/fireaxe) && C:wielded == 1) || (istype(C, /obj/item/melee/hammer)))
if (((stat & NOPOWER) || (stat & BROKEN)) && !( src.operating ))
force_toggle()
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index ca7be76a087..708692abcfa 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -269,7 +269,8 @@
return
/obj/machinery/door/attackby(obj/item/I as obj, mob/user as mob)
- src.add_fingerprint(user)
+ if(!istype(I, /obj/item/forensics))
+ src.add_fingerprint(user)
if(istype(I, /obj/item/stack/material) && I.get_material_name() == src.get_material_name())
if(stat & BROKEN)
diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm
index 5071d83d710..53dc7227c87 100644
--- a/code/game/machinery/doors/firedoor.dm
+++ b/code/game/machinery/doors/firedoor.dm
@@ -260,7 +260,8 @@
close()
/obj/machinery/door/firedoor/attackby(obj/item/C as obj, mob/user as mob)
- add_fingerprint(user)
+ if(!istype(C, /obj/item/forensics))
+ add_fingerprint(user)
if(operating)
return//Already doing something.
if(C.iswelder() && !repairing)
@@ -525,4 +526,5 @@
icon = 'icons/obj/doors/DoorHazard2x1.dmi'
width = 2
dir = EAST
+
enable_smart_generation = FALSE
\ No newline at end of file
diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm
index 8e48b3e8fb6..45d732952fb 100644
--- a/code/game/machinery/doors/windowdoor.dm
+++ b/code/game/machinery/doors/windowdoor.dm
@@ -220,8 +220,8 @@
take_damage(aforce)
return
-
- src.add_fingerprint(user)
+ if(!istype(I, /obj/item/forensics))
+ src.add_fingerprint(user)
if (src.allowed(user))
if (src.density)
@@ -305,4 +305,4 @@
/obj/machinery/door/window/brigdoor/southright
dir = SOUTH
icon_state = "rightsecure"
- base_state = "rightsecure"
+ base_state = "rightsecure"
\ No newline at end of file
diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm
index d5a7e251122..b43b8f84ffd 100644
--- a/code/game/machinery/firealarm.dm
+++ b/code/game/machinery/firealarm.dm
@@ -83,7 +83,10 @@
..()
/obj/machinery/firealarm/attackby(obj/item/W as obj, mob/user as mob)
- src.add_fingerprint(user)
+ if(!istype(W, /obj/item/forensics))
+ src.add_fingerprint(user)
+ else
+ return
if (W.isscrewdriver() && buildstage == 2)
if(!wiresexposed)
diff --git a/code/game/machinery/jukebox.dm b/code/game/machinery/jukebox.dm
index 51829d8a858..99eee1afd1b 100644
--- a/code/game/machinery/jukebox.dm
+++ b/code/game/machinery/jukebox.dm
@@ -165,7 +165,8 @@ datum/track/New(var/title_name, var/audio)
qdel(src)
/obj/machinery/media/jukebox/attackby(obj/item/W as obj, mob/user as mob)
- src.add_fingerprint(user)
+ if(!istype(W, /obj/item/forensics))
+ src.add_fingerprint(user)
if(W.iswrench())
if(playing)
diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm
index a237a6a13c7..cf5559c810e 100644
--- a/code/game/machinery/pipe/pipe_dispenser.dm
+++ b/code/game/machinery/pipe/pipe_dispenser.dm
@@ -99,7 +99,8 @@
return
/obj/machinery/pipedispenser/attackby(var/obj/item/W as obj, var/mob/user as mob)
- src.add_fingerprint(usr)
+ if(!istype(W, /obj/item/forensics))
+ src.add_fingerprint(usr)
if (istype(W, /obj/item/pipe) || istype(W, /obj/item/pipe_meter))
to_chat(usr, "You put [W] back to [src].")
user.drop_from_inventory(W,get_turf(src))
@@ -258,4 +259,4 @@ Nah
/obj/machinery/pipedispenser/disposal/orderable
anchored = 0
- unwrenched = 1
+ unwrenched = 1
\ No newline at end of file
diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm
index 1ee6f4f11ec..e059e225b26 100644
--- a/code/game/objects/items/weapons/storage/storage.dm
+++ b/code/game/objects/items/weapons/storage/storage.dm
@@ -363,7 +363,8 @@
W.on_enter_storage(src)
if(user)
W.dropped(user)
- add_fingerprint(user)
+ if(!istype(W, /obj/item/forensics))
+ add_fingerprint(user)
if(!prevent_warning)
for(var/mob/M in viewers(user, null))
@@ -732,4 +733,4 @@
//return 2**(w_class-1) //1,2,4,8,16,...
-#undef STORAGE_SPACE_CAP
+#undef STORAGE_SPACE_CAP
\ No newline at end of file
diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm
index 110c3064cd7..3791f76ec82 100644
--- a/code/modules/power/apc.dm
+++ b/code/modules/power/apc.dm
@@ -440,7 +440,8 @@
if (istype(user, /mob/living/silicon) && get_dist(src,user)>1)
return src.attack_hand(user)
- src.add_fingerprint(user)
+ if(!istype(W, /obj/item/forensics))
+ src.add_fingerprint(user)
if (W.iscrowbar() && opened)
if (has_electronics==1)
if (terminal)
diff --git a/html/changelogs/crosarius-forensics-QOL.yml b/html/changelogs/crosarius-forensics-QOL.yml
new file mode 100644
index 00000000000..555ecd24d7a
--- /dev/null
+++ b/html/changelogs/crosarius-forensics-QOL.yml
@@ -0,0 +1,43 @@
+################################
+# Example Changelog File
+#
+# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
+#
+# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
+# When it is, any changes listed below will disappear.
+#
+# Valid Prefixes:
+# bugfix
+# wip (For works in progress)
+# tweak
+# soundadd
+# sounddel
+# rscadd (general adding of nice things)
+# rscdel (general deleting of nice things)
+# imageadd
+# imagedel
+# maptweak
+# spellcheck (typo fixes)
+# experiment
+# balance
+# admin
+# backend
+# security
+# refactor
+#################################
+
+# Your name.
+author: Crosarius
+
+# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
+delete-after: True
+
+# Any changes you've made. See valid prefix list above.
+# INDENT WITH TWO SPACES. NOT TABS. SPACES.
+# SCREW THIS UP AND IT WON'T WORK.
+# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
+# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
+changes:
+ - rscadd: "Adds checks to some machinery/airlocks/alarms/buttons to preclude forensics items from applying fibers/fingterprints BEFORE you take a sample."
+ - rscadd: "Stops fire alarms and remote airlock/blastdoor/etc buttons from being triggered when you use a forensics item on them, in addition to the above changes."
+ - rscadd: "Adds a check to the to preclude forensics items from applying fibers/fingterprints BEFORE you take the sample when you put an item in a bag."