diff --git a/audio/787351__gertraut_hecher__medieval-dance-saltarello.wav b/audio/787351__gertraut_hecher__medieval-dance-saltarello.wav new file mode 100644 index 0000000..08e7e9d Binary files /dev/null and b/audio/787351__gertraut_hecher__medieval-dance-saltarello.wav differ diff --git a/audio/787351__gertraut_hecher__medieval-dance-saltarello.wav.import b/audio/787351__gertraut_hecher__medieval-dance-saltarello.wav.import new file mode 100644 index 0000000..a94438d --- /dev/null +++ b/audio/787351__gertraut_hecher__medieval-dance-saltarello.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://b01aiy2tr1jnn" +path="res://.godot/imported/787351__gertraut_hecher__medieval-dance-saltarello.wav-dafa1b0c9aa497b803110dbc04598fa0.sample" + +[deps] + +source_file="res://audio/787351__gertraut_hecher__medieval-dance-saltarello.wav" +dest_files=["res://.godot/imported/787351__gertraut_hecher__medieval-dance-saltarello.wav-dafa1b0c9aa497b803110dbc04598fa0.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=2 diff --git a/currency/sentient/farmer.tres b/currency/sentient/farmer.tres index 9c7a8e6..b0276a2 100644 --- a/currency/sentient/farmer.tres +++ b/currency/sentient/farmer.tres @@ -6,8 +6,6 @@ [ext_resource type="Resource" uid="uid://u6lls6n0xw3n" path="res://commands/move_command.tres" id="2_7lva1"] [ext_resource type="Resource" uid="uid://boshkhnywnk27" path="res://currency/production/human_production_shared_1.tres" id="2_jkjll"] [ext_resource type="Resource" uid="uid://mgb7y1r3eapq" path="res://currency/production/human_production_shared_2.tres" id="3_kfqfp"] -[ext_resource type="Resource" uid="uid://b5qok0rcalr" path="res://currency/sentient/cow.tres" id="5_uddvy"] -[ext_resource type="Resource" uid="uid://rdrcyvuvrp2m" path="res://currency/sentient/pig.tres" id="6_epa0v"] [ext_resource type="Resource" uid="uid://ervsee7ku1i2" path="res://currency/inanimate/bread.tres" id="7_uh6l7"] [ext_resource type="Resource" uid="uid://b8b6yr444ecdk" path="res://currency/inanimate/water.tres" id="8_7lva1"] [ext_resource type="Resource" uid="uid://dsohovjbf3s2p" path="res://currency/sentient/chicken.tres" id="9_i5hpk"] @@ -25,18 +23,6 @@ currency = ExtResource("10_n23mm") amount = -1 metadata/_custom_type_script = "uid://dddyxbkq0ienn" -[sub_resource type="Resource" id="Resource_p1wox"] -script = ExtResource("1_35xhy") -currency = ExtResource("5_uddvy") -amount = 50 -metadata/_custom_type_script = "uid://dddyxbkq0ienn" - -[sub_resource type="Resource" id="Resource_bu4yr"] -script = ExtResource("1_35xhy") -currency = ExtResource("6_epa0v") -amount = 50 -metadata/_custom_type_script = "uid://dddyxbkq0ienn" - [sub_resource type="Resource" id="Resource_dynkd"] script = ExtResource("1_35xhy") currency = ExtResource("7_uh6l7") @@ -67,5 +53,5 @@ name = "Farmer" production = Array[ExtResource("1_35xhy")]([ExtResource("2_jkjll"), ExtResource("3_kfqfp"), SubResource("Resource_i7808"), SubResource("Resource_bsgev")]) description = "When something is farm, but more." color = Color(0.43529412, 0.84705883, 1, 1) -wants = Array[ExtResource("1_35xhy")]([SubResource("Resource_p1wox"), SubResource("Resource_bu4yr"), SubResource("Resource_dynkd"), SubResource("Resource_t37mv"), SubResource("Resource_ou8s7"), SubResource("Resource_4ts75")]) +wants = Array[ExtResource("1_35xhy")]([SubResource("Resource_dynkd"), SubResource("Resource_t37mv"), SubResource("Resource_ou8s7"), SubResource("Resource_4ts75")]) metadata/_custom_type_script = "uid://hcvynq5fjypj" diff --git a/economy.gd b/economy.gd index 5232656..43b8fde 100644 --- a/economy.gd +++ b/economy.gd @@ -3,6 +3,8 @@ 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 @@ -78,12 +80,19 @@ 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() for o in outcome: if o == null: continue produce(o) - production_log.emit(null, o) + if e.log_message == "" and not e.skip_log: + production_log.emit(null, o) if e.timeline != null: GameState.add_letter.emit(e.into_letter()) if randf() < 0.01: @@ -109,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/economy.tscn b/economy.tscn index 8b70879..454cbec 100644 --- a/economy.tscn +++ b/economy.tscn @@ -11,6 +11,7 @@ [ext_resource type="Resource" uid="uid://ihsvxienxbeu" path="res://currency/sentient/knight.tres" id="8_qb8iw"] [ext_resource type="Resource" uid="uid://l8osuuxl7exe" path="res://currency/sentient/archer.tres" id="9_4ywr4"] [ext_resource type="Resource" uid="uid://b1tgtujqs5lnr" path="res://currency/sentient/doctor.tres" id="11_17ik3"] +[ext_resource type="AudioStream" uid="uid://b01aiy2tr1jnn" path="res://audio/787351__gertraut_hecher__medieval-dance-saltarello.wav" id="12_2k4vk"] [sub_resource type="Resource" id="Resource_g3220"] script = ExtResource("2_tljx8") @@ -72,6 +73,11 @@ currencies = Array[ExtResource("2_tljx8")]([SubResource("Resource_g3220"), SubRe [node name="SimulateTickTimer" type="Timer" parent="." unique_id=1726107261] unique_name_in_owner = true -wait_time = 2.0 +wait_time = 3.0 + +[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="." unique_id=537297929] +stream = ExtResource("12_2k4vk") +volume_db = -15.0 +autoplay = true [connection signal="timeout" from="SimulateTickTimer" to="." method="_on_timer_timeout"] diff --git a/event.gd b/event.gd index 47d04c0..347d636 100644 --- a/event.gd +++ b/event.gd @@ -16,6 +16,7 @@ enum EventNature { @export var nature: EventNature = EventNature.Random @export var email_source: Currency = preload("res://currency/sentient/town_crier.tres") @export var email_subject: String = "Something is amok!" +@export var log_message: String = "" func requirements_satisfied() -> bool: for requirement in requirements: 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) diff --git a/gui/production_ledger.gd b/gui/production_ledger.gd index 5c6bf50..0c0f192 100644 --- a/gui/production_ledger.gd +++ b/gui/production_ledger.gd @@ -5,6 +5,19 @@ extends VBoxContainer func _ready() -> void: Economy.production_log.connect(append) + Economy.log.connect(log) + +func log(s: String): + var display := preload("res://gui/production_log.tscn").instantiate() + display.set_color(new_message_color) + for child in get_children(): + if child is ProductionLog and child.is_old: + child.set_color(old_message_color) + display.generic = true + display.generic_text = s + add_child(display) + move_child(display, 0) + func append(producer: Currency, production: Production): var display := preload("res://gui/production_log.tscn").instantiate() diff --git a/gui/production_log.gd b/gui/production_log.gd index e9737ed..ffec435 100644 --- a/gui/production_log.gd +++ b/gui/production_log.gd @@ -3,27 +3,38 @@ class_name ProductionLog @export var producer: Currency = null @export var production: Production +@export var generic: bool = false +@export var generic_text: String = "" + var is_old: bool = false func _ready() -> void: - if producer != null: - %producer.text = producer.name - %Production.visible = true + if generic: + %GenericMessage.visible = true + %GenericMessage.text = generic_text + %Production.visible = false %Production2.visible = false else: - %Production.visible = false - %Production2.visible = true - %amount.text = str(abs(production.amount)) - %amount2.text = str(abs(production.amount)) - if production.amount > 0: - %type.text = "produced " - %producer2.text = "You gained " - else: - %type.text = "consumed " - %producer2.text = "You lost " - - %production.text = production.currency.name - %production2.text = production.currency.name + if producer != null: + %producer.text = producer.name + %GenericMessage.visible = false + %Production.visible = true + %Production2.visible = false + else: + %GenericMessage.visible = false + %Production.visible = false + %Production2.visible = true + %amount.text = str(abs(production.amount)) + %amount2.text = str(abs(production.amount)) + if production.amount > 0: + %type.text = "produced " + %producer2.text = "You gained " + else: + %type.text = "consumed " + %producer2.text = "You lost " + if production != null: + %production.text = production.currency.name + %production2.text = production.currency.name make_old.call_deferred() func make_old(): diff --git a/gui/production_log.tscn b/gui/production_log.tscn index 96500af..712acba 100644 --- a/gui/production_log.tscn +++ b/gui/production_log.tscn @@ -5,6 +5,10 @@ [node name="ProductionLog" type="MarginContainer" unique_id=253822540] script = ExtResource("1_ei3g1") +[node name="GenericMessage" type="Label" parent="." unique_id=712313778] +unique_name_in_owner = true +layout_mode = 2 + [node name="Production" type="HBoxContainer" parent="." unique_id=1073672077] unique_name_in_owner = true layout_mode = 2 diff --git a/random events/a_pig_flew.tres b/random events/a_pig_flew.tres index 564f117..1591e54 100644 --- a/random events/a_pig_flew.tres +++ b/random events/a_pig_flew.tres @@ -1,6 +1,7 @@ [gd_resource type="Resource" script_class="Event" format=3 uid="uid://ddjairvlvswck"] [ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="1_puqnt"] +[ext_resource type="Resource" uid="uid://chsv8oeajty8j" path="res://currency/sentient/town_crier.tres" id="1_unbcn"] [ext_resource type="Resource" uid="uid://b5qok0rcalr" path="res://currency/sentient/cow.tres" id="2_tqpw4"] [ext_resource type="Resource" uid="uid://dsohovjbf3s2p" path="res://currency/sentient/chicken.tres" id="3_unbcn"] [ext_resource type="Resource" uid="uid://rdrcyvuvrp2m" path="res://currency/sentient/pig.tres" id="4_k6ytv"] @@ -30,4 +31,5 @@ script = ExtResource("5_ks6hr") modified_resource = SubResource("Resource_wblg4") extra_mods = Array[ExtResource("1_puqnt")]([SubResource("Resource_stddx"), SubResource("Resource_3520l")]) timeline = ExtResource("6_tqpw4") +email_subject = "Pigs Fly?" metadata/_custom_type_script = "uid://diwdxofo6exg3" diff --git a/random events/bar_crawl.tres b/random events/bar_crawl.tres index 85df42d..4d06e0f 100644 --- a/random events/bar_crawl.tres +++ b/random events/bar_crawl.tres @@ -1,6 +1,7 @@ [gd_resource type="Resource" script_class="Event" format=3 uid="uid://s2n6eankt20p"] [ext_resource type="Resource" uid="uid://dv834343s36af" path="res://currency/sentient/drunk.tres" id="1_dvejf"] +[ext_resource type="Resource" uid="uid://chsv8oeajty8j" path="res://currency/sentient/town_crier.tres" id="1_ilimp"] [ext_resource type="Script" uid="uid://diwdxofo6exg3" path="res://event.gd" id="1_qbpgq"] [ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="2_iq8td"] [ext_resource type="Resource" uid="uid://bfc53d345i1h5" path="res://test/bar_crawl.dtl" id="4_iq8td"] @@ -15,4 +16,5 @@ metadata/_custom_type_script = "uid://dddyxbkq0ienn" script = ExtResource("1_qbpgq") modified_resource = SubResource("Resource_elpai") timeline = ExtResource("4_iq8td") +email_subject = "What is this, an alien invasion movie?" metadata/_custom_type_script = "uid://diwdxofo6exg3" diff --git a/random events/blood_rain.tres b/random events/blood_rain.tres index 247d312..764d9ce 100644 --- a/random events/blood_rain.tres +++ b/random events/blood_rain.tres @@ -2,6 +2,7 @@ [ext_resource type="Script" uid="uid://diwdxofo6exg3" path="res://event.gd" id="1_dxq8u"] [ext_resource type="Resource" uid="uid://by3dayfdpobpt" path="res://currency/inanimate/blood.tres" id="1_jlulm"] +[ext_resource type="Resource" uid="uid://chsv8oeajty8j" path="res://currency/sentient/town_crier.tres" id="1_tqf2y"] [ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="2_arfor"] [ext_resource type="Resource" uid="uid://ikwdxjpxukej" path="res://test/blood_rain.dtl" id="4_arfor"] @@ -15,4 +16,5 @@ metadata/_custom_type_script = "uid://dddyxbkq0ienn" script = ExtResource("1_dxq8u") modified_resource = SubResource("Resource_sfr2o") timeline = ExtResource("4_arfor") +email_subject = "The Sky Seems Redder Than Usual..." metadata/_custom_type_script = "uid://diwdxofo6exg3" diff --git a/random events/cave_in.tres b/random events/cave_in.tres index 21e095a..5f62819 100644 --- a/random events/cave_in.tres +++ b/random events/cave_in.tres @@ -32,5 +32,5 @@ modified_resource = SubResource("Resource_kiplq") extra_mods = Array[ExtResource("2_dchj7")]([SubResource("Resource_jv6j0")]) timeline = ExtResource("7_ccnp0") requirements = Array[ExtResource("2_dchj7")]([SubResource("Resource_ccnp0")]) -probability = 0.05 +email_subject = "Cave In!" metadata/_custom_type_script = "uid://diwdxofo6exg3" diff --git a/random events/dino.tres b/random events/dino.tres index 9b37ce4..f912979 100644 --- a/random events/dino.tres +++ b/random events/dino.tres @@ -2,6 +2,7 @@ [ext_resource type="Resource" uid="uid://clx8tbrad4m7c" path="res://currency/sentient/dinosaur.tres" id="1_0jmdm"] [ext_resource type="Script" uid="uid://diwdxofo6exg3" path="res://event.gd" id="1_sui6i"] +[ext_resource type="Resource" uid="uid://chsv8oeajty8j" path="res://currency/sentient/town_crier.tres" id="1_sy7r4"] [ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="2_1x1ll"] [ext_resource type="Resource" uid="uid://25iq6i8ltb6v" path="res://test/dino.dtl" id="4_1x1ll"] diff --git a/random events/double_agent.tres b/random events/double_agent.tres index 02dcffe..113320c 100644 --- a/random events/double_agent.tres +++ b/random events/double_agent.tres @@ -1,5 +1,6 @@ [gd_resource type="Resource" script_class="Event" format=3 uid="uid://dlruqgod1peaf"] +[ext_resource type="Resource" uid="uid://chsv8oeajty8j" path="res://currency/sentient/town_crier.tres" id="1_55mjt"] [ext_resource type="Script" uid="uid://diwdxofo6exg3" path="res://event.gd" id="1_d1mhu"] [ext_resource type="Resource" uid="uid://dfj4jwdmff6bu" path="res://currency/sentient/spy.tres" id="1_klvkh"] [ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="2_53otq"] diff --git a/random events/drought.tres b/random events/drought.tres index 298608d..31f638f 100644 --- a/random events/drought.tres +++ b/random events/drought.tres @@ -1,6 +1,7 @@ [gd_resource type="Resource" script_class="Event" format=3 uid="uid://vtlqhmhi0yeq"] [ext_resource type="Resource" uid="uid://b8b6yr444ecdk" path="res://currency/inanimate/water.tres" id="1_d7ltk"] +[ext_resource type="Resource" uid="uid://chsv8oeajty8j" path="res://currency/sentient/town_crier.tres" id="1_unbv5"] [ext_resource type="Script" uid="uid://diwdxofo6exg3" path="res://event.gd" id="1_ut0k2"] [ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="2_rh8yf"] [ext_resource type="Resource" uid="uid://damk3l2oj6gkd" path="res://test/drought.dtl" id="4_rh8yf"] diff --git a/random events/from_farmer_to_table.tres b/random events/from_farmer_to_table.tres index 473135d..25a0a32 100644 --- a/random events/from_farmer_to_table.tres +++ b/random events/from_farmer_to_table.tres @@ -38,4 +38,5 @@ modified_resource = SubResource("Resource_7vjbg") extra_mods = Array[ExtResource("1_piiqm")]([SubResource("Resource_korph")]) timeline = ExtResource("8_khbdk") requirements = Array[ExtResource("1_piiqm")]([SubResource("Resource_u1m57"), SubResource("Resource_uhb4h")]) +probability = 0.1 metadata/_custom_type_script = "uid://diwdxofo6exg3" diff --git a/random events/gold_rush.tres b/random events/gold_rush.tres index 70f8e9f..e8fe11e 100644 --- a/random events/gold_rush.tres +++ b/random events/gold_rush.tres @@ -1,6 +1,7 @@ [gd_resource type="Resource" script_class="Event" format=3 uid="uid://mjwk02bgdiqj"] [ext_resource type="Resource" uid="uid://bnlnq4ucsgfxe" path="res://currency/inanimate/gold.tres" id="1_8xx2a"] +[ext_resource type="Resource" uid="uid://chsv8oeajty8j" path="res://currency/sentient/town_crier.tres" id="1_dx2yq"] [ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="2_5iq3f"] [ext_resource type="Script" uid="uid://diwdxofo6exg3" path="res://event.gd" id="3_84pag"] [ext_resource type="Resource" uid="uid://dpaj2dk3qm7ow" path="res://currency/sentient/miner.tres" id="3_68771"] diff --git a/random events/taunt.tres b/random events/taunt.tres index b64d576..2bfea26 100644 --- a/random events/taunt.tres +++ b/random events/taunt.tres @@ -8,4 +8,5 @@ [resource] script = ExtResource("2_c2rsl") timeline = ExtResource("3_c2rsl") +probability = 0.05 metadata/_custom_type_script = "uid://diwdxofo6exg3" diff --git a/random events/wizard.tres b/random events/wizard.tres index 2214b57..c8f1a1a 100644 --- a/random events/wizard.tres +++ b/random events/wizard.tres @@ -1,5 +1,6 @@ [gd_resource type="Resource" script_class="Event" format=3 uid="uid://bsug257xiks84"] +[ext_resource type="Resource" uid="uid://chsv8oeajty8j" path="res://currency/sentient/town_crier.tres" id="1_7nshr"] [ext_resource type="Script" uid="uid://diwdxofo6exg3" path="res://event.gd" id="1_kjsek"] [ext_resource type="Resource" uid="uid://6xylw7p78fvf" path="res://currency/sentient/wizard.tres" id="1_wgvj8"] [ext_resource type="Script" uid="uid://dddyxbkq0ienn" path="res://currency/production.gd" id="2_8hlcg"] diff --git a/thumbnails/attributions/attributions.txt b/thumbnails/attributions/attributions.txt index f250f1b..cc1227a 100644 --- a/thumbnails/attributions/attributions.txt +++ b/thumbnails/attributions/attributions.txt @@ -9,3 +9,5 @@ doctor.jpg - cropped from: "Effect inferno 2022 movie frame 01.jpg" by Sergey A. dino.jpg - cropped from: "Dino cosumes at Knockengorroch 2023.jpeg" by Sara Thomas, https://commons.wikimedia.org/wiki/File:Dino_cosumes_at_Knockengorroch_2023.jpeg, licensed under https://creativecommons.org/licenses/by/4.0/ Godot UI Theme - https://softwave.itch.io/godot-retro-theme-space-worm/ + +Background music - Medieval Dance - Saltarello by gertraut_hecher -- https://freesound.org/s/787351/ -- License: Attribution NonCommercial 4.0