class_name Player extends Node var id: int: set(value): id = value name = str(value) var current_team_name: String: set(value): current_team_name = value multiplayer_synchronizer_2.set_property("current_team_name", value) var current_move_points := 100: set(value): current_move_points = value multiplayer_synchronizer_2.set_property("current_move_points", value) var current_attack_points := 10: set(value): current_attack_points = value multiplayer_synchronizer_2.set_property("current_attack_points", value) var current_defend_points := 10: set(value): current_defend_points = value multiplayer_synchronizer_2.set_property("current_defend_points", value) var current_ability_points := 10: set(value): current_ability_points = value multiplayer_synchronizer_2.set_property("current_ability_points", value) var units: Array[Unit] @onready var multiplayer_synchronizer_2: MultiplayerSynchronizer2 = $MultiplayerSynchronizer2 func get_color() -> Color: var rng = RandomNumberGenerator.new() rng.seed = id return Color(rng.randf(), rng.randf(), rng.randf()) # current_team_name #func set_current_team_name(value: String) -> void: #sync_current_team_name.rpc(value) # #@rpc("any_peer", "call_local") #func sync_current_team_name(value: String) -> void: #current_team_name = value # # ## current_move_points #func set_current_move_points(value: int) -> void: #sync_current_move_points.rpc(value) # #@rpc("any_peer", "call_local") #func sync_current_move_points(value: int) -> void: #current_move_points = value # # ## current_attack_points #func set_current_attack_points(value: int) -> void: #sync_current_attack_points.rpc(value) # #@rpc("any_peer", "call_local") #func sync_current_attack_points(value: int) -> void: #current_attack_points = value # # ## current_defend_points #func set_current_defend_points(value: int) -> void: #sync_current_defend_points.rpc(value) # #@rpc("any_peer", "call_local") #func sync_current_defend_points(value: int) -> void: #current_defend_points = value # # ## current_ability_points #func set_current_ability_points(value: int) -> void: #sync_current_ability_points.rpc(value) # #@rpc("any_peer", "call_local") #func sync_current_ability_points(value: int) -> void: #current_ability_points = value # # #func set_initial_values() -> void: #if not multiplayer.is_server(): #sync_initial_values.rpc_id(1, multiplayer.get_unique_id()) # #@rpc("any_peer", "call_remote") #func sync_initial_values(target_id: int) -> void: #sync_current_team_name.rpc_id(target_id, current_team_name) #sync_current_move_points.rpc_id(target_id, current_move_points) #sync_current_attack_points.rpc_id(target_id, current_attack_points)