mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 02:09:41 +00:00
Allows liquidfoods to be eaten through protective gear
This commit is contained in:
@@ -38,6 +38,7 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
|
||||
#define NOSLIP (1<<2) // Prevents from slipping on wet floors, in space, etc.
|
||||
#define BLOCK_GAS_SMOKE_EFFECT (1<<3) // Blocks the effect that chemical clouds would have on a mob -- glasses, mask and helmets ONLY! (NOTE: flag shared with ONESIZEFITSALL)
|
||||
#define FLEXIBLEMATERIAL (1<<4) // At the moment, masks with this flag will not prevent eating even if they are covering your face.
|
||||
#define ALLOW_SURVIVALFOOD (1<<5) // Allows special survival food items to be eaten through it
|
||||
|
||||
// Flags for pass_flags. - Used in /atom/var/pass_flags
|
||||
#define PASSTABLE (1<<0)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<<<<<<< HEAD
|
||||
/obj/item/clothing/mask/gas
|
||||
name = "gas mask"
|
||||
desc = "A face-covering mask that can be connected to an air supply. Filters harmful gases from the air."
|
||||
@@ -162,3 +163,168 @@
|
||||
desc = "Twoooo!"
|
||||
icon_state = "owl"
|
||||
body_parts_covered = HEAD|FACE|EYES
|
||||
=======
|
||||
/obj/item/clothing/mask/gas
|
||||
name = "gas mask"
|
||||
desc = "A face-covering mask that can be connected to an air supply. Filters harmful gases from the air."
|
||||
icon_state = "gas_alt"
|
||||
item_flags = BLOCK_GAS_SMOKE_EFFECT | AIRTIGHT | ALLOW_SURVIVALFOOD
|
||||
flags_inv = HIDEEARS|HIDEEYES|HIDEFACE
|
||||
body_parts_covered = FACE|EYES
|
||||
w_class = ITEMSIZE_NORMAL
|
||||
item_state_slots = list(slot_r_hand_str = "gas_alt", slot_l_hand_str = "gas_alt")
|
||||
gas_transfer_coefficient = 0.01
|
||||
permeability_coefficient = 0.01
|
||||
siemens_coefficient = 0.9
|
||||
var/gas_filter_strength = 1 //For gas mask filters
|
||||
var/list/filtered_gases = list("phoron", "sleeping_agent")
|
||||
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 75, rad = 0)
|
||||
|
||||
/obj/item/clothing/mask/gas/filter_air(datum/gas_mixture/air)
|
||||
var/datum/gas_mixture/gas_filtered = new
|
||||
|
||||
for(var/g in filtered_gases)
|
||||
if(air.gas[g])
|
||||
gas_filtered.gas[g] = air.gas[g] * gas_filter_strength
|
||||
air.gas[g] -= gas_filtered.gas[g]
|
||||
|
||||
air.update_values()
|
||||
gas_filtered.update_values()
|
||||
|
||||
return gas_filtered
|
||||
|
||||
/obj/item/clothing/mask/gas/clear
|
||||
name = "gas mask"
|
||||
desc = "A face-covering mask with a transparent faceplate that can be connected to an air supply."
|
||||
icon_state = "gas_clear"
|
||||
flags_inv = null
|
||||
|
||||
/obj/item/clothing/mask/gas/half
|
||||
name = "face mask"
|
||||
desc = "A compact, durable gas mask that can be connected to an air supply."
|
||||
icon_state = "halfgas"
|
||||
siemens_coefficient = 0.7
|
||||
body_parts_covered = FACE
|
||||
w_class = ITEMSIZE_SMALL
|
||||
armor = list(melee = 10, bullet = 10, laser = 10, energy = 0, bomb = 0, bio = 55, rad = 0)
|
||||
|
||||
//Plague Dr suit can be found in clothing/suits/bio.dm
|
||||
/obj/item/clothing/mask/gas/plaguedoctor
|
||||
name = "plague doctor mask"
|
||||
desc = "A modernised version of the classic design, this mask will not only filter out phoron but it can also be connected to an air supply."
|
||||
icon_state = "plaguedoctor"
|
||||
item_state_slots = list(slot_r_hand_str = "gas", slot_l_hand_str = "gas")
|
||||
armor = list(melee = 0, bullet = 0, laser = 2,energy = 2, bomb = 0, bio = 90, rad = 0)
|
||||
body_parts_covered = HEAD|FACE|EYES
|
||||
|
||||
/obj/item/clothing/mask/gas/swat
|
||||
name = "\improper SWAT mask"
|
||||
desc = "A close-fitting tactical mask that can be connected to an air supply."
|
||||
icon_state = "swat"
|
||||
siemens_coefficient = 0.7
|
||||
body_parts_covered = FACE|EYES
|
||||
|
||||
// Vox mask, has special code for eating
|
||||
/obj/item/clothing/mask/gas/swat/vox
|
||||
name = "\improper alien mask"
|
||||
desc = "Clearly not designed for a human face."
|
||||
flags = PHORONGUARD
|
||||
item_flags = BLOCK_GAS_SMOKE_EFFECT | AIRTIGHT
|
||||
species_restricted = list(SPECIES_VOX)
|
||||
filtered_gases = list("oxygen", "sleeping_agent")
|
||||
var/mask_open = FALSE // Controls if the Vox can eat through this mask
|
||||
action_button_name = "Toggle Feeding Port"
|
||||
|
||||
/obj/item/clothing/mask/gas/swat/vox/proc/feeding_port(mob/user)
|
||||
if(user.canmove && !user.stat)
|
||||
mask_open = !mask_open
|
||||
if(mask_open)
|
||||
body_parts_covered = EYES
|
||||
to_chat(user, "Your mask moves to allow you to eat.")
|
||||
else
|
||||
body_parts_covered = FACE|EYES
|
||||
to_chat(user, "Your mask moves to cover your mouth.")
|
||||
return
|
||||
|
||||
/obj/item/clothing/mask/gas/swat/vox/attack_self(mob/user)
|
||||
feeding_port(user)
|
||||
..()
|
||||
|
||||
/obj/item/clothing/mask/gas/zaddat
|
||||
name = "Zaddat Veil"
|
||||
desc = "A clear survival mask used by the Zaddat to filter out harmful nitrogen. Can be connected to an air supply and reconfigured to allow for safe eating."
|
||||
icon_state = "zaddat_mask"
|
||||
item_state = "vax_mask"
|
||||
//body_parts_covered = 0
|
||||
species_restricted = list(SPECIES_ZADDAT)
|
||||
flags_inv = HIDEEARS //semi-transparent
|
||||
filtered_gases = list("phoron", "nitrogen", "sleeping_agent")
|
||||
|
||||
/obj/item/clothing/mask/gas/syndicate
|
||||
name = "tactical mask"
|
||||
desc = "A close-fitting tactical mask that can be connected to an air supply."
|
||||
icon_state = "swat"
|
||||
siemens_coefficient = 0.7
|
||||
|
||||
/obj/item/clothing/mask/gas/explorer
|
||||
name = "explorer gas mask"
|
||||
desc = "A military-grade gas mask that can be connected to an air supply."
|
||||
icon_state = "explorer"
|
||||
item_state_slots = list(slot_r_hand_str = "gas", slot_l_hand_str = "gas")
|
||||
armor = list(melee = 10, bullet = 5, laser = 5,energy = 5, bomb = 0, bio = 50, rad = 0)
|
||||
siemens_coefficient = 0.9
|
||||
|
||||
/obj/item/clothing/mask/gas/clown_hat
|
||||
name = "clown wig and mask"
|
||||
desc = "A true prankster's facial attire. A clown is incomplete without their wig and mask."
|
||||
icon_state = "clown"
|
||||
item_state_slots = list(slot_r_hand_str = "clown_hat", slot_l_hand_str = "clown_hat")
|
||||
|
||||
/obj/item/clothing/mask/gas/sexyclown
|
||||
name = "sexy-clown wig and mask"
|
||||
desc = "A feminine clown mask for the dabbling crossdressers or female entertainers."
|
||||
icon_state = "sexyclown"
|
||||
item_state_slots = list(slot_r_hand_str = "clown_hat", slot_l_hand_str = "clown_hat")
|
||||
|
||||
/obj/item/clothing/mask/gas/mime
|
||||
name = "mime mask"
|
||||
desc = "The traditional mime's mask. It has an eerie facial posture."
|
||||
icon_state = "mime"
|
||||
item_state_slots = list(slot_r_hand_str = "mime", slot_l_hand_str = "mime")
|
||||
|
||||
/obj/item/clothing/mask/gas/monkeymask
|
||||
name = "monkey mask"
|
||||
desc = "A mask used when acting as a monkey."
|
||||
icon_state = "monkeymask"
|
||||
body_parts_covered = HEAD|FACE|EYES
|
||||
|
||||
/obj/item/clothing/mask/gas/sexymime
|
||||
name = "sexy mime mask"
|
||||
desc = "A traditional female mime's mask."
|
||||
icon_state = "sexymime"
|
||||
item_state_slots = list(slot_r_hand_str = "mime", slot_l_hand_str = "mime")
|
||||
|
||||
/obj/item/clothing/mask/gas/guy
|
||||
name = "guy fawkes mask"
|
||||
desc = "A mask stylised to depict Guy Fawkes."
|
||||
icon_state = "guyfawkes"
|
||||
flags_inv = HIDEEARS|HIDEFACE
|
||||
item_state_slots = list(slot_r_hand_str = "mime", slot_l_hand_str = "mime")
|
||||
|
||||
/obj/item/clothing/mask/gas/commando
|
||||
name = "commando mask"
|
||||
icon_state = "fullgas"
|
||||
item_state_slots = list(slot_r_hand_str = "swat", slot_l_hand_str = "swat")
|
||||
siemens_coefficient = 0.2
|
||||
|
||||
/obj/item/clothing/mask/gas/cyborg
|
||||
name = "cyborg visor"
|
||||
desc = "Beep boop"
|
||||
icon_state = "death"
|
||||
|
||||
/obj/item/clothing/mask/gas/owl_mask
|
||||
name = "owl mask"
|
||||
desc = "Twoooo!"
|
||||
icon_state = "owl"
|
||||
body_parts_covered = HEAD|FACE|EYES
|
||||
>>>>>>> 8d3a72a... Merge pull request #6129 from Heroman3003/mask-helmet-eating
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/obj/item/clothing/head/helmet/space/rig
|
||||
name = "helmet"
|
||||
item_flags = THICKMATERIAL
|
||||
item_flags = THICKMATERIAL|ALLOW_SURVIVALFOOD
|
||||
flags_inv = HIDEEARS|HIDEEYES|HIDEFACE|BLOCKHAIR
|
||||
body_parts_covered = HEAD|FACE|EYES
|
||||
heat_protection = HEAD|FACE|EYES
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
icon_state = "space"
|
||||
desc = "A special helmet designed for work in a hazardous, low-pressure environment."
|
||||
flags = PHORONGUARD
|
||||
item_flags = THICKMATERIAL | AIRTIGHT
|
||||
item_flags = THICKMATERIAL | AIRTIGHT | ALLOW_SURVIVALFOOD
|
||||
permeability_coefficient = 0.01
|
||||
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 100, rad = 50)
|
||||
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|BLOCKHAIR
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
body_parts_covered = HEAD|FACE|EYES
|
||||
siemens_coefficient = 0.9
|
||||
flags = PHORONGUARD
|
||||
item_flags = THICKMATERIAL
|
||||
item_flags = THICKMATERIAL | ALLOW_SURVIVALFOOD
|
||||
|
||||
/obj/item/clothing/suit/bio_suit
|
||||
name = "bio suit"
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
var/slices_num
|
||||
var/dried_type = null
|
||||
var/dry = 0
|
||||
var/survivalfood = FALSE
|
||||
var/nutriment_amt = 0
|
||||
var/list/nutriment_desc = list("food" = 1)
|
||||
center_of_mass = list("x"=16, "y"=16)
|
||||
@@ -49,7 +50,7 @@
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/attack(mob/M as mob, mob/user as mob, def_zone)
|
||||
if(reagents && !reagents.total_volume)
|
||||
user << "<span class='danger'>None of [src] left!</span>"
|
||||
to_chat(user, "<span class='danger'>None of [src] left!</span>")
|
||||
user.drop_from_inventory(src)
|
||||
qdel(src)
|
||||
return 0
|
||||
@@ -62,22 +63,27 @@
|
||||
if(istype(M,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(!H.check_has_mouth())
|
||||
user << "Where do you intend to put \the [src]? You don't have a mouth!"
|
||||
to_chat(user, "Where do you intend to put \the [src]? You don't have a mouth!")
|
||||
return
|
||||
var/obj/item/blocked = H.check_mouth_coverage()
|
||||
var/obj/item/blocked = null
|
||||
if(survivalfood)
|
||||
blocked = H.check_mouth_coverage_survival()
|
||||
else
|
||||
blocked = H.check_mouth_coverage()
|
||||
if(blocked)
|
||||
user << "<span class='warning'>\The [blocked] is in the way!</span>"
|
||||
to_chat(user, "<span class='warning'>\The [blocked] is in the way!</span>")
|
||||
return
|
||||
|
||||
user.setClickCooldown(user.get_attack_speed(src)) //puts a limit on how fast people can eat/drink things
|
||||
//VOREStation Edit Begin
|
||||
if (fullness <= 50)
|
||||
M << "<span class='danger'>You hungrily chew out a piece of [src] and gobble it!</span>"
|
||||
to_chat(M, "<span class='danger'>You hungrily chew out a piece of [src] and gobble it!</span>")
|
||||
if (fullness > 50 && fullness <= 150)
|
||||
M << "<span class='notice'>You hungrily begin to eat [src].</span>"
|
||||
to_chat(M, "<span class='notice'>You hungrily begin to eat [src].</span>")
|
||||
if (fullness > 150 && fullness <= 350)
|
||||
M << "<span class='notice'>You take a bite of [src].</span>"
|
||||
to_chat(M, "<span class='notice'>You take a bite of [src].</span>")
|
||||
if (fullness > 350 && fullness <= 550)
|
||||
<<<<<<< HEAD
|
||||
M << "<span class='notice'>You unwillingly chew a bit of [src].</span>"
|
||||
if (fullness > 550 && fullness <= 650)
|
||||
M << "<span class='notice'>You swallow some more of the [src], causing your belly to swell out a little.</span>"
|
||||
@@ -91,6 +97,11 @@
|
||||
M << "<span class='danger'>You barely glug down the bite of [src], causing undigested food to force into your intestines. You can't take much more of this!</span>"
|
||||
if (fullness > 6000) // There has to be a limit eventually.
|
||||
M << "<span class='danger'>Your stomach blorts and aches, prompting you to stop. You literally cannot force any more of [src] to go down your throat.</span>"
|
||||
=======
|
||||
to_chat(M, "<span class='notice'>You unwillingly chew a bit of [src].</span>")
|
||||
if (fullness > (550 * (1 + M.overeatduration / 2000))) // The more you eat - the more you can eat
|
||||
to_chat(M, "<span class='danger'>You cannot force any more of [src] to go down your throat.</span>")
|
||||
>>>>>>> 8d3a72a... Merge pull request #6129 from Heroman3003/mask-helmet-eating
|
||||
return 0
|
||||
/*if (fullness > (550 * (1 + M.overeatduration / 2000))) // The more you eat - the more you can eat
|
||||
M << "<span class='danger'>You cannot force any more of [src] to go down your throat.</span>"
|
||||
@@ -104,11 +115,23 @@
|
||||
if(istype(M,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(!H.check_has_mouth())
|
||||
user << "Where do you intend to put \the [src]? \The [H] doesn't have a mouth!"
|
||||
to_chat(user, "Where do you intend to put \the [src]? \The [H] doesn't have a mouth!")
|
||||
return
|
||||
var/obj/item/blocked = H.check_mouth_coverage()
|
||||
var/obj/item/blocked = null
|
||||
var/unconcious = FALSE
|
||||
blocked = H.check_mouth_coverage()
|
||||
if(survivalfood)
|
||||
blocked = H.check_mouth_coverage_survival()
|
||||
if(H.stat && H.check_mouth_coverage())
|
||||
unconcious = TRUE
|
||||
blocked = H.check_mouth_coverage()
|
||||
|
||||
if(unconcious)
|
||||
to_chat(user, "<span class='warning'>You can't feed [H] through \the [blocked] while they are unconcious!</span>")
|
||||
return
|
||||
|
||||
if(blocked)
|
||||
user << "<span class='warning'>\The [blocked] is in the way!</span>"
|
||||
to_chat(user, "<span class='warning'>\The [blocked] is in the way!</span>")
|
||||
return
|
||||
|
||||
/*if (fullness <= (550 * (1 + M.overeatduration / 1000))) // Vorestation edit
|
||||
@@ -127,7 +150,7 @@
|
||||
user.visible_message("<span class='danger'>[user] feeds [M] [src].</span>")
|
||||
|
||||
else
|
||||
user << "This creature does not seem to have a mouth!"
|
||||
to_chat(user, "This creature does not seem to have a mouth!")
|
||||
return
|
||||
|
||||
if(reagents) //Handle ingestion of the reagent.
|
||||
@@ -149,11 +172,11 @@
|
||||
if (bitecount==0)
|
||||
return
|
||||
else if (bitecount==1)
|
||||
user << "<font color='blue'>\The [src] was bitten by someone!</font>"
|
||||
to_chat(user, "<font color='blue'>\The [src] was bitten by someone!</font>")
|
||||
else if (bitecount<=3)
|
||||
user << "<font color='blue'>\The [src] was bitten [bitecount] times!</font>"
|
||||
to_chat(user, "<font color='blue'>\The [src] was bitten [bitecount] times!</font>")
|
||||
else
|
||||
user << "<font color='blue'>\The [src] was bitten multiple times!</font>"
|
||||
to_chat(user, "<font color='blue'>\The [src] was bitten multiple times!</font>")
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/weapon/storage))
|
||||
@@ -168,7 +191,7 @@
|
||||
U.create_reagents(5)
|
||||
|
||||
if (U.reagents.total_volume > 0)
|
||||
user << "<font color='red'>You already have something on your [U].</font>"
|
||||
to_chat(user, "<font color='red'>You already have something on your [U].</font>")
|
||||
return
|
||||
|
||||
user.visible_message( \
|
||||
@@ -3568,6 +3591,7 @@
|
||||
icon_state = "liquidfood"
|
||||
trash = /obj/item/trash/liquidfood
|
||||
filling_color = "#A8A8A8"
|
||||
survivalfood = TRUE
|
||||
center_of_mass = list("x"=16, "y"=15)
|
||||
nutriment_amt = 20
|
||||
nutriment_desc = list("chalk" = 6)
|
||||
|
||||
@@ -201,6 +201,14 @@ emp_act
|
||||
return gear
|
||||
return null
|
||||
|
||||
/mob/living/carbon/human/proc/check_mouth_coverage_survival()
|
||||
var/obj/item/organ/external/H = organs_by_name[BP_HEAD]
|
||||
var/list/protective_gear = H.get_covering_clothing(FACE)
|
||||
for(var/obj/item/gear in protective_gear)
|
||||
if(istype(gear) && (gear.body_parts_covered & FACE) && !(gear.item_flags & FLEXIBLEMATERIAL) && !(gear.item_flags & ALLOW_SURVIVALFOOD))
|
||||
return gear
|
||||
return null
|
||||
|
||||
/mob/living/carbon/human/proc/check_shields(var/damage = 0, var/atom/damage_source = null, var/mob/attacker = null, var/def_zone = null, var/attack_text = "the attack")
|
||||
for(var/obj/item/shield in list(l_hand, r_hand, wear_suit))
|
||||
if(!shield) continue
|
||||
|
||||
Reference in New Issue
Block a user