Warrior_110120.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using CommonAI.Zone.Helper;
  2. using CommonAI.Zone.Instance;
  3. using CommonLang;
  4. using XmdsCommon.Plugin;
  5. using XmdsCommonServer.Plugin;
  6. using XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator;
  7. using XmdsCommonServer.XLS.Data;
  8. namespace XmdsCommonSkill.Plugin.Skills.Warrior
  9. {
  10. /// <summary>
  11. /// 战士【1】技能 1 - 2(N%几率此技能伤害增幅N%且怒气积攒量增加N(增幅和积攒在一个触发概率里))
  12. /// </summary>
  13. public class Warrior_110120 : Warrior_110110
  14. {
  15. private static readonly int ID = 110120;
  16. public override int SkillID { get { return ID; } }
  17. //概率增幅N倍伤害
  18. protected XmdsSkillValue mValueSet3;
  19. //积攒怒气增加
  20. protected XmdsSkillValue mValueSet5;
  21. //是否触发过怒气积攒
  22. public int [] mTriggerAddAnger = {0, 0, 0, 0};
  23. protected override void OnSkillDamagePerEvent(BattleParams param)
  24. {
  25. base.OnSkillDamagePerEvent(param);
  26. if (param.Attacker.mUnit.RandomN.Next(0, 10000) < mValueSet3.GetValue(param.GameSkill.TalentSkillLevel2, 1))
  27. {
  28. param.SkillDamagePer += mValueSet3.GetValue(param.GameSkill.TalentSkillLevel2, 2);
  29. if(param.AtkProp.DamagePerID < mTriggerAddAnger.Length && mTriggerAddAnger[param.AtkProp.DamagePerID] == 0)
  30. {
  31. mTriggerAddAnger[param.AtkProp.DamagePerID] = 1;
  32. param.Attacker.Talent__Add(mValueSet5.GetValue(param.GameSkill.TalentSkillLevel2));
  33. }
  34. }
  35. }
  36. protected override int OnLaunchSkillOver(GameSkill info, XmdsCommonServer.Plugin.XmdsVirtual launcher, CommonAI.Zone.Instance.InstanceUnit.SkillState skill)
  37. {
  38. if (skill.ActionIndex == 0)
  39. {
  40. for (int i = 0; i < mTriggerAddAnger.Length; i++)
  41. {
  42. mTriggerAddAnger[i] = 0;
  43. }
  44. }
  45. return base.OnLaunchSkillOver(info, launcher, skill);
  46. }
  47. protected override void OnInitConfig()
  48. {
  49. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  50. InitData(data, out mValueSet1, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  51. InitData(data, out mValueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  52. InitData(data, out mValueSet3, XmdsSkillData.XmdsSkillDataKey.ValueSet3);
  53. // 概率提升里面增加怒气
  54. InitData(data, out mValueSet5, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
  55. // 基础扩展
  56. InitData(data, out mValueSet8, XmdsSkillData.XmdsSkillDataKey.ValueSet8);
  57. }
  58. }
  59. }