S501401.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using Common.Utility.CombatEvent;
  2. using Fort23.Core;
  3. using OfficeOpenXml.FormulaParsing.Excel.Functions.Logical;
  4. namespace GameLogic.Combat.Skill
  5. {
  6. /// <summary>
  7. /// 极速齿轮 后槽位技能在催动时获得转盘加速10%,持续2秒
  8. /// </summary>
  9. public class S501401 : SkillBasic
  10. {
  11. private float _addSpeed;
  12. private bool _isUpdate;
  13. private float _addTime;
  14. protected override void ProUseSkill()
  15. {
  16. }
  17. protected override void ProDispose()
  18. {
  19. CombatEventManager.Instance.RemoveEventListener(CombatEventType.AddUseGongFa, AddUseGongFa);
  20. Finish();
  21. }
  22. protected override void ProActiveSkill()
  23. {
  24. CombatEventManager.Instance.AddEventListener(CombatEventType.AddUseGongFa, AddUseGongFa);
  25. }
  26. protected override void ProCombatUpdate(float time)
  27. {
  28. if (_isUpdate)
  29. {
  30. _addTime += time;
  31. if (_addTime > SelfSkillConfig.effectValue[1])
  32. {
  33. Finish();
  34. }
  35. }
  36. }
  37. private void Finish()
  38. {
  39. CombatHeroEntity.CurrCombatHeroInfo.addAttSpeed_bl -= _addSpeed;
  40. _addSpeed = 0;
  41. _isUpdate = false;
  42. }
  43. private void AddUseGongFa(IEventData iEventData)
  44. {
  45. AddUseGongFaEventData addUseGongFaEventData = iEventData as AddUseGongFaEventData;
  46. if (addUseGongFaEventData.SkillBasic.CombatHeroEntity == CombatHeroEntity &&
  47. addUseGongFaEventData.SkillBasic.index - 1 == index)
  48. {
  49. _addTime = 0;
  50. _isUpdate = true;
  51. Finish();
  52. _addSpeed = SelfSkillConfig.effectValue[0];
  53. CombatHeroEntity.CurrCombatHeroInfo.addAttSpeed_bl += _addSpeed;
  54. }
  55. }
  56. }
  57. }