mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
[MIRROR] Smart Storage Tweaks (#7835)
Co-authored-by: Killian <49700375+KillianKirilenko@users.noreply.github.com> Co-authored-by: CHOMPStation2 <chompsation2@gmail.com>
This commit is contained in:
@@ -25,12 +25,17 @@
|
||||
store_per_type = TRUE
|
||||
target_type = /obj/machinery/smartfridge/sheets
|
||||
|
||||
var/min_retained = 75 //minimum percentage of current stock for retention
|
||||
var/max_retained = 80 //maximum percentage of current stock for retention
|
||||
var/stacks_go_missing = FALSE // Variable rate depletion of stacks inter-round
|
||||
var/minimum_storage_reserve = FALSE // ...but still try to maintain a minimum reserve?
|
||||
|
||||
/datum/persistent/storage/smartfridge/sheet_storage/lossy
|
||||
name = "sheet storage lossy"
|
||||
max_storage = 250
|
||||
min_storage = 20 //if the amount is at or below this, don't cull
|
||||
max_storage = 500 //if the amount is above this, cull it to this amount THEN do math
|
||||
stacks_go_missing = TRUE
|
||||
minimum_storage_reserve = TRUE
|
||||
|
||||
/datum/persistent/storage/smartfridge/sheet_storage/variable_max
|
||||
name = "variable max storage"
|
||||
@@ -65,8 +70,10 @@
|
||||
|
||||
// Delete some stacks if we want
|
||||
if(stacks_go_missing)
|
||||
var/fuzzy = rand(55,65)*0.01 // loss of 35-45% with rounding down
|
||||
count = round(count*fuzzy)
|
||||
var/fuzzy = rand(min_retained,max_retained)*0.01 // loss of 35-45% with rounding down
|
||||
if(!minimum_storage_reserve || (count > min_storage && minimum_storage_reserve))
|
||||
count = round(count*fuzzy)
|
||||
|
||||
if(count <= 0)
|
||||
continue
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
entry_decay_weight = 0
|
||||
// // // //
|
||||
|
||||
var/min_storage = 0
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user