123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- using CommonAI.Data;
- using CommonAI.Zone;
- using CommonAI.Zone.Formula;
- using CommonAI.Zone.Helper;
- using CommonAI.Zone.Instance;
- using CommonLang;
- using System;
- using System.Collections.Generic;
- using XmdsCommon.Plugin;
- using XmdsCommonServer.Plugin;
- using XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator;
- using XmdsCommonServer.XLS.Data;
- using XmdsCommonSkill.Plugin.Buffs;
- using static CommonAI.Zone.SpellTemplate;
- using static XmdsCommonSkill.Plugin.Interface.ComSpellTemplate;
- namespace XmdsCommonSkill.Plugin.Skills.Warrior
- {
- /// <summary>
- /// 二技能: 2-6 (护盾值提升,护盾被打破或时间到了,会对周围产生基于生命百分比的伤害)
- /// </summary>
- public class Warrior_110260 : Warrior_110250
- {
- private static readonly int ID = 110260;
- //护盾buff在落地后,编辑器给玩家加buff
- protected static readonly int Buff_ID_HUDUN_6 = (int)XmdsBuffBase.XmdsBuffList.HUDUN_ZS_2_6;
- /// 获取技能ID.
- public override int SkillID { get { return ID; } }
- //盾破,造成基于生命的伤害
- public XmdsSkillValue mValueSet4;
- //护盾加成值
- public XmdsSkillValue mValueSet6;
- 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_6);
- var Buf = pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.SHIELD_AbsorbDamage) as XmdsBuff_Shield_AbsorbDamage;
- Buf.breakSpellID = XmdsSpellID.WARRIOR_2_6_DunBreak;
- int hudun = mValueSet3.GetValue(info.TalentSkillLevel2, 1) + mValueSet6.GetValue(info.TalentSkillLevel3);
- Buf.AbsorbDamageSum = CUtils.CastInt(unit.MirrorProp.MaxHP * XmdsUnitProp.PER * hudun);
- 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_6) as XmdsBuff_Shield_AbsorbDamage;
- int hudun = mValueSet3.GetValue(gs.TalentSkillLevel2, 1) + mValueSet6.GetValue(gs.TalentSkillLevel3);
- buff.AbsorbDamageSum = CUtils.CastInt(unit.MirrorProp.MaxHP * XmdsUnitProp.PER * hudun);
- var bt = unit.GetRegistBuff(Buff_ID_HUDUN_6);
- bt.LifeTimeMS = mValueSet3.GetValue(gs.TalentSkillLevel2, 2);
- }
- protected override void OnSkillDamagePerEvent(BattleParams param)
- {
- if (param.AtkProp.DamagePerID < 3)
- {
- base.OnSkillDamagePerEvent(param);
- }
- }
- protected override bool OnSkillFinalDamageModifyEvent(BattleParams param)
- {
- // 护盾破碎伤害
- if(param.AtkProp.DamagePerID == 3)
- {
- param.HitDamge = Math.Max(1, CUtils.CastInt(param.Attacker.MirrorProp.MaxHP *
- XmdsUnitProp.PER * mValueSet4.GetValue(param.GameSkill.TalentSkillLevel3)));
- return true;
- }
- return false;
- }
- 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 mValueSet4, XmdsSkillData.XmdsSkillDataKey.ValueSet4);
- InitData(data, out mValueSet5, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
- InitData(data, out mValueSet6, XmdsSkillData.XmdsSkillDataKey.ValueSet6);
- //释放过程中免伤
- InitData(data, out mValueSet8, XmdsSkillData.XmdsSkillDataKey.ValueSet8);
- }
- }
- }
|