using CommonAI.Zone; using System; using System.Collections.Generic; using System.Linq; using System.Text; using XmdsCommon.Plugin; using XmdsCommonServer.Plugin; using XmdsCommonServer.Plugin.XmdsSkillTemplate.Skills; namespace XmdsCommonSkill.Plugin.Buffs { /// /// 虚无. /// public class XmdsBuff_Nothingness : XmdsBuffBase { public enum NothingnessType : byte { None, NothingnessIgnoreSkill,//无视技能. NothingnessIgnoreBuff, //无视BUFF. NothingnessIgnoreAll, //无所所有. } public NothingnessType ChangeType = NothingnessType.None; public override int GetAbilityID() { return (int)XmdsBuffProperties.XmdsBuffAbility.Nothingness; } public override void CopyTo(UnitBuff other) { var ret = other as XmdsBuff_Nothingness; ret.ChangeType = this.ChangeType; base.CopyTo(other); } protected override void OnBindTemplate(ref BuffTemplate buffTemplate) { buffTemplate.IsInvisible = true; } protected override void OnBuffBegin(XmdsCommonServer.Plugin.XmdsVirtual hitter, XmdsCommonServer.Plugin.XmdsVirtual attacker, CommonAI.Zone.Instance.InstanceUnit.BuffState state) { //通过编辑器设置无敌效果. XmdsVirtual.FormatLog("单位 {0} 虚无开始", hitter.mInfo.Name); ChangeUnitStatus(hitter, true); } protected override void OnBuffEnd(XmdsCommonServer.Plugin.XmdsVirtual hitter, CommonAI.Zone.Instance.InstanceUnit.BuffState state, bool replace) { XmdsVirtual.FormatLog("单位 {0} 虚无解除", hitter.mInfo.Name); ChangeUnitStatus(hitter, false); } private void ChangeUnitStatus(XmdsVirtual hitter, bool flag) { switch (ChangeType) { case NothingnessType.NothingnessIgnoreAll: hitter.NothingnessIgnoreAll = flag; break; case NothingnessType.NothingnessIgnoreBuff: hitter.NothingnessIgnoreBuff = flag; break; case NothingnessType.NothingnessIgnoreSkill: hitter.NothingnessIgnoreSkill = flag; break; default: break; } } } }