From 0ea4eec5dd2122c6704216971eb1249276297867 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 19 Jun 2026 18:20:26 -0400 Subject: shop fixes, 'toggle' completely removed, movement speed increased --- internal/game/action_fletch.go | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'internal/game/action_fletch.go') diff --git a/internal/game/action_fletch.go b/internal/game/action_fletch.go index ddb4d2c..aa5dfc7 100644 --- a/internal/game/action_fletch.go +++ b/internal/game/action_fletch.go @@ -10,9 +10,7 @@ import ( ) func (g *Game) startFletchAction(sess *net.Session, p *player.Player, recipe *action.RecipeDef, count int) { - if p.Flags == nil { - p.Flags = make(map[string]any) - } + p.EnsureFlags() p.Flags["last_fletch"] = recipe.ID g.AccountStore.SaveCharacter(p) @@ -61,9 +59,7 @@ func (g *Game) doInstantFletch(sess *net.Session, p *player.Player, recipe *acti } if recipe.XP > 0 { - if newLevel := p.AddSkillXP(skill, recipe.XP); newLevel > 0 { - sess.WriteLine(g.colorize(sess, "level_up", fmt.Sprintf("*** You are now level %d %s! ***", newLevel, recipe.EffectiveSkill()))) - } + g.awardSkillXP(sess, p, skill, recipe.XP) } batches++ @@ -138,7 +134,7 @@ func (g *Game) advanceFletch(sess *net.Session, p *player.Player) { recipe := g.loadProductionRecipe(recipeID) if recipe == nil { - g.CancelBackgroundAction(p) + g.cancelBackgroundAction(p) return } @@ -150,7 +146,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.cancelBackgroundAction(p) return } @@ -179,16 +175,14 @@ 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.cancelBackgroundAction(p) return } p.SetInvSlot(freeSlot, &player.InventorySlot{ItemID: recipe.Output, Quantity: outputQty}) } if recipe.XP > 0 { - if newLevel := p.AddSkillXP(skill, recipe.XP); newLevel > 0 { - sess.WriteLine(g.colorize(sess, "level_up", fmt.Sprintf("*** You are now level %d %s! ***", newLevel, recipe.EffectiveSkill()))) - } + g.awardSkillXP(sess, p, skill, recipe.XP) } g.AccountStore.SaveCharacter(p) @@ -211,14 +205,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.cancelBackgroundAction(p) return } } if !g.canContinueProduction(p, recipe) { sess.WriteLine("\nYou've run out of fletching materials.") - g.CancelBackgroundAction(p) + g.cancelBackgroundAction(p) return } -- cgit v1.2.3