- 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 에셋 자동 재구성 메뉴 제공
64 lines
2.1 KiB
C#
64 lines
2.1 KiB
C#
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;
|
|
}
|
|
}
|
|
}
|