S2007.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. using Common.Utility.CombatEvent;
  2. using Fort23.Core;
  3. using GameLogic.Combat.CombatTool;
  4. using OfficeOpenXml.FormulaParsing.Excel.Functions.Logical;
  5. namespace GameLogic.Combat.Skill
  6. {
  7. /// <summary>
  8. /// 天风迅灵 后槽位技能在催动时获得转盘加速10%,持续2秒
  9. /// 加速期间伤害提升10%
  10. /// </summary>
  11. public class S2007 : SkillBasic
  12. {
  13. private float _addSpeed;
  14. private bool _isUpdate;
  15. private float _addTime;
  16. protected override void ProUseSkill()
  17. {
  18. }
  19. protected override void ProReplace()
  20. {
  21. CombatEventManager.Instance.RemoveEventListener(CombatEventType.AddUseGongFa, AddUseGongFa);
  22. CombatEventManager.Instance.RemoveEventListener(CombatEventType.StartInjured, StartInjured);
  23. // Finish();
  24. }
  25. protected override void ProActiveSkill()
  26. {
  27. CombatEventManager.Instance.AddEventListener(CombatEventType.StartInjured, StartInjured);
  28. CombatEventManager.Instance.AddEventListener(CombatEventType.AddUseGongFa, AddUseGongFa);
  29. }
  30. protected override void ProCombatUpdate(float time)
  31. {
  32. if (_isUpdate)
  33. {
  34. _addTime += time;
  35. if (_addTime > SelfSkillConfig.effectValue[1])
  36. {
  37. Finish();
  38. }
  39. }
  40. }
  41. private void Finish()
  42. {
  43. if (CombatHeroEntity == null)
  44. {
  45. return;
  46. }
  47. CombatHeroEntity.CurrCombatHeroInfo.addAttSpeed_bl -= _addSpeed;
  48. _addSpeed = 0;
  49. _isUpdate = false;
  50. }
  51. private void StartInjured(IEventData iEventData)
  52. {
  53. if (SelfSkillConfig.level < 5||!_isUpdate)
  54. {
  55. return;
  56. }
  57. StartInjuredEventData heroInjuredEventData = iEventData as StartInjuredEventData;
  58. HarmReturnInfo harmReturnInfo = heroInjuredEventData.HarmReturnInfo;
  59. if (harmReturnInfo.source == CombatHeroEntity)
  60. {
  61. harmReturnInfo.att +=
  62. CombatCalculateTool.Instance.GetVlaueRatioForLong(harmReturnInfo.att,
  63. SelfSkillConfig.effectValue[2]);
  64. }
  65. }
  66. private void AddUseGongFa(IEventData iEventData)
  67. {
  68. AddUseGongFaEventData addUseGongFaEventData = iEventData as AddUseGongFaEventData;
  69. if (addUseGongFaEventData.SkillBasic.CombatHeroEntity == CombatHeroEntity )
  70. {
  71. if (IsPassiveActivateSkill(addUseGongFaEventData.SkillBasic))
  72. {
  73. _addTime = 0;
  74. _isUpdate = true;
  75. Finish();
  76. _addSpeed = SelfSkillConfig.effectValue[0];
  77. CombatHeroEntity.CurrCombatHeroInfo.addAttSpeed_bl += _addSpeed;
  78. }
  79. }
  80. }
  81. }
  82. }