diff options
| author | historia <[not public]> | 2026-10-05 17:49:48 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-05 17:49:48 -0400 |
| commit | 7a15a5d70004b28bf2a710fa0f536af2446e5b17 (patch) | |
| tree | 920705853f79bb13a65fcb2f89cee38e6f2efab8 /internal/game/production_menu.go | |
| parent | ec703a39738fefb60817f5659f76f8e683f8d301 (diff) | |
| download | thehouseoficarus-7a15a5d70004b28bf2a710fa0f536af2446e5b17.tar.gz | |
fix: production multi-step recipes, drop-weight validation, journal versioning
Diffstat (limited to 'internal/game/production_menu.go')
| -rw-r--r-- | internal/game/production_menu.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/game/production_menu.go b/internal/game/production_menu.go index 9b9f8e6..5d712da 100644 --- a/internal/game/production_menu.go +++ b/internal/game/production_menu.go @@ -101,7 +101,7 @@ func (g *Game) dispatchMenuEntry(sess *net.Session, entry map[string]string) { } func (g *Game) formatMaterials(sess *net.Session, item *item.ItemDef) string { - craft := item.FirstCraft() + craft := g.usableCraft(sess.Player, item) if craft == nil { return "" } @@ -125,7 +125,7 @@ func (g *Game) formatMaterials(sess *net.Session, item *item.ItemDef) string { func (g *Game) showProductionTable(sess *net.Session, p *player.Player, items []*item.ItemDef, title, skill, lastFlagKey, promptVerb string, background bool) { sort.Slice(items, func(i, j int) bool { - return items[i].FirstCraft().Level < items[j].FirstCraft().Level + return g.usableCraft(p, items[i]).Level < g.usableCraft(p, items[j]).Level }) mode := g.colorMode(sess) @@ -138,7 +138,7 @@ func (g *Game) showProductionTable(sess *net.Session, p *player.Player, items [] } for i, item := range items { - craft := item.FirstCraft() + craft := g.usableCraft(p, item) outDef, _ := g.ItemStore.Load(item.ID) productName := item.ID if outDef != nil { @@ -230,7 +230,7 @@ func (g *Game) handleProductChoice(sess *net.Session, input string) { } sort.Slice(items, func(i, j int) bool { - return items[i].FirstCraft().Level < items[j].FirstCraft().Level + return g.usableCraft(p, items[i]).Level < g.usableCraft(p, items[j]).Level }) lastItemID, _ := p.Flags[lastFlagKey].(string) @@ -247,7 +247,7 @@ func (g *Game) handleProductChoice(sess *net.Session, input string) { return } - craft := sel.Item.FirstCraft() + craft := g.usableCraft(p, sel.Item) skillLevel := p.Level(player.SkillName(skill)) if skillLevel < craft.Level { sess.WriteLine(fmt.Sprintf("You need level %d %s to make that.", craft.Level, skill)) |
