class_name EnemyNodes
extends Node2D

@onready var player_detection_zone : PlayerDetectionZone = $PlayerDetectionZone
@onready var navigation_agent : NavigationAgent2D = $NavigationAgent2D
@onready var timer = $Timer
@onready var alert_sprite = $AlertSprite
@onready var alerted_sprite = $AlertedSprite
@onready var enemy_health: Control = $EnemyHealth
@onready var notice_progress_bar: TextureProgressBar = $NoticeProgressBar
@onready var stuck_checker_area_2d: Area2D = $StuckChecker/StuckCheckerArea2D

signal player_detected(body : Node2D)
signal player_lost(body : Node2D)
signal timeout
signal target_reached

func _on_player_detection_zone_player_detected(body: Node2D) -> void:
	player_detected.emit(body)

func _on_player_detection_zone_player_lost(body: Node2D) -> void:
	player_lost.emit(body)

func _on_timer_timeout() -> void:
	timeout.emit()

func _on_navigation_agent_2d_target_reached() -> void:
	target_reached.emit()

func set_notice_maximum(max_val : float):
	notice_progress_bar.max_value = max_val
	notice_progress_bar.value = max_val

func set_notice_value(val : float):
	notice_progress_bar.value = val
