aboutsummaryrefslogtreecommitdiff
path: root/internal/game/action_fletch.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-20 03:20:01 -0400
committerhistoria <[not public]>2026-06-20 03:20:01 -0400
commite4400c5f1e84c18d2126f2cb502ae10685977cbb (patch)
tree0523e9d68f1cfdc6f81b862e3068fe12c1a85054 /internal/game/action_fletch.go
parent5ea082ab4e82409aebc889b496f43e52b003d4f7 (diff)
downloadthehouseoficarus-e4400c5f1e84c18d2126f2cb502ae10685977cbb.tar.gz
refactor: combined all station crafting
Diffstat (limited to 'internal/game/action_fletch.go')
-rw-r--r--internal/game/action_fletch.go20
1 files changed, 7 insertions, 13 deletions
diff --git a/internal/game/action_fletch.go b/internal/game/action_fletch.go
index aa5dfc7..3d8c30f 100644
--- a/internal/game/action_fletch.go
+++ b/internal/game/action_fletch.go
@@ -115,13 +115,7 @@ func (g *Game) startTimedFletch(sess *net.Session, p *player.Player, recipe *act
}
p.BackgroundActionState = &ActionState{Type: ActionFletching, TargetName: outputName}
- if g.Hub != nil {
- for _, other := range g.Hub.PlayersInRoom(p.RoomID) {
- if other != sess && other.Player != nil {
- other.WriteLine(g.colorize(other, "broadcast", fmt.Sprintf("\n%s starts fletching.", p.Name)))
- }
- }
- }
+ g.broadcastAction(sess, "\n%s starts fletching.", p.Name)
sess.WriteLine(fmt.Sprintf("\nYou begin fletching %s.", outputName))
}
@@ -132,9 +126,9 @@ func (g *Game) advanceFletch(sess *net.Session, p *player.Player) {
wait, _ := p.BackgroundAction.Data["wait"].(float64)
remaining, _ := p.BackgroundAction.Data["remaining"].(int)
- recipe := g.loadProductionRecipe(recipeID)
+ recipe := g.loadRecipe(recipeID)
if recipe == nil {
- g.cancelBackgroundAction(p)
+ g.cancelBgAction(p)
return
}
@@ -146,7 +140,7 @@ func (g *Game) advanceFletch(sess *net.Session, p *player.Player) {
if !g.canDoFletchRecipe(p, recipe) {
sess.WriteLine("\nYou've run out of fletching materials.")
- g.cancelBackgroundAction(p)
+ g.cancelBgAction(p)
return
}
@@ -175,7 +169,7 @@ func (g *Game) advanceFletch(sess *net.Session, p *player.Player) {
freeSlot := p.FirstFreeSlot()
if freeSlot == -1 {
sess.WriteLine("\nYour inventory is too full!")
- g.cancelBackgroundAction(p)
+ g.cancelBgAction(p)
return
}
p.SetInvSlot(freeSlot, &player.InventorySlot{ItemID: recipe.Output, Quantity: outputQty})
@@ -205,14 +199,14 @@ func (g *Game) advanceFletch(sess *net.Session, p *player.Player) {
p.BackgroundAction.Data["remaining"] = remaining
if remaining <= 0 {
sess.WriteLine("\nYou've finished fletching.")
- g.cancelBackgroundAction(p)
+ g.cancelBgAction(p)
return
}
}
if !g.canContinueProduction(p, recipe) {
sess.WriteLine("\nYou've run out of fletching materials.")
- g.cancelBackgroundAction(p)
+ g.cancelBgAction(p)
return
}