Files
Bubberstation/code/game/objects/items/stacks/wrap.dm
ArcaneMusic 94f27c7b25 [READY]Arconomy: Sales Taggers, split profits on barcoded, sold items! (#49111)
* Startwork

* "Arcane: Everything works up until the export datum bullshit"

* I got up to "Split Profit" in "sell object"

* This is when I switched over to components and it STILL doesn't work

* alright stopwork for the 'night'

* So this is the version that crashes

* One step further in my descent to madness.

* Alright, this should be working (Minus maybe profit_split)

* Alright splitting up custom sales splits is broken right now.

* Profit split works now.

* Alright what the hell is going on here.

* Revert "Alright what the hell is going on here."

This reverts commit 6cb3b6eb56ea45ede3496bbe219ca18302c806e2.

* Oh wait, I can do commit messages through VSC?

* Adds a quick little box with all the shipping supplies you'll ever want, unwrapping signal

* Added shipping box to all maps and the service/cargo lathes.

* Fuck you mapmerge hook you ain't shit

* Alright, yet another take of making it get rid of the pricetag

* [3:43 PM] oranges: anturk is smart (This is true)

* Tested, cleaned up component procs,  and limits signals sent a bit.

* Whoops

* Other comments from Ninja over discord

* Left in a comment line.

* Fixes the issue with ind. barcodes, adds examine.

* Well thank GOD the children wern't there to see it

* Adds a do_after to prevent accidents.

* Fixes merge conflicts

* Fixes merge conflict. Twice in one day.

* Fixes merge conflict.

* one tiny bit of documentation

* Travis play nice.
2020-02-25 20:42:01 +08:00

141 lines
3.8 KiB
Plaintext

/*
* Wrapping Paper
*/
/obj/item/stack/wrapping_paper
name = "wrapping paper"
desc = "Wrap packages with this festive paper to make gifts."
icon = 'icons/obj/stack_objects.dmi'
icon_state = "wrap_paper"
item_flags = NOBLUDGEON
amount = 25
max_amount = 25
resistance_flags = FLAMMABLE
/obj/item/stack/wrapping_paper/use(used, transfer)
var/turf/T = get_turf(src)
. = ..()
if(QDELETED(src) && !transfer)
new /obj/item/c_tube(T)
/obj/item/stack/wrapping_paper/small
desc = "Wrap packages with this festive paper to make gifts. This roll looks a bit skimpy."
amount = 10
/*
* Package Wrap
*/
/obj/item/stack/packageWrap
name = "package wrapper"
singular_name = "wrapping sheet"
desc = "You can use this to wrap items in."
icon = 'icons/obj/stack_objects.dmi'
icon_state = "deliveryPaper"
item_flags = NOBLUDGEON
amount = 25
max_amount = 25
resistance_flags = FLAMMABLE
grind_results = list(/datum/reagent/cellulose = 5)
/obj/item/stack/packageWrap/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] begins wrapping [user.p_them()]self in \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
if(use(3))
var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(user.loc))
P.icon_state = "deliverypackage5"
user.forceMove(P)
P.add_fingerprint(user)
return OXYLOSS
else
to_chat(user, "<span class='warning'>You need more paper!</span>")
return SHAME
/obj/item/proc/can_be_package_wrapped() //can the item be wrapped with package wrapper into a delivery package
return 1
/obj/item/storage/can_be_package_wrapped()
return 0
/obj/item/storage/box/can_be_package_wrapped()
return 1
/obj/item/smallDelivery/can_be_package_wrapped()
return 0
/obj/item/stack/packageWrap/afterattack(obj/target, mob/user, proximity)
. = ..()
if(!proximity)
return
if(!istype(target))
return
if(target.anchored)
return
if(isitem(target))
var/obj/item/I = target
if(!I.can_be_package_wrapped())
return
if(user.is_holding(I))
if(!user.dropItemToGround(I))
return
else if(!isturf(I.loc))
return
if(use(1))
var/obj/item/smallDelivery/P = new /obj/item/smallDelivery(get_turf(I.loc))
if(user.Adjacent(I))
P.add_fingerprint(user)
I.add_fingerprint(user)
user.put_in_hands(P)
I.forceMove(P)
var/size = round(I.w_class)
P.name = "[weightclass2text(size)] parcel"
P.w_class = size
size = min(size, 5)
P.icon_state = "deliverypackage[size]"
else if(istype (target, /obj/structure/closet))
var/obj/structure/closet/O = target
if(O.opened)
return
if(!O.delivery_icon) //no delivery icon means unwrappable closet (e.g. body bags)
to_chat(user, "<span class='warning'>You can't wrap this!</span>")
return
if(use(3))
var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc))
P.icon_state = O.delivery_icon
O.forceMove(P)
P.add_fingerprint(user)
O.add_fingerprint(user)
else
to_chat(user, "<span class='warning'>You need more paper!</span>")
return
else
to_chat(user, "<span class='warning'>The object you are trying to wrap is unsuitable for the sorting machinery!</span>")
return
user.visible_message("<span class='notice'>[user] wraps [target].</span>")
user.log_message("has used [name] on [key_name(target)]", LOG_ATTACK, color="blue")
/obj/item/stack/packageWrap/use(used, transfer = FALSE)
var/turf/T = get_turf(src)
. = ..()
if(QDELETED(src) && !transfer)
new /obj/item/c_tube(T)
/obj/item/stack/packageWrap/small
desc = "You can use this to wrap items in. This roll looks a bit skimpy."
w_class = WEIGHT_CLASS_SMALL
amount = 5
/obj/item/c_tube
name = "cardboard tube"
desc = "A tube... of cardboard."
icon = 'icons/obj/stack_objects.dmi'
icon_state = "c_tube"
throwforce = 0
w_class = WEIGHT_CLASS_TINY
throw_speed = 3
throw_range = 5