12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- using CommonAI.Zone.Instance;
- using CommonAI.Zone.Formula;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using XmdsCommon.Plugin;
- using XmdsCommonServer.Plugin;
- using XmdsCommonServer.Plugin.XmdsSkillTemplate.Skills;
- using XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator;
- using CommonAI.Data;
- namespace XmdsCommonSkill.Plugin.Buffs
- {
- /// <summary>
- /// 烙印标记,下次攻击额外伤害
- /// </summary>
- public class XmdsBuff_Brand_3 : XmdsBuffBase
- {
- /// <summary>
- /// BUFF效果,正值为扣血,负值为抵伤.
- /// </summary>
- public int BuffValue;
- private int mHandleUUID = 0;
- public override int GetAbilityID()
- {
- return (int)XmdsCommon.Plugin.XmdsBuffProperties.XmdsBuffAbility.Brand_3;
- }
- public override void CopyTo(UnitBuff other)
- {
- var ret = other as XmdsBuff_Brand_3;
- ret.BuffValue = this.BuffValue;
- base.CopyTo(other);
- }
- protected override void OnBuffBegin(XmdsCommonServer.Plugin.XmdsVirtual hitter, XmdsCommonServer.Plugin.XmdsVirtual attacker, InstanceUnit.BuffState state)
- {
- //注册监听.
- mHandleUUID = hitter.RegistOnHitOther(OnHandleHitDmage, null);
- }
- protected override void OnBuffEnd(XmdsCommonServer.Plugin.XmdsVirtual hitter, InstanceUnit.BuffState state, bool replace)
- {
- //取消监听.
- hitter.UnRegistOnHitOther(mHandleUUID);
- }
- //单位被攻击时,判断是否符合条件触发BUFF效果.
- private float OnHandleHitDmage(float damage, XmdsVirtual hitted, XmdsVirtual attacker, AttackSource source,
- ref XmdsVirtual.AtkResult result, DamageType damageType, GameSkill skill, ref bool isEndDispatch)
- {
- damage = damage + BuffValue;
- //生效一次,直接移除buff
- attacker.mUnit.removeBuff(BindBuffID);
- return damage;
- }
- protected override void OnDispose()
- {
- base.OnDispose();
- }
- }
- }
|