Tool prompts explain how to craft the missing tool

'Tree (needs a axe)' gave new players no way forward. The prompt now
shows the recipe (Tab to craft from 2 stick, 2 flint), or tells you to
select the tool if it's already in your bag.
This commit is contained in:
Paul Bailey
2026-11-04 00:37:04 +00:00
parent 4640f5e577
commit 2b1afc86ba
2 changed files with 10 additions and 2 deletions

View File

@@ -38,7 +38,15 @@ func interact_prompt(player: Node) -> String:
var verb := "Chop" if kind == "tree" else "Mine"
if tool.get("kind", "") == tool_kind:
return "%s [LMB] %s" % [display_name(), verb]
return "%s (needs a %s)" % [display_name(), tool_kind]
# Tell new players how to get the tool, not just that they lack it.
var tool_id := "stone_" + tool_kind
var r: Dictionary = ItemDB.recipes.get(tool_id, {})
var parts: Array[String] = []
for id in r.get("inputs", {}):
parts.append("%d %s" % [int(r.inputs[id]), ItemDB.item_name(id).to_lower()])
if player.inventory.count(tool_id) > 0:
return "%s (select your %s on the hotbar)" % [display_name(), ItemDB.item_name(tool_id)]
return "%s (needs a %s: Tab to craft from %s)" % [display_name(), ItemDB.item_name(tool_id), ", ".join(parts)]
## Applies one hit. Returns the items earned by this hit.
func hit(damage: float, point: Vector3, from: Vector3) -> Dictionary: