From 3b7e9fee93eb40124a9ef2a6915b0ce4b85a9098 Mon Sep 17 00:00:00 2001 From: hal9000PR <69320440+hal9000PR@users.noreply.github.com> Date: Fri, 5 Nov 2021 08:11:10 +0000 Subject: [PATCH] refactors butchering of humans with chainsaw/meatcleaver (#16812) * traits * examine * I am incapable of writing Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com> * people Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com> --- code/__HELPERS/traits.dm | 1 + code/_globalvars/traits.dm | 3 ++- code/game/objects/items.dm | 3 +++ code/game/objects/items/weapons/kitchen.dm | 4 ++++ code/game/objects/items/weapons/twohanded.dm | 4 ++++ code/modules/mob/living/carbon/human/human_defense.dm | 2 +- 6 files changed, 15 insertions(+), 2 deletions(-) diff --git a/code/__HELPERS/traits.dm b/code/__HELPERS/traits.dm index b92fb82f9af..a0ba2081310 100644 --- a/code/__HELPERS/traits.dm +++ b/code/__HELPERS/traits.dm @@ -183,6 +183,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai //***** ITEM TRAITS *****// /// Show what machine/door wires do when held. #define TRAIT_SHOW_WIRE_INFO "show_wire_info" +#define TRAIT_BUTCHERS_HUMANS "butchers_humans" // // common trait sources diff --git a/code/_globalvars/traits.dm b/code/_globalvars/traits.dm index 90840095938..8ae8e39bc18 100644 --- a/code/_globalvars/traits.dm +++ b/code/_globalvars/traits.dm @@ -63,7 +63,8 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_NOPAIN" = TRAIT_NOPAIN ), /obj/item = list( - "TRAIT_SHOW_WIRE_INFO" = TRAIT_SHOW_WIRE_INFO + "TRAIT_SHOW_WIRE_INFO" = TRAIT_SHOW_WIRE_INFO, + "TRAIT_BUTCHER_HUMANS" = TRAIT_BUTCHERS_HUMANS ) )) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 03b5a57da18..c988c341f9b 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -228,6 +228,9 @@ GLOBAL_DATUM_INIT(fire_overlay, /image, image("icon" = 'icons/goonstation/effect msg += "*--------*" . += msg + if(HAS_TRAIT(src, TRAIT_BUTCHERS_HUMANS)) + . += "Can be used to butcher dead people into meat while on harm intent." + /obj/item/burn() if(!QDELETED(src)) var/turf/T = get_turf(src) diff --git a/code/game/objects/items/weapons/kitchen.dm b/code/game/objects/items/weapons/kitchen.dm index 82334c986a0..eeb471b0194 100644 --- a/code/game/objects/items/weapons/kitchen.dm +++ b/code/game/objects/items/weapons/kitchen.dm @@ -154,6 +154,10 @@ force = 25 throwforce = 15 +/obj/item/kitchen/knife/butcher/meatcleaver/Initialize(mapload) + . = ..() + ADD_TRAIT(src, TRAIT_BUTCHERS_HUMANS, ROUNDSTART_TRAIT) + /obj/item/kitchen/knife/combat name = "combat knife" icon_state = "combatknife" diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index 7988e0f2a23..c0331c9fcfe 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -639,6 +639,10 @@ if(.) flags &= ~NODROP +/obj/item/twohanded/chainsaw/Initialize(mapload) + . = ..() + ADD_TRAIT(src, TRAIT_BUTCHERS_HUMANS, ROUNDSTART_TRAIT) + // SINGULOHAMMER /obj/item/twohanded/singularityhammer name = "singularity hammer" diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 5b15210b57e..33f9ecc9f4c 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -409,7 +409,7 @@ emp_act if(!I || !user) return 0 - if((istype(I, /obj/item/kitchen/knife/butcher/meatcleaver) || istype(I, /obj/item/twohanded/chainsaw)) && stat == DEAD && user.a_intent == INTENT_HARM) + if(HAS_TRAIT(I, TRAIT_BUTCHERS_HUMANS) && stat == DEAD && user.a_intent == INTENT_HARM) var/obj/item/reagent_containers/food/snacks/meat/human/newmeat = new /obj/item/reagent_containers/food/snacks/meat/human(get_turf(loc)) newmeat.name = real_name + newmeat.name newmeat.subjectname = real_name