[MIRROR] Adds persistent smartfridges for garden products, material sheets

This commit is contained in:
Chompstation Bot
2021-05-13 20:53:58 +00:00
parent 83a2fdc561
commit 643e532256
19 changed files with 622124 additions and 191 deletions

View File

@@ -0,0 +1 @@
#define PERSISTENCE_VARIABLE_TOKEN_LENGTH -1

View File

@@ -8,9 +8,11 @@ SUBSYSTEM_DEF(persistence)
/datum/controller/subsystem/persistence/Initialize()
. = ..()
for(var/thing in subtypesof(/datum/persistent))
var/datum/persistent/P = new thing
persistence_datums[thing] = P
P.Initialize()
var/datum/persistent/P = thing
if(initial(P.name))
P = new P
persistence_datums[thing] = P
P.Initialize()
/datum/controller/subsystem/persistence/Shutdown()
for(var/thing in persistence_datums)

View File

@@ -46,10 +46,11 @@
/datum/stored_item/proc/add_product(var/atom/movable/product)
if(product.type != item_path)
return 0
return FALSE
init_products()
product.forceMove(stored)
instances += product
return TRUE
/datum/stored_item/proc/init_products()
if(instances)
@@ -57,4 +58,40 @@
instances = list()
for(var/i = 1 to amount)
var/new_product = new item_path(stored)
instances += new_product
instances += new_product
/datum/stored_item/stack/get_amount()
return amount
/datum/stored_item/stack/add_product(var/atom/movable/product)
. = ..()
if(.)
var/obj/item/stack/S = product
if(istype(S))
amount += S.amount
/datum/stored_item/stack/get_product(var/product_location, var/count)
if(!LAZYLEN(instances))
return null // Shouldn't happen, but will loudly complain if it breaks
var/obj/item/stack/S = instances[1]
count = min(count, S.get_max_amount())
src.amount -= count // We won't vend more than one full stack per call
// Case 1: Draw the full amount from the first instance
if(count < S.get_amount())
S = S.split(count)
// Case 2: Amount at least one stack, or have to accumulate
else if(count >= S.get_amount())
count -= S.get_amount()
instances -= S
for(var/obj/item/stack/T as anything in instances)
if(count <= 0)
break
count -= T.transfer_to(S, count)
S.forceMove(product_location)
return S

View File

@@ -0,0 +1,71 @@
/obj/machinery/smartfridge/drying_rack
name = "\improper Drying Rack"
desc = "A machine for drying plants."
wrenchable = 1
icon_state = "drying_rack"
icon_base = "drying_rack"
/obj/machinery/smartfridge/drying_rack/accept_check(var/obj/item/O as obj)
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/))
var/obj/item/weapon/reagent_containers/food/snacks/S = O
if (S.dried_type)
return 1
if(istype(O, /obj/item/stack/wetleather))
return 1
return 0
/obj/machinery/smartfridge/drying_rack/process()
..()
if(stat & (BROKEN|NOPOWER))
return
if(contents.len)
dry()
update_icon()
/obj/machinery/smartfridge/drying_rack/update_icon()
var/not_working = stat & (BROKEN|NOPOWER)
var/hasItems
for(var/datum/stored_item/I in item_records)
if(I.get_amount())
hasItems = 1
break
if(hasItems)
if(not_working)
icon_state = "[icon_base]-plant-off"
else
icon_state = "[icon_base]-plant"
else
if(not_working)
icon_state = "[icon_base]-off"
else
icon_state = "[icon_base]"
/obj/machinery/smartfridge/drying_rack/proc/dry()
for(var/datum/stored_item/I in item_records)
for(var/obj/item/weapon/reagent_containers/food/snacks/S in I.instances)
if(S.dry) continue
if(S.dried_type == S.type)
S.dry = 1
S.name = "dried [S.name]"
S.color = "#AAAAAA"
I.instances -= S
S.forceMove(get_turf(src))
else
var/D = S.dried_type
new D(get_turf(src))
qdel(S)
return
for(var/obj/item/stack/wetleather/WL in I.instances)
if(!WL.wetness)
if(WL.amount)
WL.forceMove(get_turf(src))
WL.dry()
I.instances -= WL
break
WL.wetness = max(0, WL.wetness - rand(1, 3))
return

View File

@@ -0,0 +1,29 @@
/obj/machinery/smartfridge/sheets //Is this used anywhere? It's not secure.
name = "\improper Smart Sheet Storage"
desc = "A storage unit for metals."
icon_state = "fridge_dark"
icon_base = "fridge_dark"
icon_contents = "slime"
stored_datum_type = /datum/stored_item/stack
/obj/machinery/smartfridge/sheets/persistent
persistent = /datum/persistent/storage/smartfridge/sheet_storage
/obj/machinery/smartfridge/sheets/accept_check(var/obj/item/O)
return istype(O, /obj/item/stack/material)
/obj/machinery/smartfridge/sheets/vend(datum/stored_item/stack/I, var/count)
var/amount = I.get_amount()
if(amount < 1)
return
while(count > 0)
var/obj/item/stack/S = I.get_product(get_turf(src), min(count, amount))
count -= S.amount
SStgui.update_uis(src)
/obj/machinery/smartfridge/sheets/find_record(var/obj/item/O)
for(var/datum/stored_item/stack/I as anything in item_records)
if(istype(O, I.item_path)) // Typecheck should evaluate material-specific subtype
return I
return null

View File

@@ -0,0 +1,50 @@
/obj/machinery/smartfridge/produce
name = "\improper SmartFridge"
desc = "For storing all sorts of perishable foods!"
icon = 'icons/obj/vending.dmi'
icon_state = "fridge_food"
icon_base = "fridge_food"
icon_contents = "food"
/obj/machinery/smartfridge/produce/persistent
persistent = /datum/persistent/storage/smartfridge/produce
/obj/machinery/smartfridge/produce/accept_check(var/obj/item/O as obj)
if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/grown/) || istype(O,/obj/item/seeds/))
return TRUE
return FALSE
/obj/machinery/smartfridge/drinks
name = "\improper Drink Showcase"
desc = "A refrigerated storage unit for tasty tasty alcohol."
icon_state = "fridge_drinks"
icon_base = "fridge_drinks"
icon_contents = "drink"
/obj/machinery/smartfridge/drinks/accept_check(var/obj/item/O as obj)
if(istype(O,/obj/item/weapon/reagent_containers/glass) || istype(O,/obj/item/weapon/reagent_containers/food/drinks) || istype(O,/obj/item/weapon/reagent_containers/food/condiment))
return TRUE
return FALSE
/obj/machinery/smartfridge/seeds
name = "\improper MegaSeed Servitor"
desc = "When you need seeds fast!"
icon_contents = "chem"
/obj/machinery/smartfridge/seeds/accept_check(var/obj/item/O as obj)
if(istype(O,/obj/item/seeds/))
return 1
return 0
/obj/machinery/smartfridge/secure/extract
name = "\improper Biological Sample Storage"
desc = "A refrigerated storage unit for xenobiological samples."
icon_contents = "slime"
req_access = list(access_research)
/obj/machinery/smartfridge/secure/extract/accept_check(var/obj/item/O as obj)
if(istype(O, /obj/item/slime_extract))
return TRUE
if(istype(O, /obj/item/slimepotion))
return TRUE
return FALSE

View File

@@ -0,0 +1,40 @@
/obj/machinery/smartfridge/secure/medbay
name = "\improper Refrigerated Medicine Storage"
desc = "A refrigerated storage unit for storing medicine and chemicals."
req_one_access = list(access_medical,access_chemistry)
/obj/machinery/smartfridge/secure/medbay/accept_check(var/obj/item/O as obj)
if(istype(O,/obj/item/weapon/reagent_containers/glass/))
return 1
if(istype(O,/obj/item/weapon/storage/pill_bottle/))
return 1
if(istype(O,/obj/item/weapon/reagent_containers/pill/))
return 1
return 0
/obj/machinery/smartfridge/secure/virology
name = "\improper Refrigerated Virus Storage"
desc = "A refrigerated storage unit for storing viral material."
icon_contents = "drink"
req_access = list(access_virology)
/obj/machinery/smartfridge/secure/virology/accept_check(var/obj/item/O as obj)
if(istype(O,/obj/item/weapon/reagent_containers/glass/beaker/vial/))
return 1
if(istype(O,/obj/item/weapon/virusdish/))
return 1
return 0
/obj/machinery/smartfridge/chemistry //Is this used anywhere? It's not secure.
name = "\improper Smart Chemical Storage"
desc = "A refrigerated storage unit for medicine and chemical storage."
icon_contents = "chem"
/obj/machinery/smartfridge/chemistry/accept_check(var/obj/item/O as obj)
if(istype(O,/obj/item/weapon/storage/pill_bottle) || istype(O,/obj/item/weapon/reagent_containers))
return 1
return 0
/obj/machinery/smartfridge/chemistry/virology //Same
name = "\improper Smart Virus Storage"
desc = "A refrigerated storage unit for volatile sample storage."

View File

@@ -2,7 +2,7 @@
*/
/obj/machinery/smartfridge
name = "\improper SmartFridge"
desc = "For storing all sorts of perishable foods!"
desc = "For storing all sorts of things! This one doesn't accept any of them!"
icon = 'icons/obj/vending.dmi'
icon_state = "fridge_food"
var/icon_base = "fridge_food" //Iconstate to base all the broken/deny/etc on
@@ -13,10 +13,10 @@
idle_power_usage = 5
active_power_usage = 100
flags = NOREACT
var/max_n_of_items = 999 // Sorry but the BYOND infinite loop detector doesn't look things over 1000. //VOREStation Edit - Non-global
//var/global/max_n_of_items = 999 // Sorry but the BYOND infinite loop detector doesn't look things over 1000.
var/max_n_of_items = 999 // Sorry but the BYOND infinite loop detector doesn't look things over 1000. //VOREStation Edit - Nonglobal so subtypes can override to lower values
var/list/item_records = list()
var/datum/stored_item/currently_vending = null //What we're putting out of the machine.
var/stored_datum_type = /datum/stored_item
var/seconds_electrified = 0;
var/shoot_inventory = 0
var/locked = 0
@@ -24,6 +24,7 @@
var/is_secure = 0
var/wrenchable = 0
var/datum/wires/smartfridge/wires = null
var/persistent = null // Path of persistence datum used to track contents
/obj/machinery/smartfridge/secure
is_secure = 1
@@ -33,6 +34,8 @@
/obj/machinery/smartfridge/New()
..()
if(persistent)
SSpersistence.track_value(src, persistent)
if(is_secure)
wires = new/datum/wires/smartfridge/secure(src)
else
@@ -43,160 +46,13 @@
for(var/A in item_records) //Get rid of item records.
qdel(A)
wires = null
if(persistent)
SSpersistence.forget_value(src, persistent)
return ..()
/obj/machinery/smartfridge/proc/accept_check(var/obj/item/O as obj)
if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/grown/) || istype(O,/obj/item/seeds/))
return 1
return 0
/obj/machinery/smartfridge/seeds
name = "\improper MegaSeed Servitor"
desc = "When you need seeds fast!"
icon_contents = "chem"
/obj/machinery/smartfridge/seeds/accept_check(var/obj/item/O as obj)
if(istype(O,/obj/item/seeds/))
return 1
return 0
/obj/machinery/smartfridge/secure/extract
name = "\improper Biological Sample Storage"
desc = "A refrigerated storage unit for xenobiological samples."
icon_contents = "slime"
req_access = list(access_research)
/obj/machinery/smartfridge/secure/extract/accept_check(var/obj/item/O as obj)
if(istype(O, /obj/item/slime_extract))
return TRUE
if(istype(O, /obj/item/slimepotion))
return TRUE
return FALSE
/obj/machinery/smartfridge/secure/medbay
name = "\improper Refrigerated Medicine Storage"
desc = "A refrigerated storage unit for storing medicine and chemicals."
req_one_access = list(access_medical,access_chemistry)
/obj/machinery/smartfridge/secure/medbay/accept_check(var/obj/item/O as obj)
if(istype(O,/obj/item/weapon/reagent_containers/glass/))
return 1
if(istype(O,/obj/item/weapon/storage/pill_bottle/))
return 1
if(istype(O,/obj/item/weapon/reagent_containers/pill/))
return 1
return 0
/obj/machinery/smartfridge/secure/virology
name = "\improper Refrigerated Virus Storage"
desc = "A refrigerated storage unit for storing viral material."
icon_contents = "drink"
req_access = list(access_virology)
/obj/machinery/smartfridge/secure/virology/accept_check(var/obj/item/O as obj)
if(istype(O,/obj/item/weapon/reagent_containers/glass/beaker/vial/))
return 1
if(istype(O,/obj/item/weapon/virusdish/))
return 1
return 0
/obj/machinery/smartfridge/chemistry //Is this used anywhere? It's not secure.
name = "\improper Smart Chemical Storage"
desc = "A refrigerated storage unit for medicine and chemical storage."
icon_contents = "chem"
/obj/machinery/smartfridge/chemistry/accept_check(var/obj/item/O as obj)
if(istype(O,/obj/item/weapon/storage/pill_bottle) || istype(O,/obj/item/weapon/reagent_containers))
return 1
return 0
/obj/machinery/smartfridge/chemistry/virology //Same
name = "\improper Smart Virus Storage"
desc = "A refrigerated storage unit for volatile sample storage."
/obj/machinery/smartfridge/drinks
name = "\improper Drink Showcase"
desc = "A refrigerated storage unit for tasty tasty alcohol."
icon_state = "fridge_drinks"
icon_base = "fridge_drinks"
icon_contents = "drink"
/obj/machinery/smartfridge/drinks/accept_check(var/obj/item/O as obj)
if(istype(O,/obj/item/weapon/reagent_containers/glass) || istype(O,/obj/item/weapon/reagent_containers/food/drinks) || istype(O,/obj/item/weapon/reagent_containers/food/condiment))
return 1
/obj/machinery/smartfridge/drying_rack
name = "\improper Drying Rack"
desc = "A machine for drying plants."
wrenchable = 1
icon_state = "drying_rack"
icon_base = "drying_rack"
/obj/machinery/smartfridge/drying_rack/accept_check(var/obj/item/O as obj)
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/))
var/obj/item/weapon/reagent_containers/food/snacks/S = O
if (S.dried_type)
return 1
if(istype(O, /obj/item/stack/wetleather))
return 1
return 0
/obj/machinery/smartfridge/drying_rack/process()
..()
if(stat & (BROKEN|NOPOWER))
return
if(contents.len)
dry()
update_icon()
/obj/machinery/smartfridge/drying_rack/update_icon()
var/not_working = stat & (BROKEN|NOPOWER)
var/hasItems
for(var/datum/stored_item/I in item_records)
if(I.get_amount())
hasItems = 1
break
if(hasItems)
if(not_working)
icon_state = "[icon_base]-plant-off"
else
icon_state = "[icon_base]-plant"
else
if(not_working)
icon_state = "[icon_base]-off"
else
icon_state = "[icon_base]"
/obj/machinery/smartfridge/drying_rack/proc/dry()
for(var/datum/stored_item/I in item_records)
for(var/obj/item/weapon/reagent_containers/food/snacks/S in I.instances)
if(S.dry) continue
if(S.dried_type == S.type)
S.dry = 1
S.name = "dried [S.name]"
S.color = "#AAAAAA"
I.instances -= S
S.forceMove(get_turf(src))
else
var/D = S.dried_type
new D(get_turf(src))
qdel(S)
return
for(var/obj/item/stack/wetleather/WL in I.instances)
if(!WL.wetness)
if(WL.amount)
WL.forceMove(get_turf(src))
WL.dry()
I.instances -= WL
break
WL.wetness = max(0, WL.wetness - rand(1, 3))
return
/obj/machinery/smartfridge/process()
if(stat & (BROKEN|NOPOWER))
return
@@ -229,7 +85,7 @@
is_off = "-off"
// Fridge contents
if(contents) //VOREStation Edit - Some fridges do not have visible contents
if(contents)
switch(contents.len)
if(0)
add_overlay("empty[is_off]")
@@ -311,21 +167,28 @@
to_chat(user, "You short out the product lock on [src].")
return 1
/obj/machinery/smartfridge/proc/stock(obj/item/O)
var/hasRecord = FALSE //Check to see if this passes or not.
for(var/datum/stored_item/I in item_records)
/obj/machinery/smartfridge/proc/find_record(var/obj/item/O)
for(var/datum/stored_item/I as anything in item_records)
if((O.type == I.item_path) && (O.name == I.item_name))
I.add_product(O)
hasRecord = TRUE
break
if(!hasRecord)
var/datum/stored_item/item = new/datum/stored_item(src, O.type, O.name)
item.add_product(O)
item_records.Add(item)
return I
return null
/obj/machinery/smartfridge/proc/stock(obj/item/O)
var/datum/stored_item/I = find_record(O)
if(!istype(I))
I = new stored_datum_type(src, O.type, O.name)
item_records.Add(I)
I.add_product(O)
SStgui.update_uis(src)
/obj/machinery/smartfridge/proc/vend(datum/stored_item/I)
I.get_product(get_turf(src))
/obj/machinery/smartfridge/proc/vend(datum/stored_item/I, var/count)
var/amount = I.get_amount()
// Sanity check, there are probably ways to press the button when it shouldn't be possible.
if(amount <= 0)
return
for(var/i = 1 to min(amount, count))
I.get_product(get_turf(src))
SStgui.update_uis(src)
/obj/machinery/smartfridge/attack_ai(mob/user as mob)
@@ -376,16 +239,10 @@
return FALSE
var/index = text2num(params["index"])
var/datum/stored_item/I = item_records[index]
var/count = I.get_amount()
// Sanity check, there are probably ways to press the button when it shouldn't be possible.
if(count > 0)
if((count - amount) < 0)
amount = count
for(var/i = 1 to amount)
vend(I)
if(index < 1 || index > LAZYLEN(item_records))
return TRUE
vend(item_records[index], amount)
return TRUE
return FALSE
@@ -393,7 +250,7 @@
var/obj/throw_item = null
var/mob/living/target = locate() in view(7,src)
if(!target)
return 0
return FALSE
for(var/datum/stored_item/I in item_records)
throw_item = I.get_product(get_turf(src))
@@ -402,12 +259,12 @@
break
if(!throw_item)
return 0
return FALSE
spawn(0)
throw_item.throw_at(target,16,3,src)
src.visible_message("<span class='warning'>[src] launches [throw_item.name] at [target.name]!</span>")
SStgui.update_uis(src)
return 1
return TRUE
/************************
* Secure SmartFridges

View File

@@ -3,7 +3,7 @@
// of persistent data like graffiti and round to round filth.
/datum/persistent
var/name
var/name = null
var/filename
var/tokens_per_line
var/entries_expire_at // Set in rounds, this controls when the item is finally removed permanently regardless if cleaned or not.
@@ -24,6 +24,7 @@
if(!isnull(entries_decay_at) && !isnull(entries_expire_at))
entries_decay_at = round(entries_expire_at * entries_decay_at)
// Reads in list of text tokens taken from file, generates labelled list of actual token values
/datum/persistent/proc/LabelTokens(var/list/tokens)
var/list/labelled_tokens = list()
labelled_tokens["x"] = text2num(tokens[1])
@@ -48,6 +49,7 @@
tokens["age"] <= entries_expire_at \
)
// Restores saved data to world
/datum/persistent/proc/CreateEntryInstance(var/turf/creating, var/list/tokens)
return
@@ -96,7 +98,7 @@
/datum/persistent/proc/CompileEntry(var/atom/entry)
var/turf/T = get_turf(entry)
. = list(
return list(
T.x,
T.y,
T.z,
@@ -123,7 +125,8 @@
for(var/thing in SSpersistence.tracking_values[type])
if(IsValidEntry(thing))
var/list/entry = CompileEntry(thing)
if(LAZYLEN(entry) == tokens_per_line)
if(tokens_per_line == PERSISTENCE_VARIABLE_TOKEN_LENGTH || \
LAZYLEN(entry) == tokens_per_line)
for(var/i = 1 to LAZYLEN(entry))
if(istext(entry[i]))
entry[i] = replacetext(entry[i], file_entry_split_character, file_entry_substitute_character)

View File

@@ -0,0 +1,81 @@
/datum/persistent/storage/smartfridge/get_storage_list(var/obj/machinery/smartfridge/entry)
if(!istype(entry))
return ..()
. = list()
for(var/datum/stored_item/I in entry.item_records)
.[I.item_path] = I.get_amount()
/datum/persistent/storage/smartfridge/CreateEntryInstance(var/turf/creating, var/list/tokens)
var/obj/machinery/smartfridge/S = find_specific_instance(creating)
var/list/L = generate_items(tokens["items"])
for(var/atom/A in L)
if(S.accept_check(A))
S.stock(A)
else
qdel(A) // Should clean this up here, it couldn't be stocked
/datum/persistent/storage/smartfridge/sheet_storage
name = "sheet_storage"
max_storage = 50
store_per_type = TRUE
target_type = /obj/machinery/smartfridge/sheets
/datum/persistent/storage/smartfridge/sheet_storage/generate_items(var/list/L)
. = list()
for(var/obj/item/stack/material/S as anything in L)
if(!ispath(S, /obj/item/stack/material))
log_debug("Warning: Sheet_storage persistent datum tried to create [S]")
continue
var/count = L[S]
while(count > 0)
S = new S
S.amount = min(count, S.get_max_amount())
count -= S.get_amount()
. += S
/datum/persistent/storage/smartfridge/produce
name = "fruit_storage"
max_storage = 50
store_per_type = FALSE
target_type = /obj/machinery/smartfridge/produce
/datum/persistent/storage/smartfridge/produce/assemble_token(var/T)
var/list/subtok = splittext(T, " ")
if(subtok.len != 2)
return null
if(!istype(SSplants)) // No seed controller means the fruit will come out all wonky if at all
return null
subtok[2] = text2num(subtok[2])
// Ensure we've found a token describing the quantity of a path
if(subtok.len != 2 || \
!istype(SSplants.seeds[subtok[1]], /datum/seed) || \
!isnum(subtok[2]))
return null
return subtok
/datum/persistent/storage/smartfridge/produce/create_item(var/seedtype)
return new /obj/item/weapon/reagent_containers/food/snacks/grown(null, seedtype) // Smartfridge will be stock()ed with it, loc is unimportant
/datum/persistent/storage/smartfridge/produce/get_storage_list(var/obj/machinery/smartfridge/produce/entry)
if(!istype(entry))
return ..()
. = list()
for(var/datum/stored_item/I in entry.item_records)
if(LAZYLEN(I.instances))
var/obj/item/weapon/reagent_containers/food/snacks/grown/G = I.instances[1]
if(!istype(G))
continue
.[G.plantname] = I.get_amount() // Store the seed type, because that's what's used to generate the fruit

View File

@@ -0,0 +1,81 @@
/datum/persistent/storage
entries_expire_at = 1
entries_decay_at = 0
entry_decay_weight = 0
tokens_per_line = PERSISTENCE_VARIABLE_TOKEN_LENGTH
var/max_storage = 0
var/store_per_type = FALSE // If true, will store up to max_storage for each type stored
var/target_type = null // Path of the thing that this expects to put stuff into
/datum/persistent/storage/SetFilename()
if(name)
filename = "data/persistent/storage/[lowertext(using_map.name)]-[lowertext(name)].txt"
/datum/persistent/storage/LabelTokens(var/list/tokens)
. = ..()
.["items"] = list()
for(var/T in tokens)
var/list/L = assemble_token(T)
if(LAZYLEN(L))
.["items"][L[1]] = text2num(L[2])
/datum/persistent/storage/proc/assemble_token(var/T)
var/list/subtok = splittext(T, " ")
if(subtok.len != 2)
return null
subtok[1] = text2path(subtok[1])
subtok[2] = text2num( subtok[2])
// Ensure we've found a token describing the quantity of a path
if(subtok.len != 2 || \
!ispath(subtok[1]) || \
!isnum(subtok[2]))
return null
return subtok
/datum/persistent/storage/IsValidEntry(var/atom/entry)
return ..() && istype(entry, target_type)
/datum/persistent/storage/CompileEntry(var/atom/entry)
. = ..()
var/stored = max_storage
var/list/item_list = get_storage_list(entry)
var/list/storage_list = list()
for(var/item in item_list)
storage_list[item] = min(stored, storage_list[item] + item_list[item]) // Can't store more than max_storage
// stored gets reduced by qty stored, if greater than stored,
// previous assignment will handle overage, and we set to 0
if(!store_per_type)
stored = max(stored - item_list[item], 0)
for(var/item in storage_list)
. += "[item] [storage_list[item]]"
// Usage: returns list with structure:
// list(
// [type1] = [stored_quantity],
// [type2] = [stored_quantity]
// )
/datum/persistent/storage/proc/get_storage_list(var/atom/entry)
return list() // Subtypes define list structure
/datum/persistent/storage/proc/find_specific_instance(var/turf/T)
return locate(target_type) in T
/datum/persistent/storage/CheckTurfContents(var/turf/T, var/list/tokens)
return istype(find_specific_instance(T), target_type)
/datum/persistent/storage/proc/generate_items(var/list/L)
. = list()
for(var/path in L)
for(var/i in 1 to L[path])
var/atom/A = create_item(path)
if(!QDELETED(A))
. += A
/datum/persistent/storage/proc/create_item(var/path)
return new path()

File diff suppressed because it is too large Load Diff

View File

@@ -73,6 +73,7 @@
#include "code\__defines\objects.dm"
#include "code\__defines\overmap.dm"
#include "code\__defines\pda.dm"
#include "code\__defines\persistence.dm"
#include "code\__defines\planets.dm"
#include "code\__defines\planets_vr.dm"
#include "code\__defines\plants.dm"
@@ -2368,9 +2369,15 @@
#include "code\modules\food\kitchen\gibber.dm"
#include "code\modules\food\kitchen\icecream.dm"
#include "code\modules\food\kitchen\microwave.dm"
<<<<<<< HEAD
#include "code\modules\food\kitchen\microwave_ch.dm"
#include "code\modules\food\kitchen\smartfridge.dm"
#include "code\modules\food\kitchen\smartfridge_vr.dm"
||||||| parent of f0ddc3b8b8... Merge pull request #10315 from VOREStation/upstream-merge-8042
#include "code\modules\food\kitchen\smartfridge.dm"
#include "code\modules\food\kitchen\smartfridge_vr.dm"
=======
>>>>>>> f0ddc3b8b8... Merge pull request #10315 from VOREStation/upstream-merge-8042
#include "code\modules\food\kitchen\cooking_machines\_appliance.dm"
#include "code\modules\food\kitchen\cooking_machines\_cooker.dm"
#include "code\modules\food\kitchen\cooking_machines\_cooker_output.dm"
@@ -2381,6 +2388,12 @@
#include "code\modules\food\kitchen\cooking_machines\fryer.dm"
#include "code\modules\food\kitchen\cooking_machines\grill.dm"
#include "code\modules\food\kitchen\cooking_machines\oven.dm"
#include "code\modules\food\kitchen\smartfridge\drying_rack.dm"
#include "code\modules\food\kitchen\smartfridge\engineering.dm"
#include "code\modules\food\kitchen\smartfridge\hydroponics.dm"
#include "code\modules\food\kitchen\smartfridge\medical.dm"
#include "code\modules\food\kitchen\smartfridge\smartfridge.dm"
#include "code\modules\food\kitchen\smartfridge\smartfridge_vr.dm"
#include "code\modules\gamemaster\defines.dm"
#include "code\modules\gamemaster\event2\event.dm"
#include "code\modules\gamemaster\event2\meta.dm"
@@ -3528,12 +3541,14 @@
#include "code\modules\persistence\noticeboard.dm"
#include "code\modules\persistence\noticeboard_yw.dm"
#include "code\modules\persistence\persistence.dm"
#include "code\modules\persistence\datum\datum_filth.dm"
#include "code\modules\persistence\datum\datum_graffiti.dm"
#include "code\modules\persistence\datum\datum_paper.dm"
#include "code\modules\persistence\datum\datum_paper_sticky.dm"
#include "code\modules\persistence\datum\datum_trash.dm"
#include "code\modules\persistence\datum\persistence_datum.dm"
#include "code\modules\persistence\effects\filth.dm"
#include "code\modules\persistence\effects\graffiti.dm"
#include "code\modules\persistence\effects\paper.dm"
#include "code\modules\persistence\effects\paper_sticky.dm"
#include "code\modules\persistence\effects\trash.dm"
#include "code\modules\persistence\storage\smartfridge.dm"
#include "code\modules\persistence\storage\storage.dm"
#include "code\modules\planet\planet.dm"
#include "code\modules\planet\sif.dm"
#include "code\modules\planet\time.dm"