Add durable recipe discovery and profession crafting

This commit is contained in:
dingo
2026-09-09 13:28:07 -04:00
parent 940a345613
commit b65f3e8562
42 changed files with 2183 additions and 136 deletions
+8 -1
View File
@@ -47,6 +47,13 @@ func (w *World) AdminItems(c *Character, op, value string) error {
known = true
}
}
if w.Balance.Crafting != nil {
for _, m := range w.Balance.Crafting.Materials {
if m.ID == id {
known = true
}
}
}
for _, definition := range w.Balance.Items {
if definition.ID == id {
known = true
@@ -79,7 +86,7 @@ func (w *World) AdminItems(c *Character, op, value string) error {
if c.View.Inventory[id] < n {
return errors.New("player no longer holds that item quantity")
}
c.View.Inventory[id] -= n
TakeStack(c, id, n)
if c.View.Inventory[id] == 0 {
delete(c.View.Inventory, id)
}