From e27fb5d27f3baf5f17a47b06b1bc022f0961f479 Mon Sep 17 00:00:00 2001 From: Tastyfish Date: Tue, 16 Feb 2016 20:10:29 -0500 Subject: [PATCH] Stops utensils from working on mouthless humanoids --- code/game/objects/items/weapons/kitchen.dm | 5 +++++ code/modules/mob/living/carbon/carbon.dm | 3 +++ code/modules/mob/living/carbon/human/human.dm | 3 +++ code/modules/reagents/oldchem/reagents/reagents_food.dm | 6 +++--- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/code/game/objects/items/weapons/kitchen.dm b/code/game/objects/items/weapons/kitchen.dm index 83e488c5959..df741ca2328 100644 --- a/code/game/objects/items/weapons/kitchen.dm +++ b/code/game/objects/items/weapons/kitchen.dm @@ -50,6 +50,11 @@ return ..() if (reagents.total_volume > 0) + // Mouthless people cannot eat + if(!M.can_eat()) + user << "[M] cannot eat with a fork!" + return + if(M == user) M.visible_message("\The [user] eats some [loaded] from \the [src].") reagents.trans_to(M, reagents.total_volume) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index b2cd0136f30..01337b536fc 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -794,3 +794,6 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump, Stun(stun) Weaken(weaken) return 1 + +/mob/living/carbon/proc/can_eat(flags = 255) + return 1 \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 366ec02ae1e..29637dbb2c0 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1858,3 +1858,6 @@ for(var/obj/item/clothing/C in src) //If they have some clothing equipped that lets them see reagents, they can see reagents if(C.scan_reagents) return 1 + +/mob/living/carbon/human/can_eat(flags = 255) + return species && (species.dietflags & flags) diff --git a/code/modules/reagents/oldchem/reagents/reagents_food.dm b/code/modules/reagents/oldchem/reagents/reagents_food.dm index da3244cbda2..70b8929832d 100644 --- a/code/modules/reagents/oldchem/reagents/reagents_food.dm +++ b/code/modules/reagents/oldchem/reagents/reagents_food.dm @@ -14,7 +14,7 @@ if(!(M.mind in ticker.mode.vampires)) if(ishuman(M)) var/mob/living/carbon/human/H = M - if(H.species && H.species.dietflags) //Make sure the species has it's dietflag set, otherwise it can't digest any nutrients + if(H.can_eat()) //Make sure the species has it's dietflag set, otherwise it can't digest any nutrients H.nutrition += nutriment_factor // For hunger and fatness if(prob(50)) M.heal_organ_damage(1,0) if(istype(M,/mob/living/simple_animal)) //Any nutrients can heal simple animals @@ -36,7 +36,7 @@ if(!(M.mind in ticker.mode.vampires)) if(ishuman(M)) var/mob/living/carbon/human/H = M - if(H.species && H.species.dietflags && !(H.species.dietflags & DIET_HERB)) //Make sure the species has it's dietflag set, and that it is not a herbivore + if(H.can_eat(DIET_CARN | DIET_OMNI)) //Make sure that it is not a herbivore H.nutrition += nutriment_factor // For hunger and fatness if(prob(50)) M.heal_organ_damage(1,0) if(istype(M,/mob/living/simple_animal)) //Any nutrients can heal simple animals @@ -58,7 +58,7 @@ if(!(M.mind in ticker.mode.vampires)) if(ishuman(M)) var/mob/living/carbon/human/H = M - if(H.species && H.species.dietflags && !(H.species.dietflags & DIET_CARN)) //Make sure the species has it's dietflag set, and that it is not a carnivore + if(H.can_eat(DIET_HERB | DIET_OMNI)) //Make sure that it is not a carnivore H.nutrition += nutriment_factor // For hunger and fatness if(prob(50)) M.heal_organ_damage(1,0) if(istype(M,/mob/living/simple_animal)) //Any nutrients can heal simple animals