using CommonAI.Zone; using System; using System.Collections.Generic; using System.Linq; using System.Text; using XmdsCommon.Plugin; namespace XmdsCommonServer.Plugin.Units { public class XmdsInstanceUtils { public static bool IsDebuff(XmdsBuffProperties.XmdsBuffAbility ability) { if (ability == XmdsBuffProperties.XmdsBuffAbility.FROZEN || ability == XmdsBuffProperties.XmdsBuffAbility.STUN || ability == XmdsBuffProperties.XmdsBuffAbility.Silent || ability == XmdsBuffProperties.XmdsBuffAbility.Sap || ability == XmdsBuffProperties.XmdsBuffAbility.Nothingness || ability == XmdsBuffProperties.XmdsBuffAbility.Fear || ability == XmdsBuffProperties.XmdsBuffAbility.JINGU || ability == XmdsBuffProperties.XmdsBuffAbility.Mocking || ability == XmdsBuffProperties.XmdsBuffAbility.MoveSpeedDown) { return true; } return false; } public static bool IsControlBuff(BuffTemplate buff) { // buff属性 if (buff.IsSilent || !buff.IsCanMove || buff.MakeStun) { return true; } XmdsBuffProperties zb = buff.Properties as XmdsBuffProperties; if (zb == null || zb.BuffAbilityList == null) { return false; } // 能力属性 List list = zb.BuffAbilityList; for (int i = 0; i < list.Count; i++) { if (XmdsInstanceUtils.IsControlAbilityBuff(list[i].ability)) { return true; } } return false; } private static bool IsControlAbilityBuff(XmdsBuffProperties.XmdsBuffAbility ability) { if (ability == XmdsBuffProperties.XmdsBuffAbility.FROZEN || ability == XmdsBuffProperties.XmdsBuffAbility.STUN || ability == XmdsBuffProperties.XmdsBuffAbility.JINGU || ability == XmdsBuffProperties.XmdsBuffAbility.Silent || ability == XmdsBuffProperties.XmdsBuffAbility.Mocking) { return true; } return false; } /// /// /// /// public static bool IsControlBuff_Monster(BuffTemplate buff) { // buff属性 if (buff.IsSilent || !buff.IsCanMove || buff.MakeStun) { return true; } XmdsBuffProperties zb = buff.Properties as XmdsBuffProperties; if (zb == null || zb.BuffAbilityList == null) { return false; } // 能力属性 List list = zb.BuffAbilityList; for (int i = 0; i < list.Count; i++) { if (XmdsInstanceUtils.IsControlAbilityBuff_Monster(list[i].ability)) { return true; } } return false; } private static bool IsControlAbilityBuff_Monster(XmdsBuffProperties.XmdsBuffAbility ability) { if (ability == XmdsBuffProperties.XmdsBuffAbility.FROZEN || ability == XmdsBuffProperties.XmdsBuffAbility.STUN || ability == XmdsBuffProperties.XmdsBuffAbility.JINGU || ability == XmdsBuffProperties.XmdsBuffAbility.Silent) { return true; } return false; } } }