Generalizes the feed and force feed checks.

This commit is contained in:
PsiOmegaDelta
2015-10-23 10:57:55 +02:00
parent 8305404a14
commit d845a2f587
6 changed files with 68 additions and 63 deletions
@@ -1,11 +1,37 @@
/mob/living/carbon/human/proc/can_eat(var/food, var/feedback = 1)
if(!check_has_mouth())
if(feedback)
#define HUMAN_EATING_NO_ISSUE 0
#define HUMAN_EATING_NO_MOUTH 1
#define HUMAN_EATING_BLOCKED_MOUTH 2
/mob/living/carbon/human/can_eat(var/food, var/feedback = 1)
var/status = can_eat_status()
if(status == HUMAN_EATING_NO_ISSUE)
return 1
if(feedback)
if(status == HUMAN_EATING_NO_MOUTH)
src << "Where do you intend to put \the [food]? You don't have a mouth!"
return 0
else if(status == HUMAN_EATING_BLOCKED_MOUTH)
src << "<span class='warning'>\The [blocked] is in the way!</span>"
return 0
/mob/living/carbon/human/can_force_feed(var/feeder, var/food, var/feedback = 1)
var/status = can_eat_status()
if(status == HUMAN_EATING_NO_ISSUE)
return 1
if(feedback)
if(status == HUMAN_EATING_NO_MOUTH)
feeder << "Where do you intend to put \the [food]? \The [src] doesn't have a mouth!"
else if(status == HUMAN_EATING_BLOCKED_MOUTH)
feeder << "<span class='warning'>\The [blocked] is in the way!</span>"
return 0
/mob/living/carbon/human/proc/can_eat_status()
if(!check_has_mouth())
return HUMAN_EATING_NO_MOUTH
var/obj/item/blocked = check_mouth_coverage()
if(blocked)
if(feedback)
src << "<span class='warning'>\The [blocked] is in the way!</span>"
return 0
return 1
return HUMAN_EATING_BLOCKED_MOUTH
return HUMAN_EATING_NO_ISSUE
#undef HUMAN_EATING_NO_ISSUE
#undef HUMAN_EATING_NO_MOUTH
#undef HUMAN_EATING_BLOCKED_MOUTH
@@ -14,6 +14,11 @@
emote_see = list("jiggles", "bounces in place")
var/colour = "grey"
/mob/living/simple_animal/slime/can_force_feed(var/feeder, var/food, var/feedback)
if(feedback)
feeder << "Where do you intend to put \the [food]? \The [src] doesn't have a mouth!"
return 0
/mob/living/simple_animal/adultslime
name = "pet slime"
desc = "A lovable, domesticated slime."
+7 -1
View File
@@ -619,6 +619,12 @@ proc/is_blind(A)
/mob/proc/is_client_active(var/active = 1)
return client && client.inactivity < active MINUTES
/mob/proc/can_eat()
return 1
/mob/proc/can_force_feed()
return 1
#define SAFE_PERP -50
/mob/living/proc/assess_perp(var/obj/access_obj, var/check_access, var/auth_weapons, var/check_records, var/check_arrest)
if(stat == DEAD)
@@ -644,7 +650,7 @@ proc/is_blind(A)
// A proper CentCom id is hard currency.
else if(id && istype(id, /obj/item/weapon/card/id/centcom))
return SAFE_PERP
if(check_access && !access_obj.allowed(src))
threatcount += 4