custom slices (#12312)

This commit is contained in:
Sparky
2021-08-17 17:08:48 +02:00
committed by GitHub
parent e0a44e7a19
commit f39ed3ec4a
4 changed files with 26 additions and 1 deletions
@@ -92,9 +92,26 @@
name = "cake"
desc = "A popular band."
icon_state = "cakecustom"
slices_num = 5
slice_path = /obj/item/reagent_containers/food/snacks/variable/cakeslice
size = 40
w_class = ITEMSIZE_NORMAL
/obj/item/reagent_containers/food/snacks/variable/cakeslice
name = "cake slice"
desc = "A slice of cake"
icon_state = "cakeslicecustom"
trash = /obj/item/trash/plate
w_class = ITEMSIZE_SMALL
size = 8
/obj/item/reagent_containers/food/snacks/variable/cakeslice/update_icon()
. = ..()
//Filling overlay
var/image/I = image(icon, "[icon_state]_filling")
I.color = filling_color
overlays += I
/obj/item/reagent_containers/food/snacks/variable/pocket
name = "hot pocket"
desc = "You wanna put a bangin- oh, nevermind."
@@ -252,8 +252,10 @@
var/reagents_per_slice = reagents.total_volume/slices_num
for(var/i=1 to (slices_num-slices_lost))
var/obj/slice = new slice_path (src.loc)
var/obj/item/reagent_containers/food/slice = new slice_path (src.loc)
reagents.trans_to_obj(slice, reagents_per_slice)
slice.filling_color = filling_color
slice.update_icon()
qdel(src)
return