Pets: roll arrival on run-complete emergence too

The emergence-seam roll added in 3ed2e1d covered extract, abandon,
forced extraction, and death-respawn — but not a natural run-complete
(boss down / dead-end node), which is the most common successful
emergence. Players who cleared a run cleanly never got the arrival roll
despite meeting every condition.

Wire maybeRollPetArrivalOnEmerge into the two real run-complete callers
(expeditionCmdRun foreground + the autorun background ticker), gated on
reason == stopComplete. Kept out of runAutopilotWalk itself so the sim
path (which calls the walk directly) never fires arrival DMs.
This commit is contained in:
prosolis
2026-05-21 23:27:53 -07:00
parent 2ea3e42612
commit 978dc5e25f
2 changed files with 13 additions and 0 deletions

View File

@@ -554,6 +554,14 @@ func (p *AdventurePlugin) expeditionCmdRun(ctx MessageContext) error {
if r.initErr != "" { if r.initErr != "" {
return p.SendDM(ctx.Sender, r.initErr) return p.SendDM(ctx.Sender, r.initErr)
} }
// Emergence seam: a natural run-complete (boss down / dead-end node)
// surfaces the player alive just like an extract or abandon — roll pet
// arrival here too. The roll lives in the real callers, not in
// runAutopilotWalk, so the sim path (which calls the walk directly)
// never fires arrival DMs. See maybeRollPetArrivalOnEmerge.
if r.reason == stopComplete {
p.maybeRollPetArrivalOnEmerge(ctx.Sender)
}
return p.streamFlow(ctx.Sender, r.stream, r.finalMsg) return p.streamFlow(ctx.Sender, r.stream, r.finalMsg)
} }

View File

@@ -154,6 +154,11 @@ func (p *AdventurePlugin) tryAutoRun(e *Expedition, now time.Time) error {
// "no expedition" / "no run" — race with abandon/extract. Silent. // "no expedition" / "no run" — race with abandon/extract. Silent.
return nil return nil
} }
// Emergence seam: a run-complete reached by the background ticker is
// still a live emergence — roll pet arrival. See maybeRollPetArrivalOnEmerge.
if r.reason == stopComplete {
p.maybeRollPetArrivalOnEmerge(uid)
}
if !shouldDMAutoRun(r) { if !shouldDMAutoRun(r) {
return nil return nil
} }