Ports paperbags from tg (#12320)

This commit is contained in:
desven
2021-08-25 14:12:57 +02:00
committed by GitHub
parent 4696bbcef9
commit 6eff45c430
10 changed files with 113 additions and 1 deletions
@@ -924,3 +924,77 @@
/obj/item/storage/box/folders/blue
starts_with = list(/obj/item/folder/sec = 5)
/obj/item/storage/box/papersack
name = "paper sack"
desc = "A neatly sack crafted out of paper."
item_icons = list(
slot_l_hand_str = 'icons/mob/items/lefthand.dmi',
slot_r_hand_str = 'icons/mob/items/righthand.dmi',
)
item_state = "papersack"
icon_state = "paperbag_None"
use_sound = 'sound/bureaucracy/papercrumple.ogg'
drop_sound = 'sound/items/drop/paper.ogg'
pickup_sound = 'sound/items/storage/wrapper.ogg'
foldable = null
max_w_class = ITEMSIZE_NORMAL
max_storage_space = 8
use_to_pickup = TRUE
chewable = TRUE
var/opened = TRUE
var/static/list/papersack_designs
var/choice = "None"
/obj/item/storage/box/papersack/update_icon()
. = ..()
if(length(contents) == 0)
icon_state = "paperbag_[choice]"
else if(length(contents) < 8)
icon_state = "paperbag_[choice]-food"
/obj/item/storage/box/papersack/attackby(obj/item/O, mob/user)
if(O.ispen())
if(!papersack_designs)
papersack_designs = sortList(list(
"None" = image(icon = src.icon, icon_state = "paperbag_None"),
"NanotrasenStandard" = image(icon = src.icon, icon_state = "paperbag_NanotrasenStandard"),
"Idris" = image(icon = src.icon, icon_state = "paperbag_Idris"),
"Heart" = image(icon = src.icon, icon_state = "paperbag_Heart"),
"SmileyFace" = image(icon = src.icon, icon_state = "paperbag_SmileyFace")
))
choice = show_radial_menu(user, src, papersack_designs, radius = 42, tooltips = TRUE)
if(!choice)
return
switch(choice)
if("None")
desc = "A sack neatly crafted out of paper."
if("NanotrasenStandard")
desc = "A standard Nanotrasen paper lunch sack for loyal employees on the go."
if("Idris")
desc = "A premium paper bag produced by Idris Incorporated."
if("Heart")
desc = "A paper sack with a heart etched onto the side."
if("SmileyFace")
desc = "A paper sack with a crude smile etched onto the side."
else
return
to_chat(user, SPAN_NOTICE("You make some modifications to [src] using your pen."))
update_icon()
return
else if(O.isscrewdriver())
if(length(contents) == 0)
to_chat(user, SPAN_NOTICE("You begin poking holes in \the [src]."))
if (do_after(user, 10/O.toolspeed, act_target = src))
if(choice == "SmileyFace")
var/obj/item/clothing/head/papersack/smiley/S = new()
user.put_in_hands(S)
else
var/obj/item/clothing/head/papersack/PS = new()
user.put_in_hands(PS)
qdel(src)
else
to_chat(user, SPAN_WARNING("\The [src] needs to be empty before you can do that!"))
else
..()