S2014.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using Common.Utility.CombatEvent;
  2. using Fort23.Core;
  3. using GameLogic.Combat.Buff;
  4. using GameLogic.Combat.CombatTool;
  5. namespace GameLogic.Combat.Skill
  6. {
  7. /// <summary>
  8. /// 毒爆
  9. ///后方功法击中目标后,如果目标升上有{0}层毒时对目标照成20%伤害,并对周围的敌人照成等额伤害
  10. /// </summary>
  11. public class S2014 : SkillBasic
  12. {
  13. protected override void ProActiveSkill()
  14. {
  15. CombatEventManager.Instance.AddEventListener(CombatEventType.HeroInjured, HeroInjured);
  16. }
  17. protected override void ProDispose()
  18. {
  19. CombatEventManager.Instance.RemoveEventListener(CombatEventType.HeroInjured, HeroInjured);
  20. }
  21. private void HeroInjured(IEventData iEventData)
  22. {
  23. HeroInjuredEventData heroInjuredEventData = iEventData as HeroInjuredEventData;
  24. if (heroInjuredEventData.HarmReturnInfo.source == CombatHeroEntity &&
  25. heroInjuredEventData.HarmReturnInfo.isHitHero)
  26. {
  27. SkillBasic skillBasic = heroInjuredEventData.HarmReturnInfo.triggerData.Source as SkillBasic;
  28. if (skillBasic != null && IsPassiveActivateSkill(skillBasic))
  29. {
  30. CombatHeroEntity target =
  31. heroInjuredEventData.HarmReturnInfo.target.combatHeroEntity as CombatHeroEntity;
  32. b_1003 b1003 = target.BuffControl.GetBuffBasicForType<b_1003>();
  33. if (b1003 != null && b1003.buffCount >= effectValue[0])
  34. {
  35. long harm = heroInjuredEventData.HarmReturnInfo.att;
  36. long v = CombatCalculateTool.Instance.GetVlaueRatioForLong(harm, effectValue[1]);
  37. HarmReturnInfo harmReturnInfo = CombatCalculateTool.Instance.Harm(CombatHeroEntity, target,
  38. v,
  39. AttType.Skill | AttType.JianJie, triggerData,
  40. wuXingType, null,
  41. HarmType.Default);
  42. long v2 = CombatCalculateTool.Instance.GetVlaueRatioForLong(v, effectValue[2]);
  43. CombatHeroEntity[] allHero =
  44. CombatController.currActiveCombat.CombatHeroController.GetHero(!CombatHeroEntity.IsEnemy);
  45. for (int i = 0; i < allHero.Length; i++)
  46. {
  47. if (allHero[i] == target)
  48. {
  49. continue;
  50. }
  51. CombatCalculateTool.Instance.Harm(CombatHeroEntity, allHero[i],
  52. v2,
  53. AttType.Skill | AttType.JianJie, triggerData,
  54. wuXingType, null,
  55. HarmType.Default);
  56. }
  57. }
  58. }
  59. }
  60. }
  61. protected override void ProUseSkill()
  62. {
  63. }
  64. }
  65. }