123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- 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<XmdsBuffProperties.XmdsBuffAbilityNode> 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;
- }
- /// <summary>
- /// </summary>
- /// <param name="怪物和人物对于控制的概念不太一样,比如嘲讽。所以需要分开"></param>
- /// <returns></returns>
- 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<XmdsBuffProperties.XmdsBuffAbilityNode> 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;
- }
- }
- }
|