feat: 드로그 기본 루프 게이트를 BT로 이관

- big pattern grace period 판정을 런타임 헬퍼에서 제거하고 BT 조건/액션 노드로 명시

- Increment/Reset Basic Loop Count 노드 추가 및 BT_Drog 재빌드 반영

- Signature Failure Effects 수치를 BT 노드가 직접 보관하도록 정리
This commit is contained in:
2026-04-10 09:22:56 +09:00
parent b019acd0a3
commit 205b20e4e6
12 changed files with 3119 additions and 2162 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -2212,17 +2212,6 @@ MonoBehaviour:
abnormalityManager: {fileID: 0}
navMeshAgent: {fileID: 5153439431748782209}
behaviorGraphAgent: {fileID: 0}
basicLoopMinCountAfterBigPattern: 2
signatureRequiredDamageRatio: 0.1
signatureTelegraphAbnormality: {fileID: 11400000, guid: fb1a782e44ff4dc19fd8b3c633360752, type: 2}
signatureSuccessStaggerDuration: 2
signatureFailureAbnormality: {fileID: 11400000, guid: bc74f1485ad140c28cc14b821e22c127, type: 2}
signatureFailureDamage: 40
signatureFailureKnockbackRadius: 8
signatureFailureDownRadius: 3
signatureFailureKnockbackSpeed: 12
signatureFailureKnockbackDuration: 0.35
signatureFailureDownDuration: 2
maxPatternPhase: 3
debugMode: 1
--- !u!114 &7544406269366897481

View File

@@ -0,0 +1,37 @@
using System;
using Colosseum.Enemy;
using Unity.Behavior;
using Unity.Properties;
using UnityEngine;
using Action = Unity.Behavior.Action;
/// <summary>
/// 마지막 대형/징벌 패턴 이후 기본 루프 누적 횟수를 증가시킵니다.
/// </summary>
[Serializable, GeneratePropertyBag]
[NodeDescription(
name: "Increment Basic Loop Count",
story: "기본 루프 누적 횟수를 [Count] ",
category: "Action",
id: "fd1dc402-c0d7-4cf7-a97f-79d999c36f8d")]
public partial class IncrementBasicLoopCountAction : Action
{
[SerializeReference]
[Tooltip("증가시킬 기본 루프 횟수")]
public BlackboardVariable<int> Count = new BlackboardVariable<int>(1);
protected override Status OnStart()
{
BossBehaviorRuntimeState runtimeState = GameObject.GetComponent<BossBehaviorRuntimeState>();
if (runtimeState == null)
return Status.Failure;
int appliedCount = Mathf.Max(0, Count?.Value ?? 0);
runtimeState.IncrementBasicLoopCount(appliedCount);
runtimeState.LogDebug(nameof(IncrementBasicLoopCountAction), $"기본 루프 누적 증가: +{appliedCount} => {runtimeState.BasicLoopCountSinceLastBigPattern}");
return Status.Success;
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 76e508fdc9d7c8f7b9e370e453cee0fc

View File

@@ -0,0 +1,31 @@
using System;
using Colosseum.Enemy;
using Unity.Behavior;
using Unity.Properties;
using Action = Unity.Behavior.Action;
/// <summary>
/// 마지막 대형/징벌 패턴 이후 기본 루프 누적 횟수를 초기화합니다.
/// </summary>
[Serializable, GeneratePropertyBag]
[NodeDescription(
name: "Reset Basic Loop Count",
story: "기본 루프 누적 횟수 초기화",
category: "Action",
id: "0f7fc0e5-3c0d-4db6-a9aa-8e2e56f9b672")]
public partial class ResetBasicLoopCountAction : Action
{
protected override Status OnStart()
{
BossBehaviorRuntimeState runtimeState = GameObject.GetComponent<BossBehaviorRuntimeState>();
if (runtimeState == null)
return Status.Failure;
runtimeState.ResetBasicLoopCount();
runtimeState.LogDebug(nameof(ResetBasicLoopCountAction), "기본 루프 누적 초기화");
return Status.Success;
}
}

View File

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

View File

@@ -1,9 +1,7 @@
using System;
using Colosseum.Abnormalities;
using Colosseum.AI;
using Colosseum.Combat;
using Colosseum.Enemy;
using Colosseum.Player;
using Unity.Behavior;
@@ -14,7 +12,7 @@ using Action = Unity.Behavior.Action;
/// <summary>
/// 충전 차단에 실패하여 패턴이 완료되었을 때, 전체 플레이어에게 범위 효과를 적용합니다.
/// 런타임 상태에 저장된 시그니처 실패 수치를 읽어 범위 효과를 적용하는 BT 노드입니다.
/// 필요한 수치는 BT 노드 필드에서 직접 설정합니다.
/// </summary>
[Serializable, GeneratePropertyBag]
[NodeDescription(
@@ -24,30 +22,42 @@ using Action = Unity.Behavior.Action;
id: "c3d4e5f6-1111-2222-3333-777788889999")]
public partial class SignatureFailureEffectsAction : Action
{
private BossBehaviorRuntimeState runtimeState;
[SerializeReference]
public BlackboardVariable<float> FailureDamage = new BlackboardVariable<float>(40f);
[SerializeReference]
public BlackboardVariable<AbnormalityData> FailureAbnormality;
[SerializeReference]
public BlackboardVariable<float> KnockbackRadius = new BlackboardVariable<float>(8f);
[SerializeReference]
public BlackboardVariable<float> DownRadius = new BlackboardVariable<float>(3f);
[SerializeReference]
public BlackboardVariable<float> KnockbackSpeed = new BlackboardVariable<float>(12f);
[SerializeReference]
public BlackboardVariable<float> KnockbackDuration = new BlackboardVariable<float>(0.35f);
[SerializeReference]
public BlackboardVariable<float> DownDuration = new BlackboardVariable<float>(2f);
protected override Status OnStart()
{
runtimeState = GameObject.GetComponent<BossBehaviorRuntimeState>();
if (runtimeState == null)
{
Debug.LogWarning("[SignatureFailureEffects] BossBehaviorRuntimeState를 찾을 수 없습니다.");
return Status.Failure;
}
ApplyFailureEffects();
return Status.Success;
}
private void ApplyFailureEffects()
{
float failureDamage = runtimeState.SignatureFailureDamage;
AbnormalityData failureAbnormality = runtimeState.SignatureFailureAbnormality;
float knockbackRadius = runtimeState.SignatureFailureKnockbackRadius;
float downRadius = runtimeState.SignatureFailureDownRadius;
float knockbackSpeed = runtimeState.SignatureFailureKnockbackSpeed;
float knockbackDuration = runtimeState.SignatureFailureKnockbackDuration;
float downDuration = runtimeState.SignatureFailureDownDuration;
float failureDamage = Mathf.Max(0f, FailureDamage?.Value ?? 0f);
AbnormalityData failureAbnormality = FailureAbnormality?.Value;
float knockbackRadius = Mathf.Max(0f, KnockbackRadius?.Value ?? 0f);
float downRadius = Mathf.Max(0f, DownRadius?.Value ?? 0f);
float knockbackSpeed = Mathf.Max(0f, KnockbackSpeed?.Value ?? 0f);
float knockbackDuration = Mathf.Max(0f, KnockbackDuration?.Value ?? 0f);
float downDuration = Mathf.Max(0f, DownDuration?.Value ?? 0f);
PlayerNetworkController[] players = UnityEngine.Object.FindObjectsByType<PlayerNetworkController>(FindObjectsSortMode.None);
for (int i = 0; i < players.Length; i++)

View File

@@ -41,11 +41,6 @@ public partial class UsePatternByRoleAction : BossPatternActionBase
if (pattern == null)
return Status.Failure;
// 타겟 해석은 ResolveStepTarget에서 처리됩니다.
// 대형 패턴/징벌 패턴 후 기본 루프 강제 규칙이 유지되도록 모든 패턴 사용을 기록합니다.
BossBehaviorRuntimeState context = GameObject.GetComponent<BossBehaviorRuntimeState>();
context?.RegisterPatternUse(pattern);
// base.OnStart는 TryResolvePattern → ExecuteCurrentStep 호출
return base.OnStart();
}

View File

@@ -38,7 +38,6 @@ namespace Colosseum.AI.BehaviorActions.Actions
return Status.Failure;
BossBehaviorRuntimeState context = GameObject.GetComponent<BossBehaviorRuntimeState>();
context?.RegisterPatternUse(selectedPattern);
context?.LogDebug(nameof(UseWeightedReadyPatternAction), $"가중치 패턴 선택 후 실행: {selectedPattern.PatternName}");
return base.OnStart();
}

View File

@@ -12,7 +12,7 @@ namespace Colosseum.AI.BehaviorActions.Conditions
{
/// <summary>
/// 지정된 패턴이 현재 실행 가능한지 확인합니다.
/// 패턴의 특성 필드를 사용하여 grace period 등을 판단합니다.
/// BT에 명시된 추가 조건 외에, 페이즈/행동 억제/쿨다운만 판단합니다.
/// </summary>
public static bool IsPatternReady(GameObject gameObject, BossPatternData pattern)
{
@@ -29,9 +29,6 @@ namespace Colosseum.AI.BehaviorActions.Conditions
if (context.CurrentPatternPhase < pattern.MinPhase)
return false;
if (!context.IsPatternGracePeriodAllowed(pattern))
return false;
return context.IsPatternReady(pattern);
}
}

View File

@@ -7,6 +7,7 @@ using System.Reflection;
using Colosseum.AI;
using Colosseum.AI.BehaviorActions.Actions;
using Colosseum.AI.BehaviorActions.Conditions;
using Colosseum.Abnormalities;
using Colosseum.Enemy;
using Colosseum.Skills;
@@ -33,6 +34,7 @@ namespace Colosseum.Editor
private const string DefaultPressurePatternPath = "Assets/_Game/Data/Patterns/Data_Pattern_Drog_콤보-발구르기.asset";
private const string DefaultUtilityPatternPath = "Assets/_Game/Data/Patterns/Data_Pattern_Drog_투척.asset";
private const string DefaultPhase3TransitionSkillPath = "Assets/_Game/Data/Skills/Data_Skill_Drog_포효.asset";
private const string DefaultSignatureFailureAbnormalityPath = "Assets/_Game/Data/Abnormalities/Data_Abnormality_Player_집행자의낙인.asset";
private const float DefaultDownedTargetSearchRadius = 6f;
private const float DefaultLeapTargetMinDistance = 8f;
@@ -45,11 +47,18 @@ namespace Colosseum.Editor
private const float DefaultGroundShakeInterval = 12f;
private const float DefaultPhase2EnterHealthPercent = 75f;
private const float DefaultPhase3EnterHealthPercent = 40f;
private const int DefaultBasicLoopRequirementBeforeBigPattern = 2;
private const float DefaultComboPatternWeight = 26f;
private const float DefaultPressurePatternWeight = 24f;
private const float DefaultPrimaryPatternWeight = 22f;
private const float DefaultSecondaryPatternWeight = 16f;
private const float DefaultTertiaryPatternWeight = 12f;
private const float DefaultSignatureFailureDamage = 40f;
private const float DefaultSignatureFailureKnockbackRadius = 8f;
private const float DefaultSignatureFailureDownRadius = 3f;
private const float DefaultSignatureFailureKnockbackSpeed = 12f;
private const float DefaultSignatureFailureKnockbackDuration = 0.35f;
private const float DefaultSignatureFailureDownDuration = 2f;
[MenuItem("Tools/Colosseum/Rebuild Drog Behavior Authoring Graph")]
private static void Rebuild()
@@ -243,6 +252,7 @@ namespace Colosseum.Editor
BossPatternData pressurePattern = LoadRequiredAsset<BossPatternData>(DefaultPressurePatternPath, "콤보-발구르기 패턴");
BossPatternData utilityPattern = LoadRequiredAsset<BossPatternData>(DefaultUtilityPatternPath, "투척 패턴");
SkillData phase3TransitionSkill = LoadRequiredAsset<SkillData>(DefaultPhase3TransitionSkillPath, "포효 스킬");
AbnormalityData signatureFailureAbnormality = LoadRequiredAsset<AbnormalityData>(DefaultSignatureFailureAbnormalityPath, "집행 실패 디버프");
if (punishPattern == null
|| signaturePattern == null
@@ -315,6 +325,7 @@ namespace Colosseum.Editor
object phase3RefreshNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(RefreshPrimaryTargetAction), new Vector2(actionX4, startY + stepY));
SetNodeFieldValue(phase3RefreshNode, "SearchRange", DefaultTargetSearchRange, setFieldValueMethod);
object phase3ValidateNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(ValidateTargetAction), new Vector2(actionX5, startY + stepY));
object phase3SignatureResetLoopNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(ResetBasicLoopCountAction), new Vector2(actionX6 - 200f, startY + stepY));
object phase3UseSignatureNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(UsePatternByRoleAction), new Vector2(actionX6, startY + stepY));
SetNodeFieldValue(phase3UseSignatureNode, "Pattern", signaturePattern, setFieldValueMethod);
SetNodeFieldValue(phase3UseSignatureNode, "ContinueOnResolvedFailure", true, setFieldValueMethod);
@@ -323,6 +334,7 @@ namespace Colosseum.Editor
SetBranchRequiresAll(phase3SignatureResultBranch, true);
object phase3SignatureStaggerNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(BossStaggerAction), new Vector2(actionX6 + 820f, startY + stepY - 120f));
object phase3SignatureFailureNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(SignatureFailureEffectsAction), new Vector2(actionX6 + 820f, startY + stepY + 120f));
ConfigureSignatureFailureNode(phase3SignatureFailureNode, signatureFailureAbnormality, setFieldValueMethod);
object phase3SignatureTimerResetNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(SetBossPhaseAction), new Vector2(actionX6 + 1220f, startY + stepY));
SetNodeFieldValue(phase3SignatureTimerResetNode, "TargetPhase", 3, setFieldValueMethod);
SetNodeFieldValue(phase3SignatureTimerResetNode, "ResetTimer", true, setFieldValueMethod);
@@ -335,6 +347,7 @@ namespace Colosseum.Editor
phase3SetPhaseNode,
phase3RefreshNode,
phase3ValidateNode,
phase3SignatureResetLoopNode,
phase3UseSignatureNode,
phase3SignatureResultBranch,
phase3SignatureTimerResetNode);
@@ -357,12 +370,14 @@ namespace Colosseum.Editor
SetNodeFieldValue(punishSelectNode, "SearchRadius", DefaultDownedTargetSearchRadius, setFieldValueMethod);
object punishUseNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(UsePatternByRoleAction), new Vector2(actionX2, startY + stepY * 2f));
SetNodeFieldValue(punishUseNode, "Pattern", punishPattern, setFieldValueMethod);
ConnectChildren(graphAsset, connectEdgeMethod, punishSequence, punishSelectNode, punishUseNode);
object punishResetLoopNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(ResetBasicLoopCountAction), new Vector2(actionX3, startY + stepY * 2f));
ConnectChildren(graphAsset, connectEdgeMethod, punishSequence, punishSelectNode, punishUseNode, punishResetLoopNode);
object signatureBranch = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, branchCompositeType, new Vector2(branchX, startY + stepY * 3f));
AttachConditionWithValue(signatureBranch, typeof(IsCurrentPhaseCondition), "Phase", 3, authoringAssembly);
AttachConditionWithValue(signatureBranch, typeof(IsPhaseElapsedTimeAboveCondition), "Seconds", DefaultSignatureRepeatInterval, authoringAssembly);
AttachPatternReadyCondition(signatureBranch, signaturePattern, authoringAssembly);
AttachConditionWithValue(signatureBranch, typeof(IsBasicLoopCountAtLeastCondition), "Count", DefaultBasicLoopRequirementBeforeBigPattern, authoringAssembly);
SetBranchRequiresAll(signatureBranch, true);
object signatureSequence = CreateNode(
@@ -377,11 +392,13 @@ namespace Colosseum.Editor
object signatureUseNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(UsePatternByRoleAction), new Vector2(actionX3, startY + stepY * 3f));
SetNodeFieldValue(signatureUseNode, "Pattern", signaturePattern, setFieldValueMethod);
SetNodeFieldValue(signatureUseNode, "ContinueOnResolvedFailure", true, setFieldValueMethod);
object signatureResetLoopNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(ResetBasicLoopCountAction), new Vector2(actionX3 + 220f, startY + stepY * 3f));
object signatureResultBranch = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, branchCompositeType, new Vector2(actionX4, startY + stepY * 3f));
AttachConditionWithValue(signatureResultBranch, typeof(IsPatternExecutionResultCondition), "Result", BossPatternExecutionResult.Failed, authoringAssembly);
SetBranchRequiresAll(signatureResultBranch, true);
object signatureStaggerNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(BossStaggerAction), new Vector2(actionX4 + 420f, startY + stepY * 3f - 120f));
object signatureFailureNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(SignatureFailureEffectsAction), new Vector2(actionX4 + 420f, startY + stepY * 3f + 120f));
ConfigureSignatureFailureNode(signatureFailureNode, signatureFailureAbnormality, setFieldValueMethod);
object signatureTimerResetNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(SetBossPhaseAction), new Vector2(actionX5, startY + stepY * 3f));
SetNodeFieldValue(signatureTimerResetNode, "TargetPhase", 3, setFieldValueMethod);
SetNodeFieldValue(signatureTimerResetNode, "ResetTimer", true, setFieldValueMethod);
@@ -392,6 +409,7 @@ namespace Colosseum.Editor
signatureRefreshNode,
signatureValidateNode,
signatureUseNode,
signatureResetLoopNode,
signatureResultBranch,
signatureTimerResetNode);
@@ -417,6 +435,7 @@ namespace Colosseum.Editor
object leapBranch = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, branchCompositeType, new Vector2(branchX, startY + stepY * 5f));
AttachPatternReadyCondition(leapBranch, mobilityPattern, authoringAssembly);
AttachConditionWithValue(leapBranch, typeof(IsTargetBeyondDistanceCondition), "MinDistance", DefaultLeapTargetMinDistance, authoringAssembly);
AttachConditionWithValue(leapBranch, typeof(IsBasicLoopCountAtLeastCondition), "Count", DefaultBasicLoopRequirementBeforeBigPattern, authoringAssembly);
SetBranchRequiresAll(leapBranch, true);
object leapSequence = CreateNode(
@@ -432,12 +451,14 @@ namespace Colosseum.Editor
object leapValidateNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(ValidateTargetAction), new Vector2(actionX2, startY + stepY * 5f));
object leapUseNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(UsePatternByRoleAction), new Vector2(actionX3, startY + stepY * 5f));
SetNodeFieldValue(leapUseNode, "Pattern", mobilityPattern, setFieldValueMethod);
ConnectChildren(graphAsset, connectEdgeMethod, leapSequence, leapSelectNode, leapValidateNode, leapUseNode);
object leapResetLoopNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(ResetBasicLoopCountAction), new Vector2(actionX4, startY + stepY * 5f));
ConnectChildren(graphAsset, connectEdgeMethod, leapSequence, leapSelectNode, leapValidateNode, leapUseNode, leapResetLoopNode);
object groundShakeBranch = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, branchCompositeType, new Vector2(branchX, startY + stepY * 6f));
AttachConditionWithValue(groundShakeBranch, typeof(IsCurrentPhaseCondition), "Phase", 2, authoringAssembly);
AttachConditionWithValue(groundShakeBranch, typeof(IsPhaseElapsedTimeAboveCondition), "Seconds", DefaultGroundShakeInterval, authoringAssembly);
AttachPatternReadyCondition(groundShakeBranch, groundShakePattern, authoringAssembly);
AttachConditionWithValue(groundShakeBranch, typeof(IsBasicLoopCountAtLeastCondition), "Count", DefaultBasicLoopRequirementBeforeBigPattern, authoringAssembly);
SetBranchRequiresAll(groundShakeBranch, true);
object groundShakeSequence = CreateNode(
@@ -451,10 +472,11 @@ namespace Colosseum.Editor
object groundShakeValidateNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(ValidateTargetAction), new Vector2(actionX2, startY + stepY * 6f));
object groundShakeUseNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(UsePatternByRoleAction), new Vector2(actionX3, startY + stepY * 6f));
SetNodeFieldValue(groundShakeUseNode, "Pattern", groundShakePattern, setFieldValueMethod);
object groundShakeResetLoopNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(ResetBasicLoopCountAction), new Vector2(actionX4 - 180f, startY + stepY * 6f));
object groundShakeTimerResetNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(SetBossPhaseAction), new Vector2(actionX4, startY + stepY * 6f));
SetNodeFieldValue(groundShakeTimerResetNode, "TargetPhase", 2, setFieldValueMethod);
SetNodeFieldValue(groundShakeTimerResetNode, "ResetTimer", true, setFieldValueMethod);
ConnectChildren(graphAsset, connectEdgeMethod, groundShakeSequence, groundShakeRefreshNode, groundShakeValidateNode, groundShakeUseNode, groundShakeTimerResetNode);
ConnectChildren(graphAsset, connectEdgeMethod, groundShakeSequence, groundShakeRefreshNode, groundShakeValidateNode, groundShakeUseNode, groundShakeResetLoopNode, groundShakeTimerResetNode);
object meleeBranch = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, branchCompositeType, new Vector2(branchX, startY + stepY * 7f));
object meleeRangeCondModel = AttachCondition(meleeBranch, typeof(IsTargetInAttackRangeCondition), authoringAssembly);
@@ -475,7 +497,9 @@ namespace Colosseum.Editor
object meleeValidateNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(ValidateTargetAction), new Vector2(actionX1, startY + stepY * 7f));
object meleeUseNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(UseWeightedReadyPatternAction), new Vector2(actionX2, startY + stepY * 7f));
SetWeightedPatternFields(meleeUseNode, setFieldValueMethod, comboPattern, DefaultComboPatternWeight, pressurePattern, DefaultPressurePatternWeight, primaryPattern, DefaultPrimaryPatternWeight, secondaryPattern, DefaultSecondaryPatternWeight, tertiaryPattern, DefaultTertiaryPatternWeight);
ConnectChildren(graphAsset, connectEdgeMethod, meleeSequence, meleeValidateNode, meleeUseNode);
object meleeIncrementLoopNode = CreateNode(graphAsset, createNodeMethod, getNodeInfoMethod, typeof(IncrementBasicLoopCountAction), new Vector2(actionX3, startY + stepY * 7f));
SetNodeFieldValue(meleeIncrementLoopNode, "Count", 1, setFieldValueMethod);
ConnectChildren(graphAsset, connectEdgeMethod, meleeSequence, meleeValidateNode, meleeUseNode, meleeIncrementLoopNode);
object chaseSequence = CreateNode(
graphAsset,
@@ -819,6 +843,17 @@ namespace Colosseum.Editor
}
}
private static void ConfigureSignatureFailureNode(object nodeModel, AbnormalityData failureAbnormality, MethodInfo setFieldValueMethod)
{
SetNodeFieldValue(nodeModel, "FailureDamage", DefaultSignatureFailureDamage, setFieldValueMethod);
SetNodeFieldValue(nodeModel, "FailureAbnormality", failureAbnormality, setFieldValueMethod);
SetNodeFieldValue(nodeModel, "KnockbackRadius", DefaultSignatureFailureKnockbackRadius, setFieldValueMethod);
SetNodeFieldValue(nodeModel, "DownRadius", DefaultSignatureFailureDownRadius, setFieldValueMethod);
SetNodeFieldValue(nodeModel, "KnockbackSpeed", DefaultSignatureFailureKnockbackSpeed, setFieldValueMethod);
SetNodeFieldValue(nodeModel, "KnockbackDuration", DefaultSignatureFailureKnockbackDuration, setFieldValueMethod);
SetNodeFieldValue(nodeModel, "DownDuration", DefaultSignatureFailureDownDuration, setFieldValueMethod);
}
private static object CreateNode(UnityEngine.Object graphAsset, MethodInfo createNodeMethod, MethodInfo getNodeInfoMethod, Type runtimeType, Vector2 position)
{
if (runtimeType == null)

View File

@@ -8,7 +8,6 @@ using Colosseum.Skills;
using Unity.Behavior;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.Serialization;
namespace Colosseum.Enemy
{
@@ -44,42 +43,9 @@ namespace Colosseum.Enemy
[SerializeField] protected BehaviorGraphAgent behaviorGraphAgent;
[Header("Pattern Flow")]
[Tooltip("대형 패턴(시그니처/기동/조합) 직후 기본 패턴 최소 순환 횟수")]
[Min(0)] [SerializeField] protected int basicLoopMinCountAfterBigPattern = 2;
[Tooltip("패턴 하나가 끝난 뒤 다음 패턴을 시작하기까지의 공통 텀")]
[Min(0f)] [SerializeField] protected float commonPatternInterval = 0.35f;
[Header("시그니처 효과 설정")]
[Tooltip("시그니처 패턴 차단에 필요한 누적 피해 비율")]
[Range(0f, 1f)] [SerializeField] protected float signatureRequiredDamageRatio = 0.1f;
[Tooltip("시그니처 준비 상태를 나타내는 이상상태")]
[SerializeField] protected AbnormalityData signatureTelegraphAbnormality;
[Tooltip("시그니처 차단 성공 시 보스가 멈추는 시간")]
[Min(0f)] [SerializeField] protected float signatureSuccessStaggerDuration = 2f;
[Tooltip("시그니처 실패 시 모든 플레이어에게 적용할 디버프")]
[SerializeField] protected AbnormalityData signatureFailureAbnormality;
[Tooltip("시그니처 실패 시 모든 플레이어에게 주는 기본 피해")]
[Min(0f)] [SerializeField] protected float signatureFailureDamage = 40f;
[Tooltip("시그니처 실패 시 넉백이 적용되는 반경")]
[Min(0f)] [SerializeField] protected float signatureFailureKnockbackRadius = 8f;
[Tooltip("시그니처 실패 시 다운이 적용되는 반경")]
[Min(0f)] [SerializeField] protected float signatureFailureDownRadius = 3f;
[Tooltip("시그니처 실패 시 넉백 속도")]
[Min(0f)] [SerializeField] protected float signatureFailureKnockbackSpeed = 12f;
[Tooltip("시그니처 실패 시 넉백 지속 시간")]
[Min(0f)] [SerializeField] protected float signatureFailureKnockbackDuration = 0.35f;
[Tooltip("시그니처 실패 시 다운 지속 시간")]
[Min(0f)] [SerializeField] protected float signatureFailureDownDuration = 2f;
[Header("Phase State")]
[Tooltip("BT가 관리하는 최대 페이즈 수")]
[Min(1)] [SerializeField] protected int maxPatternPhase = 3;
@@ -123,7 +89,7 @@ namespace Colosseum.Enemy
public float PhaseElapsedTime => Time.time - currentPhaseStartTime;
/// <summary>
/// 마지막 대형 패턴 이후 누적된 기본 루프 횟수
/// 마지막 대형/징벌 패턴 이후 누적된 기본 루프 횟수
/// </summary>
public int BasicLoopCountSinceLastBigPattern => basicLoopCountSinceLastBigPattern;
@@ -152,41 +118,6 @@ namespace Colosseum.Enemy
/// </summary>
public bool DebugModeEnabled => debugMode;
/// <summary>
/// 시그니처 실패 시 모든 플레이어에게 주는 기본 피해
/// </summary>
public float SignatureFailureDamage => signatureFailureDamage;
/// <summary>
/// 시그니처 실패 시 모든 플레이어에게 적용할 디버프
/// </summary>
public AbnormalityData SignatureFailureAbnormality => signatureFailureAbnormality;
/// <summary>
/// 시그니처 실패 시 넉백이 적용되는 반경
/// </summary>
public float SignatureFailureKnockbackRadius => signatureFailureKnockbackRadius;
/// <summary>
/// 시그니처 실패 시 다운이 적용되는 반경
/// </summary>
public float SignatureFailureDownRadius => signatureFailureDownRadius;
/// <summary>
/// 시그니처 실패 시 넉백 속도
/// </summary>
public float SignatureFailureKnockbackSpeed => signatureFailureKnockbackSpeed;
/// <summary>
/// 시그니처 실패 시 넉백 지속 시간
/// </summary>
public float SignatureFailureKnockbackDuration => signatureFailureKnockbackDuration;
/// <summary>
/// 시그니처 실패 시 다운 지속 시간
/// </summary>
public float SignatureFailureDownDuration => signatureFailureDownDuration;
/// <summary>
/// 마지막 충전 차단 시 설정된 경직 시간 (BossPatternActionBase가 설정)
/// </summary>
@@ -345,24 +276,19 @@ namespace Colosseum.Enemy
&& value;
}
/// <summary>
/// 근접 패턴 사용 카운터를 갱신합니다.
/// </summary>
public void RegisterPatternUse(BossPatternData pattern)
public void IncrementBasicLoopCount(int count = 1)
{
if (pattern == null)
int appliedCount = Mathf.Max(0, count);
if (appliedCount <= 0)
return;
if (pattern.IsMelee)
{
meleePatternCounter++;
basicLoopCountSinceLastBigPattern++;
}
meleePatternCounter += appliedCount;
basicLoopCountSinceLastBigPattern += appliedCount;
}
if (pattern.Category == PatternCategory.Punish || pattern.IsBigPattern)
{
basicLoopCountSinceLastBigPattern = 0;
}
public void ResetBasicLoopCount()
{
basicLoopCountSinceLastBigPattern = 0;
}
/// <summary>
@@ -374,24 +300,6 @@ namespace Colosseum.Enemy
Debug.Log($"[{source}] {message}");
}
/// <summary>
/// 지정 패턴이 grace period를 통과했는지 반환합니다.
/// Punish/Melee/Utility는 항상 허용됩니다.
/// </summary>
public bool IsPatternGracePeriodAllowed(BossPatternData pattern)
{
if (pattern == null)
return false;
if (pattern.Category == PatternCategory.Punish)
return true;
if (pattern.IsMelee || pattern.TargetMode == TargetResolveMode.Utility)
return true;
return basicLoopCountSinceLastBigPattern >= basicLoopMinCountAfterBigPattern;
}
public bool IsPatternReady(BossPatternData pattern)
{
if (pattern == null || pattern.Steps == null || pattern.Steps.Count == 0)