From a6f0ad79e2e3a5b7c11eef1ffc3233f3a2766f77 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Sun, 14 Jun 2026 22:38:23 -0400 Subject: feat: fractional ticks and server game_speed implemented. potentially insanely janky. --- internal/game/action_use.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'internal/game/action_use.go') diff --git a/internal/game/action_use.go b/internal/game/action_use.go index c47492f..8987ee0 100644 --- a/internal/game/action_use.go +++ b/internal/game/action_use.go @@ -33,11 +33,13 @@ func (g *Game) startUse(sess *net.Session, p *player.Player, obj *object.ObjectD return } + p.ActionState = &ActionState{Type: ActionUsing, TargetName: obj.Name} + p.Action = &action.Action{ Type: "use", TargetID: obj.ID, TargetName: obj.Name, - WaitLeft: 1, + WaitLeft: g.computeTicks(1), Data: map[string]any{"step": 0, "behavior_id": obj.BehaviorID}, } @@ -76,7 +78,7 @@ func (g *Game) advanceUse(sess *net.Session, p *player.Player) { if cfg.FailMsg != "" { sess.WriteLine(cfg.FailMsg) } - p.Action.WaitLeft = cfg.Wait + p.Action.WaitLeft = g.computeTicks(cfg.Wait) return } } @@ -117,5 +119,5 @@ func (g *Game) advanceUse(sess *net.Session, p *player.Player) { return } - p.Action.WaitLeft = cfg.Wait + p.Action.WaitLeft = g.computeTicks(cfg.Wait) } -- cgit v1.2.3