Old Tam speaks (Kokoro); CC0 birdsong, crickets and owls; no plants through floors; menu and marker fixes
This commit is contained in:
@@ -121,6 +121,7 @@ func start(w: Node3D, from_saved: Dictionary = {}) -> void:
|
||||
|
||||
func stop() -> void:
|
||||
_clear_outline()
|
||||
Narrator.stop()
|
||||
active = false
|
||||
world = null
|
||||
|
||||
@@ -139,9 +140,11 @@ func chapter_title(step: Dictionary) -> String:
|
||||
func _enter() -> void:
|
||||
if index >= steps.size():
|
||||
finished.emit()
|
||||
Narrator.say("tutorial_finish", String(finish.get("text", "")))
|
||||
return
|
||||
_setup(steps[index].get("setup", {}))
|
||||
step_started.emit(index, steps[index])
|
||||
Narrator.say("tutorial_" + String(steps[index].id), String(steps[index].text))
|
||||
_marker_t = 0.0
|
||||
_check() # (done early? it ticks straight away)
|
||||
|
||||
@@ -346,6 +349,14 @@ func marker_position() -> Vector3:
|
||||
|
||||
## Where the current step's marker goes: the nearest thing it asks for, or
|
||||
## INF (no marker, or you've got what it was for).
|
||||
## Whether the part of `goal` about `kind`:`id` (e.g. gained: stone) is done.
|
||||
func _part_met(goal: Dictionary, kind: String, id: String) -> bool:
|
||||
var parts: Array = goal.get("all", [goal])
|
||||
for p in parts:
|
||||
if p is Dictionary and String(p.get(kind, "")) == id:
|
||||
return _met(p)
|
||||
return false
|
||||
|
||||
func find_marker() -> Vector3:
|
||||
var s := current()
|
||||
if s.is_empty() or not s.has("marker") or world == null:
|
||||
@@ -360,9 +371,14 @@ func find_marker() -> Vector3:
|
||||
var best_d := INF
|
||||
var cands: Array = []
|
||||
if what.begins_with("pickup:"):
|
||||
var id := what.substr(7)
|
||||
# "pickup:stick|stone": the nearest of whichever you still need (the
|
||||
# step's "gained" goal for that item isn't met yet).
|
||||
var ids: Array = []
|
||||
for id in what.substr(7).split("|", false):
|
||||
if not _part_met(s.get("goal", {}), "gained", id):
|
||||
ids.append(id)
|
||||
for pk in world.props.pickups.values():
|
||||
if is_instance_valid(pk) and not pk.taken and pk.item_id == id:
|
||||
if is_instance_valid(pk) and not pk.taken and pk.item_id in ids:
|
||||
cands.append(pk)
|
||||
elif what in ["tree", "rock"]:
|
||||
for n in world.props.resource_nodes.values():
|
||||
|
||||
Reference in New Issue
Block a user