Snacks, drinks, and pills now check mouth coverage

Mouth coverage is defined somewhat conservatively so that breath masks
and the like do not prevent eating. In general only things that
completely cover your face or head like gasmasks and space suit helmets
block eating and drinking, or forcing the same on someone.
This commit is contained in:
mwerezak
2015-05-11 22:17:24 -04:00
parent 6669e9631e
commit b1bfbf346d
4 changed files with 42 additions and 3 deletions
@@ -138,6 +138,14 @@ emp_act
return 1
return 0
//Used to check if they can be fed food/drinks/pills
/mob/living/carbon/human/proc/check_mouth_coverage()
var/list/protective_gear = list(head, wear_mask, wear_suit, w_uniform)
for(var/obj/item/gear in protective_gear)
if(istype(gear) && (gear.body_parts_covered & FACE) && (gear.flags & (MASKCOVERSMOUTH|HEADCOVERSMOUTH)))
return gear
return null
/mob/living/carbon/human/proc/check_shields(var/damage = 0, var/attack_text = "the attack")
if(l_hand && istype(l_hand, /obj/item/weapon))//Current base is the prob(50-d/3)
var/obj/item/weapon/I = l_hand
@@ -33,6 +33,11 @@
if(H.species.flags & IS_SYNTHETIC)
H << "\red You have a monitor for a head, where do you think you're going to put that?"
return
var/obj/item/blocked = H.check_mouth_coverage()
if(blocked)
user << "<span class='warning'>\The [blocked] is in the way!</span>"
return
M << "\blue You swallow a gulp from \the [src]."
if(reagents.total_volume)
@@ -44,7 +49,12 @@
var/mob/living/carbon/human/H = M
if(H.species.flags & IS_SYNTHETIC)
H << "\red They have a monitor for a head, where do you think you're going to put that?"
user << "\red They have a monitor for a head, where do you think you're going to put that?"
return
var/obj/item/blocked = H.check_mouth_coverage()
if(blocked)
user << "<span class='warning'>\The [blocked] is in the way!</span>"
return
for(var/mob/O in viewers(world.view, user))
@@ -49,6 +49,12 @@
if(H.species.flags & IS_SYNTHETIC)
H << "\red You have a monitor for a head, where do you think you're going to put that?"
return
var/obj/item/blocked = H.check_mouth_coverage()
if(blocked)
user << "<span class='warning'>\The [blocked] is in the way!</span>"
return
if (fullness <= 50)
M << "\red You hungrily chew out a piece of [src] and gobble it!"
if (fullness > 50 && fullness <= 150)
@@ -64,7 +70,12 @@
if(istype(M,/mob/living/carbon/human))
var/mob/living/carbon/human/H = M
if(H.species.flags & IS_SYNTHETIC)
H << "\red They have a monitor for a head, where do you think you're going to put that?"
user << "\red They have a monitor for a head, where do you think you're going to put that?"
return
var/obj/item/blocked = H.check_mouth_coverage()
if(blocked)
user << "<span class='warning'>\The [blocked] is in the way!</span>"
return
if(!istype(M, /mob/living/carbon/slime)) //If you're feeding it to someone else.
@@ -26,6 +26,11 @@
if(H.species.flags & IS_SYNTHETIC)
H << "\red You have a monitor for a head, where do you think you're going to put that?"
return
var/obj/item/blocked = H.check_mouth_coverage()
if(blocked)
user << "<span class='warning'>\The [blocked] is in the way!</span>"
return
M << "\blue You swallow [src]."
M.drop_from_inventory(src) //icon update
@@ -40,7 +45,12 @@
var/mob/living/carbon/human/H = M
if(H.species.flags & IS_SYNTHETIC)
H << "\red They have a monitor for a head, where do you think you're going to put that?"
user << "\red They have a monitor for a head, where do you think you're going to put that?"
return
var/obj/item/blocked = H.check_mouth_coverage()
if(blocked)
user << "<span class='warning'>\The [blocked] is in the way!</span>"
return
for(var/mob/O in viewers(world.view, user))