Files
beyond/Assets/Scripts/Characters/Skills/SpellDefinition.cs
2026-01-19 14:25:38 +01:00

43 lines
1.4 KiB
C#

using UnityEngine;
using Sirenix.OdinInspector;
namespace Beyond
{
public abstract class SpellDefinition : ScriptableObject
{
[Header("General Settings")]
public string spellName;
public string animationClipName;
[TextArea] public string description;
[Header("Costs & Timing")]
public int baseFaithCost = 10;
public float castTime = 0.5f; // Time until the effect spawns (Animation event timing)
[Header("Targeting")]
public float rotationDuration = 0.3f; // How long player rotates towards target
/// <summary>
/// Calculates final cost based on Trinkets (Bloom, Angel Eye, etc)
/// </summary>
public virtual float GetFaithCost(Player player)
{
float cost = baseFaithCost;
// 1. Apply Global Reductions (e.g. Bloom)
if (player.CurrentTrinketStats.effectBloom)
{
cost *= 0.8f;
}
return cost;
}
/// <summary>
/// The logic for the specific spell.
/// </summary>
/// <param name="caster">The MonoBehavior running the spell (MagicAttacks)</param>
/// <param name="target">The current auto-target (can be null)</param>
public abstract void Cast(MagicAttacks caster, Transform target);
}
}