mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
Butchering radial menu rework (#31080)
* Butchering radial menu rework * Check * Xeno claw * Now fully works * Frog legs, deer head * Repositionings * No radial menu for just one thing * No radial menu for just one thing * Removing that thing, also alt clicking carbons butchers them now * Fixed * Fixed Co-authored-by: kanef <kanef9x@protonmail.com>
This commit is contained in:
@@ -322,7 +322,13 @@
|
||||
user.client.statpanel = T.name
|
||||
|
||||
/mob/living/carbon/AltClick(var/mob/user)
|
||||
if(!(user == src) && !(isrobot(user)) && user.Adjacent(src))
|
||||
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
|
||||
..()
|
||||
|
||||
@@ -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, "<span class='notice'>There's nothing to butcher.</span>")
|
||||
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)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 43 KiB |
Reference in New Issue
Block a user