fixed recharge acceleration bug and wall placement indicators bug when walls are refunded

This commit is contained in:
Lexi Quinn 2023-12-08 03:27:10 +11:00
parent 1e3e380b90
commit c75ba6461a
5 changed files with 16 additions and 11 deletions

View File

@ -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()

View File

@ -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

View File

@ -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

View File

@ -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()

View File

@ -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: