From 17e7725f252c7f5d3be2e9c37d62751c631f196f Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Thu, 18 Jun 2026 18:50:54 -0400 Subject: feat: fletching added including zero-time bolt feathering, which probably will break lots of things --- internal/game/action.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'internal/game/action.go') diff --git a/internal/game/action.go b/internal/game/action.go index a62ccec..3d0223a 100644 --- a/internal/game/action.go +++ b/internal/game/action.go @@ -53,6 +53,7 @@ func (g *Game) StartAction(sess *net.Session, verb, target string) { if p.Action != nil { g.CancelAction(p) } + g.CancelBackgroundAction(p) lower := strings.ToLower(target) instanceIdx := -1 @@ -202,6 +203,11 @@ func (g *Game) CancelAction(p *player.Player) { p.ClearMoveState() } +func (g *Game) CancelBackgroundAction(p *player.Player) { + p.BackgroundAction = nil + p.BackgroundActionState = nil +} + func (g *Game) AdvanceActions() { if g.Hub == nil { return @@ -238,6 +244,23 @@ func (g *Game) AdvanceActions() { g.writePrompt(sess) } } + + for _, sess := range g.Hub.AllSessions() { + p, ok := sess.Player.(*player.Player) + if !ok || p.BackgroundAction == nil { + continue + } + if !p.BackgroundAction.Advance() { + continue + } + switch p.BackgroundAction.Type { + case "fletch": + g.advanceFletch(sess, p) + } + if p.BackgroundAction == nil { + g.writePrompt(sess) + } + } } func (g *Game) checkCondition(sess *net.Session, c *action.Condition) bool { -- cgit v1.2.3