Allow custom pizzas in pizza boxes

Also fix boxes icons being wrong after surviving an explosion
This commit is contained in:
Bjorn Neergaard
2016-01-22 19:22:12 -06:00
parent 92f0df219b
commit 09571bd45f
2 changed files with 19 additions and 17 deletions
+7 -11
View File
@@ -1,4 +1,3 @@
#define INGREDIENTS_FILL 1
#define INGREDIENTS_SCATTER 2
#define INGREDIENTS_STACK 3
@@ -19,7 +18,7 @@
var/ingMax = 12
var/list/ingredients = list()
var/Ingredientsplacement = INGREDIENTS_FILL
var/ingredients_placement = INGREDIENTS_FILL
var/customname = "custom"
/obj/item/weapon/reagent_containers/food/snacks/customizable/examine(mob/user)
@@ -102,7 +101,6 @@
qdel(BASE)
/obj/item/weapon/reagent_containers/food/snacks/customizable/proc/mix_filling_color(obj/item/weapon/reagent_containers/food/snacks/S)
if(ingredients.len == 1)
filling_color = S.filling_color
else
@@ -116,15 +114,13 @@
filling_color = rgb(rgbcolor[1], rgbcolor[2], rgbcolor[3], rgbcolor[4])
/obj/item/weapon/reagent_containers/food/snacks/customizable/update_overlays(obj/item/weapon/reagent_containers/food/snacks/S)
var/image/I = new(icon, "[initial(icon_state)]_filling")
if(S.filling_color == "#FFFFFF")
I.color = pick("#FF0000","#0000FF","#008000","#FFFF00")
else
I.color = S.filling_color
switch(Ingredientsplacement)
switch(ingredients_placement)
if(INGREDIENTS_SCATTER)
I.pixel_x = rand(-1,1)
I.pixel_y = rand(-1,1)
@@ -173,7 +169,7 @@
/obj/item/weapon/reagent_containers/food/snacks/customizable/burger
name = "burger"
desc = "A timeless classic."
Ingredientsplacement = INGREDIENTS_STACKPLUSTOP
ingredients_placement = INGREDIENTS_STACKPLUSTOP
icon = 'icons/obj/food/burgerbread.dmi'
icon_state = "bun"
@@ -199,7 +195,7 @@
/obj/item/weapon/reagent_containers/food/snacks/customizable/kebab
name = "kebab"
desc = "Delicious food on a stick."
Ingredientsplacement = INGREDIENTS_LINE
ingredients_placement = INGREDIENTS_LINE
trash = /obj/item/stack/rods
list_reagents = list("nutriment" = 1)
ingMax = 6
@@ -209,7 +205,7 @@
/obj/item/weapon/reagent_containers/food/snacks/customizable/pasta
name = "spaghetti"
desc = "Noodles. With stuff. Delicious."
Ingredientsplacement = INGREDIENTS_SCATTER
ingredients_placement = INGREDIENTS_SCATTER
ingMax = 6
icon = 'icons/obj/food/pizzaspaghetti.dmi'
icon_state = "spaghettiboiled"
@@ -225,7 +221,7 @@
/obj/item/weapon/reagent_containers/food/snacks/customizable/pizza
name = "pizza"
desc = "A personalized pan pizza meant for only one person."
Ingredientsplacement = INGREDIENTS_SCATTER
ingredients_placement = INGREDIENTS_SCATTER
ingMax = 8
slice_path = /obj/item/weapon/reagent_containers/food/snacks/pizzaslice/custom
slices_num = 6
@@ -245,7 +241,7 @@
/obj/item/weapon/reagent_containers/food/snacks/customizable/sandwich
name = "toast"
desc = "A timeless classic."
Ingredientsplacement = INGREDIENTS_STACK
ingredients_placement = INGREDIENTS_STACK
icon = 'icons/obj/food/burgerbread.dmi'
icon_state = "breadslice"
var/finished = 0
+12 -6
View File
@@ -136,7 +136,7 @@
user << "<span class='notice'>The stack is dangerously high!</span>"
else
user << "<span class='notice'>Close [open ? src : newbox] first!</span>"
else if(istype(I, /obj/item/weapon/reagent_containers/food/snacks/pizza))
else if(istype(I, /obj/item/weapon/reagent_containers/food/snacks/pizza) || istype(I, /obj/item/weapon/reagent_containers/food/snacks/customizable/pizza))
if(open)
if(!user.drop_item())
return
@@ -167,23 +167,29 @@
else if(is_wire_tool(I))
if(wires && bomb)
wires.interact(user)
else if(istype(I, /obj/item/weapon/reagent_containers/food))
user << "<span class='notice'>That's not a pizza!</span>"
..()
/obj/item/pizzabox/process()
if(bomb_active && !bomb_defused && (bomb_timer > 0))
playsound(loc, 'sound/items/timer.ogg', 40, 0)
playsound(loc, 'sound/items/timer.ogg', 50, 0)
bomb_timer--
if(bomb_active && !bomb_defused && (bomb_timer <= 0))
if(bomb in src)
bomb.detonate()
return
unprocess()
if(!bomb_active || bomb_defused)
if(bomb_defused && bomb in src)
bomb.defuse()
bomb_active = FALSE
SSobj.processing -= src
update_icon()
return
unprocess()
return
/obj/item/pizzabox/proc/unprocess()
SSobj.processing -= src
update_icon()
/obj/item/pizzabox/bomb/New()
var/randompizza = pick(subtypesof(/obj/item/weapon/reagent_containers/food/snacks/pizza))