[MIRROR] borg package wrapper (#12510)

Co-authored-by: Will <7099514+Willburd@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2026-03-11 16:50:38 +01:00
committed by GitHub
co-authored by Will
parent e79ee28f09
commit ca1c616e34
4 changed files with 130 additions and 88 deletions
@@ -139,39 +139,37 @@
..()
if (!( locate(/obj/structure/table, src.loc) ))
to_chat(user, span_warning("You MUST put the paper on a table!"))
if (W.w_class < ITEMSIZE_LARGE)
var/obj/item/I = user.get_inactive_hand()
if(I && I.has_tool_quality(TOOL_WIRECUTTER))
var/a_used = 2 ** (src.w_class - 1)
if (src.amount < a_used)
to_chat(user, span_warning("You need more paper!"))
return
else
if(istype(W, /obj/item/smallDelivery) || istype(W, /obj/item/gift)) //No gift wrapping gifts!
to_chat(user, span_warning("You can't wrap something that's already wrapped!"))
return
src.amount -= a_used
user.drop_item()
var/obj/item/gift/G = new /obj/item/gift( src.loc )
G.size = W.w_class
G.w_class = G.size + 1
G.icon_state = text("gift[]", G.size)
G.gift = W
W.loc = G
G.add_fingerprint(user)
W.add_fingerprint(user)
src.add_fingerprint(user)
if (src.amount <= 0)
new /obj/item/c_tube( src.loc )
qdel(src)
return
else
to_chat(user, span_warning("You need scissors!"))
else
if (W.w_class >= ITEMSIZE_LARGE)
to_chat(user, span_warning("The object is FAR too large!"))
return
return
var/obj/item/I = user.get_inactive_hand()
if(!I?.has_tool_quality(TOOL_WIRECUTTER))
to_chat(user, span_warning("You need scissors!"))
return
var/a_used = 2 ** (src.w_class - 1)
if (src.amount < a_used)
to_chat(user, span_warning("You need more paper!"))
return
if(istype(W, /obj/item/smallDelivery) || istype(W, /obj/item/gift)) //No gift wrapping gifts!
to_chat(user, span_warning("You can't wrap something that's already wrapped!"))
return
src.amount -= a_used
user.drop_item()
var/obj/item/gift/G = new /obj/item/gift( src.loc )
G.size = W.w_class
G.w_class = G.size + 1
G.icon_state = text("gift[]", G.size)
G.gift = W
W.loc = G
G.add_fingerprint(user)
W.add_fingerprint(user)
src.add_fingerprint(user)
if(src.amount <= 0)
new /obj/item/c_tube(get_turf(src))
qdel(src)
/obj/item/wrapping_paper/examine(mob/user)
. = ..()
@@ -183,7 +181,7 @@
var/mob/living/carbon/human/H = target
if (istype(H.wear_suit, /obj/item/clothing/suit/straight_jacket) || istype(H.wear_suit, /obj/item/clothing/suit/shibari) || H.stat)
if (src.amount > 2)
if (src.amount >= 2)
var/obj/effect/spresent/present = new /obj/effect/spresent (H.loc)
src.amount -= 2
@@ -661,6 +661,8 @@
src.modules += new /obj/item/vac_attachment(src) //CHOMPAdd
src.modules += new /obj/item/mail_scanner(src)
src.modules += new /obj/item/storage/bag/mail/borg(src)
src.modules += new /obj/item/destTagger(src)
src.modules += new /obj/item/packageWrap/borg(src)
src.emag += new /obj/item/kinetic_crusher/machete/dagger(src)
var/datum/matter_synth/beacon = new /datum/matter_synth/beacon(10000)
+10
View File
@@ -72,6 +72,11 @@
playsound(src, pick('sound/bureaucracy/pen1.ogg','sound/bureaucracy/pen2.ogg'), 20)
return
/obj/structure/bigDelivery/attack_robot(mob/living/user)
if(user.stat || !Adjacent(user))
return
unwrap()
/obj/structure/bigDelivery/update_icon()
cut_overlays()
if(nameset || examtext)
@@ -199,6 +204,11 @@
playsound(src, pick('sound/bureaucracy/pen1.ogg','sound/bureaucracy/pen2.ogg'), 20)
return
/obj/item/smallDelivery/attack_robot(mob/living/user)
if(user.stat || !Adjacent(user))
return
attack_self(user)
/obj/item/smallDelivery/update_icon()
cut_overlays()
if((nameset || examtext) && icon_state != "deliverycrate1")
+88 -56
View File
@@ -25,73 +25,105 @@
if (istype(target, /obj/item) && !(istype(target, /obj/item/storage) && !istype(target,/obj/item/storage/box)))
var/obj/item/O = target
if (src.amount > 1)
var/obj/item/smallDelivery/P = new /obj/item/smallDelivery(get_turf(O.loc)) //Aaannd wrap it up!
if(!istype(O.loc, /turf))
if(user.client)
user.client.screen -= O
P.wrapped = O
O.forceMove(P)
P.w_class = O.w_class
var/i = round(O.w_class)
if(i in list(1,2,3,4,5))
P.icon_state = "deliverycrate[i]"
switch(i)
if(1) P.name = "tiny parcel"
if(3) P.name = "normal-sized parcel"
if(4) P.name = "large parcel"
if(5) P.name = "huge parcel"
if(i < 1)
P.icon_state = "deliverycrate1"
P.name = "tiny parcel"
if(i > 5)
P.icon_state = "deliverycrate5"
P.name = "huge parcel"
P.add_fingerprint(user)
O.add_fingerprint(user)
src.add_fingerprint(user)
src.amount -= 1
user.visible_message("\The [user] wraps \a [target] with \a [src].",\
span_notice("You wrap \the [target], leaving [amount] units of paper on \the [src]."),\
"You hear someone taping paper around a small object.")
playsound(src, 'sound/items/package_wrap.ogg', 50, 1)
if (src.amount < 1)
to_chat(user, span_warning("You need more paper."))
return
var/obj/item/smallDelivery/P = new /obj/item/smallDelivery(get_turf(O.loc)) //Aaannd wrap it up!
if(!istype(O.loc, /turf))
if(user.client)
user.client.screen -= O
P.wrapped = O
O.forceMove(P)
P.w_class = O.w_class
var/i = round(O.w_class)
if(i in list(1,2,3,4,5))
P.icon_state = "deliverycrate[i]"
switch(i)
if(1) P.name = "tiny parcel"
if(3) P.name = "normal-sized parcel"
if(4) P.name = "large parcel"
if(5) P.name = "huge parcel"
if(i < 1)
P.icon_state = "deliverycrate1"
P.name = "tiny parcel"
if(i > 5)
P.icon_state = "deliverycrate5"
P.name = "huge parcel"
P.add_fingerprint(user)
O.add_fingerprint(user)
src.add_fingerprint(user)
src.amount -= 1
user.visible_message("\The [user] wraps \a [target] with \a [src].",\
span_notice("You wrap \the [target], leaving [amount] units of paper on \the [src]."),\
"You hear someone taping paper around a small object.")
playsound(src, 'sound/items/package_wrap.ogg', 50, 1)
else if (istype(target, /obj/structure/closet/crate))
var/obj/structure/closet/crate/O = target
if (src.amount > 3 && !O.opened)
var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc))
P.icon_state = "deliverycrate"
P.wrapped = O
O.loc = P
src.amount -= 3
user.visible_message("\The [user] wraps \a [target] with \a [src].",\
span_notice("You wrap \the [target], leaving [amount] units of paper on \the [src]."),\
"You hear someone taping paper around a large object.")
playsound(src, 'sound/items/package_wrap.ogg', 50, 1)
else if(src.amount < 3)
if (src.amount < 3)
to_chat(user, span_warning("You need more paper."))
return
if(O.opened)
return
var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc))
P.icon_state = "deliverycrate"
P.wrapped = O
O.loc = P
src.amount -= 3
user.visible_message("\The [user] wraps \a [target] with \a [src].",\
span_notice("You wrap \the [target], leaving [amount] units of paper on \the [src]."),\
"You hear someone taping paper around a large object.")
playsound(src, 'sound/items/package_wrap.ogg', 50, 1)
else if (istype (target, /obj/structure/closet))
var/obj/structure/closet/O = target
if (src.amount > 3 && !O.opened)
var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc))
P.wrapped = O
O.sealed = 1
O.loc = P
src.amount -= 3
user.visible_message("\The [user] wraps \a [target] with \a [src].",\
span_notice("You wrap \the [target], leaving [amount] units of paper on \the [src]."),\
"You hear someone taping paper around a large object.")
playsound(src, 'sound/items/package_wrap.ogg', 50, 1)
else if(src.amount < 3)
if (src.amount < 3)
to_chat(user, span_warning("You need more paper."))
return
if(O.opened)
return
var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc))
P.wrapped = O
O.sealed = 1
O.loc = P
src.amount -= 3
user.visible_message("\The [user] wraps \a [target] with \a [src].",\
span_notice("You wrap \the [target], leaving [amount] units of paper on \the [src]."),\
"You hear someone taping paper around a large object.")
playsound(src, 'sound/items/package_wrap.ogg', 50, 1)
else
to_chat(user, span_blue("The object you are trying to wrap is unsuitable for the sorting machinery!"))
if (src.amount <= 0)
new /obj/item/c_tube( src.loc )
if (src.amount <= 0 && !isrobot(loc))
new /obj/item/c_tube(get_turf(src))
qdel(src)
return
return
/obj/item/packageWrap/examine(mob/user)
. = ..()
if(get_dist(user, src) <= 0)
. += span_blue("There are [amount] units of package wrap left!")
// Borg version that refills over time
/obj/item/packageWrap/borg
name = "packaging dispenser"
desc = "Wraps various items so they can be tagged and shipped through disposals. Refills over time."
var/recharge_ticker = 0
/obj/item/packageWrap/borg/Initialize(mapload)
. = ..()
START_PROCESSING(SSobj, src)
/obj/item/packageWrap/borg/Destroy()
STOP_PROCESSING(SSobj, src)
. = ..()
/obj/item/packageWrap/borg/process()
if(recharge_ticker < 5)
recharge_ticker ++
return
recharge_ticker = 0
if(amount < initial(amount))
amount++