- 보스 공통 전투 컨텍스트와 패턴 역할 기반 BT 액션을 추가 - 드로그 패턴 선택을 다운 추가타, 도약, 기본 및 보조 패턴 우선순위 브랜치로 이관 - BT_Drog authoring 그래프를 공통 구조에 맞게 재구성 - 드로그 전용 BT 헬퍼를 정리하고 공통 베이스 액션으로 통합 - 플레이 검증으로 도약, 기본 패턴, 내려찍기, 다운 추가타 루프를 확인
58 lines
1.9 KiB
C#
58 lines
1.9 KiB
C#
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)
|
|
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();
|
|
}
|
|
|
|
return base.ResolveStepTarget(fallbackTarget);
|
|
}
|
|
}
|