using System;
using Colosseum.Enemy;
using Unity.Behavior;
using Unity.Properties;
using UnityEngine;
using Action = Unity.Behavior.Action;
///
/// BT가 보스의 현재 페이즈 값을 직접 설정합니다.
///
[Serializable, GeneratePropertyBag]
[NodeDescription(
name: "Set Boss Phase",
story: "[TargetPhase] 페이즈로 설정",
category: "Action",
id: "931c24f8-761f-4d07-a7a0-23c7a7678d6b")]
public partial class SetBossPhaseAction : Action
{
[SerializeReference]
[Tooltip("설정할 목표 페이즈 (1부터 시작)")]
public BlackboardVariable TargetPhase = new BlackboardVariable(1);
[SerializeReference]
[Tooltip("true면 페이즈 경과 시간도 함께 초기화합니다.")]
public BlackboardVariable ResetTimer = new BlackboardVariable(true);
protected override Status OnStart()
{
BossBehaviorRuntimeState context = GameObject.GetComponent();
if (context == null)
return Status.Failure;
context.SetCurrentPatternPhase(TargetPhase?.Value ?? 1, ResetTimer?.Value ?? true);
context.LogDebug(nameof(SetBossPhaseAction), $"현재 페이즈 설정: {context.CurrentPatternPhase}");
return Status.Success;
}
}