diff options
| author | historia <[not public]> | 2026-07-17 19:23:23 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-17 19:23:23 -0400 |
| commit | ed0d9332def127b2fefebe80a4992a875cc7e521 (patch) | |
| tree | 745dc622e448ca7a16da11f1684d5ba819d6da97 /internal/game/cmd_move.go | |
| parent | 3d90a18c15ca54f262cfa61edba4866c91f29802 (diff) | |
| download | thehouseoficarus-ed0d9332def127b2fefebe80a4992a875cc7e521.tar.gz | |
refactor: return (ticks, usesEnergy) in moveTicks, remove old flee code
Diffstat (limited to 'internal/game/cmd_move.go')
| -rw-r--r-- | internal/game/cmd_move.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/internal/game/cmd_move.go b/internal/game/cmd_move.go index 576bdd5..761db2f 100644 --- a/internal/game/cmd_move.go +++ b/internal/game/cmd_move.go @@ -79,16 +79,23 @@ func (g *Game) doMove(sess *net.Session, dir string, isWalk bool) { g.cancelAction(p) } - ticks := g.moveTicks(p, isWalk) + ticks, usesEnergy := g.moveTicks(p, isWalk) p.MoveDirection = string(exitDir) p.MoveTarget = targetID if ticks <= 0 { + // Instant-move gear (Cape of Agility, GodMode): escape the miss-gate + // entirely. Stash the usesEnergy flag so completeMove drains if due. + p.MoveUsesEnergy = usesEnergy g.completeMove(sess, p) return } if inCombat { + // Defer the move: stash it in the Escape* fields and wait for a mob + // miss, mob death, or the 3-strike "power through" relief. Do NOT set + // MoveUsesEnergy here — no move is in flight yet, and beginEscapeMove + // recomputes (and stores) the flag when the gate fires. firstEscape := p.EscapeDir == "" p.EscapeDir = string(exitDir) p.EscapeTarget = targetID @@ -111,6 +118,7 @@ func (g *Game) doMove(sess *net.Session, dir string, isWalk bool) { return } + p.MoveUsesEnergy = usesEnergy p.MoveTicks = ticks } |
