.
This commit is contained in:
parent
6fae54b78d
commit
ee88919e71
4 changed files with 36 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ extends Node
|
||||||
signal productions_update(p: Array[Production])
|
signal productions_update(p: Array[Production])
|
||||||
@warning_ignore("unused_signal")
|
@warning_ignore("unused_signal")
|
||||||
signal production_log(producer: Currency, p: Production)
|
signal production_log(producer: Currency, p: Production)
|
||||||
|
@warning_ignore("unused_signal")
|
||||||
signal log(s: String)
|
signal log(s: String)
|
||||||
@export var currencies: Array[Production]
|
@export var currencies: Array[Production]
|
||||||
@export var members: Array
|
@export var members: Array
|
||||||
|
|
@ -79,6 +80,10 @@ func simulate():
|
||||||
update_currencies()
|
update_currencies()
|
||||||
for e in events:
|
for e in events:
|
||||||
if e.requirements_satisfied() and e.will_happen():
|
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:
|
if e.log_message != "" and not e.skip_log:
|
||||||
Economy.log.emit(e.log_message)
|
Economy.log.emit(e.log_message)
|
||||||
var outcome := e.outcome()
|
var outcome := e.outcome()
|
||||||
|
|
@ -113,6 +118,9 @@ func _ready() -> void:
|
||||||
update_currencies()
|
update_currencies()
|
||||||
|
|
||||||
func _on_timer_timeout() -> void:
|
func _on_timer_timeout() -> void:
|
||||||
|
if get_tree().current_scene.scene_file_path != "res://game.tscn":
|
||||||
|
%SimulateTickTimer.start()
|
||||||
|
return
|
||||||
if Dialogic.current_timeline != null:
|
if Dialogic.current_timeline != null:
|
||||||
%SimulateTickTimer.start()
|
%SimulateTickTimer.start()
|
||||||
return
|
return
|
||||||
|
|
|
||||||
6
game_over.gd
Normal file
6
game_over.gd
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
extends Control
|
||||||
|
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
await Dialogic.timeline_ended
|
||||||
|
get_tree().quit()
|
||||||
1
game_over.gd.uid
Normal file
1
game_over.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://newnma6kkptj
|
||||||
21
game_over.tscn
Normal file
21
game_over.tscn
Normal file
|
|
@ -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)
|
||||||
Loading…
Add table
Reference in a new issue