magic powers refactor WIP
This commit is contained in:
43
Assets/Scripts/Characters/Skills/SpellDefinition.cs
Normal file
43
Assets/Scripts/Characters/Skills/SpellDefinition.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user