Buy menu
This commit is contained in:
parent
b59cb48b77
commit
4e8971b12d
12 changed files with 134 additions and 15 deletions
|
|
@ -2,13 +2,19 @@ extends Area3D
|
|||
|
||||
@export var weapon_spawner: MultiplayerSpawner
|
||||
@export var weapon_system: WeaponSystem
|
||||
var disabled: bool
|
||||
|
||||
func _ready() -> void:
|
||||
if is_multiplayer_authority() == false: return
|
||||
|
||||
body_entered.connect(on_body_entered)
|
||||
|
||||
func disable() -> void:
|
||||
disabled = true
|
||||
|
||||
func on_body_entered(body: Node3D):
|
||||
if disabled:
|
||||
return
|
||||
if body is DroppableWeapon:
|
||||
if weapon_system.can_add(body.slot) == false or (body.team != Session.TEAMS.UNASSIGNED and get_parent().team != body.team):
|
||||
return
|
||||
|
|
@ -22,12 +28,16 @@ func on_body_entered(body: Node3D):
|
|||
Session.despawn(body.get_path())
|
||||
|
||||
func start_temp_ignore():
|
||||
if disabled:
|
||||
return
|
||||
if is_multiplayer_authority() == false:
|
||||
return
|
||||
monitoring = false
|
||||
get_tree().create_timer(0.5).timeout.connect(stop_temp_ignore)
|
||||
|
||||
func stop_temp_ignore():
|
||||
if disabled:
|
||||
return
|
||||
if is_multiplayer_authority() == false:
|
||||
return
|
||||
monitoring = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue