FIx merge confict
This commit is contained in:
parent
5ee6a7c4a8
commit
004e47aba6
3 changed files with 19 additions and 2 deletions
|
|
@ -22,6 +22,7 @@ Lobby="*res://scripts/multiplayer/lobby.gd"
|
|||
Session="*res://scripts/multiplayer/session.gd"
|
||||
ClientSettings="*res://scripts/client_settings.gd"
|
||||
Registry="*res://scripts/registry.gd"
|
||||
ClientSettingsMenu="res://scenes/gui/client_settings.tscn"
|
||||
|
||||
[display]
|
||||
|
||||
|
|
|
|||
|
|
@ -16,8 +16,11 @@ var defence_team: Array[int] = []
|
|||
var specators_team: Array[int] = []
|
||||
|
||||
# Host defined variables
|
||||
var win_score = 13
|
||||
var half_rounds = 12
|
||||
var win_score: int = 13
|
||||
var half_rounds :int = 12
|
||||
var bomb_time: float = 45.0
|
||||
var buy_time: float = 15.0
|
||||
var round_time: float = 150.0
|
||||
|
||||
func _ready() -> void:
|
||||
multiplayer.peer_disconnected.connect(player_left)
|
||||
|
|
|
|||
|
|
@ -131,8 +131,12 @@ func start_session() -> void:
|
|||
current_round = 0
|
||||
attacker_score = 0
|
||||
defender_score = 0
|
||||
|
||||
session_started_flag = true
|
||||
session_started.emit()
|
||||
bomb_timer.wait_time = Lobby.bomb_time
|
||||
round_timer.wait_time = Lobby.round_time
|
||||
buy_timer.wait_time = Lobby.buy_time
|
||||
|
||||
start_round()
|
||||
|
||||
|
|
@ -180,6 +184,10 @@ func end_round(win_team: int) -> void:
|
|||
end_round.rpc(win_team)
|
||||
if current_round == Lobby.half_rounds:
|
||||
Lobby.swap_teams()
|
||||
var temp_rounds = attacker_score
|
||||
attacker_score = defender_score
|
||||
defender_score = temp_rounds
|
||||
sync_score.rpc(attacker_score,defender_score)
|
||||
|
||||
if win_team == TEAMS.DEFENCE:
|
||||
defender_score += 1
|
||||
|
|
@ -326,3 +334,8 @@ func kill_site(site: StringName) -> void:
|
|||
for body in plant_deadzones[site].get_overlapping_bodies():
|
||||
if body is Player:
|
||||
body.die()
|
||||
|
||||
@rpc("authority","call_remote","unreliable")
|
||||
func sync_score(attack: int, defence: int):
|
||||
attacker_score = attack
|
||||
defender_score = defence
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue