Skip to content

Commit

Permalink
[MIRROR] tweaked playsound, changes & fixes for storage items
Browse files Browse the repository at this point in the history
  • Loading branch information
Spookerton authored and SierraHelper committed Jan 14, 2024
1 parent 6f81c69 commit 5ccc108
Show file tree
Hide file tree
Showing 34 changed files with 201 additions and 190 deletions.
43 changes: 25 additions & 18 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -277,31 +277,38 @@
R.activate_module(src)
R.hud_used.update_robot_modules_display()

/obj/item/use_tool(obj/item/W, mob/living/user, list/click_params)
if(SSfabrication.try_craft_with(src, W, user))
return TRUE

if(istype(W, /obj/item/storage))
var/obj/item/storage/S = W
if (S.collection_mode && isturf(loc)) //Mode is set to collect all items
S.gather_all(loc, user)
return TRUE

/obj/item/use_tool(obj/item/item, mob/living/user, list/click_params)
if (SSfabrication.try_craft_with(src, item, user))
return TRUE
if (istype(item, /obj/item/storage) && isturf(loc))
var/obj/item/storage/storage = item
if (!storage.allow_quick_gather)
return ..()
if (!storage.quick_gather_single)
storage.gather_all(loc, user)
else if (storage.can_be_inserted(src, user))
storage.handle_item_insertion(src)
return TRUE
return ..()


///Eventually should be deleted in favor of use_tool; keeping duplicate until downstream attackbys are replaced.
/obj/item/attackby(obj/item/W, mob/living/user, list/click_params)
if(SSfabrication.try_craft_with(src, W, user))
/obj/item/attackby(obj/item/item, mob/living/user, list/click_params)
if (SSfabrication.try_craft_with(src, item, user))
return TRUE
if (istype(item, /obj/item/storage) && isturf(loc))
var/obj/item/storage/storage = item
if (!storage.allow_quick_gather)
return ..()
if (!storage.quick_gather_single)
storage.gather_all(loc, user)
else if (storage.can_be_inserted(src, user))
storage.handle_item_insertion(src)
return TRUE

if(istype(W, /obj/item/storage))
var/obj/item/storage/S = W
if (S.collection_mode && isturf(loc)) //Mode is set to collect all items
S.gather_all(loc, user)
return TRUE

return ..()


/obj/item/can_embed()
if (!canremove)
return FALSE
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/storage/backpack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@
storage_slots = 5
max_w_class = ITEM_SIZE_NORMAL
max_storage_space = 15
cant_hold = list(/obj/item/storage/backpack/satchel/flat) //muh recursive backpacks
contents_banned = list(/obj/item/storage/backpack/satchel/flat)
startswith = list(
/obj/item/stack/tile/floor,
/obj/item/crowbar
Expand Down
8 changes: 4 additions & 4 deletions code/game/objects/items/weapons/storage/bags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
/obj/item/storage/bag
allow_quick_gather = TRUE
allow_quick_empty = TRUE
collection_mode = TRUE
slot_flags = SLOT_BELT

/obj/item/storage/bag/handle_item_insertion(obj/item/W as obj, prevent_warning = 0)
Expand Down Expand Up @@ -49,7 +48,6 @@
w_class = ITEM_SIZE_SMALL
max_w_class = ITEM_SIZE_HUGE //can fit a backpack inside a trash bag, seems right
max_storage_space = DEFAULT_BACKPACK_STORAGE
can_hold = list() // any

/obj/item/storage/bag/trash/update_w_class()
..()
Expand Down Expand Up @@ -89,7 +87,6 @@
w_class = ITEM_SIZE_TINY
max_w_class = ITEM_SIZE_NORMAL
max_storage_space = DEFAULT_BOX_STORAGE
can_hold = list() // any

// -----------------------------
// Cash Bag
Expand All @@ -103,4 +100,7 @@
max_storage_space = 100
max_w_class = ITEM_SIZE_HUGE
w_class = ITEM_SIZE_SMALL
can_hold = list(/obj/item/material/coin,/obj/item/spacecash)
contents_allowed = list(
/obj/item/material/coin,
/obj/item/spacecash
)
44 changes: 20 additions & 24 deletions code/game/objects/items/weapons/storage/belt.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
var/list/can_holster //List of objects which this item can store in the designated holster slot(if unset, it will default to any holsterable items)
var/sound_in = 'sound/effects/holster/holsterin.ogg'
var/sound_out = 'sound/effects/holster/holsterout.ogg'
can_hold = list(
contents_allowed = list(
/obj/item/melee/baton,
/obj/item/melee/telebaton
)
Expand Down Expand Up @@ -107,7 +107,7 @@
icon_state = "utilitybelt"
item_state = "utility"
overlay_flags = BELT_OVERLAY_ITEMS
can_hold = list(
contents_allowed = list(
/obj/item/crowbar,
/obj/item/screwdriver,
/obj/item/weldingtool,
Expand Down Expand Up @@ -175,7 +175,7 @@
desc = "Can hold various medical equipment."
icon_state = "medicalbelt"
item_state = "medical"
can_hold = list(
contents_allowed = list(
/obj/item/device/scanner/health,
/obj/item/reagent_containers/dropper,
/obj/item/reagent_containers/glass/beaker,
Expand Down Expand Up @@ -220,7 +220,7 @@
item_state = "security"
storage_slots = 8
overlay_flags = BELT_OVERLAY_ITEMS|BELT_OVERLAY_HOLSTER
can_hold = list(
contents_allowed = list(
/obj/item/crowbar,
/obj/item/grenade,
/obj/item/reagent_containers/spray/pepper,
Expand Down Expand Up @@ -263,7 +263,7 @@
icon_state = "basicsecuritybelt"
item_state = "basicsecurity"
overlay_flags = BELT_OVERLAY_ITEMS
can_hold = list(
contents_allowed = list(
/obj/item/crowbar,
/obj/item/grenade,
/obj/item/reagent_containers/spray/pepper,
Expand Down Expand Up @@ -298,7 +298,7 @@
icon_state = "gearbelt"
item_state = "gear"
overlay_flags = BELT_OVERLAY_ITEMS
can_hold = list(
contents_allowed = list(
/obj/item/device/flash,
/obj/item/melee/telebaton,
/obj/item/device/taperecorder,
Expand Down Expand Up @@ -351,7 +351,7 @@
desc = "A belt used to hold most janitorial supplies."
icon_state = "janibelt"
item_state = "janibelt"
can_hold = list(
contents_allowed = list(
/obj/item/grenade/chem_grenade,
/obj/item/device/lightreplacer,
/obj/item/device/flashlight,
Expand All @@ -367,7 +367,7 @@
/obj/item/material/knife/folding,
/obj/item/modular_computer/tablet,
/obj/item/modular_computer/pda
)
)

/obj/item/storage/belt/holster/general
name = "holster belt"
Expand All @@ -376,7 +376,7 @@
item_state = "command"
storage_slots = 7
overlay_flags = BELT_OVERLAY_ITEMS|BELT_OVERLAY_HOLSTER
can_hold = list(
contents_allowed = list(
/obj/item/device/flash,
/obj/item/melee/telebaton,
/obj/item/device/taperecorder,
Expand Down Expand Up @@ -412,7 +412,7 @@
/obj/item/clothing/head/beret,
/obj/item/material/knife/folding,
/obj/item/device/tape
)
)

/obj/item/storage/belt/holster/forensic
name = "forensic holster belt"
Expand All @@ -421,7 +421,7 @@
item_state = "forensic"
storage_slots = 8
overlay_flags = BELT_OVERLAY_HOLSTER
can_hold = list(
contents_allowed = list(
/obj/item/reagent_containers/spray/luminol,
/obj/item/device/uv_light,
/obj/item/reagent_containers/syringe,
Expand Down Expand Up @@ -449,15 +449,15 @@
/obj/item/clothing/glasses,
/obj/item/reagent_containers/spray/pepper,
/obj/item/device/flash
)
)

/obj/item/storage/belt/forensic
name = "forensic belt"
desc = "Can hold forensic gear like fingerprint powder and luminol."
icon_state = "basicforensicbelt"
item_state = "basicforensic"
storage_slots = 8
can_hold = list(
contents_allowed = list(
/obj/item/reagent_containers/spray/luminol,
/obj/item/device/uv_light,
/obj/item/reagent_containers/syringe,
Expand Down Expand Up @@ -485,7 +485,7 @@
/obj/item/clothing/glasses,
/obj/item/reagent_containers/spray/pepper,
/obj/item/device/flash
)
)

/obj/item/storage/belt/holster/machete
name = "machete belt"
Expand All @@ -494,7 +494,7 @@
item_state = "machetebelt"
storage_slots = 8
overlay_flags = BELT_OVERLAY_HOLSTER
can_hold = list(
contents_allowed = list(
/obj/item/device/binoculars,
/obj/item/device/camera,
/obj/item/stack/flag,
Expand Down Expand Up @@ -522,7 +522,7 @@
/obj/item/device/drone_designator,
/obj/item/modular_computer/tablet,
/obj/item/modular_computer/pda
)
)
can_holster = list(/obj/item/material/hatchet/machete)
sound_in = 'sound/effects/holster/sheathin.ogg'
sound_out = 'sound/effects/holster/sheathout.ogg'
Expand All @@ -532,9 +532,7 @@
desc = "Designed for ease of access to the shards during a fight, as to not let a single enemy spirit slip away."
icon_state = "soulstonebelt"
item_state = "soulstonebelt"
can_hold = list(
/obj/item/device/soulstone
)
contents_allowed = list(/obj/item/device/soulstone)

/obj/item/storage/belt/soulstone/full/New()
..()
Expand All @@ -554,9 +552,7 @@
item_state = "champion"
storage_slots = null
max_storage_space = ITEM_SIZE_SMALL
can_hold = list(
/obj/item/clothing/mask/luchador
)
contents_allowed = list(/obj/item/clothing/mask/luchador)

/obj/item/storage/belt/holster/security/tactical
name = "combat belt"
Expand All @@ -583,12 +579,12 @@
item_state = "gear"
storage_slots = 5
overlay_flags = BELT_OVERLAY_ITEMS
can_hold = list(
contents_allowed = list(
/obj/item/grenade/chem_grenade/water,
/obj/item/crowbar/emergency_forcing_tool,
/obj/item/extinguisher/mini,
/obj/item/inflatable/door
)
)


/obj/item/storage/belt/fire_belt/full
Expand Down
7 changes: 3 additions & 4 deletions code/game/objects/items/weapons/storage/boxes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@
desc = "Drymate brand monkey cubes. Just add water!"
icon = 'icons/obj/food/food.dmi'
icon_state = "monkeycubebox"
can_hold = list(/obj/item/reagent_containers/food/snacks/monkeycube)
contents_allowed = list(/obj/item/reagent_containers/food/snacks/monkeycube)
startswith = list(/obj/item/reagent_containers/food/snacks/monkeycube/wrapped = 5)


Expand Down Expand Up @@ -448,7 +448,7 @@
desc = "Eight wrappers of fun! Ages 8 and up. Not suitable for children."
icon = 'icons/obj/toy.dmi'
icon_state = "spbox"
can_hold = list(/obj/item/toy/snappop)
contents_allowed = list(/obj/item/toy/snappop)
startswith = list(/obj/item/toy/snappop = 8)


Expand All @@ -466,7 +466,6 @@
desc = "This box is shaped on the inside so that only light tubes and bulbs fit."
item_state = "syringe_kit"
allow_quick_gather = TRUE
collection_mode = TRUE


/obj/item/storage/box/lights/Initialize()
Expand Down Expand Up @@ -531,7 +530,7 @@
icon_state = "checkers"
max_storage_space = 24
foldable = null
can_hold = list(/obj/item/reagent_containers/food/snacks/checker)
contents_allowed = list(/obj/item/reagent_containers/food/snacks/checker)
startswith = list(/obj/item/reagent_containers/food/snacks/checker = 12,
/obj/item/reagent_containers/food/snacks/checker/red = 12)

Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/storage/fancy/crackers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
max_w_class = ITEM_SIZE_TINY
w_class = ITEM_SIZE_SMALL
key_type = list(/obj/item/reagent_containers/food/snacks/cracker)
can_hold = list(
contents_allowed = list(
/obj/item/reagent_containers/food/snacks/cracker
)
startswith = list(
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/storage/fancy/egg_box.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
max_w_class = ITEM_SIZE_SMALL
w_class = ITEM_SIZE_NORMAL
key_type = list(/obj/item/reagent_containers/food/snacks/egg)
can_hold = list(
contents_allowed = list(
/obj/item/reagent_containers/food/snacks/egg,
/obj/item/reagent_containers/food/snacks/boiledegg
)
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/weapons/storage/fancy/matchbox.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
max_storage_space = 10
w_class = ITEM_SIZE_SMALL
slot_flags = SLOT_BELT
can_hold = list(/obj/item/flame/match)
contents_allowed = list(/obj/item/flame/match)
key_type = list(/obj/item/flame/match)
startswith = list(/obj/item/flame/match = 10)
var/sprite_key_type_count = 3
Expand All @@ -21,7 +21,7 @@
max_storage_space = 3
w_class = ITEM_SIZE_TINY
slot_flags = SLOT_EARS
can_hold = list(/obj/item/flame/match)
contents_allowed = list(/obj/item/flame/match)
key_type = list(/obj/item/flame/match)
startswith = list(/obj/item/flame/match = 3)

Expand Down
7 changes: 3 additions & 4 deletions code/game/objects/items/weapons/storage/firstaid.dm
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
/obj/item/reagent_containers/hypospray/autoinjector/pouch_auto/dexalin,
/obj/item/stack/medical/bruise_pack
)
can_hold = list(
contents_allowed = list(
/obj/item/clothing/gloves/latex,
/obj/item/reagent_containers/hypospray/autoinjector,
/obj/item/stack/medical/bruise_pack
Expand All @@ -174,7 +174,7 @@
max_w_class = ITEM_SIZE_NORMAL
max_storage_space = null
w_class = ITEM_SIZE_LARGE
can_hold = list(
contents_allowed = list(
/obj/item/bonesetter,
/obj/item/cautery,
/obj/item/circular_saw,
Expand Down Expand Up @@ -212,11 +212,10 @@
w_class = ITEM_SIZE_LARGE
max_storage_space = DEFAULT_LARGEBOX_STORAGE
allow_quick_gather = TRUE
collection_mode = TRUE
temperature = -16 CELSIUS
matter = list(MATERIAL_PLASTIC = 350)
origin_tech = list(TECH_MATERIAL = 3, TECH_POWER = 2)
can_hold = list(
contents_allowed = list(
/obj/item/organ,
/obj/item/reagent_containers
)
Expand Down
3 changes: 1 addition & 2 deletions code/game/objects/items/weapons/storage/laundry_basket.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
storage_slots = 14
allow_quick_empty = TRUE
allow_quick_gather = TRUE
collection_mode = TRUE
var/linked


Expand Down Expand Up @@ -78,8 +77,8 @@
icon = 'icons/obj/weapons/other.dmi'
icon_state = "offhand"
name = "second hand"
collection_mode = FALSE
allow_quick_gather = FALSE
quick_gather_single = TRUE

/obj/item/storage/laundry_basket/offhand/dropped(mob/user as mob)
..()
Expand Down
Loading

0 comments on commit 5ccc108

Please sign in to comment.