12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- using CommonAI.Data;
- using CommonAI.Zone;
- using CommonAI.Zone.Formula;
- using CommonAI.ZoneServer.JSGModule;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using XmdsCommon.Plugin;
- using XmdsCommonServer.Plugin;
- using XmdsCommonServer.Plugin.JSGXmdsModule;
- using XmdsCommonServer.XLS.Data;
- using XmdsCommonSkill.Plugin.Buffs;
- using XmdsCommonSkill.Plugin.Skills;
- namespace XmdsCommonSkill.Plugin.CardSkill
- {
- /// <summary>
- /// 空中落下矛,造成a%攻击力单体极高伤害,给敌人叠加1层减防buff,并扣除部分定力,持续n秒。(根据白虎球数2/3/4,对应连续单体伤害数量1/3/5,多段攻击会叠加多层减防buff。暂定每层减防5%,最高10层)。
- /// </summary>
- public class CardSkill_1330000 : CardSkill_BaiHuBase
- {
- private static readonly int ID = 1330000;
- public override int SkillID { get { return ID; } }
- // 敌人减防
- public static readonly int BuffID_CRITE_UP = (int)XmdsBuffBase.XmdsBuffList.CARD_DEFENCE_DOWN;
- //多种不同形态法术id
- protected static XmdsSkillValue s_TalentData;
- //伤害系数
- protected static XmdsSkillValue s_ValueSet1;
- //减防buff时间,每层效果
- protected static XmdsSkillValue s_ValueSet2;
- //额外扣除定力值
- protected static XmdsSkillValue s_ValueSet3;
- protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
- {
- base.OnInit(info, unit, ref template);
- var pack1 = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(BuffID_CRITE_UP);
- var buff1 = pack1.GetXmdsBuff(0) as XmdsBuff_PropChange;
- buff1.CurentChangeType = XmdsVirtual.UnitAttributeType.Defence;
- var bt1 = pack1.mBuffTemplate;
- pack1.BindTemplateAndDispose();
- unit.RegistSendBuff(bt1);
- unit.RegistOnHitOther(OnHandleHitOther, info);
- }
- public override int GetEffectID(int skillLv, int sameNums)
- {
- return s_TalentData.GetValue(skillLv, sameNums - 1);
- }
- public override void OnTriggerCardSkill(XmdsVirtual player, XmdsVirtual hitter, AttackSource source, CardSkillData skillData, int sameNums)
- {
- base.unitLaunchSpell(player, hitter, s_TalentData.GetValue(skillData.skilLv, sameNums - 1));
- }
- protected override void OnGetCardSkillDamage(BattleParams param)
- {
- param.SkillDamagePer = s_ValueSet1.GetValue(param.GameSkill.SkillLevel, param.AtkProp.DamagePerID);
- // 扣除定力
- param.Hitter.AddMP(-s_ValueSet3.GetValue(param.GameSkill.SkillLevel, base.GetTriggerSameCards() - 1), param.Attacker.mUnit, param.Source);
- }
- protected float OnHandleHitOther(float damage, XmdsVirtual hitted, XmdsVirtual attacker, AttackSource source,
- ref XmdsVirtual.AtkResult result, DamageType damageType, GameSkill skill, ref bool isEndDispatch)
- {
- JSGXmdsHackerModule.CheckAndPrintCardSameErrorInfo("CardSkill_1330000", this.mTriggerSameCards, this.mTriggerTime, source);
- var bt = attacker.GetRegistBuff(BuffID_CRITE_UP);
- bt.LifeTimeMS = s_ValueSet2.GetValue(skill.SkillLevel, base.GetIndex2(1));
- var buff = attacker.GetRegisBuffVirtual(BuffID_CRITE_UP) as XmdsBuff_PropChange;
- buff.CurrentValue = -s_ValueSet2.GetValue(skill.SkillLevel, base.GetIndex2(2));
- hitted.mUnit.AddBuff(BuffID_CRITE_UP, attacker.mUnit);
- return damage;
- }
- protected override void OnInitSkillParam()
- {
- XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(this.SkillID);
- InitData(data, out s_TalentData, XmdsSkillData.XmdsSkillDataKey.TalentData);
- InitData(data, out s_ValueSet1, XmdsSkillData.XmdsSkillDataKey.ValueSet);
- InitData(data, out s_ValueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
- InitData(data, out s_ValueSet3, XmdsSkillData.XmdsSkillDataKey.ValueSet3);
- }
- }
- }
|