using System; using System.Collections.Generic; using UnityEngine; using Colosseum.Stats; namespace Colosseum.Abnormalities { /// /// 제어 효과 타입 /// public enum ControlType { None, // 제어 효과 없음 Stun, // 기절 (이동, 스킬 사용 불가) Silence, // 침묵 (스킬 사용 불가) Slow, // 둔화 (이동 속도 감소) Invincible // 무적 (대미지 무시) } /// /// 스탯 수정자 엔트리 /// [Serializable] public class AbnormalityStatModifier { [Tooltip("수정할 스탯 타입")] public StatType statType; [Tooltip("수정값")] public float value; [Tooltip("수정 타입 (Flat: 고정값, PercentAdd: 퍼센트 합산, PercentMult: 퍼센트 곱셈)")] public StatModType modType; public AbnormalityStatModifier() { } public AbnormalityStatModifier(StatType statType, float value, StatModType modType) { this.statType = statType; this.value = value; this.modType = modType; } } /// /// 이상 상태 정의 ScriptableObject /// 버프/디버프의 데이터를 정의합니다. /// [CreateAssetMenu(fileName = "AbnormalityData", menuName = "Colosseum/Abnormalities/Abnormality")] public class AbnormalityData : ScriptableObject { [Header("기본 정보")] [Tooltip("이상 상태 이름")] public string abnormalityName = "Abnormality"; [Tooltip("아이콘")] public Sprite icon; [Tooltip("지속 시간 (초, 0 이하면 영구)")] public float duration = 5f; [Tooltip("효과 레벨 (중복 처리용, 높으면 우선)")] public int level = 1; [Tooltip("디버프 여부")] public bool isDebuff = false; [Tooltip("플레이어 HUD의 이상상태 UI에 표시할지 여부")] public bool showInUI = true; [Tooltip("활성 중에는 일반 피격 반응(경직, 넉백, 다운)을 무시할지 여부")] public bool ignoreHitReaction = false; [Header("스탯 수정자")] [Tooltip("스탯에 적용할 수정자 목록")] public List statModifiers = new List(); [Header("주기적 효과 (DoT/HoT)")] [Tooltip("주기적 효과 간격 (초, 0이면 비활성)")] public float periodicInterval = 0f; [Tooltip("주기적 효과값 (양수=힐, 음수=데미지)")] public float periodicValue = 0f; [Header("제어 효과 (CC)")] [Tooltip("제어 효과 타입")] public ControlType controlType = ControlType.None; [Tooltip("둔화 배율 (Slow일 때, 0.5 = 50% 감소)")] [Range(0f, 1f)] public float slowMultiplier = 0.5f; [Header("피해 배율")] [Tooltip("이상 상태가 적용된 동안 받는 피해 배율 (1 = 기본, 1.1 = 10% 증가)")] [Min(0f)] public float incomingDamageMultiplier = 1f; /// /// 영구 효과인지 확인 /// public bool IsPermanent => duration <= 0f; /// /// 주기적 효과가 있는지 확인 /// public bool HasPeriodicEffect => periodicInterval > 0f && periodicValue != 0f; /// /// 제어 효과가 있는지 확인 /// public bool HasControlEffect => controlType != ControlType.None; /// /// 받는 피해 배율 변경 여부 /// public bool HasIncomingDamageModifier => !Mathf.Approximately(incomingDamageMultiplier, 1f); } }