S9064.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. ActivationTimeLineData("9064");
  25. CombatHeroHitPoint combatHeroHitPoint = CombatHeroEntity.CombatAIBasic.currFocusTarget
  26. .GetThis<CombatHeroEntity>()
  27. .GetMainHotPoin<CombatHeroHitPoint>();
  28. BetterList<ILifetCycleHitPoint> currTarget = new BetterList<ILifetCycleHitPoint>();
  29. currTarget.Add(combatHeroHitPoint);
  30. chanRaoTarget = combatHeroHitPoint.combatHeroEntity as CombatHeroEntity;
  31. _chanRaoLoop = ActivationTimeLineData("9064_chanrao", currTarget: currTarget);
  32. }
  33. protected override void ProActiveSkill()
  34. {
  35. CombatEventManager.Instance.AddEventListener(CombatEventType.StartInjured, StartInjured);
  36. }
  37. private void StartInjured(IEventData data)
  38. {
  39. if (!_isUpdate)
  40. {
  41. return;
  42. }
  43. StartInjuredEventData startInjuredEventData = data as StartInjuredEventData;
  44. if (startInjuredEventData.HarmReturnInfo.target.combatHeroEntity != chanRaoTarget)
  45. {
  46. return;
  47. }
  48. SummonCombatHeroEntity summonCombatHeroEntity =
  49. startInjuredEventData.HarmReturnInfo.source as SummonCombatHeroEntity;
  50. if (summonCombatHeroEntity != null && summonCombatHeroEntity.ownerEntity == CombatHeroEntity)
  51. {
  52. long att = startInjuredEventData.HarmReturnInfo.att;
  53. long v = CombatCalculateTool.Instance.GetVlaueRatioForLong(att, effectValue[1]);
  54. startInjuredEventData.HarmReturnInfo.att += v;
  55. }
  56. //如果是木桩 伤害增加
  57. }
  58. protected override void ProDefaultTimeLineTrigger(string groupName, CombatHeroHitPoint targetEntity,
  59. ITimelineFxLogic timelineFxLogic,
  60. TriggerData triggerData, ISkillFeatures skillFeatures)
  61. {
  62. _currTime = 0;
  63. _isUpdate = true;
  64. BuffInfo buffInfo = BuffInfo.GetBuffInfo(10251, -1, 1);
  65. _buffBasic = chanRaoTarget.BuffControl.AddBuff(CombatHeroEntity, buffInfo);
  66. }
  67. private void Finish()
  68. {
  69. _isUpdate = false;
  70. chanRaoTarget = null;
  71. if (_buffBasic != null)
  72. {
  73. _buffBasic.DelectBuff();
  74. }
  75. _buffBasic = null;
  76. if (_chanRaoLoop != null)
  77. {
  78. _chanRaoLoop.CloseLoopFx();
  79. }
  80. _chanRaoLoop = null;
  81. }
  82. protected override void ProCombatUpdate(float time)
  83. {
  84. if (!_isUpdate)
  85. {
  86. return;
  87. }
  88. _currTime += time;
  89. if (_currTime > effectValue[0])
  90. {
  91. Finish();
  92. }
  93. }
  94. }
  95. }