P06-01: Implement approved A06 finite Mana reserve (MP-01-r02 recommended)
Initial 100, capacity 300, world tree +20 per 10 game minutes. Each boundary pays registered upkeep demand before storing surplus; overflow is discarded and recorded, 0 stops the whole tower. Furnace offers are judged after generation and demand payment. New saves carry mana_reserve and Operations rollback includes it; legacy saves keep a 0..300 amount and reject others. Outage tests that relied on Mana 0 persisting now hold the outage with a disabled demand sink, since the world tree recovers at the next boundary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
c366012446
commit
ae0f998ff4
@@ -1,4 +1,5 @@
|
||||
extends SceneTree
|
||||
const ManaOutage = preload("res://tests/helpers/mana_outage.gd")
|
||||
var checks := 0
|
||||
var failures := 0
|
||||
var runtime: Variant
|
||||
@@ -50,7 +51,7 @@ func run() -> void:
|
||||
expect(patient.current_cell == medic.current_cell and patient.health == 0 and runtime.elevators.get_report()[&"trips"].is_empty(), "emergency unloads both at the same floor without healing")
|
||||
expect(runtime.restore_snapshot(runtime.create_snapshot()), "emergency pair release remains saveable")
|
||||
expect(runtime.restore_snapshot(checkpoint), "restore boarded rescue pair for tower-wide depletion")
|
||||
state.set_resource(&"mana", 0)
|
||||
ManaOutage.hold(runtime, state)
|
||||
clock.advance_minutes(1)
|
||||
patient = runtime.staff_service.get_staff(&"patient"); medic = runtime.staff_service.get_staff(&"medic")
|
||||
expect(patient.current_cell == medic.current_cell and patient.health == 0 and runtime.elevators.get_report()[&"trips"].is_empty(), "reserve depletion lands both rescue passengers together without healing")
|
||||
@@ -60,7 +61,7 @@ func run() -> void:
|
||||
expect(runtime.staff_service.get_staff(&"patient").health == 0 and runtime.staff_service.get_staff(&"patient").current_cell == landing, "stopped clinic cannot heal or teleport the landed patient")
|
||||
var outage: Dictionary = runtime.create_snapshot()
|
||||
expect(runtime.staff_service.validate_invariants()[&"ok"] and runtime.restore_snapshot(outage) and runtime.create_snapshot() == outage, "depleted rescue ownership survives exact complete save restoration")
|
||||
state.set_resource(&"mana", 100)
|
||||
ManaOutage.release(runtime, state)
|
||||
clock.advance_minutes(100)
|
||||
expect(runtime.staff_service.get_staff(&"patient").health == 100, "restored power resumes rescue and treatment for the same patient")
|
||||
expect(runtime.staff_service.validate_invariants()[&"ok"] and runtime.restore_snapshot(runtime.create_snapshot()), "recovered rescue has no orphan ownership and remains saveable")
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
extends SceneTree
|
||||
const ManaOutage = preload("res://tests/helpers/mana_outage.gd")
|
||||
var checks := 0
|
||||
var failures := 0
|
||||
var runtime: Variant
|
||||
@@ -40,11 +41,11 @@ func run() -> void:
|
||||
expect(runtime.create_snapshot()==arrived,"staff movement and recovery replay exactly")
|
||||
worker=runtime.staff_service.get_staff(&"dorm_sleeper")
|
||||
var health:=worker.health
|
||||
state.set_resource(&"mana",0);clock.advance_minutes(30)
|
||||
ManaOutage.hold(runtime, state);clock.advance_minutes(30)
|
||||
expect(worker.health==health and not runtime.get_staff_rest_report(worker.staff_id).get(&"resting",false),"unpowered dormitory stops recovery")
|
||||
expect(runtime.restore_snapshot(runtime.create_snapshot()),"stopped dormitory and staff position restore")
|
||||
worker=runtime.staff_service.get_staff(&"dorm_sleeper")
|
||||
state.set_resource(&"mana",100);clock.advance_minutes(40)
|
||||
ManaOutage.release(runtime, state);clock.advance_minutes(40)
|
||||
expect(worker.health>health,"power recovery resumes rest")
|
||||
runtime.facility_service.set_operational_status(room_id,{&"operator_open":false},clock.absolute_minute)
|
||||
health=worker.health;clock.advance_minutes(30)
|
||||
|
||||
Reference in New Issue
Block a user