aboutsummaryrefslogtreecommitdiff
path: root/internal/game/action.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-18 18:50:54 -0400
committerhistoria <[not public]>2026-06-18 18:50:54 -0400
commit17e7725f252c7f5d3be2e9c37d62751c631f196f (patch)
tree40698c5c95cb21302adbb8cd021bd8d049b6fce1 /internal/game/action.go
parentfae979b75e37b6ad57e57062a1b637a37ec87174 (diff)
downloadthehouseoficarus-17e7725f252c7f5d3be2e9c37d62751c631f196f.tar.gz
feat: fletching added including zero-time bolt feathering, which probably will break lots of things
Diffstat (limited to 'internal/game/action.go')
-rw-r--r--internal/game/action.go23
1 files changed, 23 insertions, 0 deletions
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 {