feat: 드로그 기본 루프 게이트를 BT로 이관
- big pattern grace period 판정을 런타임 헬퍼에서 제거하고 BT 조건/액션 노드로 명시 - Increment/Reset Basic Loop Count 노드 추가 및 BT_Drog 재빌드 반영 - Signature Failure Effects 수치를 BT 노드가 직접 보관하도록 정리
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 76e508fdc9d7c8f7b9e370e453cee0fc
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5d0e0a2108f1cde06af0c597cfb2b81c
|
||||
@@ -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++)
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user