feat: 드로그 보스 AI 및 런타임 상태 구조 재구성
- 드로그 전투 컨텍스트를 BossBehaviorRuntimeState 중심 구조로 정리하고 BossEnemy, 패턴 액션, 조건 노드가 마지막 실행 결과와 phase 상태를 직접 사용하도록 갱신 - BT_Drog와 재빌드 에디터 스크립트를 확장해 phase 전환, 집행 결과 분기, 거리/쿨타임 기반 패턴 선택을 드로그 전용 자산과 노드 파라미터로 재구성 - 드로그 패턴/스킬/이펙트/애니메이션 플레이스홀더 자산을 재생성하고 보스 프리팹이 새 런타임 상태 및 등록 클립 구성을 참조하도록 정리
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.Enemy;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Colosseum.AI.BehaviorActions.Conditions
|
||||
{
|
||||
/// <summary>
|
||||
/// 마지막 대형 패턴 이후 누적된 기본 루프 횟수가 기준 이상인지 확인합니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[Condition(name: "Is Basic Loop Count At Least", story: "기본 루프 누적 횟수가 [Count]회 이상인가?", id: "5c54d42c-780b-4334-bf58-1f7d4c79f4ea")]
|
||||
[NodeDescription(
|
||||
name: "Is Basic Loop Count At Least",
|
||||
story: "기본 루프 누적 횟수가 [Count]회 이상인가?",
|
||||
category: "Condition/Pattern")]
|
||||
public partial class IsBasicLoopCountAtLeastCondition : Unity.Behavior.Condition
|
||||
{
|
||||
[SerializeReference]
|
||||
[Tooltip("필요한 최소 기본 루프 횟수")]
|
||||
public BlackboardVariable<int> Count = new BlackboardVariable<int>(0);
|
||||
|
||||
public override bool IsTrue()
|
||||
{
|
||||
BossBehaviorRuntimeState runtimeState = GameObject.GetComponent<BossBehaviorRuntimeState>();
|
||||
return runtimeState != null && runtimeState.BasicLoopCountSinceLastBigPattern >= Mathf.Max(0, Count?.Value ?? 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a6aa918a0d90f67399b6cfb594edc31b
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.Enemy;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Colosseum.AI.BehaviorActions.Conditions
|
||||
{
|
||||
/// <summary>
|
||||
/// 보스가 보유한 커스텀 조건 플래그가 활성화되었는지 확인합니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[Condition(name: "Is Boss Custom Condition True", story: "커스텀 조건 [ConditionId] 가 참인가?", id: "0c4a5f77-a599-40a7-80fb-d22c4bb27f19")]
|
||||
[NodeDescription(
|
||||
name: "Is Boss Custom Condition True",
|
||||
story: "커스텀 조건 [ConditionId] 가 참인가?",
|
||||
category: "Condition/Phase")]
|
||||
public partial class IsBossCustomConditionTrueCondition : Unity.Behavior.Condition
|
||||
{
|
||||
[SerializeReference]
|
||||
[Tooltip("확인할 커스텀 조건 ID")]
|
||||
public BlackboardVariable<string> ConditionId = new BlackboardVariable<string>(string.Empty);
|
||||
|
||||
public override bool IsTrue()
|
||||
{
|
||||
BossBehaviorRuntimeState context = GameObject.GetComponent<BossBehaviorRuntimeState>();
|
||||
return context != null && !string.IsNullOrEmpty(ConditionId?.Value) && context.CheckPhaseCustomCondition(ConditionId.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 125ba0ac5df532b00b25e8bfc3f556e3
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.Enemy;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
using UnityEngine;
|
||||
|
||||
using Condition = Unity.Behavior.Condition;
|
||||
|
||||
namespace Colosseum.AI.BehaviorActions.Conditions
|
||||
{
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[Condition(name: "Is Charge Broken", story: "충전이 차단되었는가?", id: "e5f6a7b8-1111-2222-3333-aaaaaaaa0001")]
|
||||
[NodeDescription(
|
||||
name: "Is Charge Broken",
|
||||
story: "Charge was broken by accumulated damage",
|
||||
category: "Condition/Pattern")]
|
||||
public partial class IsChargeBrokenCondition : Condition
|
||||
{
|
||||
public override bool IsTrue()
|
||||
{
|
||||
BossBehaviorRuntimeState context = GameObject.GetComponent<BossBehaviorRuntimeState>();
|
||||
return context != null && context.WasChargeBroken;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fe107cb64ea2a7c07adc2fc4db48a4d1
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.Enemy;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Colosseum.AI.BehaviorActions.Conditions
|
||||
{
|
||||
/// <summary>
|
||||
/// 현재 보스 페이즈가 지정한 값과 같은지 확인합니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[Condition(name: "Is Current Phase", story: "현재 페이즈가 [Phase] 인가?", id: "6dc82e39-6f84-43df-b8ce-5b7c0ac8e390")]
|
||||
[NodeDescription(
|
||||
name: "Is Current Phase",
|
||||
story: "현재 페이즈가 [Phase] 인가?",
|
||||
category: "Condition/Phase")]
|
||||
public partial class IsCurrentPhaseCondition : Unity.Behavior.Condition
|
||||
{
|
||||
[SerializeReference]
|
||||
[Tooltip("확인할 현재 페이즈 값 (1부터 시작)")]
|
||||
public BlackboardVariable<int> Phase = new BlackboardVariable<int>(1);
|
||||
|
||||
public override bool IsTrue()
|
||||
{
|
||||
BossBehaviorRuntimeState context = GameObject.GetComponent<BossBehaviorRuntimeState>();
|
||||
return context != null && context.CurrentPatternPhase == Mathf.Max(1, Phase?.Value ?? 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c664951a5687590b593a30936378b8d2
|
||||
@@ -23,13 +23,13 @@ namespace Colosseum.AI.BehaviorActions.Conditions
|
||||
category: "Condition/Pattern")]
|
||||
public partial class IsDownedTargetInRangeCondition : Condition
|
||||
{
|
||||
[Min(0f)]
|
||||
[SerializeReference]
|
||||
[Tooltip("다운된 대상을 탐색할 최대 반경")]
|
||||
[SerializeField]
|
||||
private float searchRadius = 6f;
|
||||
public BlackboardVariable<float> SearchRadius = new BlackboardVariable<float>(6f);
|
||||
|
||||
public override bool IsTrue()
|
||||
{
|
||||
float searchRadius = Mathf.Max(0f, SearchRadius.Value);
|
||||
HitReactionController[] controllers = UnityEngine.Object.FindObjectsByType<HitReactionController>(FindObjectsSortMode.None);
|
||||
|
||||
for (int i = 0; i < controllers.Length; i++)
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Colosseum.AI.BehaviorActions.Conditions
|
||||
if (minPhase <= 1)
|
||||
return true;
|
||||
|
||||
BossCombatBehaviorContext context = GameObject.GetComponent<BossCombatBehaviorContext>();
|
||||
BossBehaviorRuntimeState context = GameObject.GetComponent<BossBehaviorRuntimeState>();
|
||||
return context != null && context.CurrentPatternPhase >= minPhase;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.Enemy;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Colosseum.AI.BehaviorActions.Conditions
|
||||
{
|
||||
/// <summary>
|
||||
/// 마지막 패턴 실행 결과가 지정한 값과 일치하는지 확인합니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[Condition(name: "Is Pattern Execution Result", story: "마지막 패턴 결과가 [Result] 인가?", id: "4ffbf07b-3fa4-42cc-9a61-75fd07b05db6")]
|
||||
[NodeDescription(
|
||||
name: "Is Pattern Execution Result",
|
||||
story: "마지막 패턴 결과가 [Result] 인가?",
|
||||
category: "Condition/Pattern")]
|
||||
public partial class IsPatternExecutionResultCondition : Unity.Behavior.Condition
|
||||
{
|
||||
[SerializeReference]
|
||||
public BlackboardVariable<BossPatternExecutionResult> Result = new BlackboardVariable<BossPatternExecutionResult>(BossPatternExecutionResult.Succeeded);
|
||||
|
||||
public override bool IsTrue()
|
||||
{
|
||||
BossBehaviorRuntimeState runtimeState = GameObject.GetComponent<BossBehaviorRuntimeState>();
|
||||
return runtimeState != null && runtimeState.LastPatternExecutionResult == (Result?.Value ?? BossPatternExecutionResult.None);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 47a54f9591003b10db94afd51bf8cb54
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.Enemy;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Colosseum.AI.BehaviorActions.Conditions
|
||||
{
|
||||
/// <summary>
|
||||
/// 현재 페이즈의 경과 시간이 기준 이상인지 확인합니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[Condition(name: "Is Phase Elapsed Time Above", story: "페이즈 경과 시간이 [Seconds]초 이상인가?", id: "f0e0f5b3-3cb7-4991-ae8a-e89efcc0dbca")]
|
||||
[NodeDescription(
|
||||
name: "Is Phase Elapsed Time Above",
|
||||
story: "페이즈 경과 시간이 [Seconds]초 이상인가?",
|
||||
category: "Condition/Phase")]
|
||||
public partial class IsPhaseElapsedTimeAboveCondition : Unity.Behavior.Condition
|
||||
{
|
||||
[SerializeReference]
|
||||
[Tooltip("확인할 최소 경과 시간(초)")]
|
||||
public BlackboardVariable<float> Seconds = new BlackboardVariable<float>(0f);
|
||||
|
||||
public override bool IsTrue()
|
||||
{
|
||||
BossBehaviorRuntimeState context = GameObject.GetComponent<BossBehaviorRuntimeState>();
|
||||
return context != null && context.PhaseElapsedTime >= Mathf.Max(0f, Seconds?.Value ?? 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dceca864920c7cd5f8fdcf971355f380
|
||||
@@ -23,13 +23,13 @@ namespace Colosseum.AI.BehaviorActions.Conditions
|
||||
category: "Condition/Pattern")]
|
||||
public partial class IsTargetBeyondDistanceCondition : Condition
|
||||
{
|
||||
[Min(0f)]
|
||||
[SerializeReference]
|
||||
[Tooltip("이 거리 이상 떨어진 대상이 있는지 확인")]
|
||||
[SerializeField]
|
||||
private float minDistance = 8f;
|
||||
public BlackboardVariable<float> MinDistance = new BlackboardVariable<float>(8f);
|
||||
|
||||
public override bool IsTrue()
|
||||
{
|
||||
float minDistance = Mathf.Max(0f, MinDistance.Value);
|
||||
IDamageable[] targets = UnityEngine.Object.FindObjectsByType<MonoBehaviour>(FindObjectsSortMode.None)
|
||||
.OfType<IDamageable>()
|
||||
.ToArray();
|
||||
|
||||
@@ -17,20 +17,22 @@ namespace Colosseum.AI.BehaviorActions.Conditions
|
||||
[Condition(name: "Is Target In Attack Range", story: "타겟이 공격 사거리 안에 있는가?", id: "57370b5b23f82a54dabc4f189a23286a")]
|
||||
[NodeDescription(
|
||||
name: "Is Target In Attack Range",
|
||||
story: "Is [Target] in attack range",
|
||||
story: "Is [Target] in [AttackRange]m attack range",
|
||||
category: "Condition/Combat")]
|
||||
public partial class IsTargetInAttackRangeCondition : Condition
|
||||
{
|
||||
[SerializeReference]
|
||||
public BlackboardVariable<GameObject> Target;
|
||||
|
||||
[SerializeReference]
|
||||
public BlackboardVariable<float> AttackRange = new BlackboardVariable<float>(2f);
|
||||
|
||||
public override bool IsTrue()
|
||||
{
|
||||
if (Target?.Value == null)
|
||||
return false;
|
||||
|
||||
EnemyBase enemyBase = GameObject.GetComponent<EnemyBase>();
|
||||
float attackRange = enemyBase != null && enemyBase.Data != null ? enemyBase.Data.AttackRange : 2f;
|
||||
float attackRange = Mathf.Max(0f, AttackRange.Value);
|
||||
float distance = Vector3.Distance(GameObject.transform.position, Target.Value.transform.position);
|
||||
return distance <= attackRange + 0.25f;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Colosseum.AI.BehaviorActions.Conditions
|
||||
if (pattern == null)
|
||||
return false;
|
||||
|
||||
BossCombatBehaviorContext context = gameObject.GetComponent<BossCombatBehaviorContext>();
|
||||
BossBehaviorRuntimeState context = gameObject.GetComponent<BossBehaviorRuntimeState>();
|
||||
if (context == null)
|
||||
return false;
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Colosseum.AI.BehaviorActions.Conditions
|
||||
if (!context.IsPatternGracePeriodAllowed(pattern))
|
||||
return false;
|
||||
|
||||
return UsePatternAction.IsPatternReady(gameObject, pattern);
|
||||
return context.IsPatternReady(pattern);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user