Files
Colosseum/Assets/Scripts/Skills/Effects/HealEffect.cs
dal4segno 0286237b98 [Stats] 캐릭터 스탯 시스템 구현
- 6가지 기본 스탯 추가 (STR, DEX, INT, VIT, WIS, SPI)
- 스탯 수정자 시스템 (Flat, PercentAdd, PercentMult)
- 파생 스탯 계산 (체력/마나/대미지/회복력)
- 스킬 효과에 스탯 기반 대미지/회복량 적용
- 마나 비용 체크 및 소모 로직 추가
2026-03-10 13:19:55 +09:00

51 lines
1.5 KiB
C#

using UnityEngine;
using Colosseum.Stats;
using Colosseum.Player;
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);
// 타겟에 회복 적용
var networkController = target.GetComponent<PlayerNetworkController>();
if (networkController != null)
{
networkController.RestoreHealthRpc(totalHeal);
}
Debug.Log($"[Heal] {caster.name} -> {target.name}: {totalHeal:F1}");
}
/// <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);
}
}
}