Fix a bunch of shit with matter eatin'.

This commit is contained in:
Rob Nelson
2014-03-22 01:20:26 -07:00
parent 2b155f03b6
commit eddc59f609
2 changed files with 57 additions and 54 deletions

View File

@@ -217,58 +217,9 @@
perform(targets)
/obj/effect/proc_holder/spell/targeted/eat/cast(list/targets)
if(!targets.len)
usr << "<span class='notice'>No target found in range.</span>"
return
var/atom/movable/the_item = targets[1]
if(ismob(the_item))
//My gender
var/m_his="his"
if(usr.gender==FEMALE)
m_his="her"
// Their gender
var/t_his="his"
if(the_item.gender==FEMALE)
t_his="her"
usr.visible_message("\red <b>[usr] begins stuffing [the_item] into [m_his] gaping maw!")
var/mob/living/carbon/human/H = the_item
var/datum/organ/external/limb = H.get_organ(usr.zone_sel.selecting)
if(!istype(limb))
usr << "\red You can't eat this part of them!"
return 0
if(!istype(limb,/datum/organ/external/head))
// Bullshit, but prevents being unable to clone someone.
usr << "\red You try to put \the [limb] in your mouth, but [t_his] ears tickle your throat!"
return 0
var/oldloc = H.loc
if(do_after(usr,EAT_MOB_DELAY))
if(!limb || !H)
return
if(H.loc!=oldloc)
usr << "\red \The [limb] moved away from your mouth!"
return
usr.visible_message("\red [usr] [pick("chomps","bites")] off [the_item]'s [limb]!")
playsound(usr.loc, 'sound/items/eatfood.ogg', 50, 0)
var/mob/M=the_item
M.drop_l_hand()
M.drop_r_hand()
M.death(1)
if(ishuman(M) && ishuman(usr))
var/datum/organ/external/head = M:get_organ("head")
if(head)
head.droplimb(1,1)
var/datum/organ/external/chest=usr:get_organ("chest")
chest.implants += head
del(M)
else
usr.visible_message("\red [usr] eats \the [the_item].")
playsound(usr.loc, 'sound/items/eatfood.ogg', 50, 0)
del(the_item)
if(ishuman(usr))
var/mob/living/carbon/human/H=usr
/obj/effect/proc_holder/spell/targeted/eat/proc/doHeal(var/mob/user)
if(ishuman(user))
var/mob/living/carbon/human/H=user
for(var/name in H.organs_by_name)
var/datum/organ/external/affecting = null
if(!H.organs[name])
@@ -277,8 +228,59 @@
if(!istype(affecting, /datum/organ/external))
continue
affecting.heal_damage(4, 0)
usr:UpdateDamageIcon()
usr:updatehealth()
H.UpdateDamageIcon()
H.updatehealth()
/obj/effect/proc_holder/spell/targeted/eat/cast(list/targets)
if(!targets.len)
usr << "<span class='notice'>No target found in range.</span>"
return
var/atom/movable/the_item = targets[1]
if(ishuman(the_item))
//My gender
var/m_his="his"
if(usr.gender==FEMALE)
m_his="her"
// Their gender
var/t_his="his"
if(the_item.gender==FEMALE)
t_his="her"
var/mob/living/carbon/human/H = the_item
var/datum/organ/external/limb = H.get_organ(usr.zone_sel.selecting)
usr.visible_message("\red <b>[usr] begins stuffing [the_item]'s [limb] into [m_his] gaping maw!</b>")
if(!istype(limb))
usr << "\red You can't eat this part of them!"
return 0
if(istype(limb,/datum/organ/external/head))
// Bullshit, but prevents being unable to clone someone.
usr << "\red You try to put \the [limb] in your mouth, but [t_his] ears tickle your throat!"
return 0
if(istype(limb,/datum/organ/external/chest))
// Bullshit, but prevents being able to instagib someone.
usr << "\red You try to put their [limb] in your mouth, but it's too big to fit!"
return 0
var/oldloc = H.loc
if(!do_mob(usr,H,EAT_MOB_DELAY))
usr << "\red You were interrupted before you could eat [the_item]!"
else
if(!limb || !H)
return
if(H.loc!=oldloc)
usr << "\red \The [limb] moved away from your mouth!"
return
usr.visible_message("\red [usr] [pick("chomps","bites")] off [the_item]'s [limb]!")
playsound(usr.loc, 'sound/items/eatfood.ogg', 50, 0)
var/obj/limb_obj=limb.droplimb(1,1)
var/datum/organ/external/chest=usr:get_organ("chest")
chest.implants += limb_obj
limb_obj.loc=usr
doHeal(usr)
else
usr.visible_message("\red [usr] eats \the [the_item].")
playsound(usr.loc, 'sound/items/eatfood.ogg', 50, 0)
del(the_item)
doHeal(usr)
return

View File

@@ -580,6 +580,7 @@ This function completely restores a damaged organ to perfect condition.
var/lol = pick(cardinal)
step(organ,lol)
owner.regenerate_icons()
return organ
/****************************************************