mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-15 08:32:41 +00:00
Camp: auto-break when party moves to a different room
Camp was a stationary "rest here until the next briefing" intent, but
nothing struck it when the autopilot / !zone advance / fork picks walked
the party into a new room. The stale CampState then blocked !camp <type>
with "already camped" even though the player was several rooms away.
autoBreakCampOnMove clears the camp (no rest bonuses — those only land
at briefing time via processOvernightCamp) whenever Camp.RoomIndex no
longer matches run.CurrentRoom. Wired into advanceOnceWithOpts (covers
advance/autopilot, complete/fork/next-room branches all surface a
"⛺ Camp struck" banner) and zoneCmdGo (fork commit).
This commit is contained in:
@@ -606,6 +606,10 @@ func (p *AdventurePlugin) advanceOnceWithOpts(ctx MessageContext, compact bool)
|
||||
if gerr != nil {
|
||||
return advanceResult{}, fmt.Errorf("Couldn't advance: %s", gerr.Error())
|
||||
}
|
||||
var campStruck string
|
||||
if kind := autoBreakCampOnMove(ctx.Sender); kind != "" {
|
||||
campStruck = fmt.Sprintf("⛺ Camp struck (**%s**) — the party moved on.\n\n", kind)
|
||||
}
|
||||
if complete {
|
||||
_, _ = applyMoodEvent(run.RunID, MoodEventZoneComplete)
|
||||
var b strings.Builder
|
||||
@@ -613,6 +617,9 @@ func (p *AdventurePlugin) advanceOnceWithOpts(ctx MessageContext, compact bool)
|
||||
b.WriteString(outcome)
|
||||
b.WriteString("\n\n")
|
||||
}
|
||||
if campStruck != "" {
|
||||
b.WriteString(campStruck)
|
||||
}
|
||||
// A "complete" run is only a full zone clear when it isn't a mid-zone
|
||||
// region clear of a multi-region zone. For the latter, name the region
|
||||
// and point at the next one — "Cleared {zone}. Run complete." reads
|
||||
@@ -658,6 +665,9 @@ func (p *AdventurePlugin) advanceOnceWithOpts(ctx MessageContext, compact bool)
|
||||
b.WriteString("\n\n")
|
||||
}
|
||||
b.WriteString(fmt.Sprintf("✓ Cleared room %d (%s).\n\n", prevIdx+1, prettyRoomType(prev)))
|
||||
if campStruck != "" {
|
||||
b.WriteString(campStruck)
|
||||
}
|
||||
b.WriteString(forkMsg)
|
||||
return advanceResult{
|
||||
preStream: preStream,
|
||||
@@ -668,6 +678,9 @@ func (p *AdventurePlugin) advanceOnceWithOpts(ctx MessageContext, compact bool)
|
||||
}, nil
|
||||
}
|
||||
finalMsg := p.formatNextRoomMessage(run, zone, prev, prevIdx, outcome, next)
|
||||
if campStruck != "" {
|
||||
finalMsg = campStruck + finalMsg
|
||||
}
|
||||
|
||||
// H2 — auto-harvest the room the player just walked into. Only fires
|
||||
// for Exploration rooms (Entry/Trap/Elite/Boss self-skip via
|
||||
|
||||
Reference in New Issue
Block a user