123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
-
- using CommonAI.Data;
- using CommonAI.Zone;
- using CommonAI.Zone.Formula;
- using CommonAI.Zone.Instance;
- using CommonLang;
- using System;
- using XmdsCommon.Plugin;
- using XmdsCommonServer.Plugin;
- using XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator;
- using XmdsCommonServer.Plugin.XmdsSkillTemplate.Skills;
- namespace XmdsCommonSkill.Plugin.Buffs
- {
- // 根据已损失生命值增加血量
- public class XmdsBuff_AddHPByLossHP : XmdsBuffBase
- {
- public int ChangeValue = 0;
- public override int GetAbilityID()
- {
- return (int)XmdsCommon.Plugin.XmdsBuffProperties.XmdsBuffAbility.AddHPByLossHP;
- }
- public override void CopyTo(UnitBuff other)
- {
- var ret = other as XmdsBuff_AddHPByLossHP;
- ret.ChangeValue = ChangeValue;
- base.CopyTo(other);
- }
- protected override void OnBindTemplate(ref BuffTemplate buffTemplate)
- {
- //DOT类技能首帧无效.
- base.OnBindTemplate(ref buffTemplate);
- }
- public override void BuffUpdate(XmdsVirtual unit, InstanceUnit.BuffState state)
- {
- //为自己加血.
- int addHP = CUtils.CastInt((unit.mUnit.MaxHP - unit.mUnit.CurrentHP) * XmdsUnitProp.PER * ChangeValue);
- if(addHP > 0)
- {
- unit.mUnit.AddHP(addHP, unit.mUnit);
- }
- }
- public override void BuffBegin(XmdsVirtual hitter, XmdsVirtual attacker, InstanceUnit.BuffState state)
- {
-
- }
- public override void BuffEnd(XmdsVirtual hitter, InstanceUnit.BuffState state, bool replace)
- {
- }
- protected override void OnDispose()
- {
- base.OnDispose();
- }
- }
- }
|