From 45c79db18c8e37dcbc7c188ce18a91a2ab97ad4f Mon Sep 17 00:00:00 2001 From: ToasterPanic Date: Thu, 4 Dec 2025 16:32:46 -0500 Subject: [PATCH] Fuel tank refueling, dialogue sounds, retro filter adjustments --- scenes/game.tscn | 2 +- scenes/ground.tscn | 19 +++++++---- scripts/dialogue_select_button.gd | 3 +- scripts/galactamart_worker.gd | 54 +++++++++++++++++++++++++++++- scripts/game_ground.gd | 16 +++++---- scripts/global.gd | 8 +++++ sounds/dialogue.mp3 | Bin 0 -> 2425 bytes sounds/dialogue.mp3.import | 19 +++++++++++ 8 files changed, 104 insertions(+), 17 deletions(-) create mode 100644 sounds/dialogue.mp3 create mode 100644 sounds/dialogue.mp3.import diff --git a/scenes/game.tscn b/scenes/game.tscn index 4415611..f695968 100644 --- a/scenes/game.tscn +++ b/scenes/game.tscn @@ -40,7 +40,7 @@ shader = ExtResource("12_kvuet") shader_parameter/shake = 0.002000000095 shader_parameter/noiseQuality = 250.0 shader_parameter/noiseIntensity = 0.0010000000475 -shader_parameter/offsetIntensity = 0.0045 +shader_parameter/offsetIntensity = 0.0 shader_parameter/colorOffsetIntensity = 0.10000000149012 shader_parameter/pixelSize = 1024.0 shader_parameter/grainIntensity = 0.04 diff --git a/scenes/ground.tscn b/scenes/ground.tscn index 192ded5..ace20e4 100644 --- a/scenes/ground.tscn +++ b/scenes/ground.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=45 format=4 uid="uid://by43ihcec8e8q"] +[gd_scene load_steps=46 format=4 uid="uid://by43ihcec8e8q"] [ext_resource type="Script" uid="uid://b2sw6ymaf4t0s" path="res://scripts/game_ground.gd" id="1_6ra5r"] [ext_resource type="AudioStream" uid="uid://dgv01wy8r7ej2" path="res://sounds/uglyburger.mp3" id="2_5vwr8"] [ext_resource type="Script" uid="uid://dowu512otgyyf" path="res://scripts/player_ground.gd" id="3_8gbjj"] +[ext_resource type="AudioStream" uid="uid://cdl70q0x28717" path="res://sounds/dialogue.mp3" id="3_rncil"] [ext_resource type="Texture2D" uid="uid://c0cyhybh30ogt" path="res://textures/player-ground-sheet.png" id="4_2c1ag"] [ext_resource type="Texture2D" uid="uid://xs6tjca62pw1" path="res://textures/wall_side_tile.png" id="4_8gbjj"] [ext_resource type="Texture2D" uid="uid://ddfp7u4a7llnr" path="res://textures/wall_side_tile_left.png" id="5_176r3"] @@ -154,20 +155,20 @@ animations = [{ }, { "frames": [{ "duration": 1.0, -"texture": SubResource("AtlasTexture_jo68p") -}, { -"duration": 1.0, "texture": SubResource("AtlasTexture_6gpfv") }, { "duration": 1.0, -"texture": SubResource("AtlasTexture_yqhs4") +"texture": SubResource("AtlasTexture_jo68p") }, { "duration": 1.0, "texture": SubResource("AtlasTexture_fd1o3") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_yqhs4") }], "loop": true, "name": &"walk", -"speed": 6.0 +"speed": 7.0 }] [sub_resource type="CapsuleShape2D" id="CapsuleShape2D_176r3"] @@ -200,7 +201,7 @@ shader = ExtResource("9_257nh") shader_parameter/shake = 0.002000000095 shader_parameter/noiseQuality = 250.0 shader_parameter/noiseIntensity = 0.0010000000475 -shader_parameter/offsetIntensity = 0.0045 +shader_parameter/offsetIntensity = 0.0 shader_parameter/colorOffsetIntensity = 0.10000000149012 shader_parameter/pixelSize = 1024.0 shader_parameter/grainIntensity = 0.04 @@ -220,6 +221,9 @@ autoplay = true bus = &"Music" parameters/looping = true +[node name="Dialogue" type="AudioStreamPlayer" parent="."] +stream = ExtResource("3_rncil") + [node name="Map" type="TileMapLayer" parent="."] modulate = Color(0.53333336, 0.53333336, 0.53333336, 1) material = SubResource("CanvasItemMaterial_gysiw") @@ -383,6 +387,7 @@ text = "TO INTERACT" label_settings = SubResource("LabelSettings_c2suo") [node name="DialogueOptions" type="VBoxContainer" parent="UI/Control"] +visible = false custom_minimum_size = Vector2(128, 0) layout_mode = 1 anchors_preset = -1 diff --git a/scripts/dialogue_select_button.gd b/scripts/dialogue_select_button.gd index c796868..e74b65b 100644 --- a/scripts/dialogue_select_button.gd +++ b/scripts/dialogue_select_button.gd @@ -2,9 +2,8 @@ extends Button var game = null - func _on_pressed() -> void: - get_tree().quit() + game.choice_made.emit(get_name()) func _input(event: InputEvent) -> void: if has_focus() and (event.is_action_pressed("interact") or event.is_action_pressed("dialogue_continue")): diff --git a/scripts/galactamart_worker.gd b/scripts/galactamart_worker.gd index c2ac373..eca3547 100644 --- a/scripts/galactamart_worker.gd +++ b/scripts/galactamart_worker.gd @@ -11,10 +11,62 @@ func _interact(player: Node2D) -> void: await game.dialogue("How may I help you?") - await game.make_choice({ + var option = await game.make_choice({ "refuel": "Refuel ship", "buy": "Buy items", "exit": "Exit" }) + if option == "refuel": + await game.dialogue("How much?") + + var price_per_percentage = 0.433 + var price_full = floori((100 - global.stats.fuel) * price_per_percentage) + var price_half = floori((50 - global.stats.fuel) * price_per_percentage) + var price_quarter = floori((25 - global.stats.fuel) * price_per_percentage) + + var options = { + "full": "Refuel Tank (" + str(price_full)+ "¤)" + } + + if price_half > 0: + options.half = "Refuel to 50% (" + str(price_half) + "¤)" + if price_quarter > 0: + options.quarter = "Refuel to 25% (" + str(price_quarter) + "¤)" + + options.exit = "Nevermind" + + var fuel_option = await game.make_choice(options) + + if fuel_option == "full": + if price_full <= global.stats.marks: + global.stats.fuel = 100 + global.stats.marks -= price_full + + await game.dialogue("Okay, your tank should be filled to 100%.") + else: + await game.dialogue("Sorry, but you don't have enough marks for that.") + elif fuel_option == "half": + if price_half <= global.stats.marks: + global.stats.fuel = 50 + global.stats.marks -= price_half + + await game.dialogue("Okay, your tank should be filled to 50%.") + else: + await game.dialogue("Sorry, but you don't have enough marks for that.") + elif fuel_option == "quarter": + if price_quarter <= global.stats.marks: + global.stats.fuel = 25 + global.stats.marks -= price_quarter + + await game.dialogue("Okay, your tank should be filled to 25%.") + else: + await game.dialogue("Sorry, but you don't have enough marks for that.") + + player.get_node("Camera").enabled = true + $Camera.enabled = false + $InteractArea.monitoring = true + + player.busy = false + return diff --git a/scripts/game_ground.gd b/scripts/game_ground.gd index 2515e18..44ad222 100644 --- a/scripts/game_ground.gd +++ b/scripts/game_ground.gd @@ -29,7 +29,9 @@ func dialogue(text: String) -> void: $UI/Control/Dialogue/Label.text = displayed_text - await get_tree().create_timer(0.05).timeout + $Dialogue.play() + + await get_tree().create_timer(0.03).timeout i += 1 @@ -41,11 +43,9 @@ func dialogue(text: String) -> void: return -func make_choice(options: Dictionary = {}) -> void: +func make_choice(options: Dictionary = {}) -> String: $UI/Control/DialogueOptions.visible = true - $UI/Control/DialogueOptions/Button.grab_focus() - var dialogue_select_button_scene = preload("res://scenes/dialogue_select_button.tscn") for n in $UI/Control/DialogueOptions.get_children(): if n.is_class("Button"): n.free() @@ -58,6 +58,7 @@ func make_choice(options: Dictionary = {}) -> void: dialogue_select_button.name = n dialogue_select_button.text = options[n] + dialogue_select_button.game = self $UI/Control/DialogueOptions.add_child(dialogue_select_button) @@ -70,9 +71,12 @@ func make_choice(options: Dictionary = {}) -> void: first_button.grab_focus() - await dialogue_continue + var response = await choice_made + + $UI/Control/DialogueOptions.visible = false + + return response - return func _input(event: InputEvent) -> void: if event.is_action_pressed("dialogue_continue"): diff --git a/scripts/global.gd b/scripts/global.gd index 5142c53..ff9a39b 100644 --- a/scripts/global.gd +++ b/scripts/global.gd @@ -22,3 +22,11 @@ var orbit_zones = [ }, ] + +var stats = { + "fuel": 12, + "fuel_tank_size": 1, + "speed": 512, + "boost_tank_size": 1, + "marks": 200, +} diff --git a/sounds/dialogue.mp3 b/sounds/dialogue.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..ba3cc519fa576be77790c83804221e81c368f126 GIT binary patch literal 2425 zcmd^=c~H}58pmJ4p`bfYx1ZucSgm+_Sx_|Iz|JdowerBF|pLySTp7%T7 z=bd?>JWT?2;v3ElRqTDD2sHrI<3PX;5_eLygYS0oW+!k5in~1Bo!Q51EGbr2Dowvh z+Cwx##XAF~=O1*0{8Bjg+rj_K3gsP&0bz7ZynQ+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