refactor: 드로그 BT 의사결정 투명화 — 모든 조건을 BT 노드로 표시
- BossCombatPatternRole enum 완전 제거, BossPatternData에 직접 필드 추가 - 14개 패턴별 Check*/Use*Action → CheckPatternReadyCondition + UsePatternByRoleAction으로 통합 - BT 계단식 Branch 체인 구조 도입 (BranchingConditionComposite + FloatingPort) - 패턴별 고유 전제 조건을 BT Condition으로 분리 - Punish: IsDownedTargetInRangeCondition (다운 대상 반경) - Mobility: IsTargetBeyondDistanceCondition (원거리 대상) - Utility: IsTargetBeyondDistanceCondition (원거리 대상) - Primary: IsTargetInAttackRangeCondition (사거리 이내) - Phase 진입 조건을 BT에서 확인 가능하도록 IsMinPhaseSatisfiedCondition 추가 - IsPatternReady()에서 minPhase 체크 분리 → 전용 Condition으로 노출 - Secondary 패턴 개념 제거 (secondaryPattern, 보조 차례, 교대 카운터 로직 전부 삭제) - CanResolvePatternTargetCondition 삭제 (7개 중 5개가 노이즈) - RebuildDrogBehaviorAuthoringGraph로 BT 에셋 자동 재구성 메뉴 제공
This commit is contained in:
@@ -210,6 +210,13 @@ public abstract partial class BossPatternActionBase : Action
|
||||
skillTarget = ResolveStepTarget(activeTarget);
|
||||
if (skillTarget == null)
|
||||
{
|
||||
if (activePattern != null && activePattern.SkipJumpStepOnNoTarget)
|
||||
{
|
||||
UsePatternAction.MarkPatternUsed(GameObject, activePattern);
|
||||
LogDebug($"점프 대상 없음, 조합 패턴 조기 종료: {activePattern.PatternName}");
|
||||
return Status.Success;
|
||||
}
|
||||
|
||||
LogDebug($"점프 타겟을 찾지 못해 실패: {activePattern.PatternName}");
|
||||
return Status.Failure;
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.Enemy;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
|
||||
/// <summary>
|
||||
/// 기동 패턴 준비 여부를 확인하는 체크 액션입니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[NodeDescription(
|
||||
name: "Check Mobility Pattern Ready",
|
||||
story: "기동 패턴 준비 여부 확인",
|
||||
category: "Action",
|
||||
id: "5b4f133ba50f46759c1c1d3347eb0b0d")]
|
||||
public partial class CheckMobilityPatternReadyAction : CheckPatternReadyActionBase
|
||||
{
|
||||
protected override BossCombatPatternRole PatternRole => BossCombatPatternRole.Mobility;
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 489f56d9043e6d24fbe8e5574b6729be
|
||||
@@ -1,40 +0,0 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.AI;
|
||||
using Colosseum.Enemy;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
|
||||
using Action = Unity.Behavior.Action;
|
||||
|
||||
/// <summary>
|
||||
/// 지정된 공통 패턴 역할의 준비 여부를 확인하는 체크 액션 기반 클래스입니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
public abstract partial class CheckPatternReadyActionBase : Action
|
||||
{
|
||||
/// <summary>
|
||||
/// 현재 액션이 검사할 패턴 역할입니다.
|
||||
/// </summary>
|
||||
protected abstract BossCombatPatternRole PatternRole { get; }
|
||||
|
||||
protected override Status OnStart()
|
||||
{
|
||||
BossCombatBehaviorContext context = GameObject.GetComponent<BossCombatBehaviorContext>();
|
||||
if (context == null)
|
||||
return Status.Failure;
|
||||
|
||||
if (context.IsBehaviorSuppressed)
|
||||
return Status.Failure;
|
||||
|
||||
BossPatternData pattern = context.GetPattern(PatternRole);
|
||||
if (pattern == null)
|
||||
return Status.Failure;
|
||||
|
||||
if (context.CurrentPatternPhase < pattern.MinPhase)
|
||||
return Status.Failure;
|
||||
|
||||
return UsePatternAction.IsPatternReady(GameObject, pattern) ? Status.Success : Status.Failure;
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 59a58b1d5cc33f943a1af10764ee11b5
|
||||
@@ -1,20 +0,0 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.Enemy;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
|
||||
/// <summary>
|
||||
/// 기본 패턴 준비 여부를 확인하는 체크 액션입니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[NodeDescription(
|
||||
name: "Check Primary Pattern Ready",
|
||||
story: "기본 패턴 준비 여부 확인",
|
||||
category: "Action",
|
||||
id: "88626617015e43ef97ea4dd05cce55e0")]
|
||||
public partial class CheckPrimaryPatternReadyAction : CheckPatternReadyActionBase
|
||||
{
|
||||
protected override BossCombatPatternRole PatternRole => BossCombatPatternRole.Primary;
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e3b45dc2b81beac44a35a3a6545c0488
|
||||
@@ -1,20 +0,0 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.Enemy;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
|
||||
/// <summary>
|
||||
/// 징벌 패턴 준비 여부를 확인하는 체크 액션입니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[NodeDescription(
|
||||
name: "Check Punish Pattern Ready",
|
||||
story: "징벌 패턴 준비 여부 확인",
|
||||
category: "Action",
|
||||
id: "e855b3f8bdce44efa85859358d67c7a7")]
|
||||
public partial class CheckPunishPatternReadyAction : CheckPatternReadyActionBase
|
||||
{
|
||||
protected override BossCombatPatternRole PatternRole => BossCombatPatternRole.Punish;
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2211d1182dbbf7741b0058718afae162
|
||||
@@ -1,20 +0,0 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.Enemy;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
|
||||
/// <summary>
|
||||
/// 보조 패턴 준비 여부를 확인하는 체크 액션입니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[NodeDescription(
|
||||
name: "Check Secondary Pattern Ready",
|
||||
story: "보조 패턴 준비 여부 확인",
|
||||
category: "Action",
|
||||
id: "72d4626f97fe4de4aedfda612961957f")]
|
||||
public partial class CheckSecondaryPatternReadyAction : CheckPatternReadyActionBase
|
||||
{
|
||||
protected override BossCombatPatternRole PatternRole => BossCombatPatternRole.Secondary;
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e155d7ca234bf8148bef34617a3a8739
|
||||
@@ -1,26 +0,0 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.Enemy;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
|
||||
using Action = Unity.Behavior.Action;
|
||||
|
||||
/// <summary>
|
||||
/// 현재 근접 패턴 차례가 보조 패턴인지 확인하는 공통 체크 액션입니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[NodeDescription(
|
||||
name: "Check Secondary Pattern Turn",
|
||||
story: "현재 근접 패턴 차례가 보조 패턴인지 확인",
|
||||
category: "Action",
|
||||
id: "e85477bd25894248aeeea8b41efc7f48")]
|
||||
public partial class CheckSecondaryPatternTurnAction : Action
|
||||
{
|
||||
protected override Status OnStart()
|
||||
{
|
||||
BossCombatBehaviorContext context = GameObject.GetComponent<BossCombatBehaviorContext>();
|
||||
return context != null && context.IsNextSecondaryPattern() ? Status.Success : Status.Failure;
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 435950077eea65d43beb6bfaba38dc60
|
||||
@@ -1,31 +0,0 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.Enemy;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
|
||||
using Action = Unity.Behavior.Action;
|
||||
|
||||
/// <summary>
|
||||
/// 시그니처 패턴 사용 가능 여부를 확인하는 체크 액션입니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[NodeDescription(
|
||||
name: "Check Signature Pattern Ready",
|
||||
story: "시그니처 패턴 준비 여부 확인",
|
||||
category: "Action",
|
||||
id: "b3b2916257134e0eb3a71a5f544a8d6f")]
|
||||
public partial class CheckSignaturePatternReadyAction : Action
|
||||
{
|
||||
protected override Status OnStart()
|
||||
{
|
||||
BossCombatBehaviorContext context = GameObject.GetComponent<BossCombatBehaviorContext>();
|
||||
if (context != null && context.IsBehaviorSuppressed)
|
||||
return Status.Failure;
|
||||
|
||||
return context != null && context.IsSignaturePatternReady()
|
||||
? Status.Success
|
||||
: Status.Failure;
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b27f3137292d5704d802b5cfb58037e4
|
||||
@@ -1,35 +0,0 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.Enemy;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
using UnityEngine;
|
||||
|
||||
using Action = Unity.Behavior.Action;
|
||||
|
||||
/// <summary>
|
||||
/// 현재 타겟이 보스의 공격 사거리 안에 있는지 확인하는 공통 체크 액션입니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[NodeDescription(
|
||||
name: "Check Target In Attack Range",
|
||||
story: "[Target]이 보스 공격 사거리 안에 있는지 확인",
|
||||
category: "Action",
|
||||
id: "16821bba281d49f699d1ac9ec613dcce")]
|
||||
public partial class CheckTargetInAttackRangeAction : Action
|
||||
{
|
||||
[SerializeReference]
|
||||
public BlackboardVariable<GameObject> Target;
|
||||
|
||||
protected override Status OnStart()
|
||||
{
|
||||
if (Target?.Value == null)
|
||||
return Status.Failure;
|
||||
|
||||
EnemyBase enemyBase = GameObject.GetComponent<EnemyBase>();
|
||||
float attackRange = enemyBase != null && enemyBase.Data != null ? enemyBase.Data.AttackRange : 2f;
|
||||
float distance = Vector3.Distance(GameObject.transform.position, Target.Value.transform.position);
|
||||
return distance <= attackRange + 0.25f ? Status.Success : Status.Failure;
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5b3844411f6dd784089c40c5d4325b45
|
||||
@@ -1,18 +0,0 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.Enemy;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
|
||||
using Action = Unity.Behavior.Action;
|
||||
|
||||
/// <summary>
|
||||
/// 공통 원거리 견제 패턴의 준비 여부를 확인합니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[NodeDescription(name: "Check Utility Pattern Ready", story: "원거리 견제 패턴 준비 완료", category: "Action", id: "e3a3f4bd4f214efc873109631e5195db")]
|
||||
public partial class CheckUtilityPatternReadyAction : CheckPatternReadyActionBase
|
||||
{
|
||||
protected override BossCombatPatternRole PatternRole => BossCombatPatternRole.Utility;
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 15de0eb23ee195a42a07c23c18f9fa9a
|
||||
@@ -1,20 +0,0 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.Enemy;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
|
||||
/// <summary>
|
||||
/// 기동 패턴을 실행하는 공통 액션입니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[NodeDescription(
|
||||
name: "Use Mobility Pattern",
|
||||
story: "기동 패턴 실행",
|
||||
category: "Action",
|
||||
id: "bb19ca5ae11a4d9586180f7cba9f76cc")]
|
||||
public partial class UseMobilityPatternAction : UsePatternRoleActionBase
|
||||
{
|
||||
protected override BossCombatPatternRole PatternRole => BossCombatPatternRole.Mobility;
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 137700b0db09e724899700f0da861132
|
||||
@@ -0,0 +1,153 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.AI;
|
||||
using Colosseum.Enemy;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 지정된 패턴을 실행하는 범용 액션 노드입니다.
|
||||
/// Pattern 필드에 BossPatternData 에셋을 직접 할당합니다.
|
||||
/// 타겟 해석과 등록은 Condition에서 처리되므로, 이 액션은 순수하게 패턴만 실행합니다.
|
||||
/// 시그니처 패턴은 내부적으로 TryStartSignaturePattern 경로를 사용합니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[NodeDescription(
|
||||
name: "Use Pattern By Role",
|
||||
story: "[Pattern] 패턴 실행",
|
||||
category: "Action",
|
||||
id: "b2c3d4e5-1111-2222-3333-555566667777")]
|
||||
public partial class UsePatternByRoleAction : BossPatternActionBase
|
||||
{
|
||||
[SerializeReference]
|
||||
[Tooltip("실행할 패턴")]
|
||||
public BlackboardVariable<BossPatternData> Pattern;
|
||||
|
||||
/// <summary>
|
||||
/// 시그니처 패턴 실행 상태 추적
|
||||
/// </summary>
|
||||
private bool signatureStarted;
|
||||
|
||||
protected override Status OnStart()
|
||||
{
|
||||
BossPatternData pattern = Pattern?.Value;
|
||||
if (pattern == null)
|
||||
return Status.Failure;
|
||||
|
||||
if (pattern.IsSignature)
|
||||
return StartSignaturePattern();
|
||||
|
||||
// 타겟 해석은 ResolveStepTarget에서 처리됨
|
||||
// 여기서는 RegisterPatternUse만 호출 (근접 패턴 전용)
|
||||
if (pattern.IsMelee)
|
||||
{
|
||||
BossCombatBehaviorContext context = GameObject.GetComponent<BossCombatBehaviorContext>();
|
||||
context?.RegisterPatternUse(pattern);
|
||||
}
|
||||
|
||||
// base.OnStart는 TryResolvePattern → ExecuteCurrentStep 호출
|
||||
return base.OnStart();
|
||||
}
|
||||
|
||||
protected override Status OnUpdate()
|
||||
{
|
||||
BossPatternData pattern = Pattern?.Value;
|
||||
if (pattern == null)
|
||||
return Status.Failure;
|
||||
|
||||
if (pattern.IsSignature)
|
||||
return UpdateSignaturePattern();
|
||||
|
||||
return base.OnUpdate();
|
||||
}
|
||||
|
||||
protected override void OnEnd()
|
||||
{
|
||||
if (signatureStarted)
|
||||
{
|
||||
signatureStarted = false;
|
||||
return;
|
||||
}
|
||||
|
||||
base.OnEnd();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 시그니처 패턴 시작
|
||||
/// </summary>
|
||||
private Status StartSignaturePattern()
|
||||
{
|
||||
BossCombatBehaviorContext context = GameObject.GetComponent<BossCombatBehaviorContext>();
|
||||
if (context == null)
|
||||
return Status.Failure;
|
||||
|
||||
GameObject target = Target != null ? Target.Value : null;
|
||||
signatureStarted = context.TryStartSignaturePattern(target);
|
||||
return signatureStarted ? Status.Running : Status.Failure;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 시그니처 패턴 업데이트
|
||||
/// </summary>
|
||||
private Status UpdateSignaturePattern()
|
||||
{
|
||||
if (!signatureStarted)
|
||||
return Status.Failure;
|
||||
|
||||
BossCombatBehaviorContext context = GameObject.GetComponent<BossCombatBehaviorContext>();
|
||||
if (context == null)
|
||||
return Status.Failure;
|
||||
|
||||
return context.IsSignaturePatternActive
|
||||
? Status.Running
|
||||
: Status.Success;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// BossPatternActionBase.TryResolvePattern 구현.
|
||||
/// Condition에서 이미 타겟을 해석했으므로, Target.Value를 그대로 사용합니다.
|
||||
/// </summary>
|
||||
protected override bool TryResolvePattern(out BossPatternData pattern, out GameObject target)
|
||||
{
|
||||
pattern = Pattern?.Value;
|
||||
target = Target != null ? Target.Value : null;
|
||||
|
||||
if (pattern == null)
|
||||
return false;
|
||||
|
||||
if (!UsePatternAction.IsPatternReady(GameObject, pattern))
|
||||
return false;
|
||||
|
||||
if (target == null)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override GameObject ResolveStepTarget(GameObject fallbackTarget)
|
||||
{
|
||||
BossPatternData pattern = Pattern?.Value;
|
||||
if (pattern == null)
|
||||
return base.ResolveStepTarget(fallbackTarget);
|
||||
|
||||
BossCombatBehaviorContext context = GameObject.GetComponent<BossCombatBehaviorContext>();
|
||||
if (context == null)
|
||||
return base.ResolveStepTarget(fallbackTarget);
|
||||
|
||||
TargetResolveMode targetMode = pattern.TargetMode;
|
||||
|
||||
if (targetMode == TargetResolveMode.Mobility)
|
||||
return context.IsValidMobilityTarget(fallbackTarget)
|
||||
? fallbackTarget
|
||||
: context.FindMobilityTarget();
|
||||
|
||||
if (targetMode == TargetResolveMode.Utility)
|
||||
return context.IsValidUtilityTarget(fallbackTarget)
|
||||
? fallbackTarget
|
||||
: context.FindUtilityTarget();
|
||||
|
||||
return base.ResolveStepTarget(fallbackTarget);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 330e28c06aa715a4999a2ac322ee7748
|
||||
@@ -1,67 +0,0 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.AI;
|
||||
using Colosseum.Enemy;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 지정된 공통 패턴 역할을 실행하는 액션 기반 클래스입니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
public abstract partial class UsePatternRoleActionBase : BossPatternActionBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 현재 액션이 실행할 공통 패턴 역할입니다.
|
||||
/// </summary>
|
||||
protected abstract BossCombatPatternRole PatternRole { get; }
|
||||
|
||||
protected override bool TryResolvePattern(out BossPatternData pattern, out GameObject target)
|
||||
{
|
||||
BossCombatBehaviorContext context = GameObject.GetComponent<BossCombatBehaviorContext>();
|
||||
pattern = context != null ? context.GetPattern(PatternRole) : null;
|
||||
target = Target != null ? Target.Value : null;
|
||||
|
||||
if (pattern == null || !UsePatternAction.IsPatternReady(GameObject, pattern))
|
||||
return false;
|
||||
|
||||
if (target == null && PatternRole.IsMeleeRole())
|
||||
target = ResolvePrimaryTarget();
|
||||
|
||||
if (target == null && PatternRole == BossCombatPatternRole.Mobility)
|
||||
target = context != null ? context.FindMobilityTarget() : null;
|
||||
|
||||
if (target == null && PatternRole == BossCombatPatternRole.Utility)
|
||||
target = context != null ? context.FindUtilityTarget() : null;
|
||||
|
||||
if (target == null)
|
||||
return false;
|
||||
|
||||
if (PatternRole.IsMeleeRole() && context != null)
|
||||
context.RegisterPatternUse(PatternRole);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override GameObject ResolveStepTarget(GameObject fallbackTarget)
|
||||
{
|
||||
BossCombatBehaviorContext context = GameObject.GetComponent<BossCombatBehaviorContext>();
|
||||
if (PatternRole == BossCombatPatternRole.Mobility && context != null)
|
||||
{
|
||||
return context.IsValidMobilityTarget(fallbackTarget)
|
||||
? fallbackTarget
|
||||
: context.FindMobilityTarget();
|
||||
}
|
||||
|
||||
if (PatternRole == BossCombatPatternRole.Utility && context != null)
|
||||
{
|
||||
return context.IsValidUtilityTarget(fallbackTarget)
|
||||
? fallbackTarget
|
||||
: context.FindUtilityTarget();
|
||||
}
|
||||
|
||||
return base.ResolveStepTarget(fallbackTarget);
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 33384929fd7ec3c4f9240ac748de185c
|
||||
@@ -1,20 +0,0 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.Enemy;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
|
||||
/// <summary>
|
||||
/// 기본 패턴을 실행하는 공통 액션입니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[NodeDescription(
|
||||
name: "Use Primary Pattern",
|
||||
story: "기본 패턴 실행",
|
||||
category: "Action",
|
||||
id: "45d71c690f6342bcbbd348b6df5b77f1")]
|
||||
public partial class UsePrimaryPatternAction : UsePatternRoleActionBase
|
||||
{
|
||||
protected override BossCombatPatternRole PatternRole => BossCombatPatternRole.Primary;
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2d8de0b13ad776845a14b35e16485f53
|
||||
@@ -1,20 +0,0 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.Enemy;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
|
||||
/// <summary>
|
||||
/// 징벌 패턴을 실행하는 공통 액션입니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[NodeDescription(
|
||||
name: "Use Punish Pattern",
|
||||
story: "징벌 패턴 실행",
|
||||
category: "Action",
|
||||
id: "55f3c204a22b42dca6ae96e555f11a70")]
|
||||
public partial class UsePunishPatternAction : UsePatternRoleActionBase
|
||||
{
|
||||
protected override BossCombatPatternRole PatternRole => BossCombatPatternRole.Punish;
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 16cef0dbbe7946d46b3021b0c1802669
|
||||
@@ -1,20 +0,0 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.Enemy;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
|
||||
/// <summary>
|
||||
/// 보조 패턴을 실행하는 공통 액션입니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[NodeDescription(
|
||||
name: "Use Secondary Pattern",
|
||||
story: "보조 패턴 실행",
|
||||
category: "Action",
|
||||
id: "5169d341ce0c4400ae7fa3b58dde5b7a")]
|
||||
public partial class UseSecondaryPatternAction : UsePatternRoleActionBase
|
||||
{
|
||||
protected override BossCombatPatternRole PatternRole => BossCombatPatternRole.Secondary;
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 79cd3375939c8a244bad9d8e1f02a45d
|
||||
@@ -1,54 +0,0 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.Enemy;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
using UnityEngine;
|
||||
|
||||
using Action = Unity.Behavior.Action;
|
||||
|
||||
/// <summary>
|
||||
/// 보스 공통 시그니처 패턴을 실행하는 액션입니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[NodeDescription(
|
||||
name: "Use Signature Pattern",
|
||||
story: "시그니처 패턴 실행",
|
||||
category: "Action",
|
||||
id: "178f8888d56042c6a75b4d6ee8a7a7d4")]
|
||||
public partial class UseSignaturePatternAction : Action
|
||||
{
|
||||
[SerializeReference]
|
||||
public BlackboardVariable<GameObject> Target;
|
||||
|
||||
private BossCombatBehaviorContext combatBehaviorContext;
|
||||
private bool started;
|
||||
|
||||
protected override Status OnStart()
|
||||
{
|
||||
combatBehaviorContext = GameObject.GetComponent<BossCombatBehaviorContext>();
|
||||
if (combatBehaviorContext == null)
|
||||
return Status.Failure;
|
||||
|
||||
GameObject target = Target != null ? Target.Value : null;
|
||||
started = combatBehaviorContext.TryStartSignaturePattern(target);
|
||||
return started ? Status.Running : Status.Failure;
|
||||
}
|
||||
|
||||
protected override Status OnUpdate()
|
||||
{
|
||||
if (!started || combatBehaviorContext == null)
|
||||
return Status.Failure;
|
||||
|
||||
return combatBehaviorContext.IsSignaturePatternActive
|
||||
? Status.Running
|
||||
: Status.Success;
|
||||
}
|
||||
|
||||
protected override void OnEnd()
|
||||
{
|
||||
started = false;
|
||||
combatBehaviorContext = null;
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0680aed4d244d7844918883e06e718d5
|
||||
@@ -1,16 +0,0 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.Enemy;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
|
||||
/// <summary>
|
||||
/// 공통 원거리 견제 패턴을 실행합니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[NodeDescription(name: "Use Utility Pattern", story: "원거리 견제 패턴 실행", category: "Action", id: "f29d4556f2d04f6bb80418f9f9fe2c68")]
|
||||
public partial class UseUtilityPatternAction : UsePatternRoleActionBase
|
||||
{
|
||||
protected override BossCombatPatternRole PatternRole => BossCombatPatternRole.Utility;
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 36c98678f964a7447bede88fedc04561
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.AI;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
using UnityEngine;
|
||||
|
||||
using Condition = Unity.Behavior.Condition;
|
||||
|
||||
namespace Colosseum.AI.BehaviorActions.Conditions
|
||||
{
|
||||
/// <summary>
|
||||
/// 지정된 패턴이 준비되었는지 확인하는 범용 조건 노드입니다.
|
||||
/// Pattern 필드에 BossPatternData 에셋을 직접 할당합니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[Condition(name: "Check Pattern Ready", story: "[Pattern] 패턴이 준비되었는가?", id: "a1b2c3d4-1111-2222-3333-444455556666")]
|
||||
[NodeDescription(
|
||||
name: "Check Pattern Ready",
|
||||
story: "Check [Pattern] pattern ready",
|
||||
category: "Condition/Pattern")]
|
||||
public partial class CheckPatternReadyCondition : Condition
|
||||
{
|
||||
[SerializeReference]
|
||||
[Tooltip("준비 여부를 확인할 패턴")]
|
||||
public BlackboardVariable<BossPatternData> Pattern;
|
||||
|
||||
public override bool IsTrue()
|
||||
{
|
||||
BossPatternData pattern = Pattern?.Value;
|
||||
if (pattern == null)
|
||||
return false;
|
||||
|
||||
return PatternReadyHelper.IsPatternReady(GameObject, pattern);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b1a4d12e73d0f4a40a3a1d5a9c1fce6e
|
||||
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.Combat;
|
||||
using Colosseum.Player;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
using UnityEngine;
|
||||
|
||||
using Condition = Unity.Behavior.Condition;
|
||||
|
||||
namespace Colosseum.AI.BehaviorActions.Conditions
|
||||
{
|
||||
/// <summary>
|
||||
/// 다운된 적대 대상이 지정 반경 이내에 존재하는지 확인합니다.
|
||||
/// 징벌(Punish) 패턴의 전제 조건으로 사용됩니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[Condition(name: "Downed Target In Range", story: "다운된 대상이 [{SearchRadius}]m 이내에 있는가?", id: "d4e5f6a7-3333-4444-555566667777")]
|
||||
[NodeDescription(
|
||||
name: "Downed Target In Range",
|
||||
story: "Downed target within [{SearchRadius}]m",
|
||||
category: "Condition/Pattern")]
|
||||
public partial class IsDownedTargetInRangeCondition : Condition
|
||||
{
|
||||
[Min(0f)]
|
||||
[Tooltip("다운된 대상을 탐색할 최대 반경")]
|
||||
[SerializeField]
|
||||
private float searchRadius = 6f;
|
||||
|
||||
public override bool IsTrue()
|
||||
{
|
||||
HitReactionController[] controllers = UnityEngine.Object.FindObjectsByType<HitReactionController>(FindObjectsSortMode.None);
|
||||
|
||||
for (int i = 0; i < controllers.Length; i++)
|
||||
{
|
||||
HitReactionController controller = controllers[i];
|
||||
if (controller == null || !controller.IsDowned)
|
||||
continue;
|
||||
|
||||
GameObject candidate = controller.gameObject;
|
||||
if (candidate == null || !candidate.activeInHierarchy)
|
||||
continue;
|
||||
|
||||
if (candidate == GameObject)
|
||||
continue;
|
||||
|
||||
if (Team.IsSameTeam(GameObject, candidate))
|
||||
continue;
|
||||
|
||||
IDamageable damageable = candidate.GetComponent<IDamageable>();
|
||||
if (damageable != null && damageable.IsDead)
|
||||
continue;
|
||||
|
||||
float distance = Vector3.Distance(GameObject.transform.position, candidate.transform.position);
|
||||
if (distance <= searchRadius)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bc4fae13a78a0fb46863950d1c6b5b8d
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.Enemy;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
using UnityEngine;
|
||||
|
||||
using Condition = Unity.Behavior.Condition;
|
||||
|
||||
namespace Colosseum.AI.BehaviorActions.Conditions
|
||||
{
|
||||
/// <summary>
|
||||
/// 현재 보스 페이즈가 지정된 최소 페이즈 이상인지 확인하는 조건 노드입니다.
|
||||
/// 패턴의 Phase 진입 조건을 BT에서 시각적으로 확인할 수 있습니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[Condition(name: "Min Phase Satisfied", story: "현재 페이즈가 [MinPhase] 이상인가?", id: "e3f4a5b6-7777-8888-9999-ddddddddeeee")]
|
||||
[NodeDescription(
|
||||
name: "Min Phase Satisfied",
|
||||
story: "현재 페이즈가 [MinPhase] 이상인가?",
|
||||
category: "Condition/Phase")]
|
||||
public partial class IsMinPhaseSatisfiedCondition : Condition
|
||||
{
|
||||
[SerializeReference]
|
||||
[Tooltip("최소 요구 페이즈 (1=Phase 1부터)")]
|
||||
public BlackboardVariable<int> MinPhase;
|
||||
|
||||
public override bool IsTrue()
|
||||
{
|
||||
int minPhase = MinPhase?.Value ?? 1;
|
||||
if (minPhase <= 1)
|
||||
return true;
|
||||
|
||||
BossCombatBehaviorContext context = GameObject.GetComponent<BossCombatBehaviorContext>();
|
||||
return context != null && context.CurrentPatternPhase >= minPhase;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 46c95824ad6561f44833252a6f25852a
|
||||
@@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
using Colosseum.Combat;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
using UnityEngine;
|
||||
|
||||
using Condition = Unity.Behavior.Condition;
|
||||
|
||||
namespace Colosseum.AI.BehaviorActions.Conditions
|
||||
{
|
||||
/// <summary>
|
||||
/// 지정 거리 이상 떨어진 적대 대상이 존재하는지 확인합니다.
|
||||
/// 기동(도약) 또는 유틸리티(투척) 패턴의 전제 조건으로 사용됩니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[Condition(name: "Target Beyond Distance", story: "[{MinDistance}]m 이상 떨어진 대상이 있는가?", id: "e5f6a7b8-4444-5555-666677778888")]
|
||||
[NodeDescription(
|
||||
name: "Target Beyond Distance",
|
||||
story: "Target beyond [{MinDistance}]m exists",
|
||||
category: "Condition/Pattern")]
|
||||
public partial class IsTargetBeyondDistanceCondition : Condition
|
||||
{
|
||||
[Min(0f)]
|
||||
[Tooltip("이 거리 이상 떨어진 대상이 있는지 확인")]
|
||||
[SerializeField]
|
||||
private float minDistance = 8f;
|
||||
|
||||
public override bool IsTrue()
|
||||
{
|
||||
IDamageable[] targets = UnityEngine.Object.FindObjectsByType<MonoBehaviour>(FindObjectsSortMode.None)
|
||||
.OfType<IDamageable>()
|
||||
.ToArray();
|
||||
|
||||
for (int i = 0; i < targets.Length; i++)
|
||||
{
|
||||
IDamageable target = targets[i];
|
||||
if (target == null)
|
||||
continue;
|
||||
|
||||
Component component = target as Component;
|
||||
if (component == null || !component.gameObject.activeInHierarchy)
|
||||
continue;
|
||||
|
||||
GameObject candidate = component.gameObject;
|
||||
if (candidate == GameObject)
|
||||
continue;
|
||||
|
||||
if (Team.IsSameTeam(GameObject, candidate))
|
||||
continue;
|
||||
|
||||
if (target.IsDead)
|
||||
continue;
|
||||
|
||||
float distance = Vector3.Distance(GameObject.transform.position, candidate.transform.position);
|
||||
if (distance >= minDistance)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2e40fb41bbe354f4dafbe5b94fc6f9da
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
using Colosseum.Enemy;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
using UnityEngine;
|
||||
|
||||
using Condition = Unity.Behavior.Condition;
|
||||
|
||||
namespace Colosseum.AI.BehaviorActions.Conditions
|
||||
{
|
||||
/// <summary>
|
||||
/// 현재 타겟이 보스의 공격 사거리 안에 있는지 확인하는 조건 노드입니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[Condition(name: "Is Target In Attack Range", story: "타겟이 공격 사거리 안에 있는가?", id: "57370b5b23f82a54dabc4f189a23286a")]
|
||||
[NodeDescription(
|
||||
name: "Is Target In Attack Range",
|
||||
story: "Is [Target] in attack range",
|
||||
category: "Condition/Combat")]
|
||||
public partial class IsTargetInAttackRangeCondition : Condition
|
||||
{
|
||||
[SerializeReference]
|
||||
public BlackboardVariable<GameObject> Target;
|
||||
|
||||
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 distance = Vector3.Distance(GameObject.transform.position, Target.Value.transform.position);
|
||||
return distance <= attackRange + 0.25f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 57370b5b23f82a54dabc4f189a23286a
|
||||
@@ -0,0 +1,53 @@
|
||||
using UnityEngine;
|
||||
|
||||
using Colosseum.AI;
|
||||
using Colosseum.Enemy;
|
||||
|
||||
namespace Colosseum.AI.BehaviorActions.Conditions
|
||||
{
|
||||
/// <summary>
|
||||
/// 패턴 준비 여부를 확인하는 공통 헬퍼 메서드를 제공합니다.
|
||||
/// </summary>
|
||||
public static class PatternReadyHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// 지정된 패턴이 현재 실행 가능한지 확인합니다.
|
||||
/// 패턴의 특성 필드를 사용하여 grace period 등을 판단합니다.
|
||||
/// </summary>
|
||||
public static bool IsPatternReady(GameObject gameObject, BossPatternData pattern)
|
||||
{
|
||||
if (pattern == null)
|
||||
return false;
|
||||
|
||||
if (pattern.IsSignature)
|
||||
return IsSignatureReady(gameObject);
|
||||
|
||||
BossCombatBehaviorContext context = gameObject.GetComponent<BossCombatBehaviorContext>();
|
||||
if (context == null)
|
||||
return false;
|
||||
|
||||
if (context.IsBehaviorSuppressed)
|
||||
return false;
|
||||
|
||||
if (context.CurrentPatternPhase < pattern.MinPhase)
|
||||
return false;
|
||||
|
||||
if (!context.IsPatternGracePeriodAllowed(pattern))
|
||||
return false;
|
||||
|
||||
return UsePatternAction.IsPatternReady(gameObject, pattern);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 시그니처 패턴 전용 준비 여부 확인.
|
||||
/// </summary>
|
||||
private static bool IsSignatureReady(GameObject gameObject)
|
||||
{
|
||||
BossCombatBehaviorContext context = gameObject.GetComponent<BossCombatBehaviorContext>();
|
||||
if (context == null)
|
||||
return false;
|
||||
|
||||
return context.IsSignaturePatternReady();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7a0f2fd53cb729c4f97223570292e25c
|
||||
Reference in New Issue
Block a user