This commit is contained in:
Yoshax
2016-10-07 03:06:49 +01:00
parent 5819397a0a
commit 8c02e93b03

View File

@@ -2889,12 +2889,12 @@
/obj/item/pizzabox/proc/closepizzabox()
if( boxes.len > 0 )
if(boxes.len > 0)
return
open = !open
if( open && pizza )
if(open && pizza)
ismessy = 1
update_icon()
@@ -2904,29 +2904,29 @@
overlays = list()
// Set appropriate description
if( open && pizza )
if(open && pizza)
desc = "A box suited for pizzas. It appears to have a [pizza.name] inside."
else if( boxes.len > 0 )
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 != "" )
if(toptag != "")
desc = "[desc] The box on top has a tag, it reads: '[toptag]'."
else
desc = "A box suited for pizzas."
if( boxtag != "" )
if(boxtag != "")
desc = "[desc] The box has a tag, it reads: '[boxtag]'."
// Icon states and overlays
if( open )
if( ismessy )
if(open)
if(ismessy)
icon_state = "pizzabox_messy"
else
icon_state = "pizzabox_open"
if( pizza )
if(pizza)
var/image/pizzaimg = image("food.dmi", icon_state = pizza.icon_state)
pizzaimg.pixel_y = -3
overlays += pizzaimg
@@ -2935,33 +2935,33 @@
else
// Stupid code because byondcode sucks
var/doimgtag = 0
if( boxes.len > 0 )
if(boxes.len > 0)
var/obj/item/pizzabox/topbox = boxes[boxes.len]
if( topbox.boxtag != "" )
if(topbox.boxtag != "")
doimgtag = 1
else
if( boxtag != "" )
if(boxtag != "")
doimgtag = 1
if( doimgtag )
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 )
/obj/item/pizzabox/attack_hand(mob/user as mob)
if( open && pizza )
user.put_in_hands( pizza )
user.put_in_hands(pizza)
user << "\red You take the [src.pizza] out of the [src]."
user << "<span class='notice'>You take \the [src.pizza] out of the [src].</span>"
src.pizza = null
update_icon()
return
if( boxes.len > 0 )
if( user.get_inactive_hand() != src )
if(boxes.len > 0)
if(user.get_inactive_hand() != src)
..()
return
@@ -2969,13 +2969,13 @@
boxes -= box
user.put_in_hands( box )
user << "\red You remove the topmost [src] from your hand."
user << "<span class='notice'>You remove \the topmost [src] from your hand.</span>"
box.update_icon()
update_icon()
return
..()
/obj/item/pizzabox/attack_self( mob/user as mob )
/obj/item/pizzabox/attack_self(mob/user as mob)
closepizzabox()
@@ -2985,57 +2985,58 @@
closepizzabox()
/obj/item/pizzabox/attackby( obj/item/I as obj, mob/user as mob )
if( istype(I, /obj/item/pizzabox/) )
if(istype(I, /obj/item/pizzabox/))
var/obj/item/pizzabox/box = I
if( !box.open && !src.open )
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 )
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 )
src.boxes.Add(boxestoadd)
box.update_icon()
update_icon()
user << "\red You put the [box] ontop of the [src]!"
user << "<span class='notice'>You put \the [box] ontop of the [src]!</span>"
else
user << "\red The stack is too high!"
user << "<span class='warning'>\The stack is too high!</span>"
else
user << "\red Close the [box] first!"
user << "<span class='warning'>Close \the [box] first!</span>"
return
if( istype(I, /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/) ) // Long ass fucking object name
if(istype(I, /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/)) // Long ass fucking object name
if( src.open )
if(open)
if(!pizza)
user.drop_item()
I.loc = src
src.pizza = I
pizza = I
update_icon()
user << "\red You put the [I] in the [src]!"
user << "<span class='notice'>You put \the [I] in \the [src]!</span>"
else
user << "\red You try to push the [I] through the lid but it doesn't work!"
user << "<span class='warning'>\The [src] is full! It already has a [pizza] inside.</span>"
else
user << "<span class='warning'>You try to push \the [I] through the lid but it doesn't work!</span>"
return
if( istype(I, /obj/item/weapon/pen/) )
if( src.open )
if(istype(I, /obj/item/weapon/pen/))
if(open)
return
var/t = sanitize(input("Enter what you want to add to the tag:", "Write", null, null) as text, 30)
var/obj/item/pizzabox/boxtotagto = src
if( boxes.len > 0 )
if(boxes.len > 0)
boxtotagto = boxes[boxes.len]
boxtotagto.boxtag = copytext("[boxtotagto.boxtag][t]", 1, 30)