diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index bdabb37ee73..e69cc03e3ca 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -322,9 +322,15 @@ user.client.statpanel = T.name /mob/living/carbon/AltClick(var/mob/user) - if(!(user == src) && !(isrobot(user)) && user.Adjacent(src)) - src.give_item(user) - return + if(!(user == src) && user.Adjacent(src)) + if((meat_type || butchering_drops) && (stat == DEAD)) //if the carbon has a meat, and if it is dead. + var/obj/item/item_in_hand = user.get_active_hand() + if(item_in_hand && (item_in_hand.sharpness_flags & SHARP_BLADE)) + butcher() + return 1 + else if(!isrobot(user)) + src.give_item(user) + return ..() /* diff --git a/code/datums/helper_datums/butchering.dm b/code/datums/helper_datums/butchering.dm index 743f0e3daf8..13a6b1ccb95 100644 --- a/code/datums/helper_datums/butchering.dm +++ b/code/datums/helper_datums/butchering.dm @@ -22,6 +22,9 @@ var/butcher_time = 20 + var/radial_icon = "radial_butcher" + //Icon in the radial menu + /datum/butchering_product/New() ..() @@ -42,6 +45,7 @@ result = /obj/item/stack/teeth verb_name = "harvest teeth" verb_gerund = "removing teeth from" + radial_icon = "radial_teeth" stored_in_organ = LIMB_HEAD //Cutting a LIMB_HEAD off will transfer teeth to the head object @@ -119,6 +123,7 @@ result = /obj/item/stack/sheet/animalhide verb_name = "skin" verb_gerund = "skinning" + radial_icon = "radial_skin" /datum/butchering_product/skin/desc_modifier(mob/parent) if(!amount) @@ -229,6 +234,7 @@ result = /obj/item/weapon/reagent_containers/food/snacks/meat/spiderleg verb_name = "remove legs from" verb_gerund = "removing legs from" + radial_icon = "radial_sleg" amount = 8 //Amount of legs that all normal spiders have butcher_time = 10 @@ -242,6 +248,7 @@ result = /obj/item/xenos_claw verb_name = "declaw" verb_gerund = "declawing" + radial_icon = "radial_xclaw" /datum/butchering_product/xeno_claw/desc_modifier() if(!amount) @@ -253,6 +260,7 @@ result = /obj/item/weapon/reagent_containers/food/snacks/frog_leg verb_name = "remove legs from" verb_gerund = "removing legs from" + radial_icon = "radial_fleg" amount = 2 //not a magic number, frogs have 2 legs butcher_time = 10 @@ -266,6 +274,7 @@ result = /obj/item/asteroid/hivelord_core verb_name = "remove the core from" verb_gerund = "removing the core from" + radial_icon = "radial_core" butcher_time = 2 /datum/butchering_product/hivelord_core/desc_modifier() @@ -279,6 +288,7 @@ result = /obj/item/deer_head verb_name = "remove head" verb_gerund = "removing the head from" + radial_icon = "radial_dhead" amount = 1 butcher_time = 15 @@ -428,23 +438,22 @@ /mob/living/proc/butcherMenuStep(mob/user) var/list/butcherType = list() if(meat_type && meat_amount > meat_taken) - butcherType += "Butcher" + butcherType += list(list("Butcher","radial_butcher")) for(var/datum/butchering_product/BP in butchering_drops) if(BP.amount) - butcherType += BP.verb_name + butcherType += list(list(BP.verb_name,BP.radial_icon)) if(!butcherType.len) to_chat(user, "There's nothing to butcher.") return - butcherType += "Cancel" return butcherType -/mob/living/proc/butcherChooseStep(mob/user, butcherOptions, butcherTool) - var/choice = input(user,"What would you like to do with \the [src]?","Butchering") in null|butcherOptions +/mob/living/proc/butcherChooseStep(mob/user, var/list/butcherOptions, butcherTool) + var/choice = show_radial_menu(user,loc,butcherOptions,custom_check = new /callback(src, .proc/radial_check, user)) + if(!radial_check(user)) + return if(!butcherCheck(user, butcherTool)) return 0 - if(choice == "Cancel") - return 0 if(choice == "Butcher") return BUTCHER_MEAT if(!choice || !butchering_drops.len) @@ -452,6 +461,12 @@ var/theProduct = getProduct(choice) return theProduct +/mob/living/proc/radial_check(mob/living/user) + if(!istype(user)) + return FALSE + if(user.incapacitated() || !user.Adjacent(src)) + return FALSE + return TRUE /mob/living/proc/getProduct(choice) for(var/datum/butchering_product/BP in butchering_drops) diff --git a/icons/mob/radial.dmi b/icons/mob/radial.dmi index b5b011c9566..0fef6c811f5 100644 Binary files a/icons/mob/radial.dmi and b/icons/mob/radial.dmi differ