P1 iron: nuggets, ore, clay, kiln, smelter, forge, iron tools and arrows, lantern, tool wear and repair

This commit is contained in:
Paul Bailey
2026-11-05 00:31:07 +00:00
parent ab1f417c32
commit 24c280d885
24 changed files with 1334 additions and 43 deletions

View File

@@ -109,6 +109,16 @@ func item_name(id: String) -> String:
func stack_size(id: String) -> int:
return int(items.get(id, {}).get("stack", 1))
## How many uses a tool or weapon has when new (0 = it never wears out).
func max_durability(id: String) -> int:
return int(items.get(id, {}).get("durability", 0))
## Uses left on a stack (its max if it's never been used, or it can't wear).
func durability(stack) -> int:
if stack == null:
return 0
return int(stack.get("dur", max_durability(stack.id)))
func mesh_for(id: String) -> ArrayMesh:
return ItemMeshes.build(items.get(id, {}).get("mesh", id))