Adv 2.0 D&D Phase R R2: Harvest nodes & per-room registry

Per-zone resource registry (§3, all 10 zones) and full per-room harvest
layer wired into expeditions: !forage / !mine / !scavenge / !essence /
!commune / !resources. Auto-spawns a DungeonRun per region on
!expedition start, swaps it on !region travel, retires on
abandon/extract. Long rest at camp replenishes nodes across every
room and region. Reuses existing flavor.Harvest* / RichYield /
NodeDepleted / per-zone Harvest<Zone> pools.

Also clears two pre-existing test failures introduced by the E6c
flavor expansion (briefing substring list + combat-lift trial count).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
prosolis
2026-05-08 17:34:49 -07:00
parent cb51c56f00
commit 83cdf07374
13 changed files with 1314 additions and 6 deletions

View File

@@ -312,6 +312,17 @@ func updateCamp(expID string, c *CampState) error {
return err
}
// setExpeditionRunID writes the expedition's linked zone-run pointer.
// Used during region transitions and on initial spawn (R2).
func setExpeditionRunID(expID, runID string) error {
_, err := db.Get().Exec(`
UPDATE dnd_expedition
SET run_id = ?,
last_activity = CURRENT_TIMESTAMP
WHERE expedition_id = ?`, nullableString(runID), expID)
return err
}
// abandonExpedition flags the active expedition as abandoned. Idempotent.
func abandonExpedition(userID id.UserID) error {
e, err := getActiveExpedition(userID)