Files
zeling_v2/Assets/_Game/Scripts/Equipment/Effects/SoulSpellEffect.cs

37 lines
1000 B
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System;
namespace BaseGames.Equipment
{
/// <summary>
/// 法术资源类型。
/// </summary>
public enum SpellType
{
SoulAttack,
HealingWave
}
/// <summary>
/// 灵魂法术强化护符效果(架构 09_ProgressionModule §5
/// 装备时减少灵力消耗卸下时还原。SpellManager 消耗时查询 PlayerStats.SoulCostReduction。
/// </summary>
[Serializable]
public class SoulSpellEffect : ICharmEffect
{
public SpellType spellType;
public int soulCostReduction; // 减少消耗的灵力点数
public void OnEquip(EquipmentContext ctx)
{
ctx.Stats?.AddSoulCostReduction(soulCostReduction);
}
public void OnUnequip(EquipmentContext ctx)
{
ctx.Stats?.RemoveSoulCostReduction(soulCostReduction);
}
public string GetEffectDescription() => $"{spellType} 消耗减少 {soulCostReduction} 灵力";
}
}