Skip to content

Commit

Permalink
Adds the ability to jam cigarettes into the filter slot of a gas mask (
Browse files Browse the repository at this point in the history
…tgstation#76881)

This PR makes it so that when a gas mask of any type (normal, explorer,
mime, etc) has isn't holding any filters, and isn't covering the mouth,
you can jam a cigarette in there and smoke it like normal. Cigs placed
in a mask can be lit by using the lighting implement on the mask as you
would a normal cig. The gas mask can't be adjusted while holding a cig
(if the gas mask can be adjusted at all). Whether or not internals can
be used depends on the mask and its adjusted state.

![image](https://github.com/tgstation/tgstation/assets/42454181/a1d00139-eef3-479a-b8f2-b12b531f6833)
A mime enjoying their favourite robusto cigars
First off, I just find the idea of replacing an air filter in a gas
mask, something meant to protect you from harmful gasses and fumes, with
a cancer-inducing burning stick of chemicals, to be really funny.

Secondly, and the reason that was the initial inspiration for this PR,
is it allows mimes and clowns to smoke without removing their masks.
This opens the door for mimes and clowns to use smoking as part of their
character gimmick, without losing a pretty big part of their identity.
:cl:
add: Cigarettes can now be placed in and smoked through gas masks, so
long as the mask has no filters installed and is not covering the mouth.
/:cl:

---------

Co-authored-by: san7890 <the@san7890.com>
  • Loading branch information
2 people authored and Absolucy committed Mar 1, 2024
1 parent 90f7617 commit 294cc4d
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 7 deletions.
17 changes: 14 additions & 3 deletions code/game/objects/items/cigs_lighters.dm
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,20 @@ CIGARETTE PACKETS ARE IN FANCY.DM
return
var/to_smoke = smoke_all ? (reagents.total_volume * (dragtime / smoketime)) : REAGENTS_METABOLISM
var/mob/living/carbon/smoker = loc
if(!istype(smoker) || src != smoker.wear_mask)
reagents.remove_any(to_smoke)
return
// These checks are a bit messy but at least they're fairly readable
// Check if the smoker is a carbon mob, since it needs to have wear_mask
if(!istype(smoker))
// If not, check if it's a gas mask
if(!istype(smoker, /obj/item/clothing/mask/gas))
reagents.remove_any(to_smoke)
return

smoker = smoker.loc

// If it is, check if that mask is on a carbon mob
if(!istype(smoker) || smoker.get_item_by_slot(ITEM_SLOT_MASK) != loc)
reagents.remove_any(to_smoke)
return

reagents.expose(smoker, INGEST, min(to_smoke / reagents.total_volume, 1))
var/obj/item/organ/internal/lungs/lungs = smoker.get_organ_slot(ORGAN_SLOT_LUNGS)
Expand Down
71 changes: 67 additions & 4 deletions code/modules/clothing/masks/gasmask.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,17 @@ GLOBAL_LIST_INIT(clown_mask_options, list(
var/starting_filter_type = /obj/item/gas_filter
///Does the mask have an FOV?
var/has_fov = FALSE
///Cigarette in the mask
var/obj/item/clothing/mask/cigarette/cig

/datum/armor/mask_gas
bio = 100

/obj/item/clothing/mask/gas/worn_overlays(mutable_appearance/standing, isinhands)
. = ..()
if(!isinhands && cig)
. += cig.build_worn_icon(default_layer = FACEMASK_LAYER, default_icon_file = 'icons/mob/clothing/mask.dmi')

/obj/item/clothing/mask/gas/Initialize(mapload)
. = ..()
init_fov()
Expand All @@ -46,15 +53,64 @@ GLOBAL_LIST_INIT(clown_mask_options, list(
QDEL_LAZYLIST(gas_filters)
return..()

/obj/item/clothing/mask/gas/equipped(mob/equipee, slot)
cig?.equipped(equipee, slot)
return ..()

/obj/item/clothing/mask/gas/adjustmask(mob/living/carbon/user)
if(isnull(cig))
return ..()
balloon_alert(user, "there's a cig in the way!")


/obj/item/clothing/mask/gas/examine(mob/user)
. = ..()
if(max_filters > 0)
. += "<span class='notice'>[src] has [max_filters] slot\s for filters.</span>"
if(cig)
. += span_notice("There is a [cig.name] jammed into the filter slot.")
if(max_filters > 0 && !cig)
. += span_notice("[src] has [max_filters] slot\s for filters.")
if(LAZYLEN(gas_filters) > 0)
. += "<span class='notice'>Currently there [LAZYLEN(gas_filters) == 1 ? "is" : "are"] [LAZYLEN(gas_filters)] filter\s with [get_filter_durability()]% durability.</span>"
. += "<span class='notice'>The filters can be removed by right-clicking with an empty hand on [src].</span>"
. += span_notice("Currently there [LAZYLEN(gas_filters) == 1 ? "is" : "are"] [LAZYLEN(gas_filters)] filter\s with [get_filter_durability()]% durability.")
. += span_notice("The filters can be removed by right-clicking with an empty hand on [src].")

/obj/item/clothing/mask/gas/Exited(atom/movable/gone)
. = ..()
if(gone == cig)
cig = null
if(ismob(loc))
var/mob/wearer = loc
wearer.update_worn_mask()

/obj/item/clothing/mask/gas/attackby(obj/item/tool, mob/user)
var/valid_wearer = ismob(loc)
var/mob/wearer = loc
if(istype(tool, /obj/item/clothing/mask/cigarette))
if(flags_cover & MASKCOVERSMOUTH)
balloon_alert(user, "mask's mouth is covered!")
return ..()

if(max_filters <= 0 || cig)
balloon_alert(user, "can't hold that!")
return ..()

if(has_filter)
balloon_alert(user, "filters in the mask!")
return ..()

cig = tool
if(valid_wearer)
cig.equipped(loc, wearer.get_slot_by_item(cig))

cig.forceMove(src)
if(valid_wearer)
wearer.update_worn_mask()
return TRUE

if(cig)
var/cig_attackby = cig.attackby(tool, user)
if(valid_wearer)
wearer.update_worn_mask()
return cig_attackby
if(!istype(tool, /obj/item/gas_filter))
return ..()
if(LAZYLEN(gas_filters) >= max_filters)
Expand All @@ -66,6 +122,13 @@ GLOBAL_LIST_INIT(clown_mask_options, list(
return TRUE

/obj/item/clothing/mask/gas/attack_hand_secondary(mob/user, list/modifiers)
if(cig)
user.put_in_hands(cig)
cig = null
if(ismob(loc))
var/mob/wearer = loc
wearer.update_worn_mask()
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
if(!has_filter || !max_filters)
return SECONDARY_ATTACK_CONTINUE_CHAIN
for(var/i in 1 to max_filters)
Expand Down

0 comments on commit 294cc4d

Please sign in to comment.