- 공통 보스 BT 프레임워크에 utility 패턴 역할과 준비/실행 브랜치를 추가 - 드로그 투척 패턴, 스킬, 투사체 이펙트를 연결하고 1인 플레이에서도 주 대상 fallback으로 발동되게 조정 - 투척 스폰 회전 계산을 보강해 zero vector 경고를 제거 - EnemyData와 VictoryUI 보스명을 투기장의 집행자 드로그 기준으로 정리 - Unity 플레이 검증으로 1인 호스트에서 투척 실행과 후속 전투 루프를 확인
68 lines
2.3 KiB
C#
68 lines
2.3 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 && 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);
|
|
}
|
|
}
|