diff options
Diffstat (limited to 'internal/casino/machine.go')
| -rw-r--r-- | internal/casino/machine.go | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/internal/casino/machine.go b/internal/casino/machine.go index 2f8b753..15c612d 100644 --- a/internal/casino/machine.go +++ b/internal/casino/machine.go @@ -26,6 +26,7 @@ type Machine struct { reel int clock int freeSpins int + inFreeSpins bool spinBet int payoutRemainder float64 profile SlotProfile @@ -237,8 +238,13 @@ func (m *Machine) finishSpin() []Event { winEvents[0].Color = "casino_win" events = append(events, winEvents...) } - if m.spin.ScatterCount >= 3 && m.freeSpins == 0 { + // A paid feature in progress never retriggers: scatters landing during a + // free spin are ignored, matching the CalculateRTP model (the feature is + // a fixed number of automatic spins). Retriggering only on a paid spin + // keeps the machine's actual return aligned with that model. + if m.spin.ScatterCount >= 3 && m.freeSpins == 0 && !m.inFreeSpins { m.freeSpins = m.profile.FreeSpinCount + m.inFreeSpins = true events = append(events, m.public(fmt.Sprintf("Three scatter symbols trigger %d free spins!", m.profile.FreeSpinCount))...) } if m.freeSpins > 0 { @@ -247,8 +253,11 @@ func (m *Machine) finishSpin() []Event { m.spin = generateSlotSpinWithProfile(m.rng, m.spinBet, m.profile) m.reel, m.clock, m.suspense = 0, 0, false events = append(events, m.public(fmt.Sprintf("%d free spins remain.", m.freeSpins))...) - } else if !m.autoBet { - events = append(events, m.menuEvents("")...) + } else { + m.inFreeSpins = false + if !m.autoBet { + events = append(events, m.menuEvents("")...) + } } return events } @@ -277,6 +286,7 @@ func (m *Machine) resetSeat() { m.phase = machineReady m.reel, m.clock, m.suspense = 0, 0, false m.freeSpins = 0 + m.inFreeSpins = false m.payoutRemainder = 0 m.autoBet, m.autoCountdown = false, 0 } |
