123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
-
- using CommonAI.Data;
- using CommonAI.Zone;
- using CommonAI.Zone.Formula;
- using CommonAI.Zone.Instance;
- using CommonLang;
- using XmdsCommon.Plugin;
- using XmdsCommonServer.Plugin;
- using XmdsCommonServer.Plugin.XmdsSkillTemplate.Skills;
- namespace XmdsCommonSkill.Plugin.Buffs
- {
- /// <summary>
- /// Description: 治疗, 通过自身血量增减
- /// </summary>
- public class XmdsBuff_AddHPByHPPrecent : XmdsBuffBase
- {
- public int ChangeValue = 0;
- //生命每减少10%,效果增益
- public int addition = 0;
- public override int GetAbilityID()
- {
- return (int)XmdsCommon.Plugin.XmdsBuffProperties.XmdsBuffAbility.AddHPExt;
- }
- public override void CopyTo(UnitBuff other)
- {
- var ret = other as XmdsBuff_AddHPByHPPrecent;
- ret.ChangeValue = ChangeValue;
- ret.addition = this.addition;
- base.CopyTo(other);
- }
- protected override void OnBindTemplate(ref BuffTemplate buffTemplate)
- {
- //DOT类技能首帧无效.
- buffTemplate.FirstTimeEnable = false;
- base.OnBindTemplate(ref buffTemplate);
- }
- public override void BuffUpdate(XmdsVirtual unit, InstanceUnit.BuffState state)
- {
- int extValue = 0;
- if (unit.mUnit.MaxHP > 0 && addition > 0)
- {
- int HPLevel = CUtils.CastInt(10 - unit.mUnit.CurrentHP * 10.0f / unit.mUnit.MaxHP);
- extValue = CUtils.CastInt(ChangeValue * HPLevel * addition * XmdsUnitProp.PER);
- }
- //为自己加血.
- unit.AddHP(ChangeValue + extValue, 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();
- }
- }
- }
|