S2011.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using Common.Utility.CombatEvent;
  2. using Fort23.Core;
  3. using GameLogic.Combat.Buff;
  4. using GameLogic.Combat.CombatTool;
  5. using GameLogic.Combat.Hero;
  6. namespace GameLogic.Combat.Skill
  7. {
  8. /// <summary>
  9. /// 血祭神通
  10. /// 所有流血状态照成的伤害会转换成充能值,2圈后对全体敌人造成{0}%充能值的伤害
  11. /// </summary>
  12. public class S2011 : SkillBasic
  13. {
  14. private long addHarm;
  15. protected override void ProUseSkill()
  16. {
  17. }
  18. protected override void ProActiveSkill()
  19. {
  20. CombatEventManager.Instance.AddEventListener(CombatEventType.HeroInjured, HeroInjured);
  21. CombatEventManager.Instance.AddEventListener(CombatEventType.TriggerSkillSlots, TriggerSkillSlots);
  22. }
  23. protected override void ProDispose()
  24. {
  25. CombatEventManager.Instance.RemoveEventListener(CombatEventType.HeroInjured, HeroInjured);
  26. CombatEventManager.Instance.RemoveEventListener(CombatEventType.TriggerSkillSlots, TriggerSkillSlots);
  27. }
  28. private void TriggerSkillSlots(IEventData ieventData)
  29. {
  30. TriggerSkillSlotsEventData triggerSkillSlotsEventData = ieventData as TriggerSkillSlotsEventData;
  31. if (triggerSkillSlotsEventData.SkillBasic == this && addHarm > 0)
  32. {
  33. long v = CombatCalculateTool.Instance.GetVlaueRatioForLong(addHarm, effectValue[0]);
  34. if (v > 0)
  35. {
  36. CombatHeroEntity[] allHero =
  37. CombatController.currActiveCombat.CombatHeroController.GetHero(!CombatHeroEntity.IsEnemy);
  38. for (int i = 0; i < allHero.Length; i++)
  39. {
  40. HarmReturnInfo harmReturnInfo = CombatCalculateTool.Instance.Harm(CombatHeroEntity, allHero[i],
  41. v,
  42. AttType.Skill, triggerData,
  43. wuXingType, null,
  44. HarmType.Default);
  45. }
  46. }
  47. addHarm = 0;
  48. }
  49. }
  50. private void HeroInjured(IEventData ieventData)
  51. {
  52. HeroInjuredEventData heroInjuredEventData = ieventData as HeroInjuredEventData;
  53. b_1011 b1011 = heroInjuredEventData.HarmReturnInfo.triggerData.Source as b_1011;
  54. if (b1011 == null || b1011.Source != CombatHeroEntity)
  55. {
  56. return;
  57. }
  58. long harm = heroInjuredEventData.HarmReturnInfo.att;
  59. addHarm += harm;
  60. }
  61. }
  62. }