feat: 젬 이상상태 및 수치형 보정 확장
- SkillGemData와 SkillLoadoutEntry를 확장해 자기 강화/적중 이상상태와 피해·회복·보호막·위협 배율을 해석하도록 정리 - SkillController와 SkillEffect 경로를 보강해 cast start 이상상태, on-hit 이상상태, 반복 시전, 출력 보정이 실제 효과에 반영되도록 연결 - 강인함/약화 테스트 젬과 자기강화/적중이상/상태복합 프리셋, 디버그 메뉴를 추가해 젬 조합 검증 경로를 보강 - 런타임에서 약화 디버프 적용, 강인함+약화 동시 적용, 파쇄/수호/도전자 보정값 해석을 확인
This commit is contained in:
@@ -2,6 +2,8 @@ using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using Unity.Netcode;
|
||||
|
||||
using Colosseum.Abnormalities;
|
||||
|
||||
namespace Colosseum.Skills
|
||||
{
|
||||
/// <summary>
|
||||
@@ -56,6 +58,9 @@ namespace Colosseum.Skills
|
||||
private SkillLoadoutEntry currentLoadoutEntry;
|
||||
private readonly List<SkillEffect> currentCastStartEffects = new();
|
||||
private readonly Dictionary<int, List<SkillEffect>> currentTriggeredEffects = new();
|
||||
private readonly List<AbnormalityData> currentCastStartAbnormalities = new();
|
||||
private readonly Dictionary<int, List<AbnormalityData>> currentTriggeredAbnormalities = new();
|
||||
private readonly List<GameObject> currentTriggeredTargetsBuffer = new();
|
||||
private bool waitingForEndAnimation; // EndAnimation 종료 대기 중
|
||||
private int currentRepeatCount = 1;
|
||||
private int currentIterationIndex = 0;
|
||||
@@ -198,7 +203,7 @@ namespace Colosseum.Skills
|
||||
/// </summary>
|
||||
private void TriggerCastStartEffects()
|
||||
{
|
||||
if (currentSkill == null || currentCastStartEffects.Count == 0)
|
||||
if (currentSkill == null)
|
||||
return;
|
||||
|
||||
if (NetworkManager.Singleton != null && !NetworkManager.Singleton.IsServer)
|
||||
@@ -213,6 +218,26 @@ namespace Colosseum.Skills
|
||||
if (debugMode) Debug.Log($"[Skill] Cast start effect: {effect.name} (index {i})");
|
||||
effect.ExecuteOnCast(gameObject);
|
||||
}
|
||||
|
||||
if (currentCastStartAbnormalities.Count <= 0)
|
||||
return;
|
||||
|
||||
AbnormalityManager abnormalityManager = GetComponent<AbnormalityManager>();
|
||||
if (abnormalityManager == null)
|
||||
{
|
||||
if (debugMode) Debug.LogWarning("[Skill] Cast start abnormality skipped - no AbnormalityManager");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < currentCastStartAbnormalities.Count; i++)
|
||||
{
|
||||
AbnormalityData abnormality = currentCastStartAbnormalities[i];
|
||||
if (abnormality == null)
|
||||
continue;
|
||||
|
||||
if (debugMode) Debug.Log($"[Skill] Cast start abnormality: {abnormality.abnormalityName} (index {i})");
|
||||
abnormalityManager.ApplyAbnormality(abnormality, gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -251,12 +276,16 @@ namespace Colosseum.Skills
|
||||
{
|
||||
currentCastStartEffects.Clear();
|
||||
currentTriggeredEffects.Clear();
|
||||
currentCastStartAbnormalities.Clear();
|
||||
currentTriggeredAbnormalities.Clear();
|
||||
|
||||
if (loadoutEntry == null)
|
||||
return;
|
||||
|
||||
loadoutEntry.CollectCastStartEffects(currentCastStartEffects);
|
||||
loadoutEntry.CollectTriggeredEffects(currentTriggeredEffects);
|
||||
loadoutEntry.CollectCastStartAbnormalities(currentCastStartAbnormalities);
|
||||
loadoutEntry.CollectTriggeredAbnormalities(currentTriggeredAbnormalities);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -450,6 +479,8 @@ namespace Colosseum.Skills
|
||||
|
||||
effect.ExecuteOnCast(gameObject);
|
||||
}
|
||||
|
||||
ApplyTriggeredAbnormalities(index, effects);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -529,9 +560,72 @@ namespace Colosseum.Skills
|
||||
currentLoadoutEntry = null;
|
||||
currentCastStartEffects.Clear();
|
||||
currentTriggeredEffects.Clear();
|
||||
currentCastStartAbnormalities.Clear();
|
||||
currentTriggeredAbnormalities.Clear();
|
||||
currentTriggeredTargetsBuffer.Clear();
|
||||
waitingForEndAnimation = false;
|
||||
currentRepeatCount = 1;
|
||||
currentIterationIndex = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 현재 트리거 인덱스에 연결된 젬 이상상태를 적중 대상에게 적용합니다.
|
||||
/// </summary>
|
||||
private void ApplyTriggeredAbnormalities(int index, List<SkillEffect> referenceEffects)
|
||||
{
|
||||
if (!currentTriggeredAbnormalities.TryGetValue(index, out List<AbnormalityData> abnormalities) ||
|
||||
abnormalities == null ||
|
||||
abnormalities.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
currentTriggeredTargetsBuffer.Clear();
|
||||
|
||||
for (int i = 0; i < referenceEffects.Count; i++)
|
||||
{
|
||||
SkillEffect effect = referenceEffects[i];
|
||||
if (effect == null || effect.TargetType == TargetType.Self)
|
||||
continue;
|
||||
|
||||
effect.CollectTargets(gameObject, currentTriggeredTargetsBuffer);
|
||||
}
|
||||
|
||||
if (currentTriggeredTargetsBuffer.Count == 0)
|
||||
{
|
||||
if (debugMode)
|
||||
{
|
||||
Debug.LogWarning($"[Skill] Trigger abnormality skipped - no hit target resolved for index {index}");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < currentTriggeredTargetsBuffer.Count; i++)
|
||||
{
|
||||
GameObject target = currentTriggeredTargetsBuffer[i];
|
||||
if (target == null)
|
||||
continue;
|
||||
|
||||
AbnormalityManager abnormalityManager = target.GetComponent<AbnormalityManager>();
|
||||
if (abnormalityManager == null)
|
||||
continue;
|
||||
|
||||
for (int j = 0; j < abnormalities.Count; j++)
|
||||
{
|
||||
AbnormalityData abnormality = abnormalities[j];
|
||||
if (abnormality == null)
|
||||
continue;
|
||||
|
||||
if (debugMode)
|
||||
{
|
||||
Debug.Log($"[Skill] Trigger abnormality: {abnormality.abnormalityName} -> {target.name} (index {index})");
|
||||
}
|
||||
|
||||
abnormalityManager.ApplyAbnormality(abnormality, gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
currentTriggeredTargetsBuffer.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user