[Stats] 캐릭터 스탯 시스템 구현
- 6가지 기본 스탯 추가 (STR, DEX, INT, VIT, WIS, SPI) - 스탯 수정자 시스템 (Flat, PercentAdd, PercentMult) - 파생 스탯 계산 (체력/마나/대미지/회복력) - 스킬 효과에 스탯 기반 대미지/회복량 적용 - 마나 비용 체크 및 소모 로직 추가
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using UnityEngine;
|
||||
using Colosseum.Stats;
|
||||
using Colosseum.Player;
|
||||
|
||||
namespace Colosseum.Skills.Effects
|
||||
{
|
||||
@@ -9,17 +11,40 @@ namespace Colosseum.Skills.Effects
|
||||
public class HealEffect : SkillEffect
|
||||
{
|
||||
[Header("Heal Settings")]
|
||||
[Min(0f)] [SerializeField] private float healAmount = 10f;
|
||||
[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;
|
||||
|
||||
// TODO: 실제 체력 시스템 연동
|
||||
// var health = target.GetComponent<Health>();
|
||||
// health?.Heal(healAmount);
|
||||
// 회복량 계산
|
||||
float totalHeal = CalculateHeal(caster);
|
||||
|
||||
Debug.Log($"[Heal] {caster.name} -> {target.name}: {healAmount}");
|
||||
// 타겟에 회복 적용
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user