Files
beyond/Assets/Scripts/Characters/Skills/SpellDefinition.cs

51 lines
1.6 KiB
C#

using UnityEngine;
using Sirenix.OdinInspector;
namespace Beyond
{
public enum SpellCategory
{
Utility,
Defensive,
Offensive_Power, // Used for Shadow Slayer / Fireball logic
Offensive_Light
}
public abstract class SpellDefinition : ScriptableObject
{
[Header("General Settings")]
public string spellName;
public SpellCategory category;
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);
}
}