Adv 2.0 D&D Phase R6 polish: standalone-zone harvest persistence

Adds a dnd_zone_run.harvest_nodes_json column and a small persistence
layer (loadStandaloneHarvestNodes / saveStandaloneHarvestNodes) so
!zone enter runs that aren't tied to an expedition can carry per-room
HarvestNode state. Expedition runs continue to use
expedition.region_state for the same data — this is the casual flow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
prosolis
2026-05-09 07:42:21 -07:00
parent 1953eec3b5
commit 83a71173b1
3 changed files with 263 additions and 0 deletions

View File

@@ -182,6 +182,10 @@ func runMigrations(d *sql.DB) error {
// this after each rage'd combat. Cleared on long rest. Reused by
// other classes once exhaustion-inducing mechanics arrive in SUB3+.
`ALTER TABLE dnd_character ADD COLUMN exhaustion INTEGER NOT NULL DEFAULT 0`,
// Standalone-zone-run harvest: stores a per-room HarvestNode map for
// !zone enter sessions that aren't tied to an expedition. Expedition
// runs continue to use expedition.region_state for the same data.
`ALTER TABLE dnd_zone_run ADD COLUMN harvest_nodes_json TEXT NOT NULL DEFAULT '{}'`,
}
for _, stmt := range columnMigrations {
if _, err := d.Exec(stmt); err != nil {