1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- using CommonAI.Zone;
- using CommonAI.Zone.Helper;
- using CommonAI.Zone.Instance;
- using CommonLang;
- using XmdsCommon.Plugin;
- using XmdsCommonServer.Plugin;
- using XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator;
- using XmdsCommonServer.XLS.Data;
- using XmdsCommonSkill.Plugin.Buffs;
- namespace XmdsCommonSkill.Plugin.Skills.Warrior
- {
- /// <summary>
- /// 二技能: 2-5 (砸到终点时获得一个最大生命值n%护盾,持续X秒)
- /// </summary>
- public class Warrior_110250 : Warrior_110240
- {
- private static readonly int ID = 110250;
- //护盾buff在落地后,编辑器给玩家加buff
- protected static readonly int Buff_ID_HUDUN_5 = (int)XmdsBuffBase.XmdsBuffList.HUDUN_ZS_2_5;
- //护盾基于生命值
- protected XmdsSkillValue mValueSet3;
- /// 获取技能ID.
- public override int SkillID { get { return ID; } }
- protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
- {
- base.OnInit(info, unit, ref template);
- XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID_HUDUN_5);
- XmdsBuff_Shield_AbsorbDamage buff = (XmdsBuff_Shield_AbsorbDamage)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.SHIELD_AbsorbDamage);
- buff.AbsorbDamageSum = CUtils.CastInt(unit.MirrorProp.MaxHP * XmdsUnitProp.PER * mValueSet3.GetValue(info.TalentSkillLevel2, 1));
- BuffTemplate bt = pack.mBuffTemplate;
- bt.IsHarmful = false;
- bt.LifeTimeMS = mValueSet3.GetValue(info.TalentSkillLevel2, 2);
- pack.BindTemplateAndDispose();
- unit.RegistSendBuff(bt);
- }
- protected override void OnSkillDataChange(GameSkill gs, XmdsVirtual unit)
- {
- base.OnSkillDataChange(gs, unit);
- var buff = unit.GetRegisBuffVirtual(Buff_ID_HUDUN_5) as XmdsBuff_Shield_AbsorbDamage;
- buff.AbsorbDamageSum = CUtils.CastInt(unit.MirrorProp.MaxHP * XmdsUnitProp.PER * mValueSet3.GetValue(gs.TalentSkillLevel2, 1));
- var bt = unit.GetRegistBuff(Buff_ID_HUDUN_5);
- bt.LifeTimeMS = mValueSet3.GetValue(gs.TalentSkillLevel2, 2);
- }
- protected override void OnInitConfig()
- {
- XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
- InitData(data, out mValueSet1, XmdsSkillData.XmdsSkillDataKey.ValueSet);
- InitData(data, out mValueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
- InitData(data, out mValueSet3, XmdsSkillData.XmdsSkillDataKey.ValueSet3);
- InitData(data, out mValueSet5, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
- //释放过程中免伤
- InitData(data, out mValueSet8, XmdsSkillData.XmdsSkillDataKey.ValueSet8);
- }
- }
- }
|