- ThreatUtility: 공통 위협 생성 유틸리티 (OverlapSphere 기반 반경 내 적 탐색) - OverlapSphereNonAlloc 버퍼 32→256 확장으로 씬 콜라이더 누락 수정 - 위협 배율 체인: SkillGem × ThreatController × Passive - HealEffect: flatThreat + (actualHeal × threatPercent) 공식 적용 - ShieldEffect: flatThreat + (actualShield × threatPercent) 공식 적용 - AbnormalityEffect: flatThreat 고정 위협 생성 - EditMode 유닛 테스트 9/9 통과 (SupportThreatTests) - 테스트 씬 UI 레이아웃 수정 사항 포함
54 lines
1.8 KiB
C#
54 lines
1.8 KiB
C#
using UnityEngine;
|
|
|
|
using Colosseum.Abnormalities;
|
|
using Colosseum.Combat;
|
|
using Colosseum.Skills;
|
|
|
|
namespace Colosseum.Skills.Effects
|
|
{
|
|
/// <summary>
|
|
/// 이상 상태 효과.
|
|
/// AbnormalityManager를 통해 대상에게 이상 상태를 적용하며,
|
|
/// 버프 적용 시 적에게 위협을 생성할 수 있습니다.
|
|
/// </summary>
|
|
[CreateAssetMenu(fileName = "AbnormalityEffect", menuName = "Colosseum/Skills/Effects/Abnormality")]
|
|
public class AbnormalityEffect : SkillEffect
|
|
{
|
|
[Header("Abnormality")]
|
|
[Tooltip("적용할 이상 상태 데이터")]
|
|
[SerializeField] private AbnormalityData abnormalityData;
|
|
|
|
[Header("Threat")]
|
|
[Tooltip("버프 적용 시 생성할 고정 위협 수치")]
|
|
[Min(0f)] [SerializeField] private float flatThreatAmount = 5f;
|
|
[Tooltip("위협을 생성할 반경 (시전자 기준)")]
|
|
[Min(0f)] [SerializeField] private float threatRadius = 50f;
|
|
|
|
protected override void ApplyEffect(GameObject caster, GameObject target)
|
|
{
|
|
if (target == null) return;
|
|
|
|
if (abnormalityData == null) return;
|
|
|
|
var abnormalityManager = target.GetComponent<AbnormalityManager>();
|
|
if (abnormalityManager == null) return;
|
|
|
|
abnormalityManager.ApplyAbnormality(abnormalityData, caster);
|
|
|
|
// 위협 생성: 고정 수치
|
|
if (flatThreatAmount > 0f)
|
|
{
|
|
ThreatUtility.GenerateThreatOnNearbyEnemies(caster, flatThreatAmount, threatRadius);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 이상 상태 데이터 설정 (런타임용)
|
|
/// </summary>
|
|
public void SetAbnormalityData(AbnormalityData data)
|
|
{
|
|
abnormalityData = data;
|
|
}
|
|
}
|
|
}
|