feat: 드로그 투척 패턴 및 보스명 UI 정리
- 공통 보스 BT 프레임워크에 utility 패턴 역할과 준비/실행 브랜치를 추가 - 드로그 투척 패턴, 스킬, 투사체 이펙트를 연결하고 1인 플레이에서도 주 대상 fallback으로 발동되게 조정 - 투척 스폰 회전 계산을 보강해 zero vector 경고를 제거 - EnemyData와 VictoryUI 보스명을 투기장의 집행자 드로그 기준으로 정리 - Unity 플레이 검증으로 1인 호스트에서 투척 실행과 후속 전투 루프를 확인
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 15de0eb23ee195a42a07c23c18f9fa9a
|
||||
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Colosseum;
|
||||
using Colosseum.Combat;
|
||||
using Colosseum.Enemy;
|
||||
using Colosseum.Player;
|
||||
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
using UnityEngine;
|
||||
|
||||
using Action = Unity.Behavior.Action;
|
||||
|
||||
/// <summary>
|
||||
/// 현재 주 대상이 아닌 다른 원거리 대상을 선택합니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[NodeDescription(
|
||||
name: "Select Alternate Target By Distance",
|
||||
story: "주 대상이 아닌 원거리 대상 선택",
|
||||
category: "Action",
|
||||
id: "1fe74f607036406c8857c1a23f42c8a2")]
|
||||
public partial class SelectAlternateTargetByDistanceAction : Action
|
||||
{
|
||||
[SerializeReference]
|
||||
public BlackboardVariable<GameObject> Target;
|
||||
|
||||
[SerializeReference]
|
||||
public BlackboardVariable<float> MinRange = new BlackboardVariable<float>(0f);
|
||||
|
||||
[SerializeReference]
|
||||
public BlackboardVariable<float> MaxRange = new BlackboardVariable<float>(0f);
|
||||
|
||||
protected override Status OnStart()
|
||||
{
|
||||
BossCombatBehaviorContext context = GameObject.GetComponent<BossCombatBehaviorContext>();
|
||||
if (context == null)
|
||||
return Status.Failure;
|
||||
|
||||
float minRange = MinRange.Value > 0f ? MinRange.Value : context.UtilityTriggerDistance;
|
||||
float maxRange = MaxRange.Value > 0f
|
||||
? MaxRange.Value
|
||||
: (context.EnemyBase != null && context.EnemyBase.Data != null ? context.EnemyBase.Data.AggroRange : 20f);
|
||||
|
||||
GameObject selectedTarget = SelectTarget(context, minRange, maxRange);
|
||||
if (selectedTarget == null)
|
||||
return Status.Failure;
|
||||
|
||||
Target.Value = selectedTarget;
|
||||
return Status.Success;
|
||||
}
|
||||
|
||||
private GameObject SelectTarget(BossCombatBehaviorContext context, float minRange, float maxRange)
|
||||
{
|
||||
PlayerNetworkController[] players = UnityEngine.Object.FindObjectsByType<PlayerNetworkController>(FindObjectsSortMode.None);
|
||||
if (players == null || players.Length == 0)
|
||||
return null;
|
||||
|
||||
GameObject primaryTarget = context.ResolvePrimaryTarget();
|
||||
List<GameObject> validTargets = new List<GameObject>();
|
||||
|
||||
for (int i = 0; i < players.Length; i++)
|
||||
{
|
||||
PlayerNetworkController player = players[i];
|
||||
if (player == null || player.IsDead || !player.gameObject.activeInHierarchy)
|
||||
continue;
|
||||
|
||||
GameObject candidate = player.gameObject;
|
||||
if (candidate == primaryTarget)
|
||||
continue;
|
||||
|
||||
if (!context.IsValidHostileTarget(candidate))
|
||||
continue;
|
||||
|
||||
float distance = Vector3.Distance(GameObject.transform.position, candidate.transform.position);
|
||||
if (distance < minRange || distance > maxRange)
|
||||
continue;
|
||||
|
||||
validTargets.Add(candidate);
|
||||
}
|
||||
|
||||
if (validTargets.Count == 0)
|
||||
{
|
||||
if (primaryTarget != null && context.IsValidHostileTarget(primaryTarget))
|
||||
{
|
||||
float primaryDistance = Vector3.Distance(GameObject.transform.position, primaryTarget.transform.position);
|
||||
if (primaryDistance >= minRange && primaryDistance <= maxRange)
|
||||
return primaryTarget;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
int randomIndex = UnityEngine.Random.Range(0, validTargets.Count);
|
||||
return validTargets[randomIndex];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5bc0da0fc1e1b81428d64c0c8b31a402
|
||||
@@ -33,6 +33,9 @@ public abstract partial class UsePatternRoleActionBase : BossPatternActionBase
|
||||
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;
|
||||
|
||||
@@ -52,6 +55,13 @@ public abstract partial class UsePatternRoleActionBase : BossPatternActionBase
|
||||
: context.FindMobilityTarget();
|
||||
}
|
||||
|
||||
if (PatternRole == BossCombatPatternRole.Utility && context != null)
|
||||
{
|
||||
return context.IsValidUtilityTarget(fallbackTarget)
|
||||
? fallbackTarget
|
||||
: context.FindUtilityTarget();
|
||||
}
|
||||
|
||||
return base.ResolveStepTarget(fallbackTarget);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 36c98678f964a7447bede88fedc04561
|
||||
Reference in New Issue
Block a user