From 1e3aa31d6c0b887877fd4f076fa985aee26ff081 Mon Sep 17 00:00:00 2001
From: emmanuelbassil <6874235+emmanuelbassil@users.noreply.github.com>
Date: Wed, 11 Oct 2023 18:22:45 +0300
Subject: [PATCH] [MIRROR] Improves Giftwrapping
---
baystation12.dme | 3 +-
code/datums/supplypacks/nonessent.dm | 4 +-
code/datums/supplypacks/supply.dm | 8 +-
code/game/machinery/vending/games.dm | 2 +
code/game/objects/effects/misc.dm | 9 -
code/game/objects/items.dm | 7 -
.../objects/items/weapons/gift_wrappaper.dm | 118 +++----
code/game/objects/items/weapons/gifts.dm | 131 ++++++++
.../objects/items/weapons/storage/storage.dm | 8 +-
.../items/weapons/storage/uplink_kits.dm | 2 +-
.../objects/items/weapons/wrapping_paper.dm | 168 ++++++++++
code/game/objects/random/random.dm | 13 +-
.../crates_lockers/closets/utility_closets.dm | 2 +-
code/modules/clothing/_clothing.dm | 8 +
code/modules/clothing/shoes/miscellaneous.dm | 19 +-
.../clothing/under/accessories/_accessory.dm | 7 -
code/modules/mob/living/living.dm | 11 -
.../robot/flying/module_flying_filing.dm | 4 +-
.../silicon/robot/modules/module_clerical.dm | 4 +-
code/modules/recycling/sortingmachinery.dm | 292 +++++++-----------
icons/obj/gifts.dmi | Bin 1127 -> 490 bytes
icons/obj/parcels.dmi | Bin 1305 -> 2345 bytes
maps/torch/items/items.dm | 6 +-
maps/torch/structures/closets/supply.dm | 4 +-
maps/torch/torch2_deck4.dmm | 6 +-
maps/torch/torch3_deck3.dmm | 2 +-
maps/torch/torch4_deck2.dmm | 2 +-
maps/torch/torch5_deck1.dmm | 8 +-
maps/torch/torch6_bridge.dmm | 2 +-
test/check-paths.sh | 2 +-
30 files changed, 549 insertions(+), 303 deletions(-)
create mode 100644 code/game/objects/items/weapons/gifts.dm
create mode 100644 code/game/objects/items/weapons/wrapping_paper.dm
diff --git a/baystation12.dme b/baystation12.dme
index a89c50930b9db..c780f221c787b 100644
--- a/baystation12.dme
+++ b/baystation12.dme
@@ -1038,7 +1038,7 @@
#include "code\game\objects\items\weapons\extinguisher.dm"
#include "code\game\objects\items\weapons\flame.dm"
#include "code\game\objects\items\weapons\flamethrower.dm"
-#include "code\game\objects\items\weapons\gift_wrappaper.dm"
+#include "code\game\objects\items\weapons\gifts.dm"
#include "code\game\objects\items\weapons\handcuffs.dm"
#include "code\game\objects\items\weapons\janitor_sign.dm"
#include "code\game\objects\items\weapons\lighter.dm"
@@ -1067,6 +1067,7 @@
#include "code\game\objects\items\weapons\trays.dm"
#include "code\game\objects\items\weapons\weaponry.dm"
#include "code\game\objects\items\weapons\weldbackpack.dm"
+#include "code\game\objects\items\weapons\wrapping_paper.dm"
#include "code\game\objects\items\weapons\candle\candle.dm"
#include "code\game\objects\items\weapons\candle\incense.dm"
#include "code\game\objects\items\weapons\candle\scent_decls.dm"
diff --git a/code/datums/supplypacks/nonessent.dm b/code/datums/supplypacks/nonessent.dm
index a417cf1101a64..0e4b6b9be712b 100644
--- a/code/datums/supplypacks/nonessent.dm
+++ b/code/datums/supplypacks/nonessent.dm
@@ -14,7 +14,7 @@
/obj/item/device/camera,
/obj/item/device/camera_film = 2,
/obj/item/storage/photo_album,
- /obj/item/stack/package_wrap/twenty_five,
+ /obj/item/stack/package_wrap/cargo_wrap,
/obj/item/reagent_containers/glass/paint/red,
/obj/item/reagent_containers/glass/paint/green,
/obj/item/reagent_containers/glass/paint/blue,
@@ -23,7 +23,7 @@
/obj/item/reagent_containers/glass/paint/black,
/obj/item/reagent_containers/glass/paint/white,
/obj/item/contraband/poster,
- /obj/item/wrapping_paper = 3)
+ /obj/item/stack/package_wrap/gift_wrap)
cost = 10
containername = "arts and Crafts crate"
diff --git a/code/datums/supplypacks/supply.dm b/code/datums/supplypacks/supply.dm
index 52d995dbb9719..0151b1c2e9ea8 100644
--- a/code/datums/supplypacks/supply.dm
+++ b/code/datums/supplypacks/supply.dm
@@ -22,10 +22,16 @@
/singleton/hierarchy/supply_pack/supply/wpaper
name = "Cargo - Wrapping paper"
- contains = list(/obj/item/stack/package_wrap/twenty_five = 3)
+ contains = list(/obj/item/stack/package_wrap/cargo_wrap = 3)
cost = 10
containername = "wrapping paper"
+/singleton/hierarchy/supply_pack/supply/gpaper
+ name = "Cargo - Gift Wrapping paper"
+ contains = list(/obj/item/stack/package_wrap/gift_wrap = 3)
+ cost = 10
+ containername = "gift wrapping paper"
+
/singleton/hierarchy/supply_pack/supply/tapes
name = "Medium - Blank Tapes (14)"
contains = list (/obj/item/storage/box/tapes)
diff --git a/code/game/machinery/vending/games.dm b/code/game/machinery/vending/games.dm
index 52109e1672826..e91a6ef90c2ba 100644
--- a/code/game/machinery/vending/games.dm
+++ b/code/game/machinery/vending/games.dm
@@ -34,6 +34,7 @@
/obj/item/storage/box/checkers = 10,
/obj/item/storage/box/checkers/chess/red = 10,
/obj/item/storage/box/checkers/chess = 10,
+ /obj/item/stack/package_wrap/gift_wrap = 10,
/obj/item/board = 2,
/obj/item/storage/fancy/crayons = 3,
/obj/item/reagent_containers/spray/waterflower = 10,
@@ -51,6 +52,7 @@
/obj/item/storage/box/checkers = 0,
/obj/item/storage/box/checkers/chess/red = 0,
/obj/item/storage/box/checkers/chess = 0,
+ /obj/item/stack/package_wrap/gift_wrap = 0,
/obj/item/board = 0,
/obj/item/storage/fancy/crayons = 0,
/obj/item/reagent_containers/spray/waterflower = 0,
diff --git a/code/game/objects/effects/misc.dm b/code/game/objects/effects/misc.dm
index 8df10fdbca6c2..8c6215a10740b 100644
--- a/code/game/objects/effects/misc.dm
+++ b/code/game/objects/effects/misc.dm
@@ -1,12 +1,3 @@
-//The effect when you wrap a dead body in gift wrap
-/obj/effect/spresent
- name = "strange present"
- desc = "It's a ... present?"
- icon = 'icons/obj/gifts.dmi'
- icon_state = "strangepresent"
- density = TRUE
- anchored = FALSE
-
/obj/effect/stop
var/victim = null
icon_state = "empty"
diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index 52bfe85bcd793..32691a4e394af 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -288,13 +288,6 @@
else if (S.can_be_inserted(src, user))
S.handle_item_insertion(src)
-/obj/item/use_on(obj/target, mob/user)
- if (istype(target, /obj/item/clothing))
- var/obj/item/clothing/clothes = target
- if (clothes.attempt_store_item(src, user))
- return TRUE
- return ..()
-
/obj/item/can_embed()
if (!canremove)
return FALSE
diff --git a/code/game/objects/items/weapons/gift_wrappaper.dm b/code/game/objects/items/weapons/gift_wrappaper.dm
index 29c02d3ff9abb..6008421f2d2dc 100644
--- a/code/game/objects/items/weapons/gift_wrappaper.dm
+++ b/code/game/objects/items/weapons/gift_wrappaper.dm
@@ -153,45 +153,49 @@
var/amount = 2.5*BASE_STORAGE_COST(ITEM_SIZE_HUGE)
item_flags = ITEM_FLAG_TRY_ATTACK
-/obj/item/wrapping_paper/attackby(obj/item/W as obj, mob/user as mob)
- ..()
- if (!( locate(/obj/structure/table, src.loc) ))
- to_chat(user, SPAN_WARNING("You MUST put the paper on a table!"))
- if (W.w_class < ITEM_SIZE_HUGE)
- var/is_wirecutter = FALSE
- for (var/obj/item as anything in user.GetAllHeld())
- if (isWirecutter(item))
- is_wirecutter = TRUE
- break
- if (is_wirecutter)
- var/a_used = W.get_storage_cost()
- if (a_used == ITEM_SIZE_NO_CONTAINER)
- to_chat(user, SPAN_WARNING("You can't wrap that!"))//no gift-wrapping lit welders
-
- return
- 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!
- return
-
- if(user.unEquip(W))
- var/obj/item/gift/G = new /obj/item/gift( src.loc, W )
- G.add_fingerprint(user)
- W.add_fingerprint(user)
- src.amount -= a_used
-
- if (src.amount <= 0)
- new /obj/item/c_tube( src.loc )
- qdel(src)
- return
- else
- to_chat(user, SPAN_WARNING("You need scissors!"))
- else
- to_chat(user, SPAN_WARNING("The object is FAR too large!"))
- return
+/obj/item/wrapping_paper/use_tool(obj/item/tool, mob/user)
+ if (!istype(tool))
+ return FALSE
+ if (!isturf(loc))
+ to_chat(user, SPAN_WARNING("You must put \the [src] on a surface in order to wrap \the [tool]!"))
+ return TRUE
+ if (tool.w_class > ITEM_SIZE_LARGE)
+ to_chat(user, SPAN_WARNING("\The [tool] is far too large!"))
+ return TRUE
+ if (!is_sharp(user.get_inactive_hand()))
+ to_chat(user, SPAN_WARNING("You need a sharp object in your other hand to cut \the [src]!"))
+ return TRUE
+
+ var/a_used = tool.get_storage_cost()
+ if (a_used == ITEM_SIZE_NO_CONTAINER)
+ to_chat(user, SPAN_WARNING("You can't wrap that!"))
+ return TRUE
+ if (amount < a_used)
+ to_chat(user, SPAN_WARNING("You need more paper!"))
+ return TRUE
+ if (istype(tool, /obj/item/smallDelivery) || istype(tool, /obj/item/gift)) //No gift wrapping gifts!
+ to_chat(user, SPAN_WARNING("\The [tool] is already wrapped!"))
+ return TRUE
+ if (!do_after(user, tool.w_class SECONDS, tool, DO_PUBLIC_UNIQUE))
+ return TRUE
+
+ if (user.unEquip(tool))
+ var/obj/item/gift/G = new /obj/item/gift(loc, tool)
+ G.add_fingerprint(user)
+ tool.add_fingerprint(user)
+ amount -= a_used
+ if (amount <= 0)
+ new /obj/item/c_tube(loc)
+ qdel(src)
+ return TRUE
+
+/obj/item/wrapping_paper/use_on(obj/item/target, mob/user)
+ if (!isitem(target))
+ return FALSE
+ if (!isturf(loc))
+ to_chat(user, SPAN_WARNING("You must put \the [src] on a surface in order to wrap \the [target]!"))
+ return TRUE
/obj/item/wrapping_paper/examine(mob/user, distance)
. = ..()
@@ -199,25 +203,35 @@
to_chat(user, text("There is about [] square units of paper left!", src.amount))
/obj/item/wrapping_paper/attack(mob/target as mob, mob/user as mob)
- . = FALSE
if (!istype(target, /mob/living/carbon/human))
return FALSE
-
var/mob/living/carbon/human/H = target
- if (istype(H.wear_suit, /obj/item/clothing/suit/straight_jacket) || H.stat)
- if (src.amount > 2)
- var/obj/effect/spresent/present = new /obj/effect/spresent (H.loc)
- src.amount -= 2
+ var/a_used = BASE_STORAGE_COST(ITEM_SIZE_LARGE) //get_storage_cost() does not work on mobs, will reproduce same logic here.
- if (H.client)
- H.client.perspective = EYE_PERSPECTIVE
- H.client.eye = present
+ if (amount < a_used)
+ to_chat(user, SPAN_WARNING("You need more paper."))
+ return TRUE
- H.forceMove(present)
- admin_attack_log(user, H, "Used \a [src] to wrap their victim", "Was wrapepd with \a [src]", "used \the [src] to wrap")
+ if (!H.has_danger_grab(user))
+ to_chat(user, "You need to have a firm grip on \the [target] in order to wrap them.")
+ return TRUE
+
+ if (!do_after(user, ITEM_SIZE_LARGE SECONDS, target, DO_PUBLIC_UNIQUE) || !H.has_danger_grab(user))
+ return TRUE
- else
- to_chat(user, SPAN_WARNING("You need more paper."))
+ var/obj/effect/spresent/present = new /obj/effect/spresent (H.loc)
+ amount -= a_used
+
+ if (H.client)
+ H.client.perspective = EYE_PERSPECTIVE
+ H.client.eye = present
+
+ if (user == target)
+ user.visible_message(SPAN_DANGER("\The [user] has gift-wrapped themselves!"))
else
- to_chat(user, "They are moving around too much. A straightjacket would help.")
+ user.visible_message(SPAN_DANGER("\The [user] has gift-wrapped \the [target]!"))
+
+ H.forceMove(present)
+ H.remove_grabs_and_pulls()
+ admin_attack_log(user, H, "Used \a [src] to wrap their victim", "Was wrapepd with \a [src]", "used \the [src] to wrap")
return TRUE
diff --git a/code/game/objects/items/weapons/gifts.dm b/code/game/objects/items/weapons/gifts.dm
new file mode 100644
index 0000000000000..6fe8f62043f37
--- /dev/null
+++ b/code/game/objects/items/weapons/gifts.dm
@@ -0,0 +1,131 @@
+/obj/item/a_gift
+ name = "gift"
+ desc = "PRESENTS!!!! eek!"
+ icon = 'icons/obj/parcels.dmi'
+ icon_state = "gift1"
+ item_state = "gift1"
+ randpixel = 10
+
+/obj/item/a_gift/New()
+ ..()
+ if(w_class > 0 && w_class < ITEM_SIZE_HUGE)
+ icon_state = "gift[w_class]"
+ else
+ icon_state = "gift[pick(1, 2, 3)]"
+ return
+
+/obj/item/a_gift/ex_act()
+ qdel(src)
+ return
+
+/obj/item/a_gift/attack_self(mob/M as mob)
+ var/gift_type = pick(
+ /obj/item/storage/wallet,
+ /obj/item/storage/photo_album,
+ /obj/item/storage/box/snappops,
+ /obj/item/storage/fancy/crayons,
+ /obj/item/storage/backpack/holding,
+ /obj/item/storage/belt/champion,
+ /obj/item/pickaxe/silver,
+ /obj/item/pen/invisible,
+ /obj/item/lipstick/random,
+ /obj/item/grenade/smokebomb,
+ /obj/item/carvable/corncob,
+ /obj/item/contraband/poster,
+ /obj/item/book/manual/barman_recipes,
+ /obj/item/book/manual/chef_recipes,
+ /obj/item/bikehorn,
+ /obj/item/beach_ball,
+ /obj/item/beach_ball/holoball,
+ /obj/item/toy/water_balloon,
+ /obj/item/toy/blink,
+ /obj/item/toy/crossbow,
+ /obj/item/gun/projectile/revolver/capgun,
+ /obj/item/toy/katana,
+ /obj/item/toy/prize/deathripley,
+ /obj/item/toy/prize/durand,
+ /obj/item/toy/prize/fireripley,
+ /obj/item/toy/prize/gygax,
+ /obj/item/toy/prize/honk,
+ /obj/item/toy/prize/marauder,
+ /obj/item/toy/prize/mauler,
+ /obj/item/toy/prize/odysseus,
+ /obj/item/toy/prize/phazon,
+ /obj/item/toy/prize/powerloader,
+ /obj/item/toy/prize/seraph,
+ /obj/item/toy/spinningtoy,
+ /obj/item/toy/sword,
+ /obj/item/reagent_containers/food/snacks/grown/ambrosiadeus,
+ /obj/item/reagent_containers/food/snacks/grown/ambrosiavulgaris,
+ /obj/item/device/paicard,
+ /obj/item/device/synthesized_instrument/violin,
+ /obj/item/storage/belt/utility/full,
+ /obj/item/clothing/accessory/horrible,
+ /obj/item/storage/box/large/foam_gun,
+ /obj/item/storage/box/large/foam_gun/burst,
+ /obj/item/storage/box/large/foam_gun/revolver)
+
+ if(!ispath(gift_type,/obj/item)) return
+
+ var/obj/item/I = new gift_type(M)
+ M.put_in_hands(I)
+ I.add_fingerprint(M)
+ qdel(src)
+
+/*
+ * Special item for wrapped mobs
+ */
+
+/obj/effect/mobpresent
+ name = "strange gift"
+ desc = "It's a ... gift?"
+ icon = 'icons/obj/parcels.dmi'
+ icon_state = "strangegift"
+ density = TRUE
+ anchored = FALSE
+ var/package_type = "parcel"
+
+/obj/effect/mobpresent/Initialize(mapload, target, wrap_type)
+ ..(mapload)
+ if (!target || !ishuman(target) || !wrap_type)
+ return INITIALIZE_HINT_QDEL
+
+ var/mob/living/carbon/human/human = target
+ if (human.client)
+ human.client.perspective = EYE_PERSPECTIVE
+ human.client.eye = src
+
+ name = "strange [package_type]"
+ desc = "It's a ... [package_type]?"
+ package_type = wrap_type
+ update_icon()
+
+/obj/effect/mobpresent/on_update_icon()
+ icon_state = "strange[package_type]"
+
+/obj/effect/mobpresent/relaymove(mob/user as mob)
+ if (user.stat)
+ return
+ to_chat(user, SPAN_WARNING("You can't move."))
+
+
+/obj/effect/mobpresent/use_tool(obj/item/tool, mob/user, list/click_params)
+ if (is_sharp(tool))
+ user.visible_message(
+ SPAN_NOTICE("\The [user] cuts open \the [src] with \a [tool]."),
+ SPAN_NOTICE("You cut open \the [src] with \the [tool].")
+ )
+ for (var/mob/M in src) //Should only be one but whatever.
+ M.dropInto(loc)
+ if (M.client)
+ M.client.eye = M.client.mob
+ M.client.perspective = MOB_PERSPECTIVE
+ qdel(src)
+ return TRUE
+ return ..()
+
+/obj/effect/mobpresent/attack_hand(mob/living/user)
+ to_chat(user, "You need a sharp tool to unwrap \the [src].")
+
+/obj/effect/mobpresent/attack_robot(mob/living/silicon/robot/user)
+ to_chat(user, "You need a sharp tool to unwrap \the [src].")
diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm
index 003ddc0329a49..c9c1cc72f4df3 100644
--- a/code/game/objects/items/weapons/storage/storage.dm
+++ b/code/game/objects/items/weapons/storage/storage.dm
@@ -84,10 +84,10 @@
for(var/obj/item/storage/S in src)
L += S.return_inv()
- for(var/obj/item/gift/G in src)
- L += G.gift
- if (istype(G.gift, /obj/item/storage))
- L += G.gift:return_inv()
+ for(var/obj/item/smallDelivery/parcel in src)
+ L += parcel.wrapped
+ if (istype(parcel.wrapped, /obj/item/storage))
+ L += parcel.wrapped:return_inv()
return L
/obj/item/storage/proc/show_to(mob/user as mob)
diff --git a/code/game/objects/items/weapons/storage/uplink_kits.dm b/code/game/objects/items/weapons/storage/uplink_kits.dm
index 04d6a6eee9eaa..52517a29d1dfc 100644
--- a/code/game/objects/items/weapons/storage/uplink_kits.dm
+++ b/code/game/objects/items/weapons/storage/uplink_kits.dm
@@ -87,7 +87,7 @@
// Clerical uplink kit
/obj/item/storage/backpack/satchel/syndie_kit/clerical
startswith = list(
- /obj/item/stack/package_wrap/twenty_five,
+ /obj/item/stack/package_wrap/cargo_wrap,
/obj/item/hand_labeler,
/obj/item/stamp/chameleon,
/obj/item/pen/chameleon,
diff --git a/code/game/objects/items/weapons/wrapping_paper.dm b/code/game/objects/items/weapons/wrapping_paper.dm
new file mode 100644
index 0000000000000..991abd5029732
--- /dev/null
+++ b/code/game/objects/items/weapons/wrapping_paper.dm
@@ -0,0 +1,168 @@
+/**
+ * Contains cargo's package wrapper and gift wrapping paper, with relevant procs to wrap items/mobs.
+ * Gifts and parcels are found under gifts.dm and sortingmachinery.dm respectively.
+ */
+
+/obj/item/stack/package_wrap
+ abstract_type = /obj/item/stack/package_wrap
+ singular_name = "sheet"
+ amount = 25
+ max_amount = 25
+ item_flags = ITEM_FLAG_TRY_ATTACK
+ icon = 'icons/obj/parcels.dmi'
+ var/package_type
+
+/obj/item/stack/package_wrap/cargo_wrap
+ name = "package wrapper"
+ desc = "Heavy duty brown paper used to wrap packages to protect them during shipping."
+ icon_state = "deliveryPaper"
+ package_type = "parcel"
+
+/obj/item/stack/package_wrap/cargo_wrap/cyborg
+ name = "package wrapper synthesizer"
+ gender = NEUTER
+ uses_charge = 1
+ charge_costs = list(1)
+ stacktype = /obj/item/stack/package_wrap
+
+/obj/item/stack/package_wrap/gift_wrap
+ name = "gift wrapping paper"
+ desc = "A roll of green and red wrapping paper, ready to package gifts in holiday charm."
+ icon_state = "wrapping_paper"
+ package_type = "gift"
+
+/obj/item/c_tube
+ name = "cardboard tube"
+ desc = "A tube of cardboard."
+ icon = 'icons/obj/parcels.dmi'
+ icon_state = "c_tube"
+ throwforce = 1
+ w_class = ITEM_SIZE_SMALL
+ throw_speed = 4
+ throw_range = 5
+
+/obj/item/stack/package_wrap/proc/wrap_item(package_type, obj/target, mob/user)
+ var/amount_used
+ if (!isobj(target) || !istype(user))
+ return
+
+ if (istype(target, /obj/structure/closet))
+ var/obj/structure/bigDelivery/parcel = new /obj/structure/bigDelivery(get_turf(target.loc), target, package_type)
+ parcel.add_fingerprint(user)
+ amount_used = istype(target, /obj/structure/closet/crate) ? BASE_STORAGE_COST(ITEM_SIZE_NORMAL) : BASE_STORAGE_COST(ITEM_SIZE_LARGE)
+ else if (istype(target, /obj/item))
+ var/obj/item/smallDelivery/parcel = new /obj/item/smallDelivery(get_turf(target.loc), target, package_type)
+ parcel.add_fingerprint(user)
+ amount_used = parcel.get_storage_cost()
+ else
+ return
+
+ target.add_fingerprint(user)
+ add_fingerprint(user)
+ use(amount_used)
+ user.visible_message("\The [user] wraps \the [target] with [get_vague_name(TRUE)]].",
+ SPAN_NOTICE("You wrap \the [target] with [get_exact_name(amount_used)]"),
+ "You hear someone taping paper around an object.")
+
+ if (get_amount() <= 0)
+ new /obj/item/c_tube(loc)
+ qdel(src)
+ return
+
+
+/obj/item/stack/package_wrap/use_on(obj/object, mob/user)
+ if (!isobj(object) || istype(object, src))
+ return FALSE
+ if (istype(object, /obj/item/smallDelivery) || istype(object,/obj/structure/bigDelivery) || istype(object, /obj/item/evidencebag))
+ to_chat(user, SPAN_WARNING("\The [object] is already wrapped."))
+ return TRUE
+ if (object.anchored)
+ to_chat(user, SPAN_WARNING("\The [object] is bolted down and can't be wrapped."))
+ return TRUE
+ if (user in object)
+ to_chat(user, SPAN_WARNING("You cannot wrap \the [object] while inside it."))
+ return TRUE
+ var/amount = get_amount()
+ if (amount < 1)
+ to_chat(user, SPAN_WARNING("\The [src] is out of [plural_name]."))
+ return TRUE
+
+ if (istype(object, /obj/item))
+ var/obj/item/target = object
+ var/a_used = target.get_storage_cost()
+ if (target.w_class == ITEM_SIZE_NO_CONTAINER || target.w_class == ITEM_SIZE_GARGANTUAN)
+ to_chat(user, SPAN_WARNING("\The [target] is too big to wrap!"))
+ return TRUE
+ if (user.isEquipped(target))
+ to_chat(user, SPAN_WARNING("You must put down \the [target] in order to wrap it."))
+ return TRUE
+ if (amount < a_used)
+ USE_FEEDBACK_STACK_NOT_ENOUGH(src, a_used, "to wrap \the [target]!")
+ return TRUE
+ user.visible_message(
+ SPAN_NOTICE("\The [user] starts wrapping \the [target] with \the [src]."),
+ SPAN_NOTICE("You start wrapping \the [target] with \the [src].")
+ )
+ if (!do_after(user, target.w_class SECONDS, target, DO_PUBLIC_UNIQUE) || !user.use_sanity_check(target, src))
+ return TRUE
+ wrap_item(package_type, target, user)
+ return TRUE
+
+ if (istype(object, /obj/structure/closet/crate) || istype(object, /obj/structure/closet))
+ var/item_size
+ var/obj/structure/closet/target = object
+ if (target.opened)
+ return FALSE
+ if (istype(object, /obj/structure/closet/crate))
+ item_size = BASE_STORAGE_COST(ITEM_SIZE_NORMAL)
+ else
+ item_size = BASE_STORAGE_COST(ITEM_SIZE_LARGE)
+ if (amount < item_size)
+ USE_FEEDBACK_STACK_NOT_ENOUGH(src, item_size, "to wrap \the [target]!")
+ return TRUE
+ user.visible_message(
+ SPAN_NOTICE("\The [user] starts wrapping \the [target] with \the [src]."),
+ SPAN_NOTICE("You start wrapping \the [target] with \the [src].")
+ )
+ if (!do_after(user, item_size SECONDS, target, DO_PUBLIC_UNIQUE) || !user.use_sanity_check(target, src))
+ return TRUE
+ wrap_item(package_type, target, user)
+ return TRUE
+
+/obj/item/stack/package_wrap/attack(mob/living/target, mob/living/user)
+ if (!istype(target, /mob/living/carbon/human))
+ return FALSE
+ var/mob/living/carbon/human/H = target
+ var/a_used = BASE_STORAGE_COST(ITEM_SIZE_LARGE) //get_storage_cost() does not work on mobs, will reproduce same logic here.
+
+ if (get_amount() < a_used)
+ USE_FEEDBACK_STACK_NOT_ENOUGH(src, a_used, "to wrap \the [target]!")
+ return TRUE
+ if (!H.has_danger_grab(user))
+ to_chat(user, SPAN_WARNING("You need to have a firm grip on \the [target] in order to wrap them."))
+ return TRUE
+ H.visible_message(
+ SPAN_NOTICE("\The [H] starts wrapping \the [target] with \the [src]."),
+ SPAN_NOTICE("You start wrapping \the [target] with \the [src].")
+ )
+ if (!do_after(user, ITEM_SIZE_LARGE SECONDS, target, DO_PUBLIC_UNIQUE) || !H.has_danger_grab(user) || !user.use_sanity_check(H, src))
+ return TRUE
+
+ var/obj/effect/mobpresent/present = new /obj/effect/mobpresent (H.loc, H, package_type)
+ use(a_used)
+
+ if (user == target)
+ user.visible_message(
+ SPAN_DANGER("\The [user] wraps themselves with [get_vague_name(TRUE)]."),
+ SPAN_DANGER("You wrap yourself with [get_exact_name(a_used)].")
+ )
+ else
+ user.visible_message(
+ SPAN_DANGER("\The [user] wraps \the [target] with [get_vague_name(TRUE)]."),
+ SPAN_DANGER("You wrap \the [target] with [get_exact_name(a_used)].")
+ )
+
+ H.forceMove(present)
+ H.remove_grabs_and_pulls()
+ admin_attack_log(user, H, "Used \a [src] to wrap their victim", "Was wrapepd with \a [src]", "used \the [src] to wrap")
+ return TRUE
diff --git a/code/game/objects/random/random.dm b/code/game/objects/random/random.dm
index 43ddcab22f034..d06addba1076d 100644
--- a/code/game/objects/random/random.dm
+++ b/code/game/objects/random/random.dm
@@ -149,7 +149,8 @@
/obj/random/tech_supply/spawn_choices()
return list(/obj/random/powercell = 3,
/obj/random/technology_scanner = 2,
- /obj/item/stack/package_wrap/twenty_five = 1,
+ /obj/item/stack/package_wrap/cargo_wrap = 1,
+ /obj/item/stack/package_wrap/gift_wrap = 1,
/obj/item/hand_labeler = 1,
/obj/random/bomb_supply = 2,
/obj/item/extinguisher = 1,
@@ -978,7 +979,7 @@ GLOBAL_LIST_INIT(random_backpacks, list(
/obj/random/maintenance //Clutter and loot for maintenance and away missions
name = "random maintenance item"
desc = "This is a random maintenance item."
- icon = 'icons/obj/gifts.dmi'
+ icon = 'icons/obj/parcels.dmi'
icon_state = "gift1"
/obj/random/maintenance/spawn_choices()
@@ -992,8 +993,8 @@ Individual items to add to the maintenance list should go here, if you add
something, make sure it's not in one of the other lists.*/
name = "random clean maintenance item"
desc = "This is a random clean maintenance item."
- icon = 'icons/obj/gifts.dmi'
- icon_state = "gift2"
+ icon = 'icons/obj/parcels.dmi'
+ icon_state = "gift3"
/obj/random/maintenance/clean/spawn_choices()
return list(/obj/random/tech_supply = 100,
@@ -1030,8 +1031,8 @@ something, make sure it's not in one of the other lists.*/
/obj/random/loot /*Better loot for away missions and salvage */
name = "random loot"
desc = "This is some random loot."
- icon = 'icons/obj/gifts.dmi'
- icon_state = "gift3"
+ icon = 'icons/obj/parcels.dmi'
+ icon_state = "gift5"
/obj/random/loot/spawn_choices()
return list(/obj/random/energy = 10,
diff --git a/code/game/objects/structures/crates_lockers/closets/utility_closets.dm b/code/game/objects/structures/crates_lockers/closets/utility_closets.dm
index 18931a7b41bf3..187c309ef0793 100644
--- a/code/game/objects/structures/crates_lockers/closets/utility_closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets/utility_closets.dm
@@ -225,4 +225,4 @@
return list(
/obj/item/stack/material/cardboard/ten,
/obj/item/device/destTagger,
- /obj/item/stack/package_wrap/twenty_five)
+ /obj/item/stack/package_wrap/cargo_wrap)
diff --git a/code/modules/clothing/_clothing.dm b/code/modules/clothing/_clothing.dm
index 3d2b1cab59232..daf0fd4662214 100644
--- a/code/modules/clothing/_clothing.dm
+++ b/code/modules/clothing/_clothing.dm
@@ -207,6 +207,14 @@
to_chat(user, "
[capitalize(damages[key])] damage to the [key] armor.")
return TOPIC_HANDLED
+/obj/item/clothing/use_tool(obj/item/tool, mob/living/user, list/click_params)
+ SHOULD_CALL_PARENT(TRUE)
+ if (attempt_attach_accessory(tool, user))
+ return TRUE
+ if (attempt_store_item(tool, user))
+ return TRUE
+ return ..()
+
///////////////////////////////////////////////////////////////////////
// Ears: headsets, earmuffs and tiny objects
/obj/item/clothing/ears
diff --git a/code/modules/clothing/shoes/miscellaneous.dm b/code/modules/clothing/shoes/miscellaneous.dm
index 8c86214363714..5adedbed887ad 100644
--- a/code/modules/clothing/shoes/miscellaneous.dm
+++ b/code/modules/clothing/shoes/miscellaneous.dm
@@ -230,16 +230,19 @@
var/icon_state_modified = "foamclog-toeless"
/obj/item/clothing/shoes/foamclog/use_tool(obj/item/W, mob/user)
- if (isWirecutter(W) || istype(W, /obj/item/scalpel))
- if (clipped)
- to_chat(user, SPAN_NOTICE("\The [src] have already been modified!"))
- update_icon()
- return TRUE
- playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
- user.visible_message(SPAN_WARNING("\The [user] modifies \the [src] with \the [W]."),SPAN_WARNING("You modify \the [src] with \the [W]."))
- cut_clogs()
+ if (!is_sharp(W))
+ return ..()
+
+ if (clipped)
+ to_chat(user, SPAN_NOTICE("\The [src] have already been modified!"))
+ update_icon()
return TRUE
+ playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
+ user.visible_message(SPAN_WARNING("\The [user] modifies \the [src] with \the [W]."),SPAN_WARNING("You modify \the [src] with \the [W]."))
+ cut_clogs()
+ return TRUE
+
/obj/item/clothing/shoes/foamclog/proc/cut_clogs()
clipped = TRUE
name = "toe-less [name]"
diff --git a/code/modules/clothing/under/accessories/_accessory.dm b/code/modules/clothing/under/accessories/_accessory.dm
index 343759655365a..3c3d34039b978 100644
--- a/code/modules/clothing/under/accessories/_accessory.dm
+++ b/code/modules/clothing/under/accessories/_accessory.dm
@@ -106,13 +106,6 @@
else
dropInto(loc)
-/obj/item/clothing/accessory/use_on(obj/target, mob/user)
- if (istype(target, /obj/item/clothing))
- var/obj/item/clothing/clothes = target
- if (clothes.attempt_attach_accessory(src, user))
- return TRUE
- return ..()
-
//default attackby behaviour
/obj/item/clothing/accessory/attackby(obj/item/I, mob/user)
..()
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index dd52ec43a5a20..96371635b8cbd 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -332,12 +332,6 @@ default behaviour is:
//Leave this commented out, it will cause storage items to exponentially add duplicate to the list
//for(var/obj/item/storage/S in Storage.return_inv()) //Check for storage items
// L += get_contents(S)
-
- for(var/obj/item/gift/G in Storage.return_inv()) //Check for gift-wrapped items
- L += G.gift
- if(istype(G.gift, /obj/item/storage))
- L += get_contents(G.gift)
-
for(var/obj/item/smallDelivery/D in Storage.return_inv()) //Check for package wrapped items
L += D.wrapped
if(istype(D.wrapped, /obj/item/storage)) //this should never happen
@@ -350,11 +344,6 @@ default behaviour is:
for(var/obj/item/storage/S in src.contents) //Check for storage items
L += get_contents(S)
- for(var/obj/item/gift/G in src.contents) //Check for gift-wrapped items
- L += G.gift
- if(istype(G.gift, /obj/item/storage))
- L += get_contents(G.gift)
-
for(var/obj/item/smallDelivery/D in src.contents) //Check for package wrapped items
L += D.wrapped
if(istype(D.wrapped, /obj/item/storage)) //this should never happen
diff --git a/code/modules/mob/living/silicon/robot/flying/module_flying_filing.dm b/code/modules/mob/living/silicon/robot/flying/module_flying_filing.dm
index 10126340bf4ee..231e8d80ae2fd 100644
--- a/code/modules/mob/living/silicon/robot/flying/module_flying_filing.dm
+++ b/code/modules/mob/living/silicon/robot/flying/module_flying_filing.dm
@@ -16,7 +16,7 @@
/obj/item/device/destTagger,
/obj/item/crowbar,
/obj/item/device/megaphone,
- /obj/item/stack/package_wrap/cyborg
+ /obj/item/stack/package_wrap/cargo_wrap/cyborg
)
emag_gear = list(
/obj/item/melee/baton/robot/electrified_arm,
@@ -37,7 +37,7 @@
/obj/item/robot_module/flying/filing/finalize_synths()
. = ..()
var/datum/matter_synth/package_wrap = locate() in synths
- var/obj/item/stack/package_wrap/cyborg/PW = locate() in equipment
+ var/obj/item/stack/package_wrap/cargo_wrap/cyborg/PW = locate() in equipment
PW.synths = list(package_wrap)
/obj/item/robot_module/flying/filing/respawn_consumable(mob/living/silicon/robot/R, amount)
diff --git a/code/modules/mob/living/silicon/robot/modules/module_clerical.dm b/code/modules/mob/living/silicon/robot/modules/module_clerical.dm
index 43b9af3a36631..cc2b15298263b 100644
--- a/code/modules/mob/living/silicon/robot/modules/module_clerical.dm
+++ b/code/modules/mob/living/silicon/robot/modules/module_clerical.dm
@@ -94,7 +94,7 @@
/obj/item/stamp/denied,
/obj/item/device/destTagger,
/obj/item/crowbar,
- /obj/item/stack/package_wrap/cyborg
+ /obj/item/stack/package_wrap/cargo_wrap/cyborg
)
emag_gear = list(
/obj/item/melee/baton/robot/electrified_arm,
@@ -110,7 +110,7 @@
/obj/item/robot_module/clerical/general/finalize_synths()
. = ..()
var/datum/matter_synth/package_wrap/wrap = locate() in synths
- var/obj/item/stack/package_wrap/cyborg/wrap_item = locate() in equipment
+ var/obj/item/stack/package_wrap/cargo_wrap/cyborg/wrap_item = locate() in equipment
wrap_item.synths = list(wrap)
diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm
index 3baf2bb1d6a9e..14d53342465bd 100644
--- a/code/modules/recycling/sortingmachinery.dm
+++ b/code/modules/recycling/sortingmachinery.dm
@@ -2,7 +2,7 @@
desc = "A big wrapped package."
name = "large parcel"
icon = 'icons/obj/parcels.dmi'
- icon_state = "deliverycloset"
+ icon_state = "parcelcloset"
health_max = 5
var/obj/wrapped = null
density = TRUE
@@ -13,7 +13,19 @@
var/label_y
var/label_x
var/tag_x
-
+ var/package_type = "parcel"
+
+/obj/structure/bigDelivery/Initialize(mapload, obj/structure/closet/parcel, wrap_type)
+ ..(mapload)
+ if (!parcel || !istype(parcel) || !wrap_type)
+ return INITIALIZE_HINT_QDEL
+
+ wrapped = parcel
+ wrapped.forceMove(src)
+ package_type = wrap_type
+ SetName("large [package_type]")
+ desc = name
+ update_icon()
/obj/structure/bigDelivery/Destroy()
QDEL_NULL(wrapped)
@@ -40,20 +52,17 @@
victim.dropInto(loc)
qdel_self()
-
-/obj/structure/bigDelivery/attack_robot(mob/user as mob)
- unwrap(user)
-
/obj/structure/bigDelivery/attack_hand(mob/user as mob)
- unwrap(user)
+ to_chat(user, "You need a sharp tool to unwrap \the [src].")
+/obj/structure/bigDelivery/attack_robot(mob/user)
+ to_chat(user, "You need a sharp tool to unwrap \the [src].")
/obj/structure/bigDelivery/proc/unwrap(mob/user)
if(Adjacent(user))
// Destroy will drop our wrapped object on the turf, so let it.
qdel(src)
-
/obj/structure/bigDelivery/use_tool(obj/item/tool, mob/user, list/click_params)
// Destination Tagger - Tag
if (istype(tool, /obj/item/device/destTagger))
@@ -88,8 +97,8 @@
SPAN_NOTICE("You set \the [src]'s label title to '[new_title]' with \the [tool].")
)
SetName("[initial(name)] ([new_title])")
- update_icon()
nameset = TRUE
+ update_icon()
else if (input == "Description")
var/new_desc = input(user, "What would you like to set the label to?", "[name] - Label Title") as null|text
new_desc = sanitizeSafe(new_desc, MAX_NAME_LEN)
@@ -100,8 +109,16 @@
SPAN_NOTICE("You set \the [src]'s label description to '[new_desc]' with \the [tool].")
)
examtext = new_desc
- update_icon()
nameset = TRUE
+ update_icon()
+ return TRUE
+
+ if (is_sharp(tool))
+ user.visible_message(
+ SPAN_NOTICE("\The [user] cuts open \the [src] with \a [tool]."),
+ SPAN_NOTICE("You cut open \the [src] with \the [tool].")
+ )
+ unwrap(user)
return TRUE
return ..()
@@ -109,14 +126,19 @@
/obj/structure/bigDelivery/on_update_icon()
ClearOverlays()
+ if (istype(wrapped, /obj/structure/closet/crate))
+ icon_state = "[package_type]crate"
+ else
+ icon_state = "[package_type]closet"
+
if(nameset || examtext)
var/image/I = new/image('icons/obj/parcels.dmi',"delivery_label")
- if(icon_state == "deliverycloset")
+ if (icon_state == "[package_type]closet")
I.pixel_x = 2
if(label_y == null)
label_y = rand(-6, 11)
I.pixel_y = label_y
- else if(icon_state == "deliverycrate")
+ else if (icon_state == "[package_type]crate")
if(label_x == null)
label_x = rand(-8, 6)
I.pixel_x = label_x
@@ -124,12 +146,12 @@
AddOverlays(I)
if(src.sortTag)
var/image/I = new/image('icons/obj/parcels.dmi',"delivery_tag")
- if(icon_state == "deliverycloset")
+ if (icon_state == "[package_type]closet")
if(tag_x == null)
tag_x = rand(-2, 3)
I.pixel_x = tag_x
I.pixel_y = 9
- else if(icon_state == "deliverycrate")
+ else if (icon_state == "[package_type]crate")
if(tag_x == null)
tag_x = rand(-8, 6)
I.pixel_x = tag_x
@@ -157,17 +179,35 @@
return ..()
/obj/item/smallDelivery
- desc = "A small wrapped package."
name = "small parcel"
+ desc = "A small parcel."
icon = 'icons/obj/parcels.dmi'
- icon_state = "deliverycrate3"
+ icon_state = "parcel3"
health_max = 5
var/obj/item/wrapped = null
var/sortTag = null
var/examtext = null
var/nameset = 0
var/tag_x
+ var/package_type = "parcel"
+/obj/item/smallDelivery/Initialize(mapload, obj/item/parcel, wrap_type)
+ . = ..()
+ if (!parcel || !isitem(parcel) || !wrap_type)
+ return INITIALIZE_HINT_QDEL
+
+ wrapped = parcel
+ wrapped.forceMove(src)
+ package_type = wrap_type
+ w_class = parcel.w_class
+ switch (w_class)
+ if (ITEM_SIZE_TINY) SetName("tiny [package_type]")
+ if (ITEM_SIZE_SMALL) SetName("small [package_type]")
+ if (ITEM_SIZE_NORMAL) SetName("normal-sized [package_type]")
+ if (ITEM_SIZE_LARGE) SetName("large [package_type]")
+ if (ITEM_SIZE_HUGE) SetName("huge [package_type]")
+ desc = "A [name]."
+ update_icon()
/obj/item/smallDelivery/Destroy()
QDEL_NULL(wrapped)
@@ -197,97 +237,115 @@
/obj/item/smallDelivery/proc/unwrap(mob/user)
if (!Adjacent(user))
return
- if (!length(contents))
+ if (!length(contents) || !wrapped)
to_chat(user, SPAN_NOTICE("\The [src] was empty!"))
qdel_self()
return
- user.drop_from_inventory(src)
- user.put_in_hands(wrapped)
- wrapped = null
- // Take out any other items that might be in the package
- for(var/obj/item/I in src)
- user.put_in_hands(I)
+ if (user.isEquipped(src))
+ user.drop_from_inventory(src)
+ user.put_in_hands(wrapped)
+ for (var/obj/item/present in src)
+ user.put_in_hands(present)
+ else
+ wrapped.dropInto(loc)
+ for (var/obj/item/present in src)
+ present.dropInto(loc)
+ wrapped = null
qdel(src)
/obj/item/smallDelivery/attack_robot(mob/user as mob)
- unwrap(user)
+ to_chat(user, "You need a sharp tool to unwrap \the [src].")
/obj/item/smallDelivery/attack_self(mob/user as mob)
- unwrap(user)
-
-/obj/item/smallDelivery/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W, /obj/item/device/destTagger))
- var/obj/item/device/destTagger/O = W
- if(O.currTag)
- if(src.sortTag != O.currTag)
- to_chat(user, SPAN_NOTICE("You have labeled the destination as [O.currTag]."))
- if(!src.sortTag)
- src.sortTag = O.currTag
+ to_chat(user, "You need a sharp tool to unwrap \the [src].")
+
+/obj/item/smallDelivery/use_tool(obj/item/tool, mob/living/user, list/click_params)
+ if (is_sharp(tool))
+ user.visible_message(
+ SPAN_NOTICE("\The [user] cuts open \the [src] with \a [tool]."),
+ SPAN_NOTICE("You cut open \the [src] with \the [tool].")
+ )
+ unwrap(user)
+ return TRUE
+
+ if (istype(tool, /obj/item/device/destTagger))
+ var/obj/item/device/destTagger/tagger = tool
+ if (tagger.currTag)
+ if (sortTag != tagger.currTag)
+ to_chat(user, SPAN_NOTICE("You have labeled the destination as [tagger.currTag]."))
+ if (!sortTag)
+ sortTag = tagger.currTag
update_icon()
else
- src.sortTag = O.currTag
- playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 1)
+ sortTag = tagger.currTag
+ playsound(loc, 'sound/machines/twobeep.ogg', 50, 1)
+ return TRUE
else
- to_chat(user, SPAN_WARNING("The package is already labeled for [O.currTag]."))
+ to_chat(user, SPAN_WARNING("The package is already labeled for [tagger.currTag]."))
+ return TRUE
else
to_chat(user, SPAN_WARNING("You need to set a destination first!"))
+ return TRUE
- else if(istype(W, /obj/item/pen))
- switch(alert("What would you like to alter?",,"Title","Description", "Cancel"))
- if("Title")
- var/str = sanitizeSafe(input(usr,"Label text?","Set label",""), MAX_NAME_LEN)
- if(!str || !length(str))
+ if (istype(tool, /obj/item/pen))
+ switch (alert("What would you like to alter?",,"Title","Description", "Cancel"))
+ if ("Title")
+ var/str = sanitizeSafe(input(user,"Label text?","Set label",""), MAX_NAME_LEN)
+ if (!str || !length(str))
to_chat(usr, SPAN_WARNING(" Invalid text."))
- return
- user.visible_message("\The [user] titles \the [src] with \a [W], marking down: \"[str]\"",\
+ return TRUE
+ user.visible_message("\The [user] titles \the [src] with \a [tool], marking down: \"[str]\"",\
SPAN_NOTICE("You title \the [src]: \"[str]\""),\
"You hear someone scribbling a note.")
SetName("[name] ([str])")
- if(!examtext && !nameset)
+ if (!examtext && !nameset)
nameset = 1
update_icon()
else
nameset = 1
+ return TRUE
- if("Description")
- var/str = sanitize(input(usr,"Label text?","Set label",""))
+ if ("Description")
+ var/str = sanitize(input(user,"Label text?","Set label",""))
if(!str || !length(str))
- to_chat(usr, SPAN_WARNING("Invalid text."))
- return
- if(!examtext && !nameset)
+ to_chat(user, SPAN_WARNING("Invalid text."))
+ return TRUE
+ if (!examtext && !nameset)
examtext = str
update_icon()
else
examtext = str
- user.visible_message("\The [user] labels \the [src] with \a [W], scribbling down: \"[examtext]\"",\
+ user.visible_message("\The [user] labels \the [src] with \a [tool], scribbling down: \"[examtext]\"",\
SPAN_NOTICE("You label \the [src]: \"[examtext]\""),\
"You hear someone scribbling a note.")
- return
+ return TRUE
/obj/item/smallDelivery/on_update_icon()
ClearOverlays()
- if((nameset || examtext) && icon_state != "deliverycrate1")
+ icon_state = "[package_type][w_class]"
+
+ if ((nameset || examtext) && w_class > ITEM_SIZE_TINY)
var/image/I = new/image('icons/obj/parcels.dmi',"delivery_label")
- if(icon_state == "deliverycrate5")
+ if(w_class == ITEM_SIZE_HUGE)
I.pixel_y = -1
AddOverlays(I)
- if(src.sortTag)
+ if (sortTag)
var/image/I = new/image('icons/obj/parcels.dmi',"delivery_tag")
- switch(icon_state)
- if("deliverycrate1")
+ switch(w_class)
+ if(ITEM_SIZE_TINY)
I.pixel_y = -5
- if("deliverycrate2")
+ if(ITEM_SIZE_SMALL)
I.pixel_y = -2
- if("deliverycrate3")
+ if(ITEM_SIZE_NORMAL)
I.pixel_y = 0
- if("deliverycrate4")
+ if(ITEM_SIZE_LARGE)
if(tag_x == null)
tag_x = rand(0,5)
I.pixel_x = tag_x
I.pixel_y = 3
- if("deliverycrate5")
+ if(ITEM_SIZE_HUGE)
I.pixel_y = -3
AddOverlays(I)
@@ -299,108 +357,6 @@
if(examtext)
to_chat(user, SPAN_NOTICE("It has a note attached which reads, \"[examtext]\""))
-/obj/item/stack/package_wrap
- name = "package wrapper"
- desc = "Heavy duty brown paper used to wrap packages to protect them during shipping."
- singular_name = "sheet"
- max_amount = 25
- icon = 'icons/obj/parcels.dmi'
- icon_state = "deliveryPaper"
- w_class = ITEM_SIZE_NORMAL
-
-/obj/item/stack/package_wrap/twenty_five
- amount = 25
-
-
-/obj/item/c_tube
- name = "cardboard tube"
- desc = "A tube... of cardboard."
- icon = 'icons/obj/parcels.dmi'
- icon_state = "c_tube"
- throwforce = 1
- w_class = ITEM_SIZE_SMALL
- throw_speed = 4
- throw_range = 5
-
-/obj/item/stack/package_wrap/afterattack(obj/target as obj, mob/user as mob, proximity)
- if(!proximity) return
- if(!istype(target)) //this really shouldn't be necessary (but it is). -Pete
- return
- if(istype(target, /obj/item/smallDelivery) || istype(target,/obj/structure/bigDelivery) \
- || istype(target, /obj/item/gift) || istype(target, /obj/item/evidencebag))
- return
- if(target.anchored)
- return
- if(target in user)
- return
- if(user in target) //no wrapping closets that you are inside - it's not physically possible
- return
-
- if (istype(target, /obj/item) && !(istype(target, /obj/item/storage) && !istype(target,/obj/item/storage/box)))
- var/obj/item/O = target
- if (src.get_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.SetName("tiny parcel")
- if(3) P.SetName("normal-sized parcel")
- if(4) P.SetName("large parcel")
- if(5) P.SetName("huge parcel")
- if(i < 1)
- P.icon_state = "deliverycrate1"
- P.SetName("tiny parcel")
- if(i > 5)
- P.icon_state = "deliverycrate5"
- P.SetName("huge parcel")
- P.add_fingerprint(usr)
- O.add_fingerprint(usr)
- src.add_fingerprint(usr)
- src.use(1)
- user.visible_message("\The [user] wraps \a [target] with \a [src].",\
- SPAN_NOTICE("You wrap \the [target], leaving [src.get_amount()] units of paper on \the [src]."),\
- "You hear someone taping paper around a small object.")
- else
- // Should be possible only to see this as a borg?
- to_chat(user, SPAN_WARNING("The synthesizer is out of paper."))
- else if (istype(target, /obj/structure/closet/crate))
- var/obj/structure/closet/crate/O = target
- if (src.get_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.forceMove(P)
- src.use(3)
- user.visible_message("\The [user] wraps \a [target] with \a [src].",\
- SPAN_NOTICE("You wrap \the [target], leaving [src.get_amount()] units of paper on \the [src]."),\
- "You hear someone taping paper around a large object.")
- else if(src.get_amount() < 3)
- to_chat(user, SPAN_WARNING("You need more paper."))
- else if (istype (target, /obj/structure/closet))
- var/obj/structure/closet/O = target
- if (src.get_amount() >= 3 && !O.opened)
- var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc))
- P.wrapped = O
- O.welded = 1
- O.forceMove(P)
- src.use(3)
- user.visible_message("\The [user] wraps \a [target] with \a [src].",\
- SPAN_NOTICE("You wrap \the [target], leaving [src.get_amount()] units of paper on \the [src]."),\
- "You hear someone taping paper around a large object.")
- else if(src.get_amount() < 3)
- to_chat(user, SPAN_WARNING("You need more paper."))
- else
- to_chat(user, SPAN_NOTICE("The object you are trying to wrap is unsuitable for the sorting machinery!"))
-
- return
-
/obj/item/device/destTagger
name = "destination tagger"
desc = "Used to set the destination of properly wrapped packages."
@@ -567,13 +523,3 @@
if(trunk)
trunk.linked = null
..()
-
-/obj/item/stack/package_wrap/cyborg
- name = "package wrapper synthesizer"
- icon = 'icons/obj/parcels.dmi'
- icon_state = "deliveryPaper"
- gender = NEUTER
- matter = null
- uses_charge = 1
- charge_costs = list(1)
- stacktype = /obj/item/stack/package_wrap
diff --git a/icons/obj/gifts.dmi b/icons/obj/gifts.dmi
index aa42f7263c26611e067fc87a5937e8352d50ed17..d08e2306c4b4232b1a655cab2f39cfc6ec9eb502 100644
GIT binary patch
literal 490
zcmVV_YegOam4m#N;h#SHH008nyL_t(YiS3iI4uUWchOe+xClZ0V;Rzsd
zax)|{yRbNs$Q!u1FgogJTzmyb-_8Pw+laO%ZiUS-U|kgi&a0VNnzT3EQ@f(C)0V1cdR7_8y)4n6@v=>bp?X%46?B?KIU
z02q*?>$U2dgb^CxWW@j&p{+s0D!?JqJJ%Wb*g-A4ES1WwGa-m
g1cXM1tLe*gdg07*qoM6N<$f)C)wWdHyG
literal 1127
zcmV-t1ep7YP)IHnE(KP4u1du0J0I805bs0
z5&r-)vH$=pg(YS)0KmY&05b&uKLr3_34y%T(f|Me0d!JMQvg8b*k%9#0H1nPSad{X
zb7OL8aCB*JZU6vyoQ=^v3d1lA1>o5}g-Q0({H$F{Ldnovp@>AWO{rsK(Okc#Dcyp-
zy$9c*he~zrZ^Nj%`yk&)!LCkSRC_v0vDukTEKMziL8}e#B``3?SQJvsmO_k`6br!%
z_xuOiE}Vs`ELCTzCaD4wIE|h#pi3XP5%`A(kCdbn!Su{`>DfPc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udy
z8OMt_p2zVln0E$x48KfAF#f`+sN3rE``*;y!48=kx6S|n1FlI#K~#90?V0O#n>rAM
zNoZ`-K{zCKdRcYe|1ql@7fCZCE(ZS0?rBd}!P=j;MuKsRLL?H20=;M*YCrtR>h+bs
zUY5)JlOHJiA8#B%S)NWy2(0b-oF&lqS~P*SKP@3}{`NnX!1`Y|#?Jv5g!o?OVWcDApFlbR{1HSZ
zpi%(taolk3mVh|@X@F!2wh_?BY)Y?Bq`a?Brh%=g@BcBGC*n?~D8R)9;H1_`?AJ
zBgOBF`v8RJ)BynD%fbc#TvxOQKp1gauPX921fMvIHt7z?uGP3BbsI_6p^?
zqA37le*(abj=gF`o4j5CF!rZP1X?ZqvQ;COg15134J2Jt5F!?!xudoI&LJ5c#?#Xg
z%m)|(Oxj8-J$>cA-f#{eolD9(3tHyY=4dX?Cum)i?hZ
zPxb$s1~jGr-!h;{{eO4E#})wj{(lH)6M$U*-}`^i0BcGl*Z&U@={pF3YE6k``u|Zx
z`kqhLpD5v*69d5X|3&{50DS7pD8P^q0dW7i{kpRNbpKy;YXtW4Z*+t{A^fHKb~l=m
z0N$5WZgI?IY6Uuc+~Icr^Y@De;QRlg>o0-sTEKq+Ml}_g8sPi?qVF$>0w{*ohH}V=
z@Bc^RZ}pG9>-sX0NF)-8L?Y3%^zWg69q9l4cs#xj^cRUlB9TZW5*?!d8f0=L{*$sf
P00000NkvXXu0mjfQ;2C0
diff --git a/maps/torch/items/items.dm b/maps/torch/items/items.dm
index 53ac10863ab60..222953f010197 100644
--- a/maps/torch/items/items.dm
+++ b/maps/torch/items/items.dm
@@ -23,7 +23,7 @@ Random item spawning
/obj/random/maintenance/solgov
name = "random maintenance item"
desc = "This is a random maintenance item."
- icon = 'icons/obj/gifts.dmi'
+ icon = 'icons/obj/parcels.dmi'
icon_state = "gift1"
/obj/random/maintenance/solgov/spawn_choices()
@@ -34,8 +34,8 @@ Random item spawning
/obj/random/maintenance/solgov/clean
name = "random maintenance item"
desc = "This is a random maintenance item."
- icon = 'icons/obj/gifts.dmi'
- icon_state = "gift2"
+ icon = 'icons/obj/parcels.dmi'
+ icon_state = "gift3"
/obj/random/maintenance/solgov/clean/spawn_choices()
return list(/obj/random/solgov = 3,
diff --git a/maps/torch/structures/closets/supply.dm b/maps/torch/structures/closets/supply.dm
index f3be001b29695..379308653f8ca 100644
--- a/maps/torch/structures/closets/supply.dm
+++ b/maps/torch/structures/closets/supply.dm
@@ -38,7 +38,7 @@
/obj/item/hand_labeler,
/obj/item/material/clipboard,
/obj/item/folder/yellow,
- /obj/item/stack/package_wrap/twenty_five,
+ /obj/item/stack/package_wrap/cargo_wrap,
/obj/item/marshalling_wand,
/obj/item/marshalling_wand,
/obj/item/storage/belt/general,
@@ -66,7 +66,7 @@
/obj/item/hand_labeler,
/obj/item/material/clipboard,
/obj/item/folder/yellow,
- /obj/item/stack/package_wrap/twenty_five,
+ /obj/item/stack/package_wrap/cargo_wrap,
/obj/item/device/flash,
/obj/item/device/megaphone,
/obj/item/device/holowarrant,
diff --git a/maps/torch/torch2_deck4.dmm b/maps/torch/torch2_deck4.dmm
index 6ae2f1723a0b3..05d8a65103fa2 100644
--- a/maps/torch/torch2_deck4.dmm
+++ b/maps/torch/torch2_deck4.dmm
@@ -5200,7 +5200,7 @@
/obj/random/tech_supply,
/obj/random/tech_supply,
/obj/random/tech_supply,
-/obj/item/stack/package_wrap/twenty_five,
+/obj/item/stack/package_wrap/cargo_wrap,
/obj/item/hand_labeler,
/obj/item/device/destTagger,
/turf/simulated/floor/tiled,
@@ -16006,9 +16006,9 @@
pixel_x = 4;
pixel_y = 3
},
-/obj/item/stack/package_wrap/twenty_five,
+/obj/item/stack/package_wrap/cargo_wrap,
/obj/item/hand_labeler,
-/obj/item/wrapping_paper,
+/obj/item/stack/package_wrap/gift_wrap,
/obj/machinery/light/spot{
dir = 1
},
diff --git a/maps/torch/torch3_deck3.dmm b/maps/torch/torch3_deck3.dmm
index bc447287c99c0..4eff4926052ea 100644
--- a/maps/torch/torch3_deck3.dmm
+++ b/maps/torch/torch3_deck3.dmm
@@ -9739,7 +9739,7 @@
"xu" = (
/obj/structure/table/standard,
/obj/item/hand_labeler,
-/obj/item/stack/package_wrap/twenty_five,
+/obj/item/stack/package_wrap/cargo_wrap,
/obj/machinery/atmospherics/unary/vent_pump/on{
dir = 4
},
diff --git a/maps/torch/torch4_deck2.dmm b/maps/torch/torch4_deck2.dmm
index 85ed29982722c..07884d05b1c43 100644
--- a/maps/torch/torch4_deck2.dmm
+++ b/maps/torch/torch4_deck2.dmm
@@ -15628,7 +15628,7 @@
"PL" = (
/obj/structure/table/steel,
/obj/item/device/destTagger,
-/obj/item/stack/package_wrap/twenty_five,
+/obj/item/stack/package_wrap/cargo_wrap,
/obj/item/device/radio/intercom{
dir = 8;
pixel_x = 21
diff --git a/maps/torch/torch5_deck1.dmm b/maps/torch/torch5_deck1.dmm
index 8441f253cf1b7..0c2ae6af46dfa 100644
--- a/maps/torch/torch5_deck1.dmm
+++ b/maps/torch/torch5_deck1.dmm
@@ -14194,7 +14194,7 @@
/obj/item/storage/box/mousetraps,
/obj/item/storage/box/lights/mixed,
/obj/item/hand_labeler,
-/obj/item/stack/package_wrap/twenty_five,
+/obj/item/stack/package_wrap/cargo_wrap,
/obj/item/reagent_containers/spray/cleaner{
pixel_x = -5
},
@@ -15308,7 +15308,7 @@
desc = "A colourful crayon. Please refrain from eating it or putting it in your nose. This one is labeled 'Canary Yellow.'"
},
/obj/item/hand_labeler,
-/obj/item/stack/package_wrap/twenty_five,
+/obj/item/stack/package_wrap/cargo_wrap,
/obj/item/device/destTagger,
/turf/simulated/floor/tiled/white/monotile,
/area/rnd/office)
@@ -16356,7 +16356,7 @@
/area/medical/sleeper)
"dZx" = (
/obj/structure/table/steel,
-/obj/item/stack/package_wrap/twenty_five,
+/obj/item/stack/package_wrap/cargo_wrap,
/obj/item/hand_labeler,
/obj/item/device/destTagger{
pixel_y = 13
@@ -29417,7 +29417,7 @@
/obj/item/reagent_containers/dropper,
/obj/item/storage/box/beakers,
/obj/item/hand_labeler,
-/obj/item/stack/package_wrap/twenty_five,
+/obj/item/stack/package_wrap/cargo_wrap,
/obj/item/reagent_containers/spray/cleaner{
desc = "Someone has crossed out the 'Space' from Space Cleaner and written in Chemistry. Scrawled on the back is, 'Okay, whoever filled this with polytrinic acid, it was only funny the first time. It was hard enough replacing the CMO's first cat!'";
name = "Chemistry Cleaner"
diff --git a/maps/torch/torch6_bridge.dmm b/maps/torch/torch6_bridge.dmm
index f8f8afbe03978..87faac47c292b 100644
--- a/maps/torch/torch6_bridge.dmm
+++ b/maps/torch/torch6_bridge.dmm
@@ -10779,7 +10779,7 @@
/obj/item/device/multitool,
/obj/effect/floor_decal/industrial/outline/grey,
/obj/item/device/destTagger,
-/obj/item/stack/package_wrap/twenty_five,
+/obj/item/stack/package_wrap/cargo_wrap,
/turf/simulated/floor/tiled/dark/monotile,
/area/bridge/storage)
"Dw" = (
diff --git a/test/check-paths.sh b/test/check-paths.sh
index fede300bf851d..c5b54239e0ed4 100755
--- a/test/check-paths.sh
+++ b/test/check-paths.sh
@@ -57,7 +57,7 @@ exactly 0 "simulated = 0/1" 'simulated\s*=\s*\d' -P
exactly 2 "var/ in proc arguments" '(^/[^/].+/.+?\(.*?)var/' -P
exactly 0 "tmp/ vars" 'var.*/tmp/' -P
exactly 7 "uses of .len" '\.len\b' -P
-exactly 387 "attackby() override" '\/attackby\((.*)\)' -P
+exactly 385 "attackby() override" '\/attackby\((.*)\)' -P
exactly 15 "uses of examine()" '[.|\s]examine\(' -P # If this fails it's likely because you used '/atom/proc/examine(mob)' instead of '/proc/examinate(mob, atom)' - Exception: An examine()-proc may call other examine()-procs
exactly 7 "direct modifications of overlays list" '\boverlays((\s*[|^=+&-])|(\.(Cut)|(Add)|(Copy)|(Remove)|(Remove)))' -P
# With the potential exception of << if you increase any of these numbers you're probably doing it wrong