Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# SPDX-FileCopyrightText: The Threadbare Authors
# SPDX-License-Identifier: MPL-2.0
extends AnimationPlayer


func _ready() -> void:
animation_finished.connect(_on_animation_finished)


func _on_animation_finished(_anim_name: StringName) -> void:
# Go back home. Usually Fray's End and next to the Eternal Loom:
var home_scene: String = ThreadbareProjectSettings.get_setting(
ThreadbareProjectSettings.HOME_SCENE
)
SceneSwitcher.change_to_file_with_transition(
home_scene, "", Transitions.Effect.FADE, Transitions.Effect.FADE
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://k3q1kntww4eb

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ extends Node2D

signal retelling_started
signal retelling_finished
signal load_cinematic
signal play_cinematic
signal give_retelling_upgrade(type: InventoryItem.ItemType)

## Paths to world-rewoven cutscenes that will be shown.
## They must switch back to Fray's End after playing an animation.
@export var cutscene_paths: Array[String] = [
"res://scenes/game_elements/fx/world_rewoven/components/world_rewoven_cutscene_1.tscn",
"res://scenes/game_elements/fx/world_rewoven/components/world_rewoven_cutscene_2.tscn",
]

var elders: Array[Elder]

@onready var interact_area: InteractArea = %InteractArea
Expand Down Expand Up @@ -77,16 +82,29 @@ func give_spirit_upgrade() -> void:


func on_offering_succeeded() -> void:
load_cinematic.emit()
var cutscene_path: String = cutscene_paths.pick_random()
var load_error: Error = ResourceLoader.load_threaded_request(cutscene_path)

GameState.global.facts.rewoven_cutscenes = [cutscene_path]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: this generic fact is placeholder, while I figure out a way to generate an array of cutscenes to display using actual quest unlockers.


if load_error != OK:
push_error("Failed to start loading %s: %s" % [cutscene_path, error_string(load_error)])

loom_offering_animation_player.play(&"loom_offering")
await loom_offering_animation_player.animation_finished
GameState.quest.inventory.clear_inventory()

play_cinematic.emit()
if load_error != OK:
on_rewoven_finished()
return

var cutscene_packed: PackedScene = ResourceLoader.load_threaded_get(cutscene_path)
SceneSwitcher.change_to_packed_with_transition(
cutscene_packed, "", Transitions.Effect.FADE, Transitions.Effect.FADE
)


func on_cinematic_finished() -> void:
func on_rewoven_finished() -> void:
var elder: Elder = _find_elder(GameState.quest.quest)
if elder:
await elder.congratulate_player()
Expand Down
65 changes: 0 additions & 65 deletions scenes/world_map/components/cutscene_layer.gd

This file was deleted.

1 change: 0 additions & 1 deletion scenes/world_map/components/cutscene_layer.gd.uid

This file was deleted.

5 changes: 5 additions & 0 deletions scenes/world_map/components/frays_end.gd
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ func _ready() -> void:
GameState.quest.inventory.item_collected.connect(_update_story_quest_progress_visibility)
GameState.quest.inventory.item_consumed.connect(_update_story_quest_progress_visibility)

# Back to Fray's End after finishing playing all cutscenes.
if GameState.global.facts.has("rewoven_cutscenes"):
GameState.global.facts.erase("rewoven_cutscenes")
eternal_loom.on_rewoven_finished()


func _update_story_quest_progress_visibility(_item: InventoryItem = null) -> void:
var end_of_quest := eternal_loom.is_item_offering_possible()
Expand Down
5 changes: 0 additions & 5 deletions scenes/world_map/frays_end.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
[ext_resource type="Script" uid="uid://dts1hwdy3phin" path="res://scenes/menus/storybook/components/quest.gd" id="59_qgpx3"]
[ext_resource type="Resource" uid="uid://t50glay2iqhg" path="res://scenes/quests/lore_quests/quest_002/quest.tres" id="60_6b07c"]
[ext_resource type="Script" uid="uid://0enyu5v4ra34" path="res://scenes/game_elements/props/spawn_point/components/spawn_point.gd" id="61_6b07c"]
[ext_resource type="Script" uid="uid://b8pt5e5ec6hgx" path="res://scenes/world_map/components/cutscene_layer.gd" id="61_ulm71"]
[ext_resource type="Script" uid="uid://cmika1t1573xe" path="res://scenes/world_map/components/frays_end_exit_blocker.gd" id="62_t7c6s"]
[ext_resource type="PackedScene" uid="uid://covsdqqsd6rsy" path="res://scenes/game_elements/props/sign/sign.tscn" id="64_uxfrp"]

Expand Down Expand Up @@ -1453,10 +1452,6 @@ text = "West End"
[node name="HUD" parent="." unique_id=1876437396 instance=ExtResource("27_aj6tp")]
unique_name_in_owner = true

[node name="CutsceneLayer" type="CanvasLayer" parent="." unique_id=2031218370]
unique_name_in_owner = true
script = ExtResource("61_ulm71")

[node name="SpawnPointAfterIntro" parent="." unique_id=69976262 instance=ExtResource("37_thm8h")]
position = Vector2(62, 1747)

Expand Down