[Abnormality] 이상 상태 시스템 구현
- 이상 상태 데이터 (버프/디버프) ScriptableObject 정의 - 런타임임 활성 이상 상태 관리 (ActiveAbnormality) - 캐릭터터별 AbnormalityManager 컴포넌트로 이상 상태 적용/제거 - 스킬 효과(AbnormalityEffect)로 스킬에 이상 상태 연동 - UI 슬롯 및 목록 표시 구현 (버프/디버프 구분) - 테스트 코드 및 씬 설정 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
46
Assets/Scripts/Skills/Effects/AbnormalityEffect.cs
Normal file
46
Assets/Scripts/Skills/Effects/AbnormalityEffect.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using UnityEngine;
|
||||
using Colosseum.Abnormalities;
|
||||
|
||||
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;
|
||||
|
||||
protected override void ApplyEffect(GameObject caster, GameObject target)
|
||||
{
|
||||
if (target == null) return;
|
||||
|
||||
if (abnormalityData == null)
|
||||
{
|
||||
Debug.LogWarning($"[AbnormalityEffect] AbnormalityData is not assigned");
|
||||
return;
|
||||
}
|
||||
|
||||
var abnormalityManager = target.GetComponent<AbnormalityManager>();
|
||||
if (abnormalityManager == null)
|
||||
{
|
||||
Debug.LogWarning($"[AbnormalityEffect] Target {target.name} has no AbnormalityManager");
|
||||
return;
|
||||
}
|
||||
|
||||
abnormalityManager.ApplyAbnormality(abnormalityData, caster);
|
||||
Debug.Log($"[AbnormalityEffect] Applied {abnormalityData.abnormalityName} to {target.name} from {caster?.name ?? "unknown"}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 이상 상태 데이터 설정 (런타임용)
|
||||
/// </summary>
|
||||
public void SetAbnormalityData(AbnormalityData data)
|
||||
{
|
||||
abnormalityData = data;
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Skills/Effects/AbnormalityEffect.cs.meta
Normal file
2
Assets/Scripts/Skills/Effects/AbnormalityEffect.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bf750718c64c4bd48af905d2927351de
|
||||
@@ -1,32 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Colosseum.Skills.Effects
|
||||
{
|
||||
/// <summary>
|
||||
/// 버프/디버프 효과
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "BuffEffect", menuName = "Colosseum/Skills/Effects/Buff")]
|
||||
public class BuffEffect : SkillEffect
|
||||
{
|
||||
[Header("Buff Settings")]
|
||||
[SerializeField] private string buffName = "Buff";
|
||||
[Min(0f)] [SerializeField] private float duration = 5f;
|
||||
|
||||
[Header("Stat Modifiers")]
|
||||
[Range(0f, 10f)] [SerializeField] private float moveSpeedMultiplier = 1f;
|
||||
[Range(0f, 10f)] [SerializeField] private float attackPowerMultiplier = 1f;
|
||||
[Range(0f, 10f)] [SerializeField] private float defenseMultiplier = 1f;
|
||||
|
||||
protected override void ApplyEffect(GameObject caster, GameObject target)
|
||||
{
|
||||
if (target == null) return;
|
||||
|
||||
// TODO: 실제 버프 시스템 연동
|
||||
// var buffSystem = target.GetComponent<BuffSystem>();
|
||||
// buffSystem?.ApplyBuff(new BuffData(buffName, duration, moveSpeedMultiplier, attackPowerMultiplier, defenseMultiplier));
|
||||
|
||||
Debug.Log($"[Buff] {buffName} on {target.name} for {duration}s " +
|
||||
$"(Speed: {moveSpeedMultiplier}x, ATK: {attackPowerMultiplier}x, DEF: {defenseMultiplier}x)");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 32bab3b586da0d7469f63e03f18ee29f
|
||||
Reference in New Issue
Block a user