Files
Colosseum/Assets/_Game/Scripts/Skills/Effects/HealEffect.cs
dal4segno c265f980db chore: Assets 디렉토리 구조 정리 및 네이밍 컨벤션 적용
- Assets/_Game/ 하위로 게임 에셋 통합
- External/ 패키지 벤더별 분류 (Synty, Animations, UI)
- 에셋 네이밍 컨벤션 확립 및 적용
  (Data_Skill_, Data_SkillEffect_, Prefab_, Anim_, Model_, BT_ 등)
- pre-commit hook으로 네이밍 컨벤션 자동 검사 추가
- RESTRUCTURE_CHECKLIST.md 작성

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 19:08:27 +09:00

50 lines
1.4 KiB
C#

using UnityEngine;
using Colosseum.Stats;
using Colosseum.Combat;
namespace Colosseum.Skills.Effects
{
/// <summary>
/// 치료 효과
/// </summary>
[CreateAssetMenu(fileName = "HealEffect", menuName = "Colosseum/Skills/Effects/Heal")]
public class HealEffect : SkillEffect
{
[Header("Heal Settings")]
[Min(0f)] [SerializeField] private float baseHeal = 10f;
[Tooltip("회복력 계수 (1.0 = 100%)")]
[Min(0f)] [SerializeField] private float healScaling = 1f;
protected override void ApplyEffect(GameObject caster, GameObject target)
{
if (target == null) return;
// 회복량 계산
float totalHeal = CalculateHeal(caster);
// 타겟에 회복 적용 (IDamageable 인터페이스 사용)
var damageable = target.GetComponent<IDamageable>();
if (damageable != null)
{
damageable.Heal(totalHeal);
}
}
/// <summary>
/// 시전자 스탯 기반 회복량 계산
/// 공식: baseHeal + (healPower * healScaling)
/// </summary>
private float CalculateHeal(GameObject caster)
{
var stats = caster.GetComponent<CharacterStats>();
if (stats == null)
{
return baseHeal;
}
return baseHeal + (stats.HealPower * healScaling);
}
}
}