From 25996e232ab15e275fa89ed44ae518d3e586b5a2 Mon Sep 17 00:00:00 2001
From: HMBGERDO <61080616+HMBGERDO@users.noreply.github.com>
Date: Fri, 1 Mar 2024 20:56:03 +0100
Subject: [PATCH] Pepper Spray update (#24033)
* pepper spray update
* Update code/datums/status_effects/debuffs.dm
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
* Update code/modules/reagents/chemistry/reagents/food_reagents.dm
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
* Update code/modules/reagents/chemistry/reagents/food_reagents.dm
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
* Update code/modules/reagents/chemistry/reagents/food_reagents.dm
* Rurik review
---------
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
---
code/__DEFINES/status_effects.dm | 1 +
code/datums/status_effects/debuffs.dm | 20 +++++++
.../chemistry/reagents/food_reagents.dm | 52 ++++++-------------
3 files changed, 37 insertions(+), 36 deletions(-)
diff --git a/code/__DEFINES/status_effects.dm b/code/__DEFINES/status_effects.dm
index d5d3a6f2646..4f185e0f70a 100644
--- a/code/__DEFINES/status_effects.dm
+++ b/code/__DEFINES/status_effects.dm
@@ -112,6 +112,7 @@
#define STATUS_EFFECT_MAGIC_DISGUISE /datum/status_effect/magic_disguise
+#define STATUS_EFFECT_PEPPERSPRAYED /datum/status_effect/pepper_spray
//#define STATUS_EFFECT_NECROPOLIS_CURSE /datum/status_effect/necropolis_curse
//#define CURSE_BLINDING 1 //makes the edges of the target's screen obscured
diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm
index 2a2b6099762..add7fffaa65 100644
--- a/code/datums/status_effects/debuffs.dm
+++ b/code/datums/status_effects/debuffs.dm
@@ -382,6 +382,26 @@
/datum/status_effect/transient/drowsiness/calc_decay()
return (-0.2 + (IS_HORIZONTAL(owner) ? -0.8 : 0)) SECONDS
+/datum/status_effect/pepper_spray
+ id = "pepperspray"
+ duration = 10 SECONDS
+ status_type = STATUS_EFFECT_REFRESH
+ tick_interval = -1
+ alert_type = null
+
+/datum/status_effect/pepper_spray/on_apply()
+ . = ..()
+ to_chat(owner, "Your throat burns!")
+ owner.AdjustConfused(12 SECONDS)
+ owner.Slowed(4 SECONDS)
+ owner.apply_damage(40, STAMINA)
+
+/datum/status_effect/pepper_spray/refresh()
+ . = ..()
+ owner.AdjustConfused(12 SECONDS)
+ owner.Slowed(4 SECONDS)
+ owner.apply_damage(20, STAMINA)
+
/**
* # Drukenness
*
diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm
index 496cbf3fdd4..fc3ed3ccd20 100644
--- a/code/modules/reagents/chemistry/reagents/food_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm
@@ -219,56 +219,36 @@
if(method == REAGENT_TOUCH)
if(ishuman(M))
var/mob/living/carbon/human/victim = M
- var/mouth_covered = 0
- var/eyes_covered = 0
+ var/mouth_covered = FALSE
+ var/eyes_covered = FALSE
var/obj/item/safe_thing = null
if(victim.wear_mask)
if(victim.wear_mask.flags_cover & MASKCOVERSEYES)
- eyes_covered = 1
+ eyes_covered = TRUE
safe_thing = victim.wear_mask
if(victim.wear_mask.flags_cover & MASKCOVERSMOUTH)
- mouth_covered = 1
+ mouth_covered = TRUE
safe_thing = victim.wear_mask
if(victim.head)
if(victim.head.flags_cover & MASKCOVERSEYES)
- eyes_covered = 1
+ eyes_covered = TRUE
safe_thing = victim.head
if(victim.head.flags_cover & MASKCOVERSMOUTH)
- mouth_covered = 1
+ mouth_covered = TRUE
safe_thing = victim.head
- if(victim.glasses)
- eyes_covered = 1
- if(!safe_thing)
- safe_thing = victim.glasses
+
if(eyes_covered && mouth_covered)
to_chat(victim, "Your [safe_thing] protects you from the pepperspray!")
return
- else if(mouth_covered) // Reduced effects if partially protected
- to_chat(victim, "Your [safe_thing] protect you from most of the pepperspray!")
- if(prob(5))
- victim.emote("scream")
- victim.EyeBlurry(6 SECONDS)
- victim.EyeBlind(2 SECONDS)
- victim.Confused(6 SECONDS)
- victim.damageoverlaytemp = 60
- victim.Weaken(6 SECONDS)
- victim.drop_item()
- return
- else if(eyes_covered) // Eye cover is better than mouth cover
- to_chat(victim, "Your [safe_thing] protects your eyes from the pepperspray!")
- victim.EyeBlurry(6 SECONDS)
- victim.damageoverlaytemp = 30
- return
- else // Oh dear :D
- if(prob(5))
- victim.emote("scream")
- to_chat(victim, "You're sprayed directly in the eyes with pepperspray!")
- victim.EyeBlurry(10 SECONDS)
- victim.EyeBlind(4 SECONDS)
- victim.Confused(12 SECONDS)
- victim.damageoverlaytemp = 75
- victim.Weaken(10 SECONDS)
- victim.drop_item()
+
+ if(!mouth_covered)
+ victim.apply_status_effect(STATUS_EFFECT_PEPPERSPRAYED)
+
+ if(!eyes_covered)
+ to_chat(victim, "Your eyes burns!")
+ victim.Stun(0.5 SECONDS)
+ victim.EyeBlurry(20 SECONDS)
+ victim.EyeBlind(8 SECONDS)
/datum/reagent/consumable/frostoil
name = "Frost Oil"