Run outcome detection (win/loss/abandoned) #10
Labels
No labels
4-29
bug
documentation
duplicate
enhancement
flow improvement
good first issue
help wanted
invalid
investigating
issue-agent
issue-agent-blocked
issue-agent-complete
issue-agent-pr-open
issue-agent-runner-nelsonlaptop
issue-agent-runner-nelsonpc
issue-agent-runner-nelsonpc-user
issue-agent-running
needs-verification
next to do
question
queue
recon
relics-stats-onboarding
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
romaine-life/spirelens#10
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Currently
RunData.Outcomestays "in_progress" forever. Detect terminal states and set Outcome + EndedAt:win— beat the final act bossloss— player diedabandoned— Abandon Run usedHooks to explore
RunManager.IsGameOver/IsAbandoned— state changesCombatManager.ProcessPendingLossroom.RoomType == Boss && final actImplementation sketch
_currentRun.Outcomeand_currentRun.EndedAt, SaveAsync._currentRunso next RunStarted creates a fresh record.Priority
Non-blocking for M1/M2/M3 but needed before M6 (Nexus publish). "in_progress" forever confuses first-time users.
Implemented in
6a03da5(auto-closed by commit message).Approach: Harmony-postfix on `RunManager.OnEnded(bool isVictory)` — the game's canonical run-end path, called once per run with victory flag. `IsAbandoned` is set before the abandon flow transitively enters OnEnded. Three-way outcome mapping:
`RunTracker.OnRunEnded` stamps Outcome + EndedAt, refreshes FloorReached, saves, then nulls `_currentRun` so the next RunStarted gets a clean slate.
needs-verification: awaiting in-game test of all three outcome paths. Minimal test: win a run → verify outcome=win. Die in a run → verify outcome=loss. Abandon a run from pause menu → verify outcome=abandoned.