From 97a1a908b9e6e6d3516628c139c9b64262b4fe08 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Thu, 18 Jun 2026 20:26:03 -0400 Subject: feat: crafting roughly implemented (leather, gems, gold, clay, spinning). --- internal/game/action_fletch.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'internal/game/action_fletch.go') diff --git a/internal/game/action_fletch.go b/internal/game/action_fletch.go index 734453b..25f2966 100644 --- a/internal/game/action_fletch.go +++ b/internal/game/action_fletch.go @@ -33,6 +33,7 @@ func (g *Game) doInstantFletch(sess *net.Session, p *player.Player, recipe *acti batches := 0 totalOutput := 0 + skill := player.SkillName(recipe.EffectiveSkill()) for { if !g.canDoFletchRecipe(p, recipe) { break @@ -60,8 +61,8 @@ func (g *Game) doInstantFletch(sess *net.Session, p *player.Player, recipe *acti } if recipe.XP > 0 { - if newLevel := p.AddSkillXP(player.Fletching, recipe.XP); newLevel > 0 { - sess.WriteLine(g.colorize(sess, "level_up", fmt.Sprintf("*** You are now level %d fletching! ***", newLevel))) + 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()))) } } @@ -91,7 +92,7 @@ func (g *Game) doInstantFletch(sess *net.Session, p *player.Player, recipe *acti msg := fmt.Sprintf("You fletch %d %s.", totalOutput, outputName) if p.OptionBool("xp_drops") && recipe.XP > 0 { totalXP := recipe.XP * batches - abbr := player.SkillAbbr[player.Fletching] + abbr := player.SkillAbbr[skill] msg += g.colorize(sess, "xp", fmt.Sprintf(" (+%dxp %s)", totalXP, abbr)) } sess.WriteLine(msg) @@ -151,6 +152,8 @@ func (g *Game) advanceFletch(sess *net.Session, p *player.Player) { outputQty = 1 } + skill := player.SkillName(recipe.EffectiveSkill()) + placed := false if outDef != nil && outDef.Stackable { for i := 0; i < 28; i++ { @@ -175,8 +178,8 @@ func (g *Game) advanceFletch(sess *net.Session, p *player.Player) { } if recipe.XP > 0 { - if newLevel := p.AddSkillXP(player.Fletching, recipe.XP); newLevel > 0 { - sess.WriteLine(g.colorize(sess, "level_up", fmt.Sprintf("*** You are now level %d fletching! ***", newLevel))) + 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.AccountStore.SaveCharacter(p) @@ -190,7 +193,7 @@ func (g *Game) advanceFletch(sess *net.Session, p *player.Player) { msg = fmt.Sprintf("You fletch %s.", outputName) } if p.OptionBool("xp_drops") && recipe.XP > 0 { - abbr := player.SkillAbbr[player.Fletching] + abbr := player.SkillAbbr[skill] msg += g.colorize(sess, "xp", fmt.Sprintf(" (+%dxp %s)", recipe.XP, abbr)) } sess.WriteLine(msg) -- cgit v1.2.3