Persistent mobile liquid tanks (#22879)

# Summary

This PR makes liquid tanks (fuel, foam, water) persistent.
This commit is contained in:
FabianK3
2026-07-29 16:38:00 +00:00
committed by GitHub
parent 869979512a
commit 93658c90c3
11 changed files with 1824 additions and 1986 deletions
+1 -1
View File
@@ -80,7 +80,7 @@
description = "Send us some water tanks that will be used for botany research, and definitely not for creating a slip 'n slide in %PERSONNAME's office."
reward_low = 115
reward_high = 135
required_count = 3
required_count = 1
random_count = 1
wanted_types = list(/obj/structure/reagent_dispensers/watertank)
+1 -1
View File
@@ -54,7 +54,7 @@
description = "After observing your engineering staff, we think it's best if you send us a few of those fuel tanks so nobody hurts themselves."
reward_low = 250
reward_high = 350
required_count = 4
required_count = 1
random_count = 2
wanted_types = list(/obj/structure/reagent_dispensers/fueltank)
+14
View File
@@ -430,6 +430,20 @@
groupable = TRUE
spawn_amount = 1
/singleton/cargo_item/extinguishertank
category = "engineering"
name = "extinguisher tank"
supplier = "hephaestus"
description = "A tank filled with extinguisher fluid."
price = 10
items = list(
/obj/structure/reagent_dispensers/extinguisher
)
access = ACCESS_ENGINE
container_type = "box"
groupable = TRUE
spawn_amount = 1
/singleton/cargo_item/gasmask
category = "engineering"
name = "gas mask"
+14
View File
@@ -72,3 +72,17 @@
container_type = "crate"
groupable = TRUE
spawn_amount = 1
/singleton/cargo_item/watertank
category = "miscellaneous"
name = "water tank"
supplier = "orion"
description = "A tank filled with water."
price = 10
items = list(
/obj/structure/reagent_dispensers/watertank
)
access = 0
container_type = "box"
groupable = TRUE
spawn_amount = 1
-6
View File
@@ -37,12 +37,6 @@ STOCK_ITEM_LARGE(bubbleshield, 0.5)
break
new /obj/structure/machinery/shield_capacitor(T)
STOCK_ITEM_LARGE(watertank, 2)
new /obj/structure/reagent_dispensers/watertank(L)
STOCK_ITEM_LARGE(fueltank, 2)
new /obj/structure/reagent_dispensers/fueltank(L)
STOCK_ITEM_LARGE(lubetank, 2)
new /obj/structure/reagent_dispensers/lube(L)
+32 -3
View File
@@ -5,14 +5,14 @@
icon_state = "watertank"
density = 1
anchored = 0
maxhealth = OBJECT_HEALTH_HIGH
var/accept_any_reagent = TRUE
var/amount_per_transfer_from_this = 10
var/possible_transfer_amounts = list(5,10,15,25,30,50,60,100,120,250,300)
var/capacity = 1000
var/can_tamper = TRUE
var/is_leaking = FALSE
maxhealth = OBJECT_HEALTH_HIGH
var/is_persistent = FALSE
/obj/structure/reagent_dispensers/mechanics_hints(mob/user, distance, is_adjacent)
. += ..()
@@ -32,6 +32,29 @@
create_reagents(capacity)
if (!possible_transfer_amounts)
src.verbs -= /obj/structure/reagent_dispensers/verb/set_APTFT
if(is_persistent)
SSpersistence.objectsRegisterTrack(src)
/obj/structure/reagent_dispensers/persistent_objects_get_content()
var/list/content = ..()
content["remaining_volume"] = reagents ? reagents.total_volume : 0
return content
/obj/structure/reagent_dispensers/persistent_objects_apply_content(content, x, y, z)
src.x = x
src.y = y
src.z = z
if(!content["remaining_volume"] || content["remaining_volume"] <= 0)
qdel(src)
if(!LAZYLEN(reagents_to_add))
return
// This happens before Initialize, reagents are not generated yet, override to-be-added contents
// Keep ratios the same if multiple reagents are within reagents_to_add
var/scale = content["remaining_volume"] / capacity
for(var/reagent in reagents_to_add)
reagents_to_add[reagent] *= scale
/obj/structure/reagent_dispensers/verb/set_APTFT() //set amount_per_transfer_from_this
set name = "Set transfer amount"
@@ -56,6 +79,9 @@
return
if (usr.a_intent == I_HELP)
RG.standard_dispenser_refill(user,src)
if(!reagents || !reagents.total_volume)
SSpersistence.objectsDeregisterTrack(src)
return
playsound(src.loc, 'sound/machines/reagent_dispense.ogg', 25, 1)
else
if(!accept_any_reagent)
@@ -113,8 +139,9 @@
name = "extinguisher tank"
desc = "A tank filled with extinguisher fluid."
icon_state = "extinguisher_tank"
amount_per_transfer_from_this = 30
amount_per_transfer_from_this = 150 // Same volume as extinguisher refillers, quality of life value
reagents_to_add = list(/singleton/reagent/toxin/fertilizer/monoammoniumphosphate = 1000)
is_persistent = TRUE
// Tanks
/obj/structure/reagent_dispensers/watertank
@@ -123,6 +150,7 @@
icon_state = "watertank"
amount_per_transfer_from_this = 300
reagents_to_add = list(/singleton/reagent/water = 1000)
is_persistent = TRUE
/obj/structure/reagent_dispensers/lube
name = "lube tank"
@@ -141,6 +169,7 @@
var/armed = 0
var/obj/item/assembly_holder/rig = null
reagents_to_add = list(/singleton/reagent/fuel = 1000)
is_persistent = TRUE
/obj/structure/reagent_dispensers/fueltank/feedback_hints(mob/user, distance, is_adjacent)
. += ..()