Merge pull request #1482 from Anewbe/devour_fix

Fixes Taj/Unathi being unable to eat mice.
This commit is contained in:
Datraen
2016-04-28 19:22:27 -04:00
2 changed files with 18 additions and 3 deletions

View File

@@ -140,14 +140,14 @@
/obj/item/weapon/grab/proc/devour(mob/target, mob/user) /obj/item/weapon/grab/proc/devour(mob/target, mob/user)
var/can_eat var/can_eat
if((FAT in user.mutations) && issmall(target)) if((FAT in user.mutations) && ismini(target))
can_eat = 1 can_eat = 1
else else
var/mob/living/carbon/human/H = user var/mob/living/carbon/human/H = user
if(istype(H) && H.species.gluttonous) if(istype(H) && H.species.gluttonous)
if(H.species.gluttonous == 2) if(H.species.gluttonous == 2)
can_eat = 2 can_eat = 2
else if((H.mob_size > target.mob_size) && !ishuman(target) && iscarbon(target)) else if((H.mob_size > target.mob_size) && !ishuman(target) && ismini(target))
can_eat = 1 can_eat = 1
if(can_eat) if(can_eat)
@@ -156,7 +156,7 @@
if(can_eat == 2) if(can_eat == 2)
if(!do_mob(user, target)||!do_after(user, 30)) return if(!do_mob(user, target)||!do_after(user, 30)) return
else else
if(!do_mob(user, target)||!do_after(user, 100)) return if(!do_mob(user, target)||!do_after(user, 70)) return
user.visible_message("<span class='danger'>[user] devours [target]!</span>") user.visible_message("<span class='danger'>[user] devours [target]!</span>")
target.loc = user target.loc = user
attacker.stomach_contents.Add(target) attacker.stomach_contents.Add(target)

View File

@@ -5,6 +5,21 @@
return L.mob_size <= MOB_SMALL return L.mob_size <= MOB_SMALL
return 0 return 0
/proc/istiny(A)
if(A && istype(A, /mob/living))
var/mob/living/L = A
return L.mob_size <= MOB_TINY
return 0
/proc/ismini(A)
if(A && istype(A, /mob/living))
var/mob/living/L = A
return L.mob_size <= MOB_MINISCULE
return 0
// If they are 100% robotic, they count as synthetic. // If they are 100% robotic, they count as synthetic.
/mob/living/carbon/human/isSynthetic() /mob/living/carbon/human/isSynthetic()
if(isnull(full_prosthetic)) if(isnull(full_prosthetic))