1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- 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
- {
-
-
-
- public class XmdsBuff_Brand_2 : XmdsBuffBase
- {
-
-
-
- public int BuffValue;
- private int mHandleUUID = 0;
-
- private uint mSenderID = 0;
- public override int GetAbilityID()
- {
- return (int)XmdsCommon.Plugin.XmdsBuffProperties.XmdsBuffAbility.Brand_2;
- }
- public override void CopyTo(UnitBuff other)
- {
- var ret = other as XmdsBuff_Brand_2;
- ret.BuffValue = this.BuffValue;
- base.CopyTo(other);
- }
- protected override void OnBuffBegin(XmdsCommonServer.Plugin.XmdsVirtual hitter, XmdsCommonServer.Plugin.XmdsVirtual attacker, InstanceUnit.BuffState state)
- {
-
- mHandleUUID = hitter.RegistOnHitDamage(OnHandleHitDmage, null);
- mSenderID = attacker.mUnit.ID;
- }
- protected override void OnBuffEnd(XmdsCommonServer.Plugin.XmdsVirtual hitter, InstanceUnit.BuffState state, bool replace)
- {
-
- hitter.UnRegistOnHitDamage(mHandleUUID);
- }
-
- private float OnHandleHitDmage(float damage, XmdsVirtual hitted, XmdsVirtual attacker, AttackSource source,
- ref XmdsVirtual.AtkResult result, DamageType damageType, GameSkill skill, ref bool isEndDispatch)
- {
- if(mSenderID == attacker.mUnit.ID)
- {
- damage = damage * XmdsUnitProp.PER * (XmdsDamageCalculator.PERER + this.BuffValue);
- }
- return damage;
- }
- protected override void OnDispose()
- {
- base.OnDispose();
- }
- }
- }
|