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

31 lines
1.0 KiB
C#
Raw 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;
using BaseGames.Skills;
namespace BaseGames.Equipment
{
/// <summary>
/// 技能插槽替换护符效果(架构 09_ProgressionModule §5
/// 将指定形态的某技能槽替换为另一技能。
/// </summary>
[Serializable]
public class SkillSlotOverrideEffect : ICharmEffect
{
public SkillSlotOverride overrideData;
public void OnEquip(EquipmentContext ctx)
=> ctx.SkillMods?.AddSlotOverride(overrideData);
public void OnUnequip(EquipmentContext ctx)
=> ctx.SkillMods?.RemoveSlotOverride(overrideData);
public string GetEffectDescription()
{
string formStr = overrideData.targetForm != null
? overrideData.targetForm.name : "所有形态";
string skillName = overrideData.replacementSkill != null
? overrideData.replacementSkill.displayNameKey : "null";
return $"{formStr}的 {overrideData.targetSlot} 替换为 [{skillName}]";
}
}
}