Warrior_110100.cs 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. using CommonAI.Data;
  2. using CommonAI.Zone;
  3. using CommonAI.Zone.Formula;
  4. using CommonAI.Zone.Helper;
  5. using CommonAI.Zone.Instance;
  6. using System;
  7. using XmdsCommon.Plugin;
  8. using XmdsCommonServer.Plugin;
  9. using XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator;
  10. using XmdsCommonServer.XLS.Data;
  11. using XmdsCommonSkill.Plugin.Buffs;
  12. using XmdsCommonSkill.Plugin.Skills;
  13. using static CommonAI.Zone.Instance.InstanceUnit;
  14. /// <summary>
  15. /// 战士【1】技能 1 基类
  16. /// 三段向前挥舞的重击,巨剑前端附有缠绕特效,基础造成N1%/N2%/N3%(第三段需要多一个伤害填值(变为了多个相同值的小伤害N4%+原有的下砸伤害N3%)
  17. /// 【表格1:34_8000,38_9000,41_10000,50_10000。第一,第二段不变,第三段是空中转的两下伤害,第四段是下砸伤害,(3,4段伤害)根据动作需要在序列里面配置伤害】
  18. /// 攻击加成伤害,递进增加。打击比普攻范围大,内置CD,每下一段会在上一段动作做完,才能释放(技能图标是每点一段会短暂延迟,再出一下一段,出的速度与技能动作时间同步),
  19. /// T秒内不释放下一段就整体进入冷却。 (160°扇形,半径3.5-4.5)(带位移,位移在2-3) 此技能每段造成伤害提升怒气n点【每一段命中,积攒怒气值】
  20. /// </summary>
  21. ///
  22. namespace XmdsCommonSkill.Plugin.Skills.Warrior
  23. {
  24. public class Warrior_110100 : XmdsSkillBase
  25. {
  26. /// 技能ID.
  27. private static readonly int ID = 110100;
  28. public override int SkillID { get { return ID; } }
  29. //技能配置表数据 : 固定值,百分比
  30. protected XmdsSkillValue mValueSet1;
  31. //怒气值增加概率,值
  32. protected XmdsSkillValue mValueSet8;
  33. //多段命中标记
  34. public int[] mHitFlag = { 0, 0, 0, 0};
  35. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  36. {
  37. unit.RegistLaunchSkillOver(OnLaunchSkillOver, info);
  38. }
  39. protected virtual int OnLaunchSkillOver(GameSkill info, XmdsCommonServer.Plugin.XmdsVirtual launcher, CommonAI.Zone.Instance.InstanceUnit.SkillState skill)
  40. {
  41. if (skill.ActionIndex == 0)
  42. {
  43. for (int i = 0; i < mHitFlag.Length; i++)
  44. {
  45. mHitFlag[i] = 0;
  46. }
  47. }
  48. return 0;
  49. }
  50. protected override void OnSkillDamagePerEvent(BattleParams param)
  51. {
  52. param.SkillDamageAdd = mValueSet1.GetValue(param.GameSkill.SkillLevel, param.AtkProp.DamagePerID);
  53. param.SkillDamagePer = mValueSet1.GetValueExt(param.GameSkill.SkillLevel, param.AtkProp.DamagePerID);
  54. bool firstHit = false;
  55. if(param.AtkProp.DamagePerID < mHitFlag.Length)
  56. {
  57. firstHit = mHitFlag[param.AtkProp.DamagePerID] == 0;
  58. mHitFlag[param.AtkProp.DamagePerID] = 1;
  59. }
  60. //当段命中
  61. if(firstHit && param.Attacker.mUnit.RandomN.Next(GlobalData.RATE_BASE) < mValueSet8.GetValue(param.GameSkill.SkillLevel, 1))
  62. {
  63. param.Attacker.Talent__Add(mValueSet8.GetValue(param.GameSkill.SkillLevel, 2));
  64. }
  65. }
  66. protected override void OnInitConfig()
  67. {
  68. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  69. InitData(data, out mValueSet1, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  70. // 基础扩展
  71. InitData(data, out mValueSet8, XmdsSkillData.XmdsSkillDataKey.ValueSet8);
  72. }
  73. }
  74. }