S9064.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. using CombatLibrary.CombatLibrary.CombatCore.CustomizeTimeLogic.FxLogic;
  2. using Common.Utility.CombatEvent;
  3. using Fort23.Core;
  4. using GameLogic.Combat.Buff;
  5. using GameLogic.Combat.CombatTool;
  6. using GameLogic.Combat.Hero;
  7. using UnityEngine;
  8. using UTool.CustomizeTimeLogic.FxLogic.TimeLineEventinterface;
  9. namespace GameLogic.Combat.Skill
  10. {
  11. /// <summary>
  12. /// 缠绕
  13. /// 敌人脚下生长出藤蔓,将敌人捆住。{0}秒内不能行动(功法不在释放和填充),受到木灵之子的攻击伤害+{1}%
  14. /// </summary>
  15. public class S9064 : SkillBasic
  16. {
  17. private float _currTime;
  18. private bool _isUpdate;
  19. private TimeLineEventLogicGroupBasic _chanRaoLoop;
  20. private CombatHeroEntity chanRaoTarget;
  21. private BuffBasic _buffBasic;
  22. protected override void ProUseSkill()
  23. {
  24. _isUpdate = false;
  25. ActivationTimeLineData("9064");
  26. CombatHeroHitPoint combatHeroHitPoint = CombatHeroEntity.CombatAIBasic.currFocusTarget
  27. .GetThis<CombatHeroEntity>()
  28. .GetMainHotPoin<CombatHeroHitPoint>();
  29. BetterList<ILifetCycleHitPoint> currTarget = new BetterList<ILifetCycleHitPoint>();
  30. currTarget.Add(combatHeroHitPoint);
  31. chanRaoTarget = combatHeroHitPoint.combatHeroEntity as CombatHeroEntity;
  32. _chanRaoLoop = ActivationTimeLineData("9064_chanrao", currTarget: currTarget);
  33. }
  34. protected override void ProActiveSkill()
  35. {
  36. CombatEventManager.Instance.AddEventListener(CombatEventType.StartInjured, StartInjured);
  37. }
  38. private void StartInjured(IEventData data)
  39. {
  40. if (!_isUpdate)
  41. {
  42. return;
  43. }
  44. StartInjuredEventData startInjuredEventData = data as StartInjuredEventData;
  45. if (startInjuredEventData.HarmReturnInfo.target.combatHeroEntity != chanRaoTarget)
  46. {
  47. return;
  48. }
  49. SummonCombatHeroEntity summonCombatHeroEntity =
  50. startInjuredEventData.HarmReturnInfo.source as SummonCombatHeroEntity;
  51. if (summonCombatHeroEntity != null && summonCombatHeroEntity.ownerEntity == CombatHeroEntity)
  52. {
  53. long att = startInjuredEventData.HarmReturnInfo.att;
  54. long v = CombatCalculateTool.Instance.GetVlaueRatioForLong(att, effectValue[1]);
  55. startInjuredEventData.HarmReturnInfo.att += v;
  56. }
  57. //如果是木桩 伤害增加
  58. }
  59. protected override void ProDefaultTimeLineTrigger(string groupName, CombatHeroHitPoint targetEntity,
  60. ITimelineFxLogic timelineFxLogic,
  61. TriggerData triggerData, ISkillFeatures skillFeatures)
  62. {
  63. _currTime = 0;
  64. _isUpdate = true;
  65. BuffInfo buffInfo = BuffInfo.GetBuffInfo(10251, -1, 1);
  66. _buffBasic = chanRaoTarget.BuffControl.AddBuff(CombatHeroEntity, buffInfo);
  67. }
  68. private void Finish()
  69. {
  70. _isUpdate = false;
  71. chanRaoTarget = null;
  72. if (_buffBasic != null)
  73. {
  74. _buffBasic.DelectBuff();
  75. }
  76. _buffBasic = null;
  77. if (_chanRaoLoop != null)
  78. {
  79. _chanRaoLoop.CloseLoopFx();
  80. }
  81. _chanRaoLoop = null;
  82. }
  83. protected override void ProDispose()
  84. {
  85. Finish();
  86. }
  87. protected override void ProCombatUpdate(float time)
  88. {
  89. if (!_isUpdate)
  90. {
  91. return;
  92. }
  93. _currTime += time;
  94. if (_currTime > effectValue[0])
  95. {
  96. Finish();
  97. }
  98. }
  99. }
  100. }