From 054fd02a3535ec1eb74eb915f4e85cfb6fb8701a Mon Sep 17 00:00:00 2001
From: Draycu <28820640+Draycu@users.noreply.github.com>
Date: Fri, 31 Jul 2020 04:32:45 -0500
Subject: [PATCH] Rag Coding Fix
A quick one file fix to rags correcting the smothering action not checking if someone was wearing a protective helmet of some kind.
---
code/modules/detectivework/tools/rag.dm | 44 +++++++++++++++----------
1 file changed, 26 insertions(+), 18 deletions(-)
diff --git a/code/modules/detectivework/tools/rag.dm b/code/modules/detectivework/tools/rag.dm
index 2e5223420a..dd22e7c22e 100644
--- a/code/modules/detectivework/tools/rag.dm
+++ b/code/modules/detectivework/tools/rag.dm
@@ -109,29 +109,37 @@
T.clean(src, user) //VOREStation Edit End
/obj/item/weapon/reagent_containers/glass/rag/attack(atom/target as obj|turf|area, mob/user as mob , flag)
- if(isliving(target))
+ if(isliving(target)) //Leaving this as isliving.
var/mob/living/M = target
- if(on_fire)
+ if(on_fire) //Check if rag is on fire, if so igniting them and stopping.
user.visible_message("\The [user] hits [target] with [src]!",)
user.do_attack_animation(src)
M.IgniteMob()
- else if(reagents.total_volume)
- if(user.zone_sel.selecting == O_MOUTH)
- user.do_attack_animation(src)
- user.visible_message(
- "\The [user] smothers [target] with [src]!",
- "You smother [target] with [src]!",
- "You hear some struggling and muffled cries of surprise"
- )
-
- //it's inhaled, so... maybe CHEM_BLOOD doesn't make a whole lot of sense but it's the best we can do for now
- reagents.trans_to_mob(target, amount_per_transfer_from_this, CHEM_BLOOD)
- update_name()
+ else if(user.zone_sel.selecting == O_MOUTH) //Check player target location, provided the rag is not on fire. Then check if mouth is exposed.
+ if(ishuman(target)) //Added this since player species process reagents in majority of cases.
+ var/mob/living/carbon/human/H = target
+ if(H.head && (H.head.body_parts_covered & FACE)) //Check human head coverage.
+ to_chat(user, "Remove their [H.head] first.")
+ return
+ else if(reagents.total_volume) //Final check. If the rag is not on fire and their face is uncovered, smother target.
+ user.do_attack_animation(src)
+ user.visible_message(
+ "\The [user] smothers [target] with [src]!",
+ "You smother [target] with [src]!",
+ "You hear some struggling and muffled cries of surprise"
+ )
+ //it's inhaled, so... maybe CHEM_BLOOD doesn't make a whole lot of sense but it's the best we can do for now
+ reagents.trans_to_mob(target, amount_per_transfer_from_this, CHEM_BLOOD)
+ update_name()
+ else
+ to_chat(user, "You can't smother this creature.")
else
- wipe_down(target, user)
- return
-
- return ..()
+ to_chat(user, "You can't smother this creature.")
+ else
+ wipe_down(target, user)
+ else
+ wipe_down(target, user)
+ return
/obj/item/weapon/reagent_containers/glass/rag/afterattack(atom/A as obj|turf|area, mob/user as mob, proximity)
if(!proximity)