refactor human butchering trait (#28725)

* refactor human butchering trait

* Update code/datums/elements/butchers_humans.dm

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
Signed-off-by: warriorstar-orion <orion@snowfrost.garden>

---------

Signed-off-by: warriorstar-orion <orion@snowfrost.garden>
Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
This commit is contained in:
warriorstar-orion
2025-03-25 07:13:37 -04:00
committed by GitHub
parent c6c4e82ff4
commit 23bb467991
9 changed files with 58 additions and 25 deletions
@@ -462,24 +462,9 @@ emp_act
return ..()
/mob/living/carbon/human/attacked_by(obj/item/I, mob/living/user, def_zone)
if(!I || !user)
if(!I || !user || QDELETED(src))
return
if(HAS_TRAIT(I, TRAIT_BUTCHERS_HUMANS) && stat == DEAD && user.a_intent == INTENT_HARM)
var/obj/item/food/meat/human/newmeat = new /obj/item/food/meat/human(get_turf(loc))
newmeat.name = real_name + newmeat.name
newmeat.subjectname = real_name
newmeat.subjectjob = job
newmeat.reagents.add_reagent("nutriment", (nutrition / 15) / 3)
reagents.trans_to(newmeat, round((reagents.total_volume) / 3, 1))
add_mob_blood(src)
--meatleft
to_chat(user, "<span class='warning'>You hack off a chunk of meat from [name]</span>")
if(!meatleft)
add_attack_logs(user, src, "Chopped up into meat")
qdel(src)
return
var/obj/item/organ/external/affecting = get_organ(ran_zone(user.zone_selected))
// if the targeted limb doesn't exist, pick a new one at random so you don't have to swap target zone