b_1018.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using Common.Utility.CombatEvent;
  2. using Fort23.Core;
  3. using GameLogic.Combat.CombatTool;
  4. using GameLogic.Player;
  5. namespace GameLogic.Combat.Buff
  6. {
  7. /// <summary>
  8. /// 感电
  9. /// 麻痹敌人,敌人的身体受到麻痹,有{0}%*层数的概率是功法无法进入释放状态,没触发一次,消耗一半感电
  10. /// </summary>
  11. public class b_1018 : BuffBasic
  12. {
  13. protected override void ProInit()
  14. {
  15. CombatEventManager.Instance.AddEventListener(CombatEventType.TriggerSkillSlots, TriggerSkillSlots);
  16. }
  17. private void TriggerSkillSlots(IEventData eventData)
  18. {
  19. TriggerSkillSlotsEventData triggerSkillSlotsEventData = eventData as TriggerSkillSlotsEventData;
  20. if (triggerSkillSlotsEventData.SkillBasic != null &&
  21. triggerSkillSlotsEventData.SkillBasic.CombatHeroEntity == combatHeroEntity)
  22. {
  23. int triggerOdds = (int)(buffInf.BuffConfig.effectValue[0] * buffCount);
  24. int odds = CombatCalculateTool.Instance.GetOdd(0, 100);
  25. if (odds <= triggerOdds)
  26. {
  27. triggerSkillSlotsEventData.isNotUseSkill = true;
  28. ReduceCount(1);
  29. }
  30. }
  31. }
  32. protected override void ProDormancyObj()
  33. {
  34. CombatEventManager.Instance.RemoveEventListener(CombatEventType.TriggerSkillSlots, TriggerSkillSlots);
  35. }
  36. }
  37. }