From 63fb8db4038535b2e6098c29be0fdefdefd1d6d4 Mon Sep 17 00:00:00 2001 From: Striders13 <53361823+Striders13@users.noreply.github.com> Date: Sat, 12 Oct 2024 22:26:59 +0530 Subject: [PATCH] Removes gas mask fov, pepperspray now applies tint to masks until washed off (#87102) ## About The Pull Request Gas masks and all their subtypes no longer have fov. Using pepperspray on gas mask wearer applies 1 tint per 5u of spray. At 3 tint the wearer becomes fully blind. If you wanna use the mask again you'll have to wash off the pepperspray from it using soap or shower. ## Why It's Good For The Game Gas mask assistants are peak soul and removing it was a terrible disaster. FoV is too annoying to ever deal with, so it ends up with gas masks never being worn. Gas filter doesn't make up for it whatsoever, it's only use is shoving cigarettes in it to look cool. This PR makes it so pepperspray/tear gas is still useful against mask wearers, albeit less efficient. # Conflicts: # code/modules/clothing/masks/gasmask.dm --- code/datums/components/clothing_dirt.dm | 88 +++++++++++++++++++ .../antagonists/ninja/ninja_clothing.dm | 3 +- code/modules/clothing/masks/gasmask.dm | 27 ++---- code/modules/clothing/masks/hailer.dm | 2 +- .../modules/mining/equipment/explorer_gear.dm | 1 - tgstation.dme | 1 + 6 files changed, 98 insertions(+), 24 deletions(-) create mode 100644 code/datums/components/clothing_dirt.dm diff --git a/code/datums/components/clothing_dirt.dm b/code/datums/components/clothing_dirt.dm new file mode 100644 index 00000000000..40f0ddb07e2 --- /dev/null +++ b/code/datums/components/clothing_dirt.dm @@ -0,0 +1,88 @@ +/// This component applies tint to clothing when its exposed to pepperspray, used in /obj/item/clothing/mask/gas. + +/datum/component/clothing_dirt + /// Amount of dirt stacks on the clothing + var/dirtiness = 0 + +/datum/component/clothing_dirt/Initialize() + if(!isclothing(parent)) + return COMPONENT_INCOMPATIBLE + +/datum/component/clothing_dirt/RegisterWithParent() + RegisterSignal(parent, COMSIG_ATOM_EXAMINE, PROC_REF(on_examine)) + RegisterSignal(parent, COMSIG_ITEM_EQUIPPED, PROC_REF(on_equip)) + RegisterSignal(parent, COMSIG_ITEM_DROPPED, PROC_REF(on_drop)) + RegisterSignal(parent, COMSIG_COMPONENT_CLEAN_ACT, PROC_REF(on_clean)) + RegisterSignal(parent, COMSIG_ATOM_EXPOSE_REAGENTS, PROC_REF(on_expose), TRUE) + +/datum/component/clothing_dirt/UnregisterFromParent() + var/obj/item/clothing/clothing = parent + clothing.tint -= dirtiness + if(iscarbon(clothing.loc)) + var/mob/living/carbon/wearer = clothing.loc + wearer.update_tint() + UnregisterSignal(wearer, COMSIG_ATOM_EXPOSE_REAGENTS) + else + UnregisterSignal(parent, COMSIG_ATOM_EXPOSE_REAGENTS) + UnregisterSignal(parent, list( + COMSIG_ATOM_EXAMINE, + COMSIG_ITEM_EQUIPPED, + COMSIG_MOB_UNEQUIPPED_ITEM, + COMSIG_COMPONENT_CLEAN_ACT, + )) + return ..() + +/datum/component/clothing_dirt/proc/on_equip(datum/source, mob/user, slot) + SIGNAL_HANDLER + var/obj/item/clothing/clothing = parent + if (!(slot & clothing.slot_flags)) + return + UnregisterSignal(parent, COMSIG_ATOM_EXPOSE_REAGENTS) + RegisterSignal(user, COMSIG_ATOM_EXPOSE_REAGENTS, PROC_REF(on_expose), TRUE) + +/datum/component/clothing_dirt/proc/on_drop(datum/source, mob/holder) + SIGNAL_HANDLER + UnregisterSignal(holder, COMSIG_ATOM_EXPOSE_REAGENTS) + RegisterSignal(parent, COMSIG_ATOM_EXPOSE_REAGENTS, PROC_REF(on_expose), TRUE) + +/datum/component/clothing_dirt/proc/on_examine(datum/source, mob/user, list/examine_list) + SIGNAL_HANDLER + if (dirtiness > 0) + examine_list += span_warning("It appears to be covered in some oily substance. Won't see much while wearing it until you wash it off.") + +/datum/component/clothing_dirt/proc/on_expose(atom/target, list/reagents, datum/reagents/source, methods) + SIGNAL_HANDLER + + var/mob/living/carbon/wearer + if(iscarbon(target)) + wearer = target + if(is_protected(wearer)) + return + + var/datum/reagent/consumable/condensedcapsaicin/pepper = locate() in reagents + if(isnull(pepper)) + return + + var/obj/item/clothing/clothing = parent + if (methods & (TOUCH | VAPOR)) + clothing.tint -= dirtiness + dirtiness = min(dirtiness + round(reagents[pepper] / 5), 3) + clothing.tint += dirtiness + if(!isnull(wearer)) + wearer.update_tint() + +/datum/component/clothing_dirt/proc/is_protected(mob/living/carbon/wearer) + return wearer.head && (wearer.head.flags_cover & PEPPERPROOF) + +/datum/component/clothing_dirt/proc/on_clean(datum/target, clean_types) + SIGNAL_HANDLER + var/obj/item/clothing/clothing = parent + var/mob/living/carbon/wearer + if(iscarbon(clothing.loc)) + wearer = clothing.loc + + if (clean_types & (CLEAN_WASH|CLEAN_SCRUB)) + clothing.tint -= dirtiness + dirtiness = 0 + if(!isnull(wearer)) + wearer.update_tint() diff --git a/code/modules/antagonists/ninja/ninja_clothing.dm b/code/modules/antagonists/ninja/ninja_clothing.dm index 54ed46c9c3e..4eaf40f9c79 100644 --- a/code/modules/antagonists/ninja/ninja_clothing.dm +++ b/code/modules/antagonists/ninja/ninja_clothing.dm @@ -15,7 +15,8 @@ resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF flags_inv = HIDEFACIALHAIR | HIDEFACE | HIDESNOUT flags_cover = MASKCOVERSMOUTH | PEPPERPROOF - has_fov = FALSE + pepper_tint = FALSE + /obj/item/clothing/under/syndicate/ninja name = "ninja suit" diff --git a/code/modules/clothing/masks/gasmask.dm b/code/modules/clothing/masks/gasmask.dm index 1f9711cc7cc..828bbb01092 100644 --- a/code/modules/clothing/masks/gasmask.dm +++ b/code/modules/clothing/masks/gasmask.dm @@ -25,12 +25,12 @@ GLOBAL_LIST_INIT(clown_mask_options, list( var/list/gas_filters ///Type of filter that spawns on roundstart var/starting_filter_type = /obj/item/gas_filter - ///Does the mask have an FOV? - var/has_fov = TRUE ///Cigarette in the mask var/obj/item/cigarette/cig ///How much does this mask affect fishing difficulty var/fishing_modifier = 2 + ///Applies clothing_dirt component to the pepperproof mask if true + var/pepper_tint = TRUE /datum/armor/mask_gas bio = 100 @@ -39,6 +39,9 @@ GLOBAL_LIST_INIT(clown_mask_options, list( . = ..() //init_fov() BUBBER EDIT - Dear god + if((flags_cover & PEPPERPROOF) && pepper_tint) + AddComponent(/datum/component/clothing_dirt) + if(fishing_modifier) AddComponent(/datum/component/adjust_fishing_difficulty, fishing_modifier) @@ -160,11 +163,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list( has_filter = FALSE return filtered_breath -/// Initializes the FoV component for the gas mask -/obj/item/clothing/mask/gas/proc/init_fov() - if (has_fov) - AddComponent(/datum/component/clothing_fov_visor, FOV_90_DEGREES) - /** * Getter for overall filter durability, takes into consideration all filters filter_status */ @@ -267,7 +265,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list( icon_state = "plaguedoctor" flags_inv = HIDEEARS|HIDEEYES|HIDEFACE|HIDEFACIALHAIR|HIDESNOUT|HIDEHAIR inhand_icon_state = "gas_mask" - has_fov = FALSE clothing_flags = BLOCK_GAS_SMOKE_EFFECT|MASKINTERNALS /obj/item/clothing/mask/gas/syndicate @@ -278,8 +275,8 @@ GLOBAL_LIST_INIT(clown_mask_options, list( resistance_flags = FIRE_PROOF | ACID_PROOF strip_delay = 60 w_class = WEIGHT_CLASS_SMALL - has_fov = FALSE fishing_modifier = 0 + pepper_tint = FALSE /obj/item/clothing/mask/gas/clown_hat name = "clown wig and mask" @@ -296,7 +293,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list( resistance_flags = FLAMMABLE actions_types = list(/datum/action/item_action/adjust) dog_fashion = /datum/dog_fashion/head/clown - has_fov = FALSE var/list/clownmask_designs = list() voice_filter = null // performer masks expect to be talked through fishing_modifier = 0 @@ -341,7 +337,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list( righthand_file = 'icons/mob/inhands/clothing/hats_righthand.dmi' flags_cover = MASKCOVERSEYES resistance_flags = FLAMMABLE - has_fov = FALSE fishing_modifier = 0 /obj/item/clothing/mask/gas/mime @@ -355,7 +350,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list( resistance_flags = FLAMMABLE actions_types = list(/datum/action/item_action/adjust) species_exception = list(/datum/species/golem) - has_fov = FALSE fishing_modifier = 0 var/list/mimemask_designs = list() @@ -414,7 +408,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list( inhand_icon_state = "owl_mask" flags_cover = MASKCOVERSEYES resistance_flags = FLAMMABLE - has_fov = FALSE fishing_modifier = 0 /obj/item/clothing/mask/gas/sexymime @@ -426,7 +419,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list( flags_cover = MASKCOVERSEYES resistance_flags = FLAMMABLE species_exception = list(/datum/species/golem) - has_fov = FALSE fishing_modifier = 0 /obj/item/clothing/mask/gas/cyborg @@ -434,7 +426,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list( desc = "Beep boop." icon_state = "death" resistance_flags = FLAMMABLE - has_fov = FALSE flags_cover = MASKCOVERSEYES fishing_modifier = 0 @@ -446,7 +437,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list( clothing_flags = MASKINTERNALS flags_cover = MASKCOVERSEYES resistance_flags = FLAMMABLE - has_fov = FALSE fishing_modifier = -1 /obj/item/clothing/mask/gas/carp @@ -454,7 +444,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list( desc = "Gnash gnash." icon_state = "carp_mask" inhand_icon_state = null - has_fov = FALSE flags_cover = MASKCOVERSEYES fishing_modifier = -3 @@ -465,7 +454,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list( inhand_icon_state = null custom_materials = list(/datum/material/wood = SHEET_MATERIAL_AMOUNT * 1.25) resistance_flags = FLAMMABLE - has_fov = FALSE flags_cover = MASKCOVERSEYES max_integrity = 100 actions_types = list(/datum/action/item_action/adjust) @@ -512,7 +500,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list( inhand_icon_state = "gas_atmos" resistance_flags = FIRE_PROOF | ACID_PROOF flags_inv = HIDEFACIALHAIR|HIDEFACE|HIDEEYES|HIDEEARS|HIDEHAIR|HIDESNOUT - has_fov = FALSE fishing_modifier = -2 /obj/item/clothing/mask/gas/prop @@ -523,7 +510,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list( clothing_flags = NONE flags_cover = MASKCOVERSMOUTH resistance_flags = FLAMMABLE - has_fov = FALSE fishing_modifier = 0 /obj/item/clothing/mask/gas/atmosprop @@ -535,7 +521,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list( clothing_flags = NONE flags_cover = MASKCOVERSMOUTH resistance_flags = FLAMMABLE - has_fov = FALSE fishing_modifier = 0 /obj/item/clothing/mask/gas/driscoll diff --git a/code/modules/clothing/masks/hailer.dm b/code/modules/clothing/masks/hailer.dm index aee1ac17b1b..182bc3ace76 100644 --- a/code/modules/clothing/masks/hailer.dm +++ b/code/modules/clothing/masks/hailer.dm @@ -56,7 +56,6 @@ GLOBAL_LIST_INIT(hailer_phrases, list( flags_cover = MASKCOVERSMOUTH visor_flags_cover = MASKCOVERSMOUTH tint = 0 - has_fov = FALSE fishing_modifier = 0 unique_death = 'sound/items/sec_hailer/sec_death.ogg' COOLDOWN_DECLARE(hailer_cooldown) @@ -88,6 +87,7 @@ GLOBAL_LIST_INIT(hailer_phrases, list( flags_cover = MASKCOVERSMOUTH | MASKCOVERSEYES | PEPPERPROOF visor_flags_cover = MASKCOVERSMOUTH | MASKCOVERSEYES | PEPPERPROOF fishing_modifier = 2 + pepper_tint = FALSE /obj/item/clothing/mask/gas/sechailer/swat/spacepol name = "spacepol mask" diff --git a/code/modules/mining/equipment/explorer_gear.dm b/code/modules/mining/equipment/explorer_gear.dm index cc8cba654dd..c2dffd37ee5 100644 --- a/code/modules/mining/equipment/explorer_gear.dm +++ b/code/modules/mining/equipment/explorer_gear.dm @@ -61,7 +61,6 @@ actions_types = list(/datum/action/item_action/adjust) armor_type = /datum/armor/gas_explorer resistance_flags = FIRE_PROOF - has_fov = FALSE /datum/armor/gas_explorer melee = 10 diff --git a/tgstation.dme b/tgstation.dme index a3c311ab535..5cde02a39cf 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1195,6 +1195,7 @@ #include "code\datums\components\chuunibyou.dm" #include "code\datums\components\cleaner.dm" #include "code\datums\components\clickbox.dm" +#include "code\datums\components\clothing_dirt.dm" #include "code\datums\components\clothing_fov_visor.dm" #include "code\datums\components\codeword_hearing.dm" #include "code\datums\components\combo_attacks.dm"