Files
Atermonera a2c68d9a8d Sheet storage has different caps per type. (#9029)
* Adds per-type max storage persistence

* false paths
2023-03-13 23:44:06 -08:00

35 lines
1.1 KiB
Plaintext

/obj/machinery/smartfridge/sheets
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/persistent_lossy
persistent = /datum/persistent/storage/smartfridge/sheet_storage/variable_max
/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
count = min(count, amount)
while(count > 0)
var/obj/item/stack/S = I.get_product(get_turf(src), count)
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(O.type == I.item_path) // Typecheck should evaluate material-specific subtype
return I
return null