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>
2.5 KiB
2.5 KiB
P06-01:A06 マナ有限残量契約の実装(2026-10-19)
ユーザーが MP-01-r02 推薦案を採用しました(decisions.json A06)。内容は初期100、容量300、世界樹の生成20/ゲーム内10分です。炉は、自然生成と需要の支払いを済ませた後に判定します。
製品への反映
scripts/mana/mana_reserve_cycle.gd:承認値と境界処理です。10分境界ごとにavailable=B+G+F、consumed=min(available,D)、after=min(C,available−consumed)を計算します。容量を超えた分は overflow として記録し、破棄します。同じ境界は二度処理しません。境界を飛ばした場合は、各境界を順番に処理します。保存データは検証が通ってから反映し、不正なら何も変えません。炉の受理判定はfurnace_offer_accepted(base_after 後の空きが100以上)です。scripts/mana/mana_network_service.gd:get_total_consumer_demand()を追加しました。登録済みの全 consumer の需要を合計します。無効化・停止中の consumer も含みます。autoload/simulation_runtime.gd:MANA phase の最初で残量を確定してから、局所配電と全館ゲートを評価します。phase の順序は変えていません。新しいセーブはmana_reserveを持ちます。Operations の巻き戻し対象にも含めました。- 旧セーブの移行:
mana_reserveが無いセーブは、残量が0〜300の整数であれば、その値を保持して開始します。明示的な0は停止のまま保持します。300超・負値・非整数は拒否し、現在の状態を保持します。
試験
- 新規:
tests/s2/test_mana_reserve_cycle.gd(提案書の比較表の推薦列の値、炉判定の3例、改ざん拒否)、tests/s2/test_runtime_mana_reserve.gd(Runtimeでの境界処理、保存往復、旧0の移行、容量超過の拒否、枯渇と復帰)。 - 既存の停電試験は「マナを0にすれば停電が続く」前提でした。A06では世界樹が次の境界で復帰させるため、停電を継続させる試験だけ
tests/helpers/mana_outage.gdに置き換えました。これは配電を受けない無効 consumer で需要を足す方法です。
未了
- 炉の人物適格性・収率の実接続、未定義13施設の需要、D05 の詳細は別承認です。
- 全館の実プレイ、性能、Windows での受入は未実施です。原88の正式完了数は変わりません。