S2007.cs 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. CombatHeroEntity.CurrCombatHeroInfo.addAttSpeed_bl -= _addSpeed;
  44. _addSpeed = 0;
  45. _isUpdate = false;
  46. }
  47. private void StartInjured(IEventData iEventData)
  48. {
  49. if (SelfSkillConfig.level < 5||!_isUpdate)
  50. {
  51. return;
  52. }
  53. StartInjuredEventData heroInjuredEventData = iEventData as StartInjuredEventData;
  54. HarmReturnInfo harmReturnInfo = heroInjuredEventData.HarmReturnInfo;
  55. if (harmReturnInfo.source == CombatHeroEntity)
  56. {
  57. harmReturnInfo.att +=
  58. CombatCalculateTool.Instance.GetVlaueRatioForLong(harmReturnInfo.att,
  59. SelfSkillConfig.effectValue[2]);
  60. }
  61. }
  62. private void AddUseGongFa(IEventData iEventData)
  63. {
  64. AddUseGongFaEventData addUseGongFaEventData = iEventData as AddUseGongFaEventData;
  65. if (addUseGongFaEventData.SkillBasic.CombatHeroEntity == CombatHeroEntity )
  66. {
  67. if (IsPassiveActivateSkill(addUseGongFaEventData.SkillBasic))
  68. {
  69. _addTime = 0;
  70. _isUpdate = true;
  71. Finish();
  72. _addSpeed = SelfSkillConfig.effectValue[0];
  73. CombatHeroEntity.CurrCombatHeroInfo.addAttSpeed_bl += _addSpeed;
  74. }
  75. }
  76. }
  77. }
  78. }