From c75ba6461a713387ef6a4e5f07976d4e4e17369e Mon Sep 17 00:00:00 2001 From: Lexi Quinn Date: Fri, 8 Dec 2023 03:27:10 +1100 Subject: [PATCH] fixed recharge acceleration bug and wall placement indicators bug when walls are refunded --- .../RocketLauncher/weapon_rocket_launcher.gd | 1 + Scenes/gauntlet.tscn | 1 + Scripts/AStarGraph3D.gd | 2 +- Scripts/Weapons/weapon.gd | 3 ++- Scripts/game.gd | 20 ++++++++++--------- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/PCs/Universal/ClassCards/RocketLauncher/weapon_rocket_launcher.gd b/PCs/Universal/ClassCards/RocketLauncher/weapon_rocket_launcher.gd index 1830bbd..16c6672 100644 --- a/PCs/Universal/ClassCards/RocketLauncher/weapon_rocket_launcher.gd +++ b/PCs/Universal/ClassCards/RocketLauncher/weapon_rocket_launcher.gd @@ -54,6 +54,7 @@ func release_trigger(): func shoot(): animator.play("shoot") recharging = false + recharge_speed = 0.0 for target in targets: networked_spawn_rocket.rpc(get_tree().root.get_path_to(target), multiplayer.get_unique_id()) targets.clear() diff --git a/Scenes/gauntlet.tscn b/Scenes/gauntlet.tscn index fd7c169..d8f45b8 100644 --- a/Scenes/gauntlet.tscn +++ b/Scenes/gauntlet.tscn @@ -20,6 +20,7 @@ target_position = Vector3(0, 0, -20) collision_mask = 25 [node name="WallPreview" parent="." instance=ExtResource("2_r3632")] +visible = false [node name="ProgressBar" type="TextureProgressBar" parent="."] anchors_preset = 8 diff --git a/Scripts/AStarGraph3D.gd b/Scripts/AStarGraph3D.gd index 1bba796..5f04629 100644 --- a/Scripts/AStarGraph3D.gd +++ b/Scripts/AStarGraph3D.gd @@ -53,7 +53,7 @@ func networked_toggle_point(point_id, caller_id): else: astar.set_point_disabled(point_id, true) find_path() - disable_path_tower_frames() + enable_non_path_tower_frames() if is_multiplayer_authority() and astar.is_point_disabled(point_id): networked_spawn_wall.rpc(astar.get_point_position(point_id), wall_id, caller_id) wall_id += 1 diff --git a/Scripts/Weapons/weapon.gd b/Scripts/Weapons/weapon.gd index 5fc669e..588e40e 100644 --- a/Scripts/Weapons/weapon.gd +++ b/Scripts/Weapons/weapon.gd @@ -21,7 +21,7 @@ var energy_cost := 1.0 var recharging := false var recharge_speed := 0.0 var recharge_acceleration = 2.0 -var recharge_max_speed = 20.0 +var recharge_max_speed = 25.0 func _ready() -> void: @@ -85,6 +85,7 @@ func shoot(): animator.play("shoot") audio_player.play() recharging = false + recharge_speed = 0.0 recharge_timer.stop() diff --git a/Scripts/game.gd b/Scripts/game.gd index ea24f2f..c5bafbe 100644 --- a/Scripts/game.gd +++ b/Scripts/game.gd @@ -45,30 +45,32 @@ func parse_command(text : String, peer_id : int): if x.title == gift_name: gift = x connected_players_nodes[peer_id].inventory.add(gift) - if text.substr(1, 2) == "tr": + elif text.substr(1, 2) == "tr": chatbox.append_message("SERVER", Color.TOMATO, "[color=#f7a8b8]t[color=#55cdfc]r[color=#ffffff]a[color=#55cdfc]n[color=#f7a8b8]s [color=#e50000]r[color=#ff8d00]i[color=#ffee00]g[color=#028121]h[color=#004cff]t[color=#760088]s[color=white]!!") - if text.substr(1, 11) == "random_maze": + elif text.substr(1, 6) == "length": + chatbox.append_message("SERVER", Color.TOMATO, str(level.a_star_graph_3d.visualized_path.curve.get_baked_length())) + elif text.substr(1, 11) == "random_maze": level.a_star_graph_3d.build_random_maze(50) - if text.substr(1, 13) == "random_towers": + elif text.substr(1, 13) == "random_towers": level.a_star_graph_3d.place_random_towers(level.a_star_graph_3d.tower_bases.size() / 3.0) - if text.substr(1, 11) == "set_endless": + elif text.substr(1, 11) == "set_endless": if is_multiplayer_authority(): networked_set_endless.rpc(true) else: chatbox.append_message("SERVER", Color.TOMATO, "Unable to edit gamemode") - if text.substr(1, 12) == "set_standard": + elif text.substr(1, 12) == "set_standard": if is_multiplayer_authority(): networked_set_endless.rpc(false) else: chatbox.append_message("SERVER", Color.TOMATO, "Unable to edit gamemode") - if text.substr(1, 11) == "spawn_print": + elif text.substr(1, 11) == "spawn_print": level.printer._on_static_body_3d_button_interacted(0) - if text.substr(1, 10) == "spawn_shop": + elif text.substr(1, 10) == "spawn_shop": level.shop.randomize_cards() - if text.substr(1, 7) == "prosper": + elif text.substr(1, 7) == "prosper": for id in connected_players_nodes: connected_players_nodes[id].currency += 50 - if text.substr(1, 8) == "set_wave": + elif text.substr(1, 8) == "set_wave": if is_multiplayer_authority(): networked_set_wave.rpc(int(text.substr(10))) else: