CardSkill_1330000.cs 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. using CommonAI.Data;
  2. using CommonAI.Zone;
  3. using CommonAI.Zone.Formula;
  4. using CommonAI.ZoneServer.JSGModule;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using XmdsCommon.Plugin;
  11. using XmdsCommonServer.Plugin;
  12. using XmdsCommonServer.Plugin.JSGXmdsModule;
  13. using XmdsCommonServer.XLS.Data;
  14. using XmdsCommonSkill.Plugin.Buffs;
  15. using XmdsCommonSkill.Plugin.Skills;
  16. namespace XmdsCommonSkill.Plugin.CardSkill
  17. {
  18. /// <summary>
  19. /// 空中落下矛,造成a%攻击力单体极高伤害,给敌人叠加1层减防buff,并扣除部分定力,持续n秒。(根据白虎球数2/3/4,对应连续单体伤害数量1/3/5,多段攻击会叠加多层减防buff。暂定每层减防5%,最高10层)。
  20. /// </summary>
  21. public class CardSkill_1330000 : CardSkill_BaiHuBase
  22. {
  23. private static readonly int ID = 1330000;
  24. public override int SkillID { get { return ID; } }
  25. // 敌人减防
  26. public static readonly int BuffID_CRITE_UP = (int)XmdsBuffBase.XmdsBuffList.CARD_DEFENCE_DOWN;
  27. //多种不同形态法术id
  28. protected static XmdsSkillValue s_TalentData;
  29. //伤害系数
  30. protected static XmdsSkillValue s_ValueSet1;
  31. //减防buff时间,每层效果
  32. protected static XmdsSkillValue s_ValueSet2;
  33. //额外扣除定力值
  34. protected static XmdsSkillValue s_ValueSet3;
  35. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  36. {
  37. base.OnInit(info, unit, ref template);
  38. var pack1 = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(BuffID_CRITE_UP);
  39. var buff1 = pack1.GetXmdsBuff(0) as XmdsBuff_PropChange;
  40. buff1.CurentChangeType = XmdsVirtual.UnitAttributeType.Defence;
  41. var bt1 = pack1.mBuffTemplate;
  42. pack1.BindTemplateAndDispose();
  43. unit.RegistSendBuff(bt1);
  44. unit.RegistOnHitOther(OnHandleHitOther, info);
  45. }
  46. public override int GetEffectID(int skillLv, int sameNums)
  47. {
  48. return s_TalentData.GetValue(skillLv, sameNums - 1);
  49. }
  50. public override void OnTriggerCardSkill(XmdsVirtual player, XmdsVirtual hitter, AttackSource source, CardSkillData skillData, int sameNums)
  51. {
  52. base.unitLaunchSpell(player, hitter, s_TalentData.GetValue(skillData.skilLv, sameNums - 1));
  53. }
  54. protected override void OnGetCardSkillDamage(BattleParams param)
  55. {
  56. param.SkillDamagePer = s_ValueSet1.GetValue(param.GameSkill.SkillLevel, param.AtkProp.DamagePerID);
  57. // 扣除定力
  58. param.Hitter.AddMP(-s_ValueSet3.GetValue(param.GameSkill.SkillLevel, base.GetTriggerSameCards() - 1), param.Attacker.mUnit, param.Source);
  59. }
  60. protected float OnHandleHitOther(float damage, XmdsVirtual hitted, XmdsVirtual attacker, AttackSource source,
  61. ref XmdsVirtual.AtkResult result, DamageType damageType, GameSkill skill, ref bool isEndDispatch)
  62. {
  63. JSGXmdsHackerModule.CheckAndPrintCardSameErrorInfo("CardSkill_1330000", this.mTriggerSameCards, this.mTriggerTime, source);
  64. var bt = attacker.GetRegistBuff(BuffID_CRITE_UP);
  65. bt.LifeTimeMS = s_ValueSet2.GetValue(skill.SkillLevel, base.GetIndex2(1));
  66. var buff = attacker.GetRegisBuffVirtual(BuffID_CRITE_UP) as XmdsBuff_PropChange;
  67. buff.CurrentValue = -s_ValueSet2.GetValue(skill.SkillLevel, base.GetIndex2(2));
  68. hitted.mUnit.AddBuff(BuffID_CRITE_UP, attacker.mUnit);
  69. return damage;
  70. }
  71. protected override void OnInitSkillParam()
  72. {
  73. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(this.SkillID);
  74. InitData(data, out s_TalentData, XmdsSkillData.XmdsSkillDataKey.TalentData);
  75. InitData(data, out s_ValueSet1, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  76. InitData(data, out s_ValueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  77. InitData(data, out s_ValueSet3, XmdsSkillData.XmdsSkillDataKey.ValueSet3);
  78. }
  79. }
  80. }