feat: 젬 이상상태 및 수치형 보정 확장
- SkillGemData와 SkillLoadoutEntry를 확장해 자기 강화/적중 이상상태와 피해·회복·보호막·위협 배율을 해석하도록 정리 - SkillController와 SkillEffect 경로를 보강해 cast start 이상상태, on-hit 이상상태, 반복 시전, 출력 보정이 실제 효과에 반영되도록 연결 - 강인함/약화 테스트 젬과 자기강화/적중이상/상태복합 프리셋, 디버그 메뉴를 추가해 젬 조합 검증 경로를 보강 - 런타임에서 약화 디버프 적용, 강인함+약화 동시 적용, 파쇄/수호/도전자 보정값 해석을 확인
This commit is contained in:
@@ -2,6 +2,8 @@ using System.Collections.Generic;
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
using Colosseum.Abnormalities;
|
||||
|
||||
namespace Colosseum.Skills
|
||||
{
|
||||
/// <summary>
|
||||
@@ -156,6 +158,26 @@ namespace Colosseum.Skills
|
||||
return Mathf.Max(0.05f, resolved);
|
||||
}
|
||||
|
||||
public float GetResolvedDamageMultiplier()
|
||||
{
|
||||
return GetResolvedScalarMultiplier(gem => gem.DamageMultiplier);
|
||||
}
|
||||
|
||||
public float GetResolvedHealMultiplier()
|
||||
{
|
||||
return GetResolvedScalarMultiplier(gem => gem.HealMultiplier);
|
||||
}
|
||||
|
||||
public float GetResolvedShieldMultiplier()
|
||||
{
|
||||
return GetResolvedScalarMultiplier(gem => gem.ShieldMultiplier);
|
||||
}
|
||||
|
||||
public float GetResolvedThreatMultiplier()
|
||||
{
|
||||
return GetResolvedScalarMultiplier(gem => gem.ThreatMultiplier);
|
||||
}
|
||||
|
||||
public int GetResolvedRepeatCount()
|
||||
{
|
||||
if (baseSkill == null)
|
||||
@@ -210,6 +232,26 @@ namespace Colosseum.Skills
|
||||
}
|
||||
}
|
||||
|
||||
public void CollectCastStartAbnormalities(List<AbnormalityData> destination)
|
||||
{
|
||||
if (destination == null || socketedGems == null)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < socketedGems.Length; i++)
|
||||
{
|
||||
SkillGemData gem = socketedGems[i];
|
||||
if (gem == null || gem.SelfAbnormalities == null)
|
||||
continue;
|
||||
|
||||
for (int j = 0; j < gem.SelfAbnormalities.Count; j++)
|
||||
{
|
||||
AbnormalityData abnormality = gem.SelfAbnormalities[j];
|
||||
if (abnormality != null)
|
||||
destination.Add(abnormality);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void CollectTriggeredEffects(Dictionary<int, List<SkillEffect>> destination)
|
||||
{
|
||||
if (destination == null)
|
||||
@@ -254,6 +296,35 @@ namespace Colosseum.Skills
|
||||
}
|
||||
}
|
||||
|
||||
public void CollectTriggeredAbnormalities(Dictionary<int, List<AbnormalityData>> destination)
|
||||
{
|
||||
if (destination == null || socketedGems == null)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < socketedGems.Length; i++)
|
||||
{
|
||||
SkillGemData gem = socketedGems[i];
|
||||
if (gem == null || gem.OnHitAbnormalities == null)
|
||||
continue;
|
||||
|
||||
for (int j = 0; j < gem.OnHitAbnormalities.Count; j++)
|
||||
{
|
||||
SkillGemTriggeredAbnormalityEntry entry = gem.OnHitAbnormalities[j];
|
||||
if (entry == null || entry.Abnormalities == null)
|
||||
continue;
|
||||
|
||||
for (int k = 0; k < entry.Abnormalities.Count; k++)
|
||||
{
|
||||
AbnormalityData abnormality = entry.Abnormalities[k];
|
||||
if (abnormality == null)
|
||||
continue;
|
||||
|
||||
AddTriggeredAbnormality(destination, entry.TriggerIndex, abnormality);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddTriggeredEffect(Dictionary<int, List<SkillEffect>> destination, int triggerIndex, SkillEffect effect)
|
||||
{
|
||||
if (!destination.TryGetValue(triggerIndex, out List<SkillEffect> effectList))
|
||||
@@ -264,5 +335,75 @@ namespace Colosseum.Skills
|
||||
|
||||
effectList.Add(effect);
|
||||
}
|
||||
|
||||
private static void AddTriggeredAbnormality(Dictionary<int, List<AbnormalityData>> destination, int triggerIndex, AbnormalityData abnormality)
|
||||
{
|
||||
if (!destination.TryGetValue(triggerIndex, out List<AbnormalityData> abnormalityList))
|
||||
{
|
||||
abnormalityList = new List<AbnormalityData>();
|
||||
destination.Add(triggerIndex, abnormalityList);
|
||||
}
|
||||
|
||||
abnormalityList.Add(abnormality);
|
||||
}
|
||||
|
||||
private float GetResolvedScalarMultiplier(System.Func<SkillGemData, float> selector)
|
||||
{
|
||||
if (baseSkill == null)
|
||||
return 1f;
|
||||
|
||||
float resolved = 1f;
|
||||
if (socketedGems == null)
|
||||
return resolved;
|
||||
|
||||
for (int i = 0; i < socketedGems.Length; i++)
|
||||
{
|
||||
SkillGemData gem = socketedGems[i];
|
||||
if (gem == null)
|
||||
continue;
|
||||
|
||||
resolved *= Mathf.Max(0f, selector(gem));
|
||||
}
|
||||
|
||||
return resolved;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 현재 시전 중인 스킬 로드아웃의 젬 보정값을 안전하게 조회하는 유틸리티입니다.
|
||||
/// </summary>
|
||||
public static class SkillRuntimeModifierUtility
|
||||
{
|
||||
public static float GetDamageMultiplier(GameObject caster)
|
||||
{
|
||||
return GetCurrentLoadout(caster)?.GetResolvedDamageMultiplier() ?? 1f;
|
||||
}
|
||||
|
||||
public static float GetHealMultiplier(GameObject caster)
|
||||
{
|
||||
return GetCurrentLoadout(caster)?.GetResolvedHealMultiplier() ?? 1f;
|
||||
}
|
||||
|
||||
public static float GetShieldMultiplier(GameObject caster)
|
||||
{
|
||||
return GetCurrentLoadout(caster)?.GetResolvedShieldMultiplier() ?? 1f;
|
||||
}
|
||||
|
||||
public static float GetThreatMultiplier(GameObject caster)
|
||||
{
|
||||
return GetCurrentLoadout(caster)?.GetResolvedThreatMultiplier() ?? 1f;
|
||||
}
|
||||
|
||||
private static SkillLoadoutEntry GetCurrentLoadout(GameObject caster)
|
||||
{
|
||||
if (caster == null)
|
||||
return null;
|
||||
|
||||
SkillController skillController = caster.GetComponent<SkillController>();
|
||||
if (skillController == null)
|
||||
return null;
|
||||
|
||||
return skillController.CurrentLoadoutEntry;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user