S501201.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using Common.Utility.CombatEvent;
  2. using Fort23.Core;
  3. using GameLogic.Combat.CombatTool;
  4. using GameLogic.Player;
  5. namespace GameLogic.Combat.Skill
  6. {
  7. /// <summary>
  8. /// 火灵丹 每层经过火经脉时使火系功法伤害提升1%,最多叠加20层
  9. /// </summary>
  10. public class S501201 : SkillBasic
  11. {
  12. private int _currAddCount;
  13. private int hd = 216;
  14. private int lastJingGuo;
  15. protected override void ProUseSkill()
  16. {
  17. }
  18. protected override void ProDispose()
  19. {
  20. _currAddCount = 0;
  21. CombatEventManager.Instance.RemoveEventListener(CombatEventType.StartInjured, StartInjured);
  22. }
  23. protected override void ProActiveSkill()
  24. {
  25. if (angle > hd)
  26. {
  27. lastJingGuo += 360;
  28. }
  29. else
  30. {
  31. lastJingGuo = hd;
  32. }
  33. CombatEventManager.Instance.AddEventListener(CombatEventType.StartInjured, StartInjured);
  34. }
  35. protected override void ProCombatUpdate(float time)
  36. {
  37. // float jd = angle % 360;
  38. if (angle >= lastJingGuo)
  39. {
  40. lastJingGuo += 360;
  41. if (_currAddCount < SelfSkillConfig.effectValue[1])
  42. {
  43. _currAddCount++;
  44. }
  45. }
  46. }
  47. private void StartInjured(IEventData iEventData)
  48. {
  49. HeroInjuredEventData heroInjuredEventData = iEventData as HeroInjuredEventData;
  50. if (heroInjuredEventData.HarmReturnInfo.source == CombatHeroEntity)
  51. {
  52. SkillBasic skillBasic = heroInjuredEventData.HarmReturnInfo.triggerData.Source as SkillBasic;
  53. if (skillBasic == null || !skillBasic.wuXingType.HasFlag(WuXingType.Fire))
  54. {
  55. return;
  56. }
  57. long addAtt = CombatCalculateTool.Instance.GetVlaueRatioForLong(heroInjuredEventData.HarmReturnInfo.att,
  58. SelfSkillConfig.effectValue[0] * _currAddCount);
  59. heroInjuredEventData.HarmReturnInfo.att += addAtt;
  60. }
  61. }
  62. }
  63. }