P1 iron: nuggets, ore, clay, kiln, smelter, forge, iron tools and arrows, lantern, tool wear and repair
This commit is contained in:
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user