S9062.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. using CombatLibrary.CombatLibrary.CombatCore.CustomizeTimeLogic.FxLogic;
  2. using Common.Utility.CombatEvent;
  3. using Core.Utility;
  4. using Fort23.Core;
  5. using GameLogic.Combat.CombatTool;
  6. using GameLogic.Combat.Hero;
  7. using OfficeOpenXml.FormulaParsing.Excel.Functions.Logical;
  8. using UnityEngine;
  9. using UTool.CustomizeTimeLogic.FxLogic.TimeLineEventinterface;
  10. namespace GameLogic.Combat.Skill
  11. {
  12. /// <summary>
  13. /// 木灵分身
  14. /// 生命低于{0}%时触发,木灵的根须快速在自身周围生出2个木灵之子,木灵之子之有普通攻击,木灵之子拥有boss的{1}最大生命值的生命
  15. ///(等级跟随boss的等级走)
  16. /// </summary>
  17. public class S9062 : SkillBasic
  18. {
  19. private bool _isTrigger;
  20. private Vector3[] pos;
  21. // private Vector3 pos2;
  22. protected override void ProUseSkill()
  23. {
  24. ActivationTimeLineData("9062");
  25. Vector3 pos1 = CombatHeroEntity.GameObject.transform.TransformPoint(new Vector3(3, 0, 3));
  26. Vector3 pos2 = CombatHeroEntity.GameObject.transform.TransformPoint(new Vector3(-3, 0, 3));
  27. if (pos == null)
  28. {
  29. pos = new Vector3[2];
  30. }
  31. pos[0] = pos1;
  32. pos[1] = pos2;
  33. ActivationTimeLineData("9062_fashe", customizePos: new Vector3[] { pos1 });
  34. ActivationTimeLineData("9062_fashe", customizePos: new Vector3[] { pos2 });
  35. }
  36. protected override void ProActiveSkill()
  37. {
  38. CombatEventManager.Instance.AddEventListener(CombatEventType.HeroInjured, HeroInjured);
  39. }
  40. protected override void ProDispose()
  41. {
  42. CombatEventManager.Instance.RemoveEventListener(CombatEventType.HeroInjured, HeroInjured);
  43. }
  44. private void HeroInjured(IEventData data)
  45. {
  46. if (_isTrigger)
  47. {
  48. return;
  49. }
  50. HeroInjuredEventData heroInjuredEventData = data as HeroInjuredEventData;
  51. if (heroInjuredEventData.HarmReturnInfo.target.combatHeroEntity == CombatHeroEntity)
  52. {
  53. if (CombatHeroEntity.HpBl < effectValue[0])
  54. {
  55. _isTrigger = true;
  56. CombatHeroEntity.CombatHeroSkillControl.This<CombatHeroSkillControl>().AddCommandSkill(this);
  57. // ZhaoHuan();
  58. }
  59. }
  60. }
  61. private void ZhaoHuan()
  62. {
  63. for (int i = 0; i < 2; i++)
  64. {
  65. CombatHeroEntity heroEntity = new CombatHeroEntity();
  66. heroEntity.IsEnemy = true;
  67. CombatHeroInfo combatHeroInfo = new CombatHeroInfo();
  68. combatHeroInfo.InitMonster(1005, CombatHeroEntity.CurrCombatHeroInfo.level.Value);
  69. combatHeroInfo.hp =(EncryptionLong)
  70. CombatCalculateTool.Instance.GetVlaueRatioForLong(CombatHeroEntity.MaxCombatHeroInfo.hp.Value,
  71. effectValue[1]);
  72. CombatController.currActiveCombat.CombatHeroController.SummonHero(combatHeroInfo, CombatHeroEntity,
  73. pos[i], -1, null);
  74. }
  75. S9061 s9061 = CombatHeroEntity.CombatHeroSkillControl.GetSkillBasic<S9061>();
  76. if (s9061 != null)
  77. {
  78. CombatHeroEntity.CombatHeroSkillControl.This<CombatHeroSkillControl>().AddCommandSkill(s9061);
  79. }
  80. }
  81. protected override void ProDefaultTimeLineTrigger(string groupName, CombatHeroHitPoint targetEntity,
  82. ITimelineFxLogic timelineFxLogic,
  83. TriggerData triggerData, ISkillFeatures skillFeatures)
  84. {
  85. ZhaoHuan();
  86. // float harmBl = 0;
  87. // b_1018 b1018 = targetEntity.combatHeroEntity.BuffControl.GetBuffBasicForType<b_1018>();
  88. // if (b1018 != null) //消耗一层感电,额外照成伤害
  89. // {
  90. // harmBl += b1018.buffCount * effectValue[1];
  91. // }
  92. //
  93. // long v = CombatCalculateTool.Instance.GetVlaueRatioForLong(CombatHeroEntity.CurrCombatHeroInfo.attack.Value,
  94. // harmBl);
  95. //
  96. // HarmReturnInfo harmReturnInfo = CombatCalculateTool.Instance.Harm(CombatHeroEntity, targetEntity, v,
  97. // AttType.Skill, triggerData,
  98. // wuXingType, skillFeatures,
  99. // HarmType.Default);
  100. }
  101. }
  102. }