diff options
| author | historia <[not public]> | 2026-06-15 00:55:26 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-15 00:56:27 -0400 |
| commit | 445c4612cc5cf2c226f85894b6ad1e2419a374e2 (patch) | |
| tree | df3c6d4702cbeb7bd1618f88e93eb9cd08bcfcf4 /internal/game/game.go | |
| parent | b6fdde0aa6fcefd735e7c550aaa7fca879023f1c (diff) | |
| download | thehouseoficarus-445c4612cc5cf2c226f85894b6ad1e2419a374e2.tar.gz | |
feat: walk command, improved tables and columns
Diffstat (limited to 'internal/game/game.go')
| -rw-r--r-- | internal/game/game.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/internal/game/game.go b/internal/game/game.go index 7447215..b08c97e 100644 --- a/internal/game/game.go +++ b/internal/game/game.go @@ -348,6 +348,12 @@ func (g *Game) executeCommand(sess *net.Session, cmd string, args []string, rawI g.doSearch(sess, strings.Join(args, " ")) } return + case "walk": + if p == nil { + return + } + g.doWalk(sess, args) + return case "wear", "wield": if p == nil { return @@ -381,7 +387,7 @@ func (g *Game) ProcessQueuedCommands() { } switch as.Type { case ActionGathering, ActionCombating, ActionUsing, ActionTalking, - ActionToggling, ActionBurning, ActionStoking, ActionResting: + ActionToggling, ActionBurning, ActionStoking, ActionResting, ActionWalking: default: p.ActionState = nil } @@ -421,6 +427,14 @@ func (g *Game) ProcessQueuedCommands() { } g.activeQueue = make(map[string]*QueuedCommand) + for _, sess := range g.Hub.AllSessions() { + p, ok := sess.Player.(*player.Player) + if !ok || p == nil || len(p.WalkSequence) == 0 { + continue + } + g.advanceWalk(sess, p) + } + g.flushPendingDepletions() } |
