diff options
| author | historia <[not public]> | 2026-07-31 17:44:10 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-31 17:44:10 -0400 |
| commit | f51424c90dbce7191a31b6e675818c985f0f4539 (patch) | |
| tree | a7845a2e09bd6e83d2d034f5e702a4940f38126a /internal/game/cmd_stop.go | |
| parent | 58758d41488a777d2bc0e787be655363bdd9eb60 (diff) | |
| download | thehouseoficarus-f51424c90dbce7191a31b6e675818c985f0f4539.tar.gz | |
feat: casino framework and basic slot machine
Diffstat (limited to 'internal/game/cmd_stop.go')
| -rw-r--r-- | internal/game/cmd_stop.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/game/cmd_stop.go b/internal/game/cmd_stop.go index d1b8faa..5c347e6 100644 --- a/internal/game/cmd_stop.go +++ b/internal/game/cmd_stop.go @@ -6,6 +6,18 @@ import ( func (g *Game) executeStop(sess *net.Session, args []string, rawInput string) { p := sess.Player + if table, playing := g.Casino.Participation(p.Name); playing { + if table != nil { + g.emitCasinoEvents(g.Casino.Leave(table.RoomID, table.Config.ID, p.Name)) + } else if machine, ok := g.Casino.MachineFor(p.Name); ok { + if events, stopped := g.Casino.StopMachineAutoBet(machine.RoomID, machine.Config.ID, p.Name); stopped { + g.emitCasinoEvents(events) + return + } + g.emitCasinoEvents(g.Casino.LeaveMachine(machine.RoomID, machine.Config.ID, p.Name)) + } + return + } ss, _ := g.safespot.Get(p.Name) if p.Action == nil && p.BackgroundAction == nil && g.Combat.Get(p.Name) == nil && p.MoveTicks == 0 && len(p.WalkSequence) == 0 && !ss.Active { sess.WriteLine("You're not doing anything.") |
