diff --git a/scripts/core/actions.gd b/scripts/core/actions.gd index 6191fc7..a86624a 100644 --- a/scripts/core/actions.gd +++ b/scripts/core/actions.gd @@ -114,7 +114,7 @@ func harvest_hit(player: Node3D, node: Node3D, hit_point: Vector3) -> bool: var held: Dictionary = ItemDB.get_item(player.held_item_id()) var tool: Dictionary = held.get("tool", {}) if tool.get("kind", "") != node.tool_kind or int(tool.get("tier", 0)) < node.min_tier: - notify.emit("Need a %s" % ("stone " + node.tool_kind)) + notify.emit("Needs a %s (Tab to craft)" % ItemDB.item_name("stone_" + node.tool_kind)) return false var drops: Dictionary = node.hit(float(tool.get("damage", 1.0)), hit_point, player.global_position) for id in drops: diff --git a/scripts/world/resource_node.gd b/scripts/world/resource_node.gd index 797af4e..85da25a 100644 --- a/scripts/world/resource_node.gd +++ b/scripts/world/resource_node.gd @@ -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: