123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- using CommonAI.Zone;
- using CommonAI.Zone.Formula;
- using CommonAI.Zone.Helper;
- using CommonAI.Zone.Instance;
- using CommonLang;
- using XmdsCommon.Plugin;
- using XmdsCommonServer.Plugin;
- using XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator;
- using XmdsCommonServer.Plugin.XmdsSkillTemplate.Skills;
- using XmdsCommonServer.XLS.Data;
- using XmdsCommonSkill.Plugin.Buffs;
- using XmdsCommonSkill.Plugin.PassiveSkills.Warrior;
- namespace XmdsCommonSkill.Plugin.Skills.Warrior
- {
- /// <summary>
- /// 四技能 4 : 基类
- /// 踩踏地面咆哮,获得气动山河buff 对范围怪物仇恨值增加N并上加仇恨最高队友N倍的仇恨值,队友在持续期间不增加怪物仇恨值【结束挂 需要在底层加应用层东西,建议去掉】(对玩家为嘲讽T秒)
- /// ,受到来自拉到仇恨的怪物和玩家平A伤害减半,技能不减伤害减免n%(PVP为受到被嘲讽玩家的普攻伤害减半)整体伤害减免n%(上版本已加过)。
- /// 对范围敌人造成自身当前生命值最大生命值n%伤害,两个荒原血统、嗜血神力被动直接刷新并满层,嗜血神力天赋,在buff持续时间内每n秒增长x点怒气。仇恨效果持续5秒(圆半径4-5)
- /// </summary>
- public class Warrior_110400 : XmdsSkillBase
- {
- private static readonly int ID = 110400;
- private static readonly int Buff_Mocking = (int)XmdsBuffBase.XmdsBuffList.ZS_CAOFENG;
- private static readonly int Buff_4_4 = (int)XmdsBuffBase.XmdsBuffList.ZS_4_ADD_TALENT;
- public override int SkillID { get { return ID; } }
- //普攻减伤
- protected XmdsSkillValue mDamageReduce;
- //生命百分比伤害
- protected XmdsSkillValue mValueSet1;
- // 嘲讽配置
- protected XmdsSkillValue mValueSet5;
- //技能效果时间
- protected XmdsSkillValue mValueSet6;
- //嘲讽期间,增加怒气
- protected XmdsSkillValue mValueSet8;
- // 被动
- public Warrior_110600 playerPassive;
- protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
- {
- // 嘲讽注册
- var pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_Mocking);
- var buff = (XmdsBuff_Mocking)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.Mocking);
- buff.damageReduce = mDamageReduce.GetValue(info.SkillLevel) + GetSkillValue(AbstractSkillType.Value1);
- var bt = pack.mBuffTemplate;
- bt.IsHarmful = true;
- bt.LifeTimeMS = mValueSet5.GetValue(info.SkillLevel, 1);
- pack.BindTemplateAndDispose();
- unit.RegistSendBuff(bt);
- //气动山河buff
- var pack2 = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_4_4);
- var buff2 = (XmdsBuff_AddTalent)pack2.GetXmdsBuff(0);
- buff2.hitAddTalentValue = mValueSet8.GetValue(info.SkillLevel);
- var bt2 = pack2.mBuffTemplate;
- bt2.IsHarmful = true;
- bt2.LifeTimeMS = this.GetBuffTime(null, info);
- pack2.BindTemplateAndDispose();
- unit.RegistSendBuff(bt2);
- unit.RegistLaunchSkillOver(OnLaunchSkillOver, info);
- }
- protected override void OnSkillDataChange(GameSkill gs, XmdsVirtual unit)
- {
- base.OnSkillDataChange(gs, unit);
- var buff = unit.GetRegisBuffVirtual(Buff_Mocking) as XmdsBuff_Mocking;
- buff.damageReduce = mDamageReduce.GetValue(gs.SkillLevel) + GetSkillValue(AbstractSkillType.Value1);
- var bt2 = unit.GetRegistBuff(Buff_4_4);
- bt2.LifeTimeMS = this.GetBuffTime(null, gs);
- var buff2 = unit.GetRegisBuffVirtual(Buff_4_4) as XmdsBuff_AddTalent;
- buff2.hitAddTalentValue = mValueSet8.GetValue(gs.SkillLevel);
- }
- private int OnLaunchSkillOver(GameSkill info, XmdsCommonServer.Plugin.XmdsVirtual launcher, CommonAI.Zone.Instance.InstanceUnit.SkillState skill)
- {
- //直接刷新两个buff,并到满层
- launcher.mUnit.AddBuff(Warrior_110601.GetTalentBufID(), launcher.mUnit, 0, false, true);
- launcher.mUnit.AddBuff(Buff_4_4, launcher.mUnit);
- // 重置嗜血神力
- if(playerPassive == null)
- {
- playerPassive = (Warrior_110600)launcher.SkillHelper.GetPlayerSkillByIdExt(Warrior_110600.ID);
- }
- if(playerPassive != null)
- {
- playerPassive.ResetTriggerTime();
- }
- return 0;
- }
- protected override bool OnSkillFinalDamageModifyEvent(BattleParams param)
- {
- // 相当于把生命系数转换成攻击值去算攻击力
- param.HitDamge = GetHitDamage(param);
- return true;
- }
- protected int GetHitDamage(BattleParams param)
- {
- int baseDamge = mValueSet1.GetValue(param.GameSkill.SkillLevel);
- int hpValue = CUtils.CastInt(param.Attacker.mUnit.CurrentHP * XmdsUnitProp.PER * mValueSet1.GetValueExt(param.GameSkill.SkillLevel));
- return baseDamge + XmdsDamageCalculator.GetDamage(hpValue, param.Attacker, param.Hitter, param.Source);
- }
- protected override void OnSkillLogicEvent(BattleParams param)
- {
- BuffTemplate bt = param.Attacker.GetRegistBuff(Buff_Mocking);
- bt.LifeTimeMS = GetBuffTime(param.Hitter, param.GameSkill);
- param.Hitter.mUnit.AddBuff(Buff_Mocking, param.Attacker.mUnit);
- }
- protected int GetBuffTime(XmdsVirtual hitter, GameSkill skill)
- {
- if (hitter != null && hitter is XmdsVirtual_Player)
- {
- return mValueSet5.GetValue(skill.SkillLevel, 1);
- }
- return mValueSet5.GetValue(skill.SkillLevel, 2);
- }
- protected override void OnInitConfig()
- {
- XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
- InitData(data, out mDamageReduce, XmdsSkillData.XmdsSkillDataKey.DmgRate);
- InitData(data, out mValueSet1, XmdsSkillData.XmdsSkillDataKey.ValueSet);
- // 扩展配置
- InitData(data, out mValueSet5, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
- InitData(data, out mValueSet6, XmdsSkillData.XmdsSkillDataKey.ValueSet6);
- InitData(data, out mValueSet8, XmdsSkillData.XmdsSkillDataKey.ValueSet8);
- }
- }
- }
|