Fixes human burgers not naming after the meat donor (#59286)

- Adds custom materials to result of grilling
- Adds custom materials to result of atom processing
- Adds source name and job to mob_meat material if available
- Makes processed atoms have same pixel offsets as their source but randomise with each subsequent one
This commit is contained in:
cacogen
2021-05-27 04:39:17 -07:00
committed by GitHub
parent ebaeff9765
commit d2ea4be6c8
4 changed files with 29 additions and 14 deletions
+3
View File
@@ -70,6 +70,9 @@
var/atom/original_object = parent
var/atom/grilled_result = new cook_result(original_object.loc)
if(original_object.custom_materials)
grilled_result.set_custom_materials(original_object.custom_materials, 1)
grilled_result.pixel_x = original_object.pixel_x
grilled_result.pixel_y = original_object.pixel_y
+12
View File
@@ -34,12 +34,24 @@
/datum/material/meat/mob_meat
init_flags = MATERIAL_INIT_BESPOKE
var/subjectname = ""
var/subjectjob = null
/datum/material/meat/mob_meat/Initialize(_id, mob/living/source)
if(!istype(source))
return FALSE
name = "[source?.name ? "[source.name]'s" : "mystery"] [initial(name)]"
if(source.real_name)
subjectname = source.real_name
else if(source.name)
subjectname = source.name
if(ishuman(source))
var/mob/living/carbon/human/human_source = source
subjectjob = human_source.job
return ..()
/datum/material/meat/species_meat
+7 -2
View File
@@ -1431,8 +1431,13 @@
var/list/atom/created_atoms = list()
for(var/i = 1 to chosen_option[TOOL_PROCESSING_AMOUNT])
var/atom/created_atom = new atom_to_create(drop_location())
created_atom.pixel_x = rand(-8, 8)
created_atom.pixel_y = rand(-8, 8)
if(custom_materials)
created_atom.set_custom_materials(custom_materials, 1 / chosen_option[TOOL_PROCESSING_AMOUNT])
created_atom.pixel_x = pixel_x
created_atom.pixel_y = pixel_y
if(i > 1)
created_atom.pixel_x += rand(-8,8)
created_atom.pixel_y += rand(-8,8)
SEND_SIGNAL(created_atom, COMSIG_ATOM_CREATEDBY_PROCESSING, src, chosen_option)
created_atom.OnCreatedFromProcessing(user, I, chosen_option, src)
to_chat(user, "<span class='notice'>You manage to create [chosen_option[TOOL_PROCESSING_AMOUNT]] [initial(atom_to_create.name)]\s from [src].</span>")
+7 -12
View File
@@ -34,22 +34,17 @@
food_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/protein = 6, /datum/reagent/consumable/nutriment/vitamin = 5)
tastes = list("bun" = 2, "long pig" = 4)
foodtypes = MEAT | GRAIN | GROSS
var/subjectname = ""
var/subjectjob = null
venue_value = FOOD_PRICE_CHEAP
/obj/item/food/burger/human/CheckParts(list/parts_list)
..()
var/obj/item/food/meat/M = locate(/obj/item/food/meat/steak/plain/human) in contents
if(M)
subjectname = M.subjectname
subjectjob = M.subjectjob
if(subjectname)
name = "[subjectname] burger"
else if(subjectjob)
name = "[subjectjob] burger"
qdel(M)
var/obj/item/food/patty/human/human_patty = locate(/obj/item/food/patty/human) in contents
if(LAZYLEN(human_patty.custom_materials))
for(var/datum/material/meat/mob_meat/mob_meat_material in human_patty.custom_materials)
if(mob_meat_material.subjectname)
name = "[mob_meat_material.subjectname] burger"
else if(mob_meat_material.subjectjob)
name = "[mob_meat_material.subjectjob] burger"
/obj/item/food/burger/corgi
name = "corgi burger"