Warrior_110220.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using CommonAI.Data;
  2. using CommonAI.Zone.Helper;
  3. using CommonAI.Zone.Instance;
  4. using XmdsCommonServer.Plugin;
  5. using XmdsCommonServer.XLS.Data;
  6. namespace XmdsCommonSkill.Plugin.Skills.Warrior
  7. {
  8. /// <summary>
  9. /// 二技能 : 2-2( 落地后的动作有一个二段按钮,按下才会释放第二段的位移+挥击,存在T秒。挥击的法术会向前短暂飞出,(编辑器自配)【同1-3】伤害系数等不变,击中有n%几率提升怒气n点 多人只算一次)
  10. /// </summary>
  11. public class Warrior_110220 : Warrior_110210
  12. {
  13. private static readonly int ID = 110220;
  14. //挥斩伤害比例
  15. protected XmdsSkillValue mValueSet3;
  16. //挥击额外获得怒气
  17. protected XmdsSkillValue mValueSet6;
  18. //挥击是否首次
  19. private bool isFirstHuiJi = false;
  20. public override int SkillID { get { return ID; } }
  21. protected override void OnSkillDamagePerEvent(BattleParams param)
  22. {
  23. if(param.AtkProp.DamagePerID <= 1)
  24. {
  25. isFirstHuiJi = true;
  26. }
  27. if(param.AtkProp.DamagePerID == 3)//挥击
  28. {
  29. param.SkillDamagePer = mValueSet3.GetValue(param.GameSkill.TalentSkillLevel2);
  30. //概率性获得怒气加成
  31. if (isFirstHuiJi)
  32. {
  33. isFirstHuiJi = false;
  34. if (param.Attacker.mUnit.RandomN.Next(GlobalData.RATE_BASE) < mValueSet6.GetValue(param.GameSkill.TalentSkillLevel2, 1))
  35. {
  36. param.Attacker.Talent__Add(mValueSet6.GetValue(param.GameSkill.TalentSkillLevel2, 2));
  37. }
  38. }
  39. }
  40. else
  41. {
  42. base.OnSkillDamagePerEvent(param);
  43. }
  44. }
  45. protected override void OnInitConfig()
  46. {
  47. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  48. InitData(data, out mValueSet1, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  49. InitData(data, out mValueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  50. InitData(data, out mValueSet3, XmdsSkillData.XmdsSkillDataKey.ValueSet3);
  51. // 扩展配置
  52. InitData(data, out mValueSet5, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
  53. //挥击额外获得怒气
  54. InitData(data, out mValueSet6, XmdsSkillData.XmdsSkillDataKey.ValueSet6);
  55. //释放过程中免伤
  56. InitData(data, out mValueSet8, XmdsSkillData.XmdsSkillDataKey.ValueSet8);
  57. }
  58. }
  59. }