Combat: wire pet procs into the turn-based engine

Pet attacks were never resolved in turn-based fights. Roll the proc once
at fight start (a per-round roll would make a proc near-certain over a
long manual fight), persist it on the session so suspend/resume and
reaper auto-play honor the same outcome, and land a single pet hit on
the player's first acting turn.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
prosolis
2026-05-14 08:08:26 -07:00
parent c84682abf7
commit c5a2634657
5 changed files with 141 additions and 2 deletions

View File

@@ -91,8 +91,11 @@ func (p *AdventurePlugin) handleFightCmd(ctx MessageContext) error {
}
// Carry fight-start one-shot resources (Abjuration Arcane Ward, etc.) onto
// the session so they survive the turn engine's resume/commit cycle.
if seedCombatSessionOneShots(sess, player.Mods) {
// the session so they survive the turn engine's resume/commit cycle, and
// make the one-and-only per-fight pet-attack roll.
seeded := seedCombatSessionOneShots(sess, player.Mods)
pet := rollCombatSessionPetProc(sess, player.Mods)
if seeded || pet {
if err := saveCombatSession(sess); err != nil {
slog.Error("combat: seed session one-shots", "user", ctx.Sender, "err", err)
}