diff options
| author | historia <[not public]> | 2026-06-14 22:38:23 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-14 22:38:23 -0400 |
| commit | a6f0ad79e2e3a5b7c11eef1ffc3233f3a2766f77 (patch) | |
| tree | 89601a502bbfcb50302cf03f09b6febc6040eeb0 /internal/game/action_use.go | |
| parent | 1aba2bdd23aebed4032333e74aa553c40a31fcbd (diff) | |
| download | thehouseoficarus-a6f0ad79e2e3a5b7c11eef1ffc3233f3a2766f77.tar.gz | |
feat: fractional ticks and server game_speed implemented. potentially insanely janky.
Diffstat (limited to 'internal/game/action_use.go')
| -rw-r--r-- | internal/game/action_use.go | 8 |
1 files changed, 5 insertions, 3 deletions
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) } |
