1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- using CommonAI.Zone.Helper;
- using CommonAI.Zone.Instance;
- using XmdsCommonServer.Plugin;
- using XmdsCommonServer.XLS.Data;
- using XmdsCommonSkill.Plugin.Buffs;
- using System;
- using static CommonAI.Zone.Instance.InstanceUnit;
- using XmdsCommon.Plugin;
- using CommonAI.Zone;
- using XmdsCommonServer.Plugin.Units;
- using CommonAI.Zone.Formula;
- using XmdsCommonSkill.Plugin.Skills;
- using XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator;
- using CommonAI.Data;
- using CommonLang;
- namespace XmdsCommonSkill.Plugin.PassiveSkills.Remedy
- {
- /// <summary>
- /// boss通用被动 - 尖刺(反弹受到伤害的百分之N)
- /// </summary>
- class Boss_90104 : XmdsPassiveSkillBase
- {
- public static int ID = 90104;
- //private static XmdsSkillValue valueSet;
- private static float damageReturn = 0;
- private int mUUID_1 = 0;
-
- public override int SkillID {get{return ID;}}
- protected override void OnInit(GameSkill skillInfo, XmdsVirtual owner)
- {
- mUUID_1 = owner.RegistOnHitDamage(OnHandleHitDmage, skillInfo, true);
- }
- //单位被攻击时,判断是否符合条件触发BUFF效果.
- private float OnHandleHitDmage(float damage, XmdsVirtual hitted, XmdsVirtual attacker, AttackSource source,
- ref XmdsVirtual.AtkResult result, DamageType damageType, GameSkill skill, ref bool isEndDispatch)
- {
- int reduce = Math.Max(1, CUtils.CastInt(damage * damageReturn));
- //自己给自己回血
- attacker.AddHP(-reduce, hitted.mUnit);
- return damage;
- }
- protected override void OnInitSkillParam()
- {
- XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
- XmdsSkillValue valueSet;
- InitData(data, out valueSet, XmdsSkillData.XmdsSkillDataKey.DmgRate);
- damageReturn = valueSet.GetValue() * XmdsUnitProp.PER;
- }
- protected override void OnDispose(XmdsVirtual owner)
- {
- owner.UnRegistOnHitDamage(mUUID_1);
- }
- }
- }
|