feat: 드로그 투척 패턴 및 보스명 UI 정리

- 공통 보스 BT 프레임워크에 utility 패턴 역할과 준비/실행 브랜치를 추가

- 드로그 투척 패턴, 스킬, 투사체 이펙트를 연결하고 1인 플레이에서도 주 대상 fallback으로 발동되게 조정

- 투척 스폰 회전 계산을 보강해 zero vector 경고를 제거

- EnemyData와 VictoryUI 보스명을 투기장의 집행자 드로그 기준으로 정리

- Unity 플레이 검증으로 1인 호스트에서 투척 실행과 후속 전투 루프를 확인
This commit is contained in:
2026-03-24 18:20:22 +09:00
parent 2d77bcea91
commit 0610099a62
23 changed files with 1691 additions and 884 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 1ecdc2379b078b246a0bd5c0fb58e346, type: 3}
m_Name: Data_Enemy_Drog
m_EditorClassIdentifier: Colosseum.Game::Colosseum.Enemy.EnemyData
enemyName: Boss The Test
enemyName: "\uD22C\uAE30\uC7A5\uC758 \uC9D1\uD589\uC790 \uB4DC\uB85C\uADF8"
description:
icon: {fileID: 21300000, guid: 452012ebe6d33bc4bbb53a355f77ce63, type: 3}
baseStrength: 10

View File

@@ -0,0 +1,20 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0ce956e0878565343974c31b8111c0c6, type: 3}
m_Name: "Data_Pattern_Drog_\uD22C\uCC99"
m_EditorClassIdentifier: Colosseum.Game::Colosseum.AI.BossPatternData
patternName: "\uD22C\uCC99"
steps:
- Type: 0
Skill: {fileID: 11400000, guid: 4fb4fa3d50c14824a4ab981e4d73eac3, type: 2}
Duration: 0
cooldown: 6

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9f7ab8078af64fd9a6ff4c9ce6aa9d3a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,30 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 94f0a76cebcac2f4fb5daf1b675fd79f, type: 3}
m_Name: "Data_Skill_Drog_\uD22C\uCC99"
m_EditorClassIdentifier: Colosseum.Game::Colosseum.Skills.SkillData
skillName: "\uD22C\uCC99"
description: "\uB4DC\uB85C\uADF8\uAC00 \uC8FC \uB300\uC0C1 \uBC16\uC758 \uC6D0\uAC70\uB9AC \uD50C\uB808\uC774\uC5B4\uB97C \uACAC\uC81C\uD558\uB294 \uD22C\uC0AC\uCCB4 \uACF5\uACA9\uC785\uB2C8\uB2E4."
icon: {fileID: 0}
skillClip: {fileID: -7717634560727564301, guid: 4005a77aa7d531742b1de1bec27001b1, type: 3}
endClip: {fileID: -8265974341663887746, guid: d3e4690f866332b43b86ee7005291cd0, type: 3}
animationSpeed: 1
useRootMotion: 0
ignoreRootMotionY: 1
jumpToTarget: 0
blockMovementWhileCasting: 1
blockJumpWhileCasting: 1
blockOtherSkillsWhileCasting: 1
cooldown: 0
manaCost: 0
effects:
- {fileID: 11400000, guid: 7cb93b3b54be4e59b40f2f1f6dcf2c63, type: 2}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4fb4fa3d50c14824a4ab981e4d73eac3
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,32 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a3139ddf07cfe324fa692a88cd565e24, type: 3}
m_Name: "Data_SkillEffect_Drog_\uD22C\uCC99_0_\uD22C\uC0AC\uCCB4"
m_EditorClassIdentifier: Colosseum.Game::Colosseum.Skills.Effects.SpawnEffect
targetType: 0
targetTeam: 0
areaCenter: 0
areaShape: 0
targetLayers:
serializedVersion: 2
m_Bits: 4294967295
areaRadius: 3
fanOriginDistance: 1
fanRadius: 3
fanHalfAngle: 45
prefab: {fileID: 7991191450305394598, guid: b8e3d022f0a2ce84da42fe4afd4a1b13, type: 3}
spawnLocation: 1
spawnOffset: {x: 0, y: 1.2, z: 0}
parentToCaster: 0
autoDestroyTime: 5
useCombatContextTarget: 1
hitEffect: {fileID: 11400000, guid: 6f8d2c2d2c744b7f8e23fe4b4fd2a991, type: 2}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7cb93b3b54be4e59b40f2f1f6dcf2c63
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,28 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 58efb3c775496fa40b801b21127a011e, type: 3}
m_Name: "Data_SkillEffect_Drog_\uD22C\uCC99\uD22C\uC0AC\uCCB4_0_\uB370\uBBF8\uC9C0"
m_EditorClassIdentifier: Colosseum.Game::Colosseum.Skills.Effects.DamageEffect
targetType: 1
targetTeam: 0
areaCenter: 0
areaShape: 0
targetLayers:
serializedVersion: 2
m_Bits: 4294967295
areaRadius: 1
fanOriginDistance: 0
fanRadius: 3
fanHalfAngle: 45
baseDamage: 1
damageType: 2
statScaling: 1

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6f8d2c2d2c744b7f8e23fe4b4fd2a991
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -2189,6 +2189,7 @@ MonoBehaviour:
mainPattern: {fileID: 11400000, guid: 5efd8123be76bf844875d386d9d5f73d, type: 2}
slamPattern: {fileID: 11400000, guid: 4a52d59d590b4eaa9ef92b7984eb08c7, type: 2}
leapPattern: {fileID: 11400000, guid: 88e6cc7cab28baf4c8f8a742247000ec, type: 2}
utilityPattern: {fileID: 11400000, guid: 9f7ab8078af64fd9a6ff4c9ce6aa9d3a, type: 2}
downPunishPattern: {fileID: 11400000, guid: fe5100f855d14c0faac44b6d4f2c771e, type: 2}
signaturePattern: {fileID: 11400000, guid: 5e732b41722c45288bb6234f3e3fa638, type: 2}
phase2HealthThreshold: 0.75
@@ -2196,6 +2197,7 @@ MonoBehaviour:
targetRefreshInterval: 0.2
leapDistanceThreshold: 8
downPunishSearchRadius: 6
utilityTriggerDistance: 5
phase1SlamInterval: 3
phase2SlamInterval: 2
phase3SlamInterval: 2

View File

@@ -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;
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 15de0eb23ee195a42a07c23c18f9fa9a

View File

@@ -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];
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 5bc0da0fc1e1b81428d64c0c8b31a402

View File

@@ -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);
}
}

View File

@@ -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;
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 36c98678f964a7447bede88fedc04561

View File

@@ -68,12 +68,13 @@ namespace Colosseum.Editor
object selectorNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, runtimeAssembly.GetType("Unity.Behavior.SelectorComposite", true), new Vector2(420f, -280f));
object signatureSequence = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, runtimeAssembly.GetType("Unity.Behavior.SequenceComposite", true), new Vector2(-1020f, -40f));
object downSequence = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, runtimeAssembly.GetType("Unity.Behavior.SequenceComposite", true), new Vector2(-620f, -40f));
object leapSequence = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, runtimeAssembly.GetType("Unity.Behavior.SequenceComposite", true), new Vector2(-220f, -40f));
object slamSequence = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, runtimeAssembly.GetType("Unity.Behavior.SequenceComposite", true), new Vector2(180f, -40f));
object mainSequence = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, runtimeAssembly.GetType("Unity.Behavior.SequenceComposite", true), new Vector2(580f, -40f));
object slamFallbackSequence = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, runtimeAssembly.GetType("Unity.Behavior.SequenceComposite", true), new Vector2(980f, -40f));
object chaseSequence = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, runtimeAssembly.GetType("Unity.Behavior.SequenceComposite", true), new Vector2(1380f, -40f));
object downSequence = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, runtimeAssembly.GetType("Unity.Behavior.SequenceComposite", true), new Vector2(-780f, -40f));
object utilitySequence = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, runtimeAssembly.GetType("Unity.Behavior.SequenceComposite", true), new Vector2(-380f, -40f));
object leapSequence = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, runtimeAssembly.GetType("Unity.Behavior.SequenceComposite", true), new Vector2(20f, -40f));
object slamSequence = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, runtimeAssembly.GetType("Unity.Behavior.SequenceComposite", true), new Vector2(420f, -40f));
object mainSequence = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, runtimeAssembly.GetType("Unity.Behavior.SequenceComposite", true), new Vector2(820f, -40f));
object slamFallbackSequence = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, runtimeAssembly.GetType("Unity.Behavior.SequenceComposite", true), new Vector2(1220f, -40f));
object chaseSequence = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, runtimeAssembly.GetType("Unity.Behavior.SequenceComposite", true), new Vector2(1620f, -40f));
object signatureRefreshNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(RefreshPrimaryTargetAction), new Vector2(-1140f, 240f));
object signatureHasTargetNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(ValidateTargetAction), new Vector2(-1020f, 240f));
@@ -84,39 +85,44 @@ namespace Colosseum.Editor
object downReadyNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(CheckPunishPatternReadyAction), new Vector2(-620f, 240f));
object downUseNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(UsePunishPatternAction), new Vector2(-500f, 240f));
object leapSelectNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(SelectTargetByDistanceAction), new Vector2(-340f, 240f));
object leapReadyNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(CheckMobilityPatternReadyAction), new Vector2(-220f, 240f));
object leapUseNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(UseMobilityPatternAction), new Vector2(-100f, 240f));
object utilitySelectNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(SelectAlternateTargetByDistanceAction), new Vector2(-500f, 240f));
object utilityReadyNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(CheckUtilityPatternReadyAction), new Vector2(-380f, 240f));
object utilityUseNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(UseUtilityPatternAction), new Vector2(-260f, 240f));
object slamRefreshNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(RefreshPrimaryTargetAction), new Vector2(0f, 240f));
object slamHasTargetNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(ValidateTargetAction), new Vector2(120f, 240f));
object slamRangeNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(CheckTargetInAttackRangeAction), new Vector2(240f, 240f));
object slamTurnNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(CheckSecondaryPatternTurnAction), new Vector2(360f, 240f));
object slamReadyNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(CheckSecondaryPatternReadyAction), new Vector2(480f, 240f));
object slamUseNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(UseSecondaryPatternAction), new Vector2(600f, 240f));
object leapSelectNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(SelectTargetByDistanceAction), new Vector2(-100f, 240f));
object leapReadyNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(CheckMobilityPatternReadyAction), new Vector2(20f, 240f));
object leapUseNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(UseMobilityPatternAction), new Vector2(140f, 240f));
object mainRefreshNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(RefreshPrimaryTargetAction), new Vector2(520f, 240f));
object mainHasTargetNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(ValidateTargetAction), new Vector2(640f, 240f));
object mainRangeNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(CheckTargetInAttackRangeAction), new Vector2(760f, 240f));
object mainReadyNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(CheckPrimaryPatternReadyAction), new Vector2(880f, 240f));
object mainUseNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(UsePrimaryPatternAction), new Vector2(1000f, 240f));
object slamRefreshNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(RefreshPrimaryTargetAction), new Vector2(240f, 240f));
object slamHasTargetNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(ValidateTargetAction), new Vector2(360f, 240f));
object slamRangeNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(CheckTargetInAttackRangeAction), new Vector2(480f, 240f));
object slamTurnNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(CheckSecondaryPatternTurnAction), new Vector2(600f, 240f));
object slamReadyNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(CheckSecondaryPatternReadyAction), new Vector2(720f, 240f));
object slamUseNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(UseSecondaryPatternAction), new Vector2(840f, 240f));
object fallbackRefreshNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(RefreshPrimaryTargetAction), new Vector2(920f, 240f));
object fallbackHasTargetNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(ValidateTargetAction), new Vector2(1040f, 240f));
object fallbackRangeNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(CheckTargetInAttackRangeAction), new Vector2(1160f, 240f));
object fallbackReadyNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(CheckSecondaryPatternReadyAction), new Vector2(1280f, 240f));
object fallbackUseNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(UseSecondaryPatternAction), new Vector2(1400f, 240f));
object mainRefreshNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(RefreshPrimaryTargetAction), new Vector2(760f, 240f));
object mainHasTargetNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(ValidateTargetAction), new Vector2(880f, 240f));
object mainRangeNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(CheckTargetInAttackRangeAction), new Vector2(1000f, 240f));
object mainReadyNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(CheckPrimaryPatternReadyAction), new Vector2(1120f, 240f));
object mainUseNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(UsePrimaryPatternAction), new Vector2(1240f, 240f));
object chaseRefreshNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(RefreshPrimaryTargetAction), new Vector2(1320f, 240f));
object chaseHasTargetNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(ValidateTargetAction), new Vector2(1440f, 240f));
object chaseUseNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(ChaseTargetAction), new Vector2(1560f, 240f));
object fallbackRefreshNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(RefreshPrimaryTargetAction), new Vector2(1160f, 240f));
object fallbackHasTargetNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(ValidateTargetAction), new Vector2(1280f, 240f));
object fallbackRangeNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(CheckTargetInAttackRangeAction), new Vector2(1400f, 240f));
object fallbackReadyNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(CheckSecondaryPatternReadyAction), new Vector2(1520f, 240f));
object fallbackUseNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(UseSecondaryPatternAction), new Vector2(1640f, 240f));
object chaseRefreshNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(RefreshPrimaryTargetAction), new Vector2(1560f, 240f));
object chaseHasTargetNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(ValidateTargetAction), new Vector2(1680f, 240f));
object chaseUseNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(ChaseTargetAction), new Vector2(1800f, 240f));
Connect(graphAsset, connectEdgeMethod, GetDefaultOutputPort(startNode), GetDefaultInputPort(repeatNode));
Connect(graphAsset, connectEdgeMethod, GetDefaultOutputPort(repeatNode), GetDefaultInputPort(selectorNode));
ConnectChildren(graphAsset, connectEdgeMethod, selectorNode, signatureSequence, downSequence, leapSequence, slamSequence, mainSequence, slamFallbackSequence, chaseSequence);
ConnectChildren(graphAsset, connectEdgeMethod, selectorNode, signatureSequence, downSequence, utilitySequence, leapSequence, slamSequence, mainSequence, slamFallbackSequence, chaseSequence);
ConnectChildren(graphAsset, connectEdgeMethod, signatureSequence, signatureRefreshNode, signatureHasTargetNode, signatureReadyNode, signatureUseNode);
ConnectChildren(graphAsset, connectEdgeMethod, downSequence, downSelectNode, downReadyNode, downUseNode);
ConnectChildren(graphAsset, connectEdgeMethod, utilitySequence, utilitySelectNode, utilityReadyNode, utilityUseNode);
ConnectChildren(graphAsset, connectEdgeMethod, leapSequence, leapSelectNode, leapReadyNode, leapUseNode);
ConnectChildren(graphAsset, connectEdgeMethod, slamSequence, slamRefreshNode, slamHasTargetNode, slamRangeNode, slamTurnNode, slamReadyNode, slamUseNode);
ConnectChildren(graphAsset, connectEdgeMethod, mainSequence, mainRefreshNode, mainHasTargetNode, mainRangeNode, mainReadyNode, mainUseNode);
@@ -128,6 +134,8 @@ namespace Colosseum.Editor
LinkTarget(signatureUseNode, targetVariable);
LinkTarget(downSelectNode, targetVariable);
LinkTarget(downUseNode, targetVariable);
LinkTarget(utilitySelectNode, targetVariable);
LinkTarget(utilityUseNode, targetVariable);
LinkTarget(leapSelectNode, targetVariable);
LinkTarget(leapUseNode, targetVariable);
LinkTarget(slamRefreshNode, targetVariable);

View File

@@ -43,6 +43,9 @@ namespace Colosseum.Enemy
[FormerlySerializedAs("leapPattern")]
[SerializeField] protected BossPatternData mobilityPattern;
[Tooltip("비주 대상 원거리 견제 패턴")]
[SerializeField] protected BossPatternData utilityPattern;
[Tooltip("특정 상황에서 우선 발동하는 징벌 패턴")]
[FormerlySerializedAs("downPunishPattern")]
[SerializeField] protected BossPatternData punishPattern;
@@ -70,6 +73,9 @@ namespace Colosseum.Enemy
[FormerlySerializedAs("downPunishSearchRadius")]
[Min(0f)] [SerializeField] protected float punishSearchRadius = 6f;
[Tooltip("원거리 견제 패턴을 고려하기 시작하는 최소 거리")]
[Min(0f)] [SerializeField] protected float utilityTriggerDistance = 5f;
[Header("Pattern Cadence")]
[Tooltip("1페이즈에서 몇 번의 근접 패턴마다 보조 패턴을 섞을지")]
[FormerlySerializedAs("phase1SlamInterval")]
@@ -141,11 +147,41 @@ namespace Colosseum.Enemy
/// </summary>
public float MobilityTriggerDistance => mobilityTriggerDistance;
/// <summary>
/// 원거리 견제 패턴을 고려하는 최소 거리
/// </summary>
public float UtilityTriggerDistance => utilityTriggerDistance;
/// <summary>
/// 징벌 패턴을 고려하는 최대 반경
/// </summary>
public float PunishSearchRadius => punishSearchRadius;
/// <summary>
/// 현재 전투 대상
/// </summary>
public GameObject CurrentTarget => currentTarget;
/// <summary>
/// EnemyBase 접근자
/// </summary>
public EnemyBase EnemyBase => enemyBase;
/// <summary>
/// 현재 전투 기준이 되는 주 대상을 반환합니다.
/// </summary>
public GameObject ResolvePrimaryTarget()
{
if (IsValidHostileTarget(currentTarget))
return currentTarget;
GameObject highestThreatTarget = enemyBase != null
? enemyBase.GetHighestThreatTarget(currentTarget, null, enemyBase.Data != null ? enemyBase.Data.AggroRange : Mathf.Infinity)
: null;
return highestThreatTarget != null ? highestThreatTarget : FindNearestLivingTarget();
}
/// <summary>
/// 시그니처 패턴 진행 여부
/// </summary>
@@ -214,6 +250,9 @@ namespace Colosseum.Enemy
if (TryStartMobilityPattern())
return;
if (TryStartUtilityPattern())
return;
TryStartPrimaryLoopPattern();
}
@@ -227,6 +266,7 @@ namespace Colosseum.Enemy
BossCombatPatternRole.Primary => primaryPattern,
BossCombatPatternRole.Secondary => secondaryPattern,
BossCombatPatternRole.Mobility => mobilityPattern,
BossCombatPatternRole.Utility => utilityPattern,
BossCombatPatternRole.Punish => punishPattern,
BossCombatPatternRole.Signature => signaturePattern,
_ => null,
@@ -324,6 +364,61 @@ namespace Colosseum.Enemy
return farthestTarget;
}
/// <summary>
/// 원거리 견제 패턴 대상으로 유효한지 확인합니다.
/// </summary>
public bool IsValidUtilityTarget(GameObject candidate)
{
if (!IsValidHostileTarget(candidate))
return false;
if (candidate == ResolvePrimaryTarget())
return false;
float maxDistance = enemyBase != null && enemyBase.Data != null ? enemyBase.Data.AggroRange : 20f;
float distance = Vector3.Distance(transform.position, candidate.transform.position);
return distance >= utilityTriggerDistance && distance <= maxDistance;
}
/// <summary>
/// 현재 주 대상이 아닌 원거리 견제 대상을 찾습니다.
/// </summary>
public GameObject FindUtilityTarget()
{
PlayerNetworkController[] players = FindObjectsByType<PlayerNetworkController>(FindObjectsSortMode.None);
List<GameObject> validTargets = new List<GameObject>();
GameObject primaryTarget = ResolvePrimaryTarget();
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 (!IsValidUtilityTarget(candidate))
continue;
validTargets.Add(candidate);
}
if (validTargets.Count == 0)
{
if (IsValidHostileTarget(primaryTarget))
{
float maxDistance = enemyBase != null && enemyBase.Data != null ? enemyBase.Data.AggroRange : 20f;
float distance = Vector3.Distance(transform.position, primaryTarget.transform.position);
if (distance >= utilityTriggerDistance && distance <= maxDistance)
return primaryTarget;
}
return null;
}
int randomIndex = UnityEngine.Random.Range(0, validTargets.Count);
return validTargets[randomIndex];
}
/// <summary>
/// 가장 가까운 생존 플레이어를 찾습니다.
/// </summary>
@@ -432,6 +527,21 @@ namespace Colosseum.Enemy
return true;
}
protected virtual bool TryStartUtilityPattern()
{
BossPatternData pattern = GetPattern(BossCombatPatternRole.Utility);
if (!IsPatternReady(pattern))
return false;
GameObject target = FindUtilityTarget();
if (target == null)
return false;
currentTarget = target;
StartPattern(pattern, target);
return true;
}
protected virtual BossPatternData SelectPrimaryLoopPattern()
{
BossPatternData primary = GetPattern(BossCombatPatternRole.Primary);
@@ -466,6 +576,7 @@ namespace Colosseum.Enemy
if (pattern == null || activePatternCoroutine != null)
return;
currentTarget = target;
LogDebug(GetType().Name, $"패턴 시작: {pattern.PatternName} / Target={(target != null ? target.name : "None")} / Phase={CurrentPatternPhase}");
activePatternCoroutine = StartCoroutine(RunPatternCoroutine(pattern, target));
}

View File

@@ -10,6 +10,7 @@ namespace Colosseum.Enemy
Mobility = 2,
Punish = 3,
Signature = 4,
Utility = 5,
}
/// <summary>

View File

@@ -1,6 +1,8 @@
using UnityEngine;
using Unity.Netcode;
using Colosseum.Enemy;
namespace Colosseum.Skills.Effects
{
/// <summary>
@@ -15,6 +17,8 @@ namespace Colosseum.Skills.Effects
[SerializeField] private Vector3 spawnOffset = Vector3.zero;
[SerializeField] private bool parentToCaster = false;
[Min(0f)] [SerializeField] private float autoDestroyTime = 3f;
[Tooltip("전투 컨텍스트의 현재 타겟을 스폰 방향 계산에 사용할지 여부")]
[SerializeField] private bool useCombatContextTarget = false;
[Header("Hit Settings")]
[Tooltip("투사체가 대상에 명중했을 때 적용할 효과. 미설정 시 명중 효과 없음.")]
@@ -24,8 +28,9 @@ namespace Colosseum.Skills.Effects
{
if (prefab == null || caster == null) return;
Vector3 spawnPos = GetSpawnPosition(caster, target) + spawnOffset;
Quaternion spawnRot = GetSpawnRotation(caster, target);
GameObject resolvedTarget = ResolveTarget(caster, target);
Vector3 spawnPos = GetSpawnPosition(caster, resolvedTarget) + spawnOffset;
Quaternion spawnRot = GetSpawnRotation(caster, resolvedTarget);
var networkObject = prefab.GetComponent<NetworkObject>();
if (networkObject != null)
@@ -55,6 +60,20 @@ namespace Colosseum.Skills.Effects
}
}
private GameObject ResolveTarget(GameObject caster, GameObject target)
{
if (!useCombatContextTarget)
return target;
if (target != null && target != caster)
return target;
BossCombatBehaviorContext context = caster.GetComponent<BossCombatBehaviorContext>();
return context != null && context.CurrentTarget != null
? context.CurrentTarget
: target;
}
private Vector3 GetSpawnPosition(GameObject caster, GameObject target)
{
return spawnLocation switch
@@ -68,10 +87,13 @@ namespace Colosseum.Skills.Effects
private Quaternion GetSpawnRotation(GameObject caster, GameObject target)
{
if (spawnLocation == SpawnLocation.Target && target != null)
if (target != null && (spawnLocation == SpawnLocation.Target || spawnLocation == SpawnLocation.CasterForward))
{
return Quaternion.LookRotation(target.transform.position - caster.transform.position);
Vector3 lookDirection = target.transform.position - caster.transform.position;
if (lookDirection.sqrMagnitude > 0.0001f)
return Quaternion.LookRotation(lookDirection);
}
return caster.transform.rotation;
}
}

View File

@@ -1,6 +1,7 @@
using UnityEngine;
using UnityEngine.UI;
using TMPro;
using Colosseum.Enemy;
namespace Colosseum.UI
@@ -42,7 +43,7 @@ namespace Colosseum.UI
// 보스 이름 표시
if (bossNameText != null && BossEnemy.ActiveBoss != null)
{
bossNameText.text = $"{BossEnemy.ActiveBoss.name} Defeated!";
bossNameText.text = BuildBossVictoryText(BossEnemy.ActiveBoss);
}
// 애니메이션 재생
@@ -51,5 +52,20 @@ namespace Colosseum.UI
animator.SetTrigger("Show");
}
}
/// <summary>
/// 승리 UI에 표시할 보스 이름 문구를 생성합니다.
/// </summary>
private static string BuildBossVictoryText(BossEnemy boss)
{
if (boss == null)
return string.Empty;
string bossName = boss.Data != null && !string.IsNullOrWhiteSpace(boss.Data.EnemyName)
? boss.Data.EnemyName
: boss.name;
return $"{bossName} 격파";
}
}
}