From ee88919e7177927b336a464c25a979d4fd04ddc6 Mon Sep 17 00:00:00 2001 From: Spencer Killen Date: Sun, 27 Sep 2026 15:00:53 -0600 Subject: [PATCH] . --- economy.gd | 8 ++++++++ game_over.gd | 6 ++++++ game_over.gd.uid | 1 + game_over.tscn | 21 +++++++++++++++++++++ 4 files changed, 36 insertions(+) create mode 100644 game_over.gd create mode 100644 game_over.gd.uid create mode 100644 game_over.tscn diff --git a/economy.gd b/economy.gd index 075095b..43b8fde 100644 --- a/economy.gd +++ b/economy.gd @@ -3,6 +3,7 @@ extends Node signal productions_update(p: Array[Production]) @warning_ignore("unused_signal") signal production_log(producer: Currency, p: Production) +@warning_ignore("unused_signal") signal log(s: String) @export var currencies: Array[Production] @export var members: Array @@ -79,6 +80,10 @@ func simulate(): update_currencies() for e in events: if e.requirements_satisfied() and e.will_happen(): + if e.game_over_timeline != null: + get_tree().change_scene_to_file("res://game_over.tscn") + Dialogic.start(e.game_over_timeline) + return if e.log_message != "" and not e.skip_log: Economy.log.emit(e.log_message) var outcome := e.outcome() @@ -113,6 +118,9 @@ func _ready() -> void: update_currencies() func _on_timer_timeout() -> void: + if get_tree().current_scene.scene_file_path != "res://game.tscn": + %SimulateTickTimer.start() + return if Dialogic.current_timeline != null: %SimulateTickTimer.start() return diff --git a/game_over.gd b/game_over.gd new file mode 100644 index 0000000..070e3a8 --- /dev/null +++ b/game_over.gd @@ -0,0 +1,6 @@ +extends Control + + +func _ready() -> void: + await Dialogic.timeline_ended + get_tree().quit() diff --git a/game_over.gd.uid b/game_over.gd.uid new file mode 100644 index 0000000..02ba99f --- /dev/null +++ b/game_over.gd.uid @@ -0,0 +1 @@ +uid://newnma6kkptj diff --git a/game_over.tscn b/game_over.tscn new file mode 100644 index 0000000..19e6097 --- /dev/null +++ b/game_over.tscn @@ -0,0 +1,21 @@ +[gd_scene format=3 uid="uid://cqfexy3yy3tbr"] + +[ext_resource type="Script" uid="uid://newnma6kkptj" path="res://game_over.gd" id="1_y26ei"] + +[node name="GameOver" type="Control" unique_id=880250183] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_y26ei") + +[node name="ColorRect" type="ColorRect" parent="." unique_id=619694373] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +color = Color(0, 0, 0, 1)