1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- using CommonAI.Zone;
- using CommonAI.Zone.Helper;
- using CommonAI.Zone.Instance;
- using System;
- using XmdsCommon.Plugin;
- using XmdsCommonServer.Plugin;
- using XmdsCommonServer.XLS.Data;
- using XmdsCommonSkill.Plugin.Buffs;
- namespace XmdsCommonSkill.Plugin.Skills.Warrior
- {
- /// <summary>
- /// 三技能 3- 4(根据命中人数提高自身防御,x秒(每层n%,上限5))
- /// </summary>
- public class Warrior_110340 : Warrior_110300
- {
- private static readonly int ID = 110340;
- //命中多人,提升防御
- protected XmdsSkillValue mValueSet2;
- //本次释放技能命中人数
- private int mHitUintsLayer = 0;
- private static readonly int Buff_DefenceUp = (int)XmdsBuffBase.XmdsBuffList.ZS_DEFENCEUP_3_4;
- 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_DefenceUp);
- var buff = pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.PropChange) as XmdsBuff_PropChange;
- buff.CurentChangeType = XmdsVirtual.UnitAttributeType.Defence;
- buff.IsPercent = true;
- buff.CurrentValue = mValueSet2.GetValue(info.TalentSkillLevel1, 1);
- BuffTemplate bt = pack.mBuffTemplate;
- bt.IsHarmful = false;
- bt.LifeTimeMS = mValueSet2.GetValue(info.TalentSkillLevel1, 2);
- pack.BindTemplateAndDispose();
- unit.RegistSendBuff(bt);
- unit.RegistLaunchSkillOver(OnLaunchSkillOver, info);
- }
- protected override void OnSkillDataChange(GameSkill gs, XmdsVirtual unit)
- {
- base.OnSkillDataChange(gs, unit);
- var buff = unit.GetRegisBuffVirtual(Buff_DefenceUp) as XmdsBuff_PropChange;
- buff.CurrentValue = mValueSet2.GetValue(gs.TalentSkillLevel1, 1);
- var bt = unit.GetRegistBuff(Buff_DefenceUp);
- bt.LifeTimeMS = mValueSet2.GetValue(gs.TalentSkillLevel1, 2);
- }
- private int OnLaunchSkillOver(GameSkill info, XmdsCommonServer.Plugin.XmdsVirtual launcher, CommonAI.Zone.Instance.InstanceUnit.SkillState state)
- {
- this.mHitUintsLayer = 0;
- info.mHitUnits.Clear();
- return 0;
- }
- protected override void OnSkillDamagePerEvent(BattleParams param)
- {
- base.OnSkillDamagePerEvent(param);
- param.GameSkill.mHitUnits.Put(param.Hitter.mUnit.ID, 1);
- int layers = GetBufEffect(param.GameSkill.mHitUnits.Count);
- if (this.mHitUintsLayer != layers)
- {
- this.mHitUintsLayer = layers;
- param.Attacker.mUnit.AddBuff(Buff_DefenceUp);
- }
- }
- 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 mValueSet5, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
- //蓄力技能规则
- InitData(data, out mValueSet8, XmdsSkillData.XmdsSkillDataKey.ValueSet8);
- }
- }
- }
|