class_name PawnBody extends Node3D

@export var projectile_template : PackedScene

@onready var anim_player : AnimationPlayer = %AnimationPlayer
@onready var ranged_point : Node3D = %RangedPoint
@onready var material : StandardMaterial3D = $Mesh.material
@onready var struggle_ui : Sprite3D = %StruggleUI
@onready var struggle_bar : ProgressBar = %StruggleBar

@rpc("call_local")
func play_animation(anim_name : String) -> void:
	anim_player.play(anim_name)

@rpc("call_local")
func show_struggle() -> void:
	struggle_ui.visible = true
	
func _on_struggle_changed(value : float) -> void:
	if value <= 0:
		struggle_ui.visible = false
	else:
		struggle_bar.value = value
