refactor: 집행개시 시그니처 전용 경로를 BT 일반 패턴 스텝으로 통합
- PatternStepType.ChargeWait 및 ChargeStepData 도입으로 충전/차단 판정을 일반 패턴 스텝으로 표현 - UsePatternByRoleAction에서 IsSignature 분기 완전 제거, 일반 패턴 경로로 통합 - BossCombatBehaviorContext에서 시그니처 전용 메서드 10개 이상 제거 - BossStaggerAction(신규): 충전 차단 성공 시 보스 경직 처리 - SignatureFailureEffectsAction(신규): 차단 실패 시 범위 피해/넉백/다운 적용 - RebuildDrogBehaviorAuthoringGraph에 시그니처 Sequence + outcomeBranch 구조 추가 - 집행개시 에셋 스텝 구성을 ChargeWait(3초) → Skill으로 변경 - BossHealthBarUI 시그니처 UI 비활성화, PlayerSkillDebugMenu 디버그 메서드 제거
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
using Colosseum;
|
||||
using Colosseum.Abnormalities;
|
||||
using Colosseum.AI;
|
||||
using Colosseum.Combat;
|
||||
using Colosseum.Enemy;
|
||||
@@ -27,6 +27,7 @@ public abstract partial class BossPatternActionBase : Action
|
||||
protected SkillController skillController;
|
||||
protected BossCombatBehaviorContext combatBehaviorContext;
|
||||
protected UnityEngine.AI.NavMeshAgent navMeshAgent;
|
||||
protected AbnormalityManager abnormalityManager;
|
||||
|
||||
private BossPatternData activePattern;
|
||||
private GameObject activeTarget;
|
||||
@@ -34,6 +35,13 @@ public abstract partial class BossPatternActionBase : Action
|
||||
private bool isWaiting;
|
||||
private float waitEndTime;
|
||||
|
||||
private bool isChargeWaiting;
|
||||
private float chargeEndTime;
|
||||
private float chargeAccumulatedDamage;
|
||||
private float chargeRequiredDamage;
|
||||
private ChargeStepData activeChargeData;
|
||||
private bool chargeTelegraphApplied;
|
||||
|
||||
/// <summary>
|
||||
/// 액션 시작 시 실제로 실행할 패턴과 대상을 결정합니다.
|
||||
/// </summary>
|
||||
@@ -86,7 +94,23 @@ public abstract partial class BossPatternActionBase : Action
|
||||
if (bossEnemy.IsDead || bossEnemy.IsTransitioning)
|
||||
return Status.Failure;
|
||||
|
||||
if (isWaiting)
|
||||
if (isChargeWaiting)
|
||||
{
|
||||
if (chargeAccumulatedDamage >= chargeRequiredDamage)
|
||||
{
|
||||
EndChargeWait(broken: true);
|
||||
skillController?.CancelSkill(SkillCancelReason.Interrupt);
|
||||
LogDebug($"충전 차단 성공: 누적 {chargeAccumulatedDamage:F1} / 필요 {chargeRequiredDamage:F1}");
|
||||
CombatBalanceTracker.RecordBossEvent("집행 개시 차단 성공");
|
||||
return Status.Failure;
|
||||
}
|
||||
|
||||
if (Time.time < chargeEndTime)
|
||||
return Status.Running;
|
||||
|
||||
EndChargeWait(broken: false);
|
||||
}
|
||||
else if (isWaiting)
|
||||
{
|
||||
if (Time.time < waitEndTime)
|
||||
return Status.Running;
|
||||
@@ -132,8 +156,6 @@ public abstract partial class BossPatternActionBase : Action
|
||||
continue;
|
||||
|
||||
GameObject candidate = player.gameObject;
|
||||
if (Team.IsSameTeam(GameObject, candidate))
|
||||
continue;
|
||||
|
||||
float distance = Vector3.Distance(GameObject.transform.position, candidate.transform.position);
|
||||
if (distance > maxDistance || distance >= nearestDistance)
|
||||
@@ -164,7 +186,8 @@ public abstract partial class BossPatternActionBase : Action
|
||||
if (candidate == null || !candidate.activeInHierarchy)
|
||||
return false;
|
||||
|
||||
if (Team.IsSameTeam(GameObject, candidate))
|
||||
// 보스는 항상 적 팀이므로, 플레이어만 적대 대상으로 간주
|
||||
if (candidate.GetComponent<PlayerNetworkController>() == null)
|
||||
return false;
|
||||
|
||||
IDamageable damageable = candidate.GetComponent<IDamageable>();
|
||||
@@ -198,6 +221,12 @@ public abstract partial class BossPatternActionBase : Action
|
||||
return Status.Running;
|
||||
}
|
||||
|
||||
if (step.Type == PatternStepType.ChargeWait)
|
||||
{
|
||||
StartChargeWait(step);
|
||||
return Status.Running;
|
||||
}
|
||||
|
||||
if (step.Skill == null)
|
||||
{
|
||||
Debug.LogWarning($"[{GetType().Name}] 스킬이 비어 있는 패턴 스텝입니다: {activePattern.PatternName} / Step={currentStepIndex}");
|
||||
@@ -234,6 +263,68 @@ public abstract partial class BossPatternActionBase : Action
|
||||
return Status.Running;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 충전 대기를 시작합니다. 전조 이상상태를 부여하고 데미지 추적을 시작합니다.
|
||||
/// </summary>
|
||||
private void StartChargeWait(PatternStep step)
|
||||
{
|
||||
isChargeWaiting = true;
|
||||
activeChargeData = step.ChargeData;
|
||||
chargeEndTime = Time.time + step.Duration;
|
||||
chargeAccumulatedDamage = 0f;
|
||||
|
||||
float damageRatio = activeChargeData != null ? activeChargeData.RequiredDamageRatio : 0.1f;
|
||||
chargeRequiredDamage = bossEnemy.MaxHealth * damageRatio;
|
||||
chargeTelegraphApplied = false;
|
||||
|
||||
if (enemyBase != null)
|
||||
enemyBase.OnDamageTaken += OnChargeDamageTaken;
|
||||
|
||||
if (activeChargeData != null && activeChargeData.TelegraphAbnormality != null && abnormalityManager != null)
|
||||
{
|
||||
abnormalityManager.ApplyAbnormality(activeChargeData.TelegraphAbnormality, GameObject);
|
||||
chargeTelegraphApplied = true;
|
||||
}
|
||||
|
||||
LogDebug($"충전 대기 시작: 필요 피해={chargeRequiredDamage:F1} / 대기={step.Duration:F1}s");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 충전 대기를 종료합니다. 전조 이상상태를 제거하고 데미지 추적을 해제합니다.
|
||||
/// </summary>
|
||||
private void EndChargeWait(bool broken)
|
||||
{
|
||||
isChargeWaiting = false;
|
||||
|
||||
if (enemyBase != null)
|
||||
enemyBase.OnDamageTaken -= OnChargeDamageTaken;
|
||||
|
||||
if (chargeTelegraphApplied && abnormalityManager != null && activeChargeData != null
|
||||
&& activeChargeData.TelegraphAbnormality != null)
|
||||
{
|
||||
abnormalityManager.RemoveAbnormality(activeChargeData.TelegraphAbnormality);
|
||||
chargeTelegraphApplied = false;
|
||||
}
|
||||
|
||||
if (broken && activeChargeData != null)
|
||||
{
|
||||
combatBehaviorContext.LastChargeStaggerDuration = activeChargeData.StaggerDuration;
|
||||
}
|
||||
|
||||
activeChargeData = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 충전 중 보스가 받은 피해를 누적합니다.
|
||||
/// </summary>
|
||||
private void OnChargeDamageTaken(float damage)
|
||||
{
|
||||
if (!isChargeWaiting || damage <= 0f)
|
||||
return;
|
||||
|
||||
chargeAccumulatedDamage += damage;
|
||||
}
|
||||
|
||||
private bool IsReady()
|
||||
{
|
||||
return bossEnemy != null && enemyBase != null && skillController != null && combatBehaviorContext != null;
|
||||
@@ -255,10 +346,16 @@ public abstract partial class BossPatternActionBase : Action
|
||||
|
||||
if (navMeshAgent == null)
|
||||
navMeshAgent = GameObject.GetComponent<UnityEngine.AI.NavMeshAgent>();
|
||||
|
||||
if (abnormalityManager == null)
|
||||
abnormalityManager = GameObject.GetComponent<AbnormalityManager>();
|
||||
}
|
||||
|
||||
private void ClearRuntimeState()
|
||||
{
|
||||
if (isChargeWaiting)
|
||||
EndChargeWait(broken: false);
|
||||
|
||||
activePattern = null;
|
||||
activeTarget = null;
|
||||
currentStepIndex = 0;
|
||||
|
||||
Reference in New Issue
Block a user