37 lines
1000 B
C#
37 lines
1000 B
C#
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} 灵力";
|
||
}
|
||
}
|