diff --git a/code/game/objects/stacks/metal.dm b/code/game/objects/stacks/metal.dm index ce170b3a4ed..c226d636e90 100644 --- a/code/game/objects/stacks/metal.dm +++ b/code/game/objects/stacks/metal.dm @@ -152,6 +152,7 @@ var/global/list/datum/stack_recipe/cardboard_recipes = list ( \ new/datum/stack_recipe("mouse traps", /obj/item/weapon/storage/mousetraps), \ new/datum/stack_recipe("cardborg suit", /obj/item/clothing/suit/cardborg, 3), \ new/datum/stack_recipe("cardborg helmet", /obj/item/clothing/head/cardborg), \ + new/datum/stack_recipe("pizza box", /obj/item/pizzabox), \ ) /obj/item/stack/sheet/cardboard diff --git a/code/modules/food/food.dm b/code/modules/food/food.dm index 857e28da164..8aef1d92ae2 100644 --- a/code/modules/food/food.dm +++ b/code/modules/food/food.dm @@ -1880,3 +1880,175 @@ icon_state = "vegetablepizzaslice" bitesize = 2 +/obj/item/pizzabox + name = "Pizza Box" + desc = "A box suited for pizzas" + icon = 'food.dmi' + icon_state = "pizzabox1" + + var/open = 0 // Is the box open? + var/ismessy = 0 // Fancy mess on the lid + var/obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/pizza // Content pizza + var/list/boxes = list() // If the boxes are stacked, they come here + var/boxtag = "" + +/obj/item/pizzabox/update_icon() + + overlays = list() + + // Set appropriate description + if( open && pizza ) + desc = "A box suited for pizzas. It appears to have a [pizza.name] inside." + else if( boxes.len > 0 ) + desc = "A pile of boxes suited for pizzas. There appears to be [boxes.len + 1] boxes in the pile." + + var/obj/item/pizzabox/topbox = boxes[boxes.len] + var/toptag = topbox.boxtag + if( toptag != "" ) + desc = "[desc] The box on top has a tag, it reads: '[toptag]'." + else + desc = "A box suited for pizzas." + + if( boxtag != "" ) + desc = "[desc] The box has a tag, it reads: '[boxtag]'." + + // Icon states and overlays + if( open ) + if( ismessy ) + icon_state = "pizzabox_messy" + else + icon_state = "pizzabox_open" + + if( pizza ) + var/image/pizzaimg = image("food.dmi", icon_state = pizza.icon_state) + pizzaimg.pixel_y = -3 + overlays += pizzaimg + + return + else + // Stupid code because byondcode sucks + var/doimgtag = 0 + if( boxes.len > 0 ) + var/obj/item/pizzabox/topbox = boxes[boxes.len] + if( topbox.boxtag != "" ) + doimgtag = 1 + else + if( boxtag != "" ) + doimgtag = 1 + + if( doimgtag ) + var/image/tagimg = image("food.dmi", icon_state = "pizzabox_tag") + tagimg.pixel_y = boxes.len * 3 + overlays += tagimg + + icon_state = "pizzabox[boxes.len+1]" + +/obj/item/pizzabox/attack_hand( mob/user as mob ) + + if( open && pizza ) + user.put_in_hand( pizza ) + + user << "\red You take the [src.pizza] out of the [src]." + src.pizza = null + update_icon() + return + + if( boxes.len > 0 ) + if( user.get_inactive_hand() != src ) + ..() + return + + var/obj/item/pizzabox/box = boxes[boxes.len] + boxes -= box + + user.put_in_hand( box ) + user << "\red You remove the topmost [src] from your hand." + box.update_icon() + update_icon() + return + ..() + +/obj/item/pizzabox/attack_self( mob/user as mob ) + + if( boxes.len > 0 ) + return + + open = !open + + if( open && pizza ) + ismessy = 1 + + update_icon() + +/obj/item/pizzabox/attackby( obj/item/I as obj, mob/user as mob ) + if( istype(I, /obj/item/pizzabox/) ) + var/obj/item/pizzabox/box = I + + if( !box.open && !src.open ) + // Make a list of all boxes to be added + var/list/boxestoadd = list() + boxestoadd += box + for(var/obj/item/pizzabox/i in box.boxes) + boxestoadd += i + + if( (boxes.len+1) + boxestoadd.len <= 5 ) + user.drop_item() + + box.loc = src + box.boxes = list() // Clear the box boxes so we don't have boxes inside boxes. - Xzibit + src.boxes.Add( boxestoadd ) + + box.update_icon() + update_icon() + + user << "\red You put the [box] ontop of the [src]!" + else + user << "\red The stack is too high!" + else + user << "\red Close the [box] first!" + + return + + if( istype(I, /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/) ) // Long ass fucking object name + + if( src.open ) + user.drop_item() + I.loc = src + src.pizza = I + + update_icon() + + user << "\red You put the [I] in the [src]!" + else + user << "\red You try to push the [I] through the lid but it doesn't work!" + return + + if( istype(I, /obj/item/weapon/pen/) ) + + if( src.open ) + return + + var/t = input("Enter what you want to add to the tag:", "Write", null, null) as text + + var/obj/item/pizzabox/boxtotagto = src + if( boxes.len > 0 ) + boxtotagto = boxes[boxes.len] + + boxtotagto.boxtag = copytext("[boxtotagto.boxtag][t]", 1, 30) + + update_icon() + return + ..() + + + + + + + + + + + + + diff --git a/html/changelog.html b/html/changelog.html index c50372388f8..b8fc3d75847 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -46,18 +46,21 @@ Stuff which is in development and not yet visible to players or just code relate should be listed in the changelog upon commit tho. Thanks. --> -
-

Wed 27th June 2012

+

Wednesday, June 27th

Errorage updated:

+

Donkie updated:

+
-

Tue 26th June 2012

+

Tuesday, June 26th

Errorage updated:

-

Sat 23rd June 2012

+

Saturday, June 23rd

+

Donkie updated:

+

Carn updated:

-

Saturday, June 23rd

-

Donkie updated:

- -
- -
-

June 20th, 2012

+

Wednesday, June 20th

Nodrak updated:

-

June 18th, 2012

+

Monday, June 18th

Giacom updated:

-
- -
-

June 18th, 2012

Sieve updated:

-
- -
-

Monday, June 18th

Icarus updated: