Adding paper-attaching to wrapped packages (#47329)

About The Pull Request

This lets people attach paper to wrapped packages that can be read on the package and comes off when the package is ripped open. This works almost exactly like airlocks. This is my first time spriting so feel free to criticize.

mailservice
Why It's Good For The Game

Makes the mail service system more useful by allowing information about packages to be directly attached to those packages.
Changelog

cl
add: Paper can now be attached to wrapped packages.
/cl
This commit is contained in:
Dingo-Dongler
2019-10-26 21:03:44 +13:00
committed by oranges
parent 3de8dbac15
commit a58ee925e5
2 changed files with 48 additions and 0 deletions
@@ -7,6 +7,7 @@
mouse_drag_pointer = MOUSE_ACTIVE_POINTER
var/giftwrapped = FALSE
var/sortTag = 0
var/obj/item/paper/note
/obj/structure/bigDelivery/interact(mob/user)
playsound(src.loc, 'sound/items/poster_ripped.ogg', 50, TRUE)
@@ -22,6 +23,15 @@
for(var/atom/movable/AM in contents)
AM.ex_act()
/obj/structure/bigDelivery/examine(mob/user)
. = ..()
if(note)
if(!in_range(user, src))
. += "There's a [note.name] attached to it. You can't read it from here."
else
. += "There's a [note.name] attached to it..."
. += note.examine(user)
/obj/structure/bigDelivery/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/destTagger))
var/obj/item/destTagger/O = W
@@ -53,6 +63,21 @@
icon_state = "gift[icon_state]"
else
to_chat(user, "<span class='warning'>You need more paper!</span>")
else if(istype(W, /obj/item/paper))
if(note)
to_chat(user, "<span class='warning'>This package already has a note attached!</span>")
return
if(!user.transferItemToLoc(W, src))
to_chat(user, "<span class='warning'>For some reason, you can't attach [W]!</span>")
return
user.visible_message("<span class='notice'>[user] attaches [W] to [src].</span>", "<span class='notice'>You attach [W] to [src].</span>")
note = W
if(giftwrapped)
add_overlay(copytext("[icon_state]_note",5))
return
add_overlay("[icon_state]_note")
else
return ..()
@@ -82,6 +107,7 @@
item_state = "deliverypackage"
var/giftwrapped = 0
var/sortTag = 0
var/obj/item/paper/note
/obj/item/smallDelivery/contents_explosion(severity, target)
for(var/atom/movable/AM in contents)
@@ -109,6 +135,15 @@
playsound(src.loc, 'sound/items/poster_ripped.ogg', 50, TRUE)
qdel(src)
/obj/item/smallDelivery/examine(mob/user)
. = ..()
if(note)
if(!in_range(user, src))
. += "There's a [note.name] attached to it. You can't read it from here."
else
. += "There's a [note.name] attached to it..."
. += note.examine(user)
/obj/item/smallDelivery/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/destTagger))
var/obj/item/destTagger/O = W
@@ -141,6 +176,19 @@
else
to_chat(user, "<span class='warning'>You need more paper!</span>")
else if(istype(W, /obj/item/paper))
if(note)
to_chat(user, "<span class='warning'>This package already has a note attached!</span>")
return
if(!user.transferItemToLoc(W, src))
to_chat(user, "<span class='warning'>For some reason, you can't attach [W]!</span>")
return
user.visible_message("<span class='notice'>[user] attaches [W] to [src].</span>", "<span class='notice'>You attach [W] to [src].</span>")
note = W
if(giftwrapped)
add_overlay(copytext("[icon_state]_note",5))
return
add_overlay("[icon_state]_note")
/obj/item/destTagger
name = "destination tagger"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 64 KiB