Warrior_110520.cs 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. using CommonAI.Zone;
  2. using CommonAI.Zone.Helper;
  3. using CommonAI.Zone.Instance;
  4. using CommonLang;
  5. using System;
  6. using XmdsCommon.Plugin;
  7. using XmdsCommonServer.Plugin;
  8. using XmdsCommonServer.Plugin.Base;
  9. using XmdsCommonServer.XLS.Data;
  10. namespace XmdsCommonSkill.Plugin.Skills.Warrior
  11. {
  12. /// <summary>
  13. /// 五技能 5-2(烈焰风暴释放期间再次释放技能可以立刻停止旋转,顺势砸下对指向小区域造成一次伤害(伤害为未打出伤害的百分比))
  14. /// </summary>
  15. public class Warrior_110520 : Warrior_110510
  16. {
  17. private static readonly int ID = 110520;
  18. //一次打完剩余剑刃风暴
  19. protected XmdsSkillValue mValueSet3;
  20. private int mLeftSkillDamage = 1; //剩余剑刃风暴打出,伤害
  21. public override int SkillID { get { return ID; } }
  22. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  23. {
  24. base.OnInit(info, unit, ref template);
  25. unit.RegistLaunchSkillOver(OnLaunchSkillOver, info);
  26. }
  27. protected override void OnSkillDamagePerEvent(BattleParams param)
  28. {
  29. base.OnSkillDamagePerEvent(param);
  30. if (param.AtkProp.DamagePerID == 2)
  31. {
  32. param.SkillDamagePer = CUtils.CastInt(param.SkillDamagePer * XmdsUnitProp.PER * this.mLeftSkillDamage);
  33. }
  34. }
  35. private int OnLaunchSkillOver(GameSkill info, XmdsCommonServer.Plugin.XmdsVirtual attacker, CommonAI.Zone.Instance.InstanceUnit.SkillState state)
  36. {
  37. //挥斩出去的动作
  38. if (state.ActionIndex == 3)
  39. {
  40. //自动/手动 释放的剑刃风暴
  41. long leftTime = DAMAGE_SPELL_TIME - (CommonLang.CUtils.localTimeMS - base.damageStartTime);
  42. this.mLeftSkillDamage = Math.Max(1, CUtils.CastInt(leftTime / 500)) * mValueSet3.GetValue(info.TalentSkillLevel2);
  43. //根据剩余时间,返还怒气
  44. int returnAnger = CUtils.CastInt(XmdsGlobalData.GetTalentData(this.SkillID).GetValue() * leftTime / DAMAGE_SPELL_TIME);
  45. attacker.Talent__Add(returnAnger);
  46. }
  47. return 0;
  48. }
  49. protected override void OnInitConfig()
  50. {
  51. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  52. InitData(data, out mJuQiValue, XmdsSkillData.XmdsSkillDataKey.DmgRate);
  53. InitData(data, out mValueSet1, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  54. InitData(data, out mValueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  55. InitData(data, out mValueSet3, XmdsSkillData.XmdsSkillDataKey.ValueSet3);
  56. //扩展配置
  57. InitData(data, out mValueSet5, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
  58. InitData(data, out mValueSet6, XmdsSkillData.XmdsSkillDataKey.ValueSet6);
  59. InitData(data, out mValueSet8, XmdsSkillData.XmdsSkillDataKey.ValueSet8);
  60. }
  61. }
  62. }