mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-21 13:05:36 +01:00
Part 4: Storage Improvements (#90783)
- Address https://github.com/tgstation/tgstation/pull/90476#discussion_r2051701283. Makes pill bottle code cleaner - Datumized some more storage values(monkey guncase toolbox & crafter toolbox) making their init slightly faster - Moved all standard storage subtypes(bags, boxes, lockboxes etc) that is scattered across various files & folders in the codebase into their respective files under `code/game/objects/item/storage` folder. This means for e.g. if you want to see all boxes in the game you can find them in `code/game/objects/item/storage/boxes` folder & don't have to go looking for hidden subtypes in various module files or folders where they were hidden away. Makes looking for stuff & modifying these storages much saner & easier 🆑 code: organized storage subtypes under the same files & folders /🆑 --------- Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com>
This commit is contained in:
@@ -100,16 +100,3 @@
|
||||
|
||||
return return_flags
|
||||
|
||||
|
||||
/**
|
||||
* Base container used for gimmick disks.
|
||||
*/
|
||||
/obj/item/storage/briefcase/secure/digital_storage
|
||||
name = "digi-case"
|
||||
desc = "It's made of AUTHENTIC digital leather and has a price-tag still attached. Its owner must be a real professional."
|
||||
icon_state = "secure"
|
||||
base_icon_state = "secure"
|
||||
inhand_icon_state = "sec-case"
|
||||
|
||||
/obj/item/storage/briefcase/secure/digital_storage/PopulateContents()
|
||||
return
|
||||
|
||||
@@ -104,45 +104,6 @@
|
||||
var/our_amount = rand(20, 50)
|
||||
reagents.add_reagent(our_reagent, our_amount)
|
||||
|
||||
/obj/item/storage/box/alchemist_basic_chems
|
||||
name = "box of alchemical bases"
|
||||
desc = "Contains a set of basic reagents, for all your potion-making needs! If only you labeled them."
|
||||
illustration = "beaker"
|
||||
|
||||
/obj/item/storage/box/alchemist_basic_chems/PopulateContents()
|
||||
for(var/i in 1 to 7)
|
||||
if(prob(1))
|
||||
new /obj/item/reagent_containers/cup/glass/coffee(src)
|
||||
continue
|
||||
new /obj/item/reagent_containers/cup/bottle/alchemist_basic(src)
|
||||
|
||||
/obj/item/storage/box/alchemist_random_chems
|
||||
name = "box of potions"
|
||||
desc = "An especially fancy box to keep your finished potions safe."
|
||||
icon_state = "syndiebox"
|
||||
illustration = "beaker"
|
||||
|
||||
/obj/item/storage/box/alchemist_random_chems/PopulateContents()
|
||||
for(var/i in 1 to 7)
|
||||
if(prob(1))
|
||||
new /obj/item/reagent_containers/cup/glass/coffee(src)
|
||||
continue
|
||||
new /obj/item/reagent_containers/cup/bottle/alchemist_random(src)
|
||||
|
||||
/obj/item/storage/box/alchemist_chemistry_kit
|
||||
name = "box of alchemy tools"
|
||||
desc = "Contains everything needed for the up and coming chemistry student to enact hazardous chemical mishaps in the comfort of their own home."
|
||||
|
||||
/obj/item/storage/box/alchemist_chemistry_kit/PopulateContents()
|
||||
new /obj/item/reagent_containers/cup/mortar(src)
|
||||
new /obj/item/pestle(src)
|
||||
new /obj/item/lighter/skull(src)
|
||||
new /obj/item/ph_booklet(src)
|
||||
new /obj/item/thermometer(src)
|
||||
new /obj/item/storage/test_tube_rack/full(src)
|
||||
new /obj/item/reagent_containers/cup/glass/coffee(src)
|
||||
|
||||
|
||||
/datum/bitrunning_gimmick/rogue
|
||||
name = "Rogue"
|
||||
|
||||
@@ -169,15 +130,6 @@
|
||||
/obj/item/bedsheet/black/rogue_cape
|
||||
name = "cape of DARKNESS"
|
||||
|
||||
/obj/item/storage/belt/fannypack/black/rogue
|
||||
name = "fannypack of ULTIMATE DESPAIR"
|
||||
|
||||
/obj/item/storage/belt/fannypack/black/rogue/PopulateContents()
|
||||
new /obj/item/food/drug/saturnx(src)
|
||||
new /obj/item/reagent_containers/cup/blastoff_ampoule(src)
|
||||
new /obj/item/reagent_containers/hypospray/medipen/methamphetamine(src)
|
||||
|
||||
|
||||
/datum/bitrunning_gimmick/healer
|
||||
name = "Healer"
|
||||
|
||||
|
||||
@@ -41,24 +41,6 @@
|
||||
/obj/item/storage/cans/sixenergydrink,
|
||||
)
|
||||
|
||||
/obj/item/storage/cans/sixenergydrink
|
||||
name = "energy drink bottle ring"
|
||||
desc = "Holds six energy drink cans. Remember to recycle when you're done!"
|
||||
|
||||
/// Pool of energy drinks tm we may add from
|
||||
var/list/energy_drink_options = list(
|
||||
/obj/item/reagent_containers/cup/soda_cans/space_mountain_wind = 50,
|
||||
/obj/item/reagent_containers/cup/soda_cans/monkey_energy = 30,
|
||||
/obj/item/reagent_containers/cup/soda_cans/volt_energy = 15,
|
||||
/obj/item/reagent_containers/cup/soda_cans/thirteenloko = 5,
|
||||
)
|
||||
|
||||
/obj/item/storage/cans/sixenergydrink/PopulateContents()
|
||||
for(var/i in 1 to 6)
|
||||
var/obj/item/chosen_energy_drink = pick_weight(energy_drink_options)
|
||||
new chosen_energy_drink(src)
|
||||
|
||||
|
||||
/datum/bitrunning_gimmick/archer
|
||||
name = "Archer"
|
||||
|
||||
@@ -70,15 +52,6 @@
|
||||
/obj/item/ammo_casing/arrow/holy/blazing,
|
||||
)
|
||||
|
||||
/obj/item/storage/bag/quiver/endless
|
||||
name = "endless quiver"
|
||||
desc = "Holds arrows for your bow. A deep digital void is contained within."
|
||||
storage_type = /datum/storage/bag/quiver/endless
|
||||
|
||||
/obj/item/storage/bag/quiver/endless/PopulateContents()
|
||||
. = ..()
|
||||
new arrow_path(src)
|
||||
|
||||
/datum/bitrunning_gimmick/fisher
|
||||
name = "Fisher"
|
||||
|
||||
@@ -107,24 +80,6 @@
|
||||
/obj/item/storage/cans/sixgamerdrink,
|
||||
)
|
||||
|
||||
/obj/item/storage/cans/sixgamerdrink
|
||||
name = "gamer drink bottle ring"
|
||||
desc = "Holds six gamer drink cans. Remember to recycle when you're done!"
|
||||
|
||||
/// Pool of gamer drinks tm we may add from
|
||||
var/list/gamer_drink_options = list(
|
||||
/obj/item/reagent_containers/cup/soda_cans/pwr_game = 55,
|
||||
/obj/item/reagent_containers/cup/soda_cans/space_mountain_wind = 15,
|
||||
/obj/item/reagent_containers/cup/soda_cans/monkey_energy = 15,
|
||||
/obj/item/reagent_containers/cup/soda_cans/volt_energy = 10,
|
||||
/obj/item/reagent_containers/cup/soda_cans/thirteenloko = 5,
|
||||
)
|
||||
|
||||
/obj/item/storage/cans/sixgamerdrink/PopulateContents()
|
||||
for(var/i in 1 to 6)
|
||||
var/obj/item/chosen_gamer_drink = pick_weight(gamer_drink_options)
|
||||
new chosen_gamer_drink(src)
|
||||
|
||||
/obj/item/modular_computer/laptop/gamer
|
||||
desc = "A high-end laptop often used for metagaming."
|
||||
device_theme = PDA_THEME_TERMINAL
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
/obj/item/storage/lockbox/bitrunning
|
||||
name = "base class curiosity"
|
||||
desc = "Talk to a coder."
|
||||
req_access = list(ACCESS_INACCESSIBLE)
|
||||
icon_state = "bitrunning+l"
|
||||
inhand_icon_state = "bitrunning"
|
||||
base_icon_state = "bitrunning"
|
||||
icon_locked = "bitrunning+l"
|
||||
icon_closed = "bitrunning"
|
||||
icon_broken = "bitrunning+b"
|
||||
icon_open = "bitrunning"
|
||||
|
||||
/obj/item/storage/lockbox/bitrunning/encrypted
|
||||
name = "encrypted curiosity"
|
||||
desc = "Needs to be decrypted at the safehouse to be opened."
|
||||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
|
||||
/// Path for the loot we are assigned
|
||||
var/loot_path
|
||||
|
||||
/obj/item/storage/lockbox/bitrunning/encrypted/emag_act(mob/user, obj/item/card/emag/emag_card)
|
||||
return FALSE
|
||||
|
||||
/obj/item/storage/lockbox/bitrunning/decrypted
|
||||
name = "decrypted curiosity"
|
||||
desc = "Compiled from the virtual domain. An extra reward of a successful bitrunner."
|
||||
storage_type = /datum/storage/lockbox/bitrunning_decrypted
|
||||
|
||||
/// What virtual domain did we come from.
|
||||
var/datum/lazy_template/virtual_domain/source_domain
|
||||
|
||||
/obj/item/storage/lockbox/bitrunning/decrypted/Initialize(
|
||||
mapload,
|
||||
datum/lazy_template/virtual_domain/completed_domain,
|
||||
)
|
||||
|
||||
if(isnull(completed_domain))
|
||||
log_runtime("Decrypted curiosity was created with no source domain.")
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
if(!istype(completed_domain, /datum/lazy_template/virtual_domain)) // Check if this is a proper virtual domain before doing anything with it
|
||||
log_runtime("Decrypted curiosity was created with an invalid source domain. [completed_domain.name] ([completed_domain.type]).")
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
source_domain = completed_domain
|
||||
|
||||
. = ..()
|
||||
|
||||
icon_state = icon_closed
|
||||
playsound(src, 'sound/effects/magic/blink.ogg', 50, TRUE)
|
||||
|
||||
/obj/item/storage/lockbox/bitrunning/decrypted/PopulateContents()
|
||||
var/choice = SSbitrunning.pick_secondary_loot(source_domain)
|
||||
new choice(src)
|
||||
Reference in New Issue
Block a user