extends Node3D

@export var _projectile_scene: PackedScene
@export var _projectile_holder: Node
@export var _production_timer: Timer


func _ready() -> void:
	set_multiplayer_authority(1)


func _drop_water() -> void:
	var new_projectile: Node3D = _projectile_scene.instantiate()
	_projectile_holder.add_child(new_projectile, true)
	new_projectile.set_multiplayer_authority(1)
	new_projectile.body.process_mode = Node.PROCESS_MODE_INHERIT
	new_projectile.set_global_pos.rpc(global_position)


func _on_drop_timer_timeout() -> void:
	if not is_multiplayer_authority():
		return
	_drop_water()
