diff options
| author | historia <[not public]> | 2026-06-18 20:26:03 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-18 20:26:03 -0400 |
| commit | 97a1a908b9e6e6d3516628c139c9b64262b4fe08 (patch) | |
| tree | d82953974edbfb4051dff1a48f1b264b9c264d28 /internal/game/action_fletch.go | |
| parent | 17e7725f252c7f5d3be2e9c37d62751c631f196f (diff) | |
| download | thehouseoficarus-97a1a908b9e6e6d3516628c139c9b64262b4fe08.tar.gz | |
feat: crafting roughly implemented (leather, gems, gold, clay, spinning).
Diffstat (limited to 'internal/game/action_fletch.go')
| -rw-r--r-- | internal/game/action_fletch.go | 15 |
1 files changed, 9 insertions, 6 deletions
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) |
