WIP: DM window tiers, expedition activity dedup, harvest gating

- Split advDMResponseWindow into a 12h low-priority tier for passive
  overnight-tolerant prompts (pet arrival/type/name); bump pet arrival
  chance 15% -> 30%.
- Skip zone_run activity lines for runs that belong to an active
  expedition — the expedition rollup is the source of truth.
- Loosen currentRoomCleared: Entry/Exploration/Trap allow harvest
  unconditionally (risk is the combat-interrupt roll); Elite/Boss stay
  gated on RoomsCleared.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
prosolis
2026-05-13 22:53:58 -07:00
parent 4af110cc20
commit 0ca17628d4
5 changed files with 79 additions and 16 deletions

View File

@@ -79,6 +79,30 @@ func loadAdvDailyActivity(date string) (map[id.UserID][]AdvDailyActivity, error)
}
rows.Close()
// Pre-load (user_id, zone_id) of active expeditions. Zone runs are now
// exclusively spawned by the expedition layer, and the expedition flips
// a region's run to abandoned on !region travel / inactivity timeout /
// forced extraction. Those transitions are internal — the expedition
// rollup below is the source of truth for the player. Skip zone_run
// entries that match an active expedition to avoid a misleading
// "Withdrew from <zone>" line while the player is still on it.
activeExp := make(map[string]struct{})
expRows, err := d.Query(`
SELECT user_id, zone_id FROM dnd_expedition
WHERE status IN ('active','extracting')`)
if err != nil {
return nil, fmt.Errorf("active expeditions: %w", err)
}
for expRows.Next() {
var u, z string
if err := expRows.Scan(&u, &z); err != nil {
expRows.Close()
return nil, fmt.Errorf("active expedition scan: %w", err)
}
activeExp[u+"|"+z] = struct{}{}
}
expRows.Close()
// 2. dnd_zone_run — rows touched today. Progress count is derived
// from len(visited_nodes) — current_room retired in G9.
rows, err = d.Query(`
@@ -110,6 +134,9 @@ func loadAdvDailyActivity(date string) (map[id.UserID][]AdvDailyActivity, error)
if currentRoom < 0 {
currentRoom = 0
}
if _, onExp := activeExp[uid+"|"+zoneID]; onExp {
continue
}
userID := id.UserID(uid)
zoneDef := zoneOrFallback(ZoneID(zoneID))