feat: 젬 이상상태 및 수치형 보정 확장
- SkillGemData와 SkillLoadoutEntry를 확장해 자기 강화/적중 이상상태와 피해·회복·보호막·위협 배율을 해석하도록 정리 - SkillController와 SkillEffect 경로를 보강해 cast start 이상상태, on-hit 이상상태, 반복 시전, 출력 보정이 실제 효과에 반영되도록 연결 - 강인함/약화 테스트 젬과 자기강화/적중이상/상태복합 프리셋, 디버그 메뉴를 추가해 젬 조합 검증 경로를 보강 - 런타임에서 약화 디버프 적용, 강인함+약화 동시 적용, 파쇄/수호/도전자 보정값 해석을 확인
This commit is contained in:
@@ -2,6 +2,7 @@ using UnityEngine;
|
||||
|
||||
using Colosseum.Abnormalities;
|
||||
using Colosseum.Combat;
|
||||
using Colosseum.Skills;
|
||||
|
||||
namespace Colosseum.Skills.Effects
|
||||
{
|
||||
@@ -28,7 +29,7 @@ namespace Colosseum.Skills.Effects
|
||||
return;
|
||||
|
||||
ApplyAbnormality(target, caster);
|
||||
ApplyThreatMultiplier(target);
|
||||
ApplyThreatMultiplier(target, caster);
|
||||
}
|
||||
|
||||
private void ApplyAbnormality(GameObject target, GameObject caster)
|
||||
@@ -43,7 +44,7 @@ namespace Colosseum.Skills.Effects
|
||||
abnormalityManager.ApplyAbnormality(abnormalityData, caster);
|
||||
}
|
||||
|
||||
private void ApplyThreatMultiplier(GameObject target)
|
||||
private void ApplyThreatMultiplier(GameObject target, GameObject caster)
|
||||
{
|
||||
if (threatMultiplier <= 0f || threatMultiplierDuration <= 0f)
|
||||
return;
|
||||
@@ -54,7 +55,8 @@ namespace Colosseum.Skills.Effects
|
||||
threatController = target.AddComponent<ThreatController>();
|
||||
}
|
||||
|
||||
threatController.ApplyThreatMultiplier(threatMultiplier, threatMultiplierDuration);
|
||||
float resolvedThreatMultiplier = SkillRuntimeModifierUtility.GetThreatMultiplier(caster);
|
||||
threatController.ApplyThreatMultiplier(threatMultiplier * resolvedThreatMultiplier, threatMultiplierDuration);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ using UnityEngine;
|
||||
|
||||
using Colosseum.Stats;
|
||||
using Colosseum.Combat;
|
||||
using Colosseum.Skills;
|
||||
using Colosseum.Weapons;
|
||||
|
||||
namespace Colosseum.Skills.Effects
|
||||
@@ -73,7 +74,8 @@ namespace Colosseum.Skills.Effects
|
||||
|
||||
// 무기 데미지 배율 적용
|
||||
float damageMultiplier = GetDamageMultiplier(caster);
|
||||
return baseTotal * damageMultiplier;
|
||||
float gemMultiplier = SkillRuntimeModifierUtility.GetDamageMultiplier(caster);
|
||||
return baseTotal * damageMultiplier * gemMultiplier;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -2,6 +2,7 @@ using UnityEngine;
|
||||
|
||||
using Colosseum.Stats;
|
||||
using Colosseum.Combat;
|
||||
using Colosseum.Skills;
|
||||
|
||||
namespace Colosseum.Skills.Effects
|
||||
{
|
||||
@@ -41,10 +42,11 @@ namespace Colosseum.Skills.Effects
|
||||
var stats = caster.GetComponent<CharacterStats>();
|
||||
if (stats == null)
|
||||
{
|
||||
return baseHeal;
|
||||
return baseHeal * SkillRuntimeModifierUtility.GetHealMultiplier(caster);
|
||||
}
|
||||
|
||||
return baseHeal + (stats.HealPower * healScaling);
|
||||
float resolvedHeal = baseHeal + (stats.HealPower * healScaling);
|
||||
return resolvedHeal * SkillRuntimeModifierUtility.GetHealMultiplier(caster);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ using Colosseum.Enemy;
|
||||
using Colosseum.Player;
|
||||
using Colosseum.Stats;
|
||||
using Colosseum.Combat;
|
||||
using Colosseum.Skills;
|
||||
|
||||
namespace Colosseum.Skills.Effects
|
||||
{
|
||||
@@ -55,9 +56,10 @@ namespace Colosseum.Skills.Effects
|
||||
{
|
||||
CharacterStats stats = caster != null ? caster.GetComponent<CharacterStats>() : null;
|
||||
if (stats == null)
|
||||
return baseShield;
|
||||
return baseShield * SkillRuntimeModifierUtility.GetShieldMultiplier(caster);
|
||||
|
||||
return baseShield + (stats.HealPower * shieldScaling);
|
||||
float resolvedShield = baseShield + (stats.HealPower * shieldScaling);
|
||||
return resolvedShield * SkillRuntimeModifierUtility.GetShieldMultiplier(caster);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using UnityEngine;
|
||||
|
||||
using Colosseum.Combat;
|
||||
using Colosseum.Enemy;
|
||||
using Colosseum.Skills;
|
||||
|
||||
namespace Colosseum.Skills.Effects
|
||||
{
|
||||
@@ -62,13 +63,14 @@ namespace Colosseum.Skills.Effects
|
||||
if (selfThreatMultiplier <= 0f || selfThreatMultiplierDuration <= 0f)
|
||||
return;
|
||||
|
||||
float resolvedThreatMultiplier = SkillRuntimeModifierUtility.GetThreatMultiplier(caster);
|
||||
ThreatController threatController = caster.GetComponent<ThreatController>();
|
||||
if (threatController == null)
|
||||
{
|
||||
threatController = caster.AddComponent<ThreatController>();
|
||||
}
|
||||
|
||||
threatController.ApplyThreatMultiplier(selfThreatMultiplier, selfThreatMultiplierDuration);
|
||||
threatController.ApplyThreatMultiplier(selfThreatMultiplier * resolvedThreatMultiplier, selfThreatMultiplierDuration);
|
||||
}
|
||||
|
||||
private void ApplyTauntThreat(EnemyBase enemy, GameObject caster)
|
||||
@@ -76,11 +78,14 @@ namespace Colosseum.Skills.Effects
|
||||
if (enemy == null || caster == null || !enemy.UseThreatSystem)
|
||||
return;
|
||||
|
||||
float resolvedThreatMultiplier = SkillRuntimeModifierUtility.GetThreatMultiplier(caster);
|
||||
GameObject highestThreatTarget = enemy.GetHighestThreatTarget();
|
||||
float highestThreat = highestThreatTarget != null ? enemy.GetThreat(highestThreatTarget) : 0f;
|
||||
float currentCasterThreat = enemy.GetThreat(caster);
|
||||
|
||||
float desiredThreat = Mathf.Max(currentCasterThreat + flatThreatAmount, highestThreat + threatLeadBonus + flatThreatAmount);
|
||||
float resolvedFlatThreat = flatThreatAmount * resolvedThreatMultiplier;
|
||||
float resolvedLeadBonus = threatLeadBonus * resolvedThreatMultiplier;
|
||||
float desiredThreat = Mathf.Max(currentCasterThreat + resolvedFlatThreat, highestThreat + resolvedLeadBonus + resolvedFlatThreat);
|
||||
enemy.SetThreat(caster, desiredThreat);
|
||||
CombatBalanceTracker.RecordThreat(caster, Mathf.Max(0f, desiredThreat - currentCasterThreat));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using UnityEngine;
|
||||
|
||||
using Colosseum.Combat;
|
||||
using Colosseum.Skills;
|
||||
|
||||
namespace Colosseum.Skills.Effects
|
||||
{
|
||||
@@ -28,7 +29,8 @@ namespace Colosseum.Skills.Effects
|
||||
threatController = target.AddComponent<ThreatController>();
|
||||
}
|
||||
|
||||
threatController.ApplyThreatMultiplier(threatMultiplier, duration);
|
||||
float resolvedThreatMultiplier = SkillRuntimeModifierUtility.GetThreatMultiplier(caster);
|
||||
threatController.ApplyThreatMultiplier(threatMultiplier * resolvedThreatMultiplier, duration);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,14 +51,32 @@ namespace Colosseum.Skills
|
||||
/// </summary>
|
||||
public void ExecuteOnCast(GameObject caster)
|
||||
{
|
||||
List<GameObject> targets = new List<GameObject>();
|
||||
CollectTargets(caster, targets);
|
||||
|
||||
for (int i = 0; i < targets.Count; i++)
|
||||
{
|
||||
ApplyEffect(caster, targets[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 현재 효과가 영향을 줄 대상 목록을 수집합니다.
|
||||
/// 젬의 적중 이상상태 적용 등에서 동일한 타겟 해석을 재사용하기 위한 경로입니다.
|
||||
/// </summary>
|
||||
public void CollectTargets(GameObject caster, List<GameObject> destination)
|
||||
{
|
||||
if (caster == null || destination == null)
|
||||
return;
|
||||
|
||||
switch (targetType)
|
||||
{
|
||||
case TargetType.Self:
|
||||
ApplyEffect(caster, caster);
|
||||
AddUniqueTarget(destination, caster);
|
||||
break;
|
||||
|
||||
case TargetType.Area:
|
||||
ExecuteArea(caster);
|
||||
CollectAreaTargets(caster, destination);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -110,17 +128,14 @@ namespace Colosseum.Skills
|
||||
};
|
||||
}
|
||||
|
||||
private void ExecuteArea(GameObject caster)
|
||||
private void CollectAreaTargets(GameObject caster, List<GameObject> destination)
|
||||
{
|
||||
Vector3 center = GetAreaCenter(caster);
|
||||
Collider[] hits = Physics.OverlapSphere(center, Mathf.Max(areaRadius, fanRadius), targetLayers);
|
||||
// 같은 GameObject가 여러 콜라이더를 가질 수 있으므로 중복 제거
|
||||
HashSet<GameObject> processedTargets = new HashSet<GameObject>();
|
||||
foreach (var hit in hits)
|
||||
{
|
||||
if (!includeCasterInArea && hit.gameObject == caster) continue;
|
||||
if (!IsCorrectTeam(caster, hit.gameObject)) continue;
|
||||
if (processedTargets.Contains(hit.gameObject)) continue;
|
||||
// 부채꼴 판정
|
||||
if (areaShape == AreaShapeType.Fan)
|
||||
{
|
||||
@@ -128,11 +143,18 @@ namespace Colosseum.Skills
|
||||
continue;
|
||||
}
|
||||
|
||||
processedTargets.Add(hit.gameObject);
|
||||
ApplyEffect(caster, hit.gameObject);
|
||||
AddUniqueTarget(destination, hit.gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddUniqueTarget(List<GameObject> destination, GameObject target)
|
||||
{
|
||||
if (target == null || destination.Contains(target))
|
||||
return;
|
||||
|
||||
destination.Add(target);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 타겟이 부채꼴 범위 내에 있는지 확인
|
||||
/// </summary>
|
||||
|
||||
@@ -3,6 +3,8 @@ using System.Collections.Generic;
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
using Colosseum.Abnormalities;
|
||||
|
||||
namespace Colosseum.Skills
|
||||
{
|
||||
/// <summary>
|
||||
@@ -34,6 +36,21 @@ namespace Colosseum.Skills
|
||||
public IReadOnlyList<SkillEffect> Effects => effects;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 젬이 적중 대상에게 부여할 이상상태 목록입니다.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class SkillGemTriggeredAbnormalityEntry
|
||||
{
|
||||
[Tooltip("OnEffect(index)와 매칭되는 애니메이션 이벤트 인덱스")]
|
||||
[Min(0)] [SerializeField] private int triggerIndex = 0;
|
||||
[Tooltip("해당 인덱스에서 적중 대상에게 부여할 이상상태")]
|
||||
[SerializeField] private List<AbnormalityData> abnormalities = new();
|
||||
|
||||
public int TriggerIndex => triggerIndex;
|
||||
public IReadOnlyList<AbnormalityData> Abnormalities => abnormalities;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 스킬의 기반 효과 위에 추가 동작을 덧붙이는 젬 데이터입니다.
|
||||
/// </summary>
|
||||
@@ -55,6 +72,14 @@ namespace Colosseum.Skills
|
||||
[Min(0f)] [SerializeField] private float cooldownMultiplier = 1f;
|
||||
[Tooltip("장착 시 스킬 애니메이션 재생 속도 배율")]
|
||||
[Min(0.1f)] [SerializeField] private float castSpeedMultiplier = 1f;
|
||||
[Tooltip("장착 시 스킬이 만드는 피해량 배율")]
|
||||
[Min(0f)] [SerializeField] private float damageMultiplier = 1f;
|
||||
[Tooltip("장착 시 스킬이 만드는 회복량 배율")]
|
||||
[Min(0f)] [SerializeField] private float healMultiplier = 1f;
|
||||
[Tooltip("장착 시 스킬이 만드는 보호막량 배율")]
|
||||
[Min(0f)] [SerializeField] private float shieldMultiplier = 1f;
|
||||
[Tooltip("장착 시 스킬이 만드는 위협량 배율")]
|
||||
[Min(0f)] [SerializeField] private float threatMultiplier = 1f;
|
||||
[Tooltip("기반 스킬 시전을 몇 회 더 반복할지 정의합니다. 현재는 계산/표시용으로만 사용됩니다.")]
|
||||
[Min(0)] [SerializeField] private int additionalRepeatCount = 0;
|
||||
|
||||
@@ -64,6 +89,12 @@ namespace Colosseum.Skills
|
||||
[Tooltip("애니메이션 이벤트 인덱스별로 발동하는 추가 효과")]
|
||||
[SerializeField] private List<SkillGemTriggeredEffectEntry> triggeredEffects = new();
|
||||
|
||||
[Header("이상상태 부여")]
|
||||
[Tooltip("스킬 사용 시 자신에게 즉시 부여할 이상상태")]
|
||||
[SerializeField] private List<AbnormalityData> selfAbnormalities = new();
|
||||
[Tooltip("애니메이션 이벤트 인덱스별로 적중 대상에게 부여할 이상상태")]
|
||||
[SerializeField] private List<SkillGemTriggeredAbnormalityEntry> onHitAbnormalities = new();
|
||||
|
||||
public string GemName => gemName;
|
||||
public string Description => description;
|
||||
public Sprite Icon => icon;
|
||||
@@ -71,8 +102,14 @@ namespace Colosseum.Skills
|
||||
public float ManaCostMultiplier => manaCostMultiplier;
|
||||
public float CooldownMultiplier => cooldownMultiplier;
|
||||
public float CastSpeedMultiplier => castSpeedMultiplier;
|
||||
public float DamageMultiplier => damageMultiplier;
|
||||
public float HealMultiplier => healMultiplier;
|
||||
public float ShieldMultiplier => shieldMultiplier;
|
||||
public float ThreatMultiplier => threatMultiplier;
|
||||
public int AdditionalRepeatCount => additionalRepeatCount;
|
||||
public IReadOnlyList<SkillEffect> CastStartEffects => castStartEffects;
|
||||
public IReadOnlyList<SkillGemTriggeredEffectEntry> TriggeredEffects => triggeredEffects;
|
||||
public IReadOnlyList<AbnormalityData> SelfAbnormalities => selfAbnormalities;
|
||||
public IReadOnlyList<SkillGemTriggeredAbnormalityEntry> OnHitAbnormalities => onHitAbnormalities;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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