Adv 2.0 D&D polish: GM→DM rename, streamed zone combat, end-to-end scenario test

GM→DM rename across docs and code (GMNarrationType→DMNarrationType,
GMState→DMState, narration constants, comments) so the system reads as
"Dungeon Master" everywhere. Player-visible "GM mood" wording stays
where it appears in flavor.

Streamed zone/expedition combat: zone advance now stages patrol →
patrol play-by-play → patrol resolution → room intro → room play-by-play
→ final outcome through sendZoneCombatMessages with 2–3s pacing
(arena keeps its 5–8s window). Combat narrative lines pick up a compact
d20-vs-AC roll annotation for hit/crit/miss/block events.

Combat outcome polish: dndHPSnapshot lets narration show sheet HP
rather than legacy combat-engine HP, and markAdventureDead clears the
zombie state where hp_current was 0 but the legacy alive flag stayed
true after a D&D-layer KO.

Adv 2.0 announcement (ADVENTURE_2.0_ANNOUNCEMENT.md), README rewrite
covering the new layer, and adv2_scenario_test.go — a full
zone-run + expedition + harvest playthrough against a copy of the prod
DB asserting persisted state end-to-end.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
prosolis
2026-05-09 07:43:11 -07:00
parent 83a71173b1
commit dfa7beeb96
32 changed files with 1262 additions and 334 deletions

View File

@@ -82,7 +82,7 @@ type Expedition struct {
RegionState map[string]any
XPEarned int
CoinsEarned int
GMMood int
DMMood int
LastBriefingAt *time.Time
LastRecapAt *time.Time
LastActivity time.Time
@@ -143,6 +143,10 @@ func startExpedition(userID id.UserID, zoneID ZoneID, runID string, supplies Exp
if currentRegion != "" {
regionState[regionStateVisitedKey] = []string{currentRegion}
}
startMood := 50
if isHol, _ := isHolidayToday(); isHol {
startMood = 55
}
exp := &Expedition{
ID: newExpeditionID(),
UserID: string(userID),
@@ -155,7 +159,7 @@ func startExpedition(userID id.UserID, zoneID ZoneID, runID string, supplies Exp
Supplies: supplies,
ThreatEvents: []ThreatEvent{},
RegionState: regionState,
GMMood: 50,
DMMood: startMood,
LastActivity: now,
}
supJSON, _ := json.Marshal(supplies)
@@ -167,9 +171,9 @@ func startExpedition(userID id.UserID, zoneID ZoneID, runID string, supplies Exp
(expedition_id, user_id, zone_id, run_id, status,
start_date, current_day, current_region, supplies_json,
threat_events, region_state, gm_mood, last_activity)
VALUES (?, ?, ?, ?, 'active', ?, 1, ?, ?, ?, ?, 50, ?)`,
VALUES (?, ?, ?, ?, 'active', ?, 1, ?, ?, ?, ?, ?, ?)`,
exp.ID, exp.UserID, string(zoneID), nullableString(runID),
now, currentRegion, string(supJSON), string(threatJSON), string(regJSON), now,
now, currentRegion, string(supJSON), string(threatJSON), string(regJSON), startMood, now,
); err != nil {
return nil, fmt.Errorf("insert expedition: %w", err)
}
@@ -235,7 +239,7 @@ func scanExpedition(row scanner) (*Expedition, error) {
&e.StartDate, &e.CurrentDay, &e.CurrentRegion, &bossI,
&suppliesJSON, &campJSON, &e.ThreatLevel, &siegeI,
&threatJSON, &e.TemporalStack, &regionJSON,
&e.XPEarned, &e.CoinsEarned, &e.GMMood,
&e.XPEarned, &e.CoinsEarned, &e.DMMood,
&lastBriefingRaw, &lastRecapRaw, &e.LastActivity, &completedRaw,
); err != nil {
return nil, err