class_name FuseBox
extends StaticBody3D

var done: bool = false

func _ready() -> void:
	if multiplayer.is_server():
		Multiplayer.add_fusebox.rpc()

func _on_fixing_started(body: Node3D) -> void:
	if multiplayer.is_server() and !done and body is Player:
		var player: Player = body
		if !player.hunter:
			complete_fusebox()

func complete_fusebox() -> void:
	($Hinge as Node3D).rotation.y = 0
	done = true
	Multiplayer.remove_fusebox.rpc()
