pellet spread, bulletholes and balance fixes

This commit is contained in:
Rendo 2025-12-14 14:54:35 +05:00
commit 74e37f8a18
17 changed files with 261 additions and 72 deletions

View file

@ -2,7 +2,7 @@ extends Node
func can_buy(player_id: int,weapon: WeaponResource) -> bool:
return Session.player_data[player_id]["money"] >= weapon.cost
return Session.player_data[player_id]["money"] >= weapon.cost or LobbySettings.infinite_money
func buy(player_id: int, weapon: WeaponResource) -> void:
if not multiplayer.is_server() or can_buy(player_id,weapon) == false:
@ -27,6 +27,7 @@ func buy(player_id: int, weapon: WeaponResource) -> void:
var player_data = Session.player_data[player_id]
player_data["money"] -= weapon.cost
if not LobbySettings.infinite_money:
player_data["money"] -= weapon.cost
weapon_system.add(weapon.weapon_system_scene.instantiate(),slot)

View file

@ -10,6 +10,7 @@ func _ready() -> void:
%RoundBox.set_value_no_signal(LobbySettings.win_score)
%AllowMultipleAbilityButton.set_pressed_no_signal(LobbySettings.allow_multiple_abilities)
%AllowTeamSwitch.set_pressed_no_signal(LobbySettings.allow_team_switch)
%InfiniteMoney.set_pressed_no_signal(LobbySettings.infinite_money)
var popup: PopupMenu = %MapsButton.get_popup()
%MapsButton.text = LobbySettings.selected_map
@ -53,3 +54,7 @@ func _on_allow_team_switch_toggled(toggled_on: bool) -> void:
func on_maps_index_pressed(index: int):
%MapsButton.text = levels_by_index[index]
LobbySettings.selected_map = levels_by_index[index]
func _on_infinite_money_toggled(toggled_on: bool) -> void:
LobbySettings.infinite_money = toggled_on

View file

@ -112,14 +112,24 @@ layout_mode = 2
folded = true
title = "Геймплей"
[node name="AllowMultipleAbilityButton" type="CheckButton" parent="Gameplay"]
unique_name_in_owner = true
[node name="VBoxContainer" type="VBoxContainer" parent="Gameplay"]
visible = false
layout_mode = 2
[node name="AllowMultipleAbilityButton" type="CheckButton" parent="Gameplay/VBoxContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(200, 0)
layout_mode = 2
text = "Неограниченная закупка абилок"
autowrap_mode = 2
[node name="InfiniteMoney" type="CheckButton" parent="Gameplay/VBoxContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(200, 0)
layout_mode = 2
text = "Бесконечные деньги"
autowrap_mode = 2
[node name="PortForward" type="FoldableContainer" parent="."]
layout_mode = 2
folded = true
@ -166,7 +176,8 @@ text = "Перемешать"
[connection signal="value_changed" from="Time/VBoxContainer/BuyTime/BuyTimeBox" to="." method="_on_buy_time_box_value_changed"]
[connection signal="value_changed" from="Round/VBoxContainer/RoundAmount/RoundBox" to="." method="_on_round_box_value_changed"]
[connection signal="value_changed" from="Round/VBoxContainer/TeamSwitchAmount/TeamSwitchBox" to="." method="_on_team_switch_box_value_changed"]
[connection signal="toggled" from="Gameplay/AllowMultipleAbilityButton" to="." method="_on_allow_multiple_ability_button_toggled"]
[connection signal="toggled" from="Gameplay/VBoxContainer/AllowMultipleAbilityButton" to="." method="_on_allow_multiple_ability_button_toggled"]
[connection signal="toggled" from="Gameplay/VBoxContainer/InfiniteMoney" to="." method="_on_infinite_money_toggled"]
[connection signal="update_ip" from="PortForward/PortForwardContainer/ForwardPortButton" to="PortForward/PortForwardContainer/PublicIP" method="on_update_ip"]
[connection signal="toggled" from="Teams/VBoxContainer/AllowTeamSwitch" to="." method="_on_allow_team_switch_toggled"]
[connection signal="pressed" from="Teams/VBoxContainer/Shuffle" to="." method="_on_shuffle_pressed"]