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
This commit is contained in:
Striders13
2024-10-12 22:26:59 +05:30
committed by lessthanthree
parent 6421ada164
commit 63fb8db403
6 changed files with 98 additions and 24 deletions

View File

@@ -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()

View File

@@ -15,7 +15,8 @@
resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF
flags_inv = HIDEFACIALHAIR | HIDEFACE | HIDESNOUT flags_inv = HIDEFACIALHAIR | HIDEFACE | HIDESNOUT
flags_cover = MASKCOVERSMOUTH | PEPPERPROOF flags_cover = MASKCOVERSMOUTH | PEPPERPROOF
has_fov = FALSE pepper_tint = FALSE
/obj/item/clothing/under/syndicate/ninja /obj/item/clothing/under/syndicate/ninja
name = "ninja suit" name = "ninja suit"

View File

@@ -25,12 +25,12 @@ GLOBAL_LIST_INIT(clown_mask_options, list(
var/list/gas_filters var/list/gas_filters
///Type of filter that spawns on roundstart ///Type of filter that spawns on roundstart
var/starting_filter_type = /obj/item/gas_filter var/starting_filter_type = /obj/item/gas_filter
///Does the mask have an FOV?
var/has_fov = TRUE
///Cigarette in the mask ///Cigarette in the mask
var/obj/item/cigarette/cig var/obj/item/cigarette/cig
///How much does this mask affect fishing difficulty ///How much does this mask affect fishing difficulty
var/fishing_modifier = 2 var/fishing_modifier = 2
///Applies clothing_dirt component to the pepperproof mask if true
var/pepper_tint = TRUE
/datum/armor/mask_gas /datum/armor/mask_gas
bio = 100 bio = 100
@@ -39,6 +39,9 @@ GLOBAL_LIST_INIT(clown_mask_options, list(
. = ..() . = ..()
//init_fov() BUBBER EDIT - Dear god //init_fov() BUBBER EDIT - Dear god
if((flags_cover & PEPPERPROOF) && pepper_tint)
AddComponent(/datum/component/clothing_dirt)
if(fishing_modifier) if(fishing_modifier)
AddComponent(/datum/component/adjust_fishing_difficulty, fishing_modifier) AddComponent(/datum/component/adjust_fishing_difficulty, fishing_modifier)
@@ -160,11 +163,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list(
has_filter = FALSE has_filter = FALSE
return filtered_breath 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 * 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" icon_state = "plaguedoctor"
flags_inv = HIDEEARS|HIDEEYES|HIDEFACE|HIDEFACIALHAIR|HIDESNOUT|HIDEHAIR flags_inv = HIDEEARS|HIDEEYES|HIDEFACE|HIDEFACIALHAIR|HIDESNOUT|HIDEHAIR
inhand_icon_state = "gas_mask" inhand_icon_state = "gas_mask"
has_fov = FALSE
clothing_flags = BLOCK_GAS_SMOKE_EFFECT|MASKINTERNALS clothing_flags = BLOCK_GAS_SMOKE_EFFECT|MASKINTERNALS
/obj/item/clothing/mask/gas/syndicate /obj/item/clothing/mask/gas/syndicate
@@ -278,8 +275,8 @@ GLOBAL_LIST_INIT(clown_mask_options, list(
resistance_flags = FIRE_PROOF | ACID_PROOF resistance_flags = FIRE_PROOF | ACID_PROOF
strip_delay = 60 strip_delay = 60
w_class = WEIGHT_CLASS_SMALL w_class = WEIGHT_CLASS_SMALL
has_fov = FALSE
fishing_modifier = 0 fishing_modifier = 0
pepper_tint = FALSE
/obj/item/clothing/mask/gas/clown_hat /obj/item/clothing/mask/gas/clown_hat
name = "clown wig and mask" name = "clown wig and mask"
@@ -296,7 +293,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list(
resistance_flags = FLAMMABLE resistance_flags = FLAMMABLE
actions_types = list(/datum/action/item_action/adjust) actions_types = list(/datum/action/item_action/adjust)
dog_fashion = /datum/dog_fashion/head/clown dog_fashion = /datum/dog_fashion/head/clown
has_fov = FALSE
var/list/clownmask_designs = list() var/list/clownmask_designs = list()
voice_filter = null // performer masks expect to be talked through voice_filter = null // performer masks expect to be talked through
fishing_modifier = 0 fishing_modifier = 0
@@ -341,7 +337,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list(
righthand_file = 'icons/mob/inhands/clothing/hats_righthand.dmi' righthand_file = 'icons/mob/inhands/clothing/hats_righthand.dmi'
flags_cover = MASKCOVERSEYES flags_cover = MASKCOVERSEYES
resistance_flags = FLAMMABLE resistance_flags = FLAMMABLE
has_fov = FALSE
fishing_modifier = 0 fishing_modifier = 0
/obj/item/clothing/mask/gas/mime /obj/item/clothing/mask/gas/mime
@@ -355,7 +350,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list(
resistance_flags = FLAMMABLE resistance_flags = FLAMMABLE
actions_types = list(/datum/action/item_action/adjust) actions_types = list(/datum/action/item_action/adjust)
species_exception = list(/datum/species/golem) species_exception = list(/datum/species/golem)
has_fov = FALSE
fishing_modifier = 0 fishing_modifier = 0
var/list/mimemask_designs = list() var/list/mimemask_designs = list()
@@ -414,7 +408,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list(
inhand_icon_state = "owl_mask" inhand_icon_state = "owl_mask"
flags_cover = MASKCOVERSEYES flags_cover = MASKCOVERSEYES
resistance_flags = FLAMMABLE resistance_flags = FLAMMABLE
has_fov = FALSE
fishing_modifier = 0 fishing_modifier = 0
/obj/item/clothing/mask/gas/sexymime /obj/item/clothing/mask/gas/sexymime
@@ -426,7 +419,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list(
flags_cover = MASKCOVERSEYES flags_cover = MASKCOVERSEYES
resistance_flags = FLAMMABLE resistance_flags = FLAMMABLE
species_exception = list(/datum/species/golem) species_exception = list(/datum/species/golem)
has_fov = FALSE
fishing_modifier = 0 fishing_modifier = 0
/obj/item/clothing/mask/gas/cyborg /obj/item/clothing/mask/gas/cyborg
@@ -434,7 +426,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list(
desc = "Beep boop." desc = "Beep boop."
icon_state = "death" icon_state = "death"
resistance_flags = FLAMMABLE resistance_flags = FLAMMABLE
has_fov = FALSE
flags_cover = MASKCOVERSEYES flags_cover = MASKCOVERSEYES
fishing_modifier = 0 fishing_modifier = 0
@@ -446,7 +437,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list(
clothing_flags = MASKINTERNALS clothing_flags = MASKINTERNALS
flags_cover = MASKCOVERSEYES flags_cover = MASKCOVERSEYES
resistance_flags = FLAMMABLE resistance_flags = FLAMMABLE
has_fov = FALSE
fishing_modifier = -1 fishing_modifier = -1
/obj/item/clothing/mask/gas/carp /obj/item/clothing/mask/gas/carp
@@ -454,7 +444,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list(
desc = "Gnash gnash." desc = "Gnash gnash."
icon_state = "carp_mask" icon_state = "carp_mask"
inhand_icon_state = null inhand_icon_state = null
has_fov = FALSE
flags_cover = MASKCOVERSEYES flags_cover = MASKCOVERSEYES
fishing_modifier = -3 fishing_modifier = -3
@@ -465,7 +454,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list(
inhand_icon_state = null inhand_icon_state = null
custom_materials = list(/datum/material/wood = SHEET_MATERIAL_AMOUNT * 1.25) custom_materials = list(/datum/material/wood = SHEET_MATERIAL_AMOUNT * 1.25)
resistance_flags = FLAMMABLE resistance_flags = FLAMMABLE
has_fov = FALSE
flags_cover = MASKCOVERSEYES flags_cover = MASKCOVERSEYES
max_integrity = 100 max_integrity = 100
actions_types = list(/datum/action/item_action/adjust) actions_types = list(/datum/action/item_action/adjust)
@@ -512,7 +500,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list(
inhand_icon_state = "gas_atmos" inhand_icon_state = "gas_atmos"
resistance_flags = FIRE_PROOF | ACID_PROOF resistance_flags = FIRE_PROOF | ACID_PROOF
flags_inv = HIDEFACIALHAIR|HIDEFACE|HIDEEYES|HIDEEARS|HIDEHAIR|HIDESNOUT flags_inv = HIDEFACIALHAIR|HIDEFACE|HIDEEYES|HIDEEARS|HIDEHAIR|HIDESNOUT
has_fov = FALSE
fishing_modifier = -2 fishing_modifier = -2
/obj/item/clothing/mask/gas/prop /obj/item/clothing/mask/gas/prop
@@ -523,7 +510,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list(
clothing_flags = NONE clothing_flags = NONE
flags_cover = MASKCOVERSMOUTH flags_cover = MASKCOVERSMOUTH
resistance_flags = FLAMMABLE resistance_flags = FLAMMABLE
has_fov = FALSE
fishing_modifier = 0 fishing_modifier = 0
/obj/item/clothing/mask/gas/atmosprop /obj/item/clothing/mask/gas/atmosprop
@@ -535,7 +521,6 @@ GLOBAL_LIST_INIT(clown_mask_options, list(
clothing_flags = NONE clothing_flags = NONE
flags_cover = MASKCOVERSMOUTH flags_cover = MASKCOVERSMOUTH
resistance_flags = FLAMMABLE resistance_flags = FLAMMABLE
has_fov = FALSE
fishing_modifier = 0 fishing_modifier = 0
/obj/item/clothing/mask/gas/driscoll /obj/item/clothing/mask/gas/driscoll

View File

@@ -56,7 +56,6 @@ GLOBAL_LIST_INIT(hailer_phrases, list(
flags_cover = MASKCOVERSMOUTH flags_cover = MASKCOVERSMOUTH
visor_flags_cover = MASKCOVERSMOUTH visor_flags_cover = MASKCOVERSMOUTH
tint = 0 tint = 0
has_fov = FALSE
fishing_modifier = 0 fishing_modifier = 0
unique_death = 'sound/items/sec_hailer/sec_death.ogg' unique_death = 'sound/items/sec_hailer/sec_death.ogg'
COOLDOWN_DECLARE(hailer_cooldown) COOLDOWN_DECLARE(hailer_cooldown)
@@ -88,6 +87,7 @@ GLOBAL_LIST_INIT(hailer_phrases, list(
flags_cover = MASKCOVERSMOUTH | MASKCOVERSEYES | PEPPERPROOF flags_cover = MASKCOVERSMOUTH | MASKCOVERSEYES | PEPPERPROOF
visor_flags_cover = MASKCOVERSMOUTH | MASKCOVERSEYES | PEPPERPROOF visor_flags_cover = MASKCOVERSMOUTH | MASKCOVERSEYES | PEPPERPROOF
fishing_modifier = 2 fishing_modifier = 2
pepper_tint = FALSE
/obj/item/clothing/mask/gas/sechailer/swat/spacepol /obj/item/clothing/mask/gas/sechailer/swat/spacepol
name = "spacepol mask" name = "spacepol mask"

View File

@@ -61,7 +61,6 @@
actions_types = list(/datum/action/item_action/adjust) actions_types = list(/datum/action/item_action/adjust)
armor_type = /datum/armor/gas_explorer armor_type = /datum/armor/gas_explorer
resistance_flags = FIRE_PROOF resistance_flags = FIRE_PROOF
has_fov = FALSE
/datum/armor/gas_explorer /datum/armor/gas_explorer
melee = 10 melee = 10

View File

@@ -1195,6 +1195,7 @@
#include "code\datums\components\chuunibyou.dm" #include "code\datums\components\chuunibyou.dm"
#include "code\datums\components\cleaner.dm" #include "code\datums\components\cleaner.dm"
#include "code\datums\components\clickbox.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\clothing_fov_visor.dm"
#include "code\datums\components\codeword_hearing.dm" #include "code\datums\components\codeword_hearing.dm"
#include "code\datums\components\combo_attacks.dm" #include "code\datums\components\combo_attacks.dm"