S30001.cs 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. using CombatLibrary.CombatLibrary.CombatCore.CustomizeTimeLogic.FxLogic;
  2. using GameLogic.Combat.CombatTool;
  3. using GameLogic.Combat.Hero;
  4. using UnityEngine;
  5. using UTool.CustomizeTimeLogic.FxLogic.TimeLineEventinterface;
  6. namespace GameLogic.Combat.Skill
  7. {
  8. /// <summary>
  9. /// 火烧
  10. /// </summary>
  11. public class S30001 : SkillBasic
  12. {
  13. protected float _harm;
  14. protected float _maxTime;
  15. protected float _currTime;
  16. private BetterList<ILifetCycleHitPoint> _currTrigger = new BetterList<ILifetCycleHitPoint>();
  17. protected TimeLineEventLogicGroupBasic loopGroupBasic;
  18. protected TimeLineEventLogicGroupBasic currMyLoopGroupBasic;
  19. protected bool _isUpdate;
  20. protected float _currAllTime;
  21. // protected float addXuanZhuang = 0.5f;
  22. // protected float _allAddJiaoDu;
  23. protected override void ProInitSkill()
  24. {
  25. _harm = 200;
  26. _maxTime = 3;
  27. }
  28. // protected override ILifetCycleHitPoint[] ProGetTineLineTargetEntity(
  29. // TimeLineEventLogicBasic timeLineEventLogicBasic)
  30. // {
  31. // ILifetCycleHitPoint[] allHero = new ILifetCycleHitPoint[_enterAlertTarget.Count];
  32. // for (int i = 0; i < _enterAlertTarget.Count; i++)
  33. // {
  34. // allHero[i] = _enterAlertTarget[i].GetMainHotPoin<ILifetCycleHitPoint>();
  35. // }
  36. //
  37. // return allHero;
  38. // }
  39. protected override void ProUseSkill()
  40. {
  41. _finishTimeLineGroupName = "-1";
  42. currMyLoopGroupBasic = ActivationTimeLineData("sk1");
  43. _isUpdate = true;
  44. _currTime = 0;
  45. _currAllTime = 0;
  46. }
  47. protected override void ProBreakSkill()
  48. {
  49. Finish();
  50. }
  51. protected void Finish()
  52. {
  53. currMyLoopGroupBasic?.BreakTimeLine();
  54. if (loopGroupBasic != null)
  55. {
  56. loopGroupBasic.BreakTimeLine();
  57. }
  58. loopGroupBasic = null;
  59. _isUpdate = false;
  60. SpecialDotInfo specialDotInfo = CombatHeroEntity.GetMainHotPoin<ILifetCycleHitPoint>(true)
  61. .GetSpecialDotInfo("sk1_trigger");
  62. specialDotInfo.targetTran.gameObject.SetActive(false);
  63. }
  64. protected override void ProSkillPlayFinish()
  65. {
  66. Finish();
  67. }
  68. protected override void ProCombatUpdate(float time)
  69. {
  70. if (!_isUpdate)
  71. {
  72. return;
  73. }
  74. // _allAddJiaoDu += addXuanZhuang;
  75. // if (_allAddJiaoDu > 5 || _allAddJiaoDu < -5)
  76. // {
  77. // addXuanZhuang *= -1;
  78. // }
  79. //
  80. // CombatHeroEntity.combatHeroGameObject.transform.Rotate(Vector3.up, addXuanZhuang);
  81. _currTime += time;
  82. _currAllTime += time;
  83. if (_currTime > 0.2f)
  84. {
  85. _currTime -= 0.2f;
  86. long v = CombatCalculateTool.Instance.GetVlaueRatioForLong(
  87. CombatHeroEntity.CurrCombatHeroInfo.attack.Value,
  88. _harm);
  89. if (loopGroupBasic != null)
  90. {
  91. loopGroupBasic.BreakTimeLine();
  92. }
  93. // for (int i = 0; i < _currTrigger.Count; i++)
  94. // {
  95. // _currTrigger[i].IfLifeCycle.This<CombatHeroEntity>().H
  96. // }
  97. _currTrigger.Clear();
  98. // ILifetCycleHitPoint[] allHero = new ILifetCycleHitPoint[_enterAlertTarget.Count];
  99. for (int i = 0; i < _enterAlertTarget.Count; i++)
  100. {
  101. ILifetCycleHitPoint targetEntity = _enterAlertTarget[i].GetMainHotPoin<ILifetCycleHitPoint>();
  102. _currTrigger.Add(targetEntity);
  103. HarmReturnInfo harmReturnInfo = Harm(CombatHeroEntity, targetEntity as CombatHeroHitPoint,
  104. v, AttType.Skill, triggerData);
  105. }
  106. // "sk1_hit"
  107. string hitName = "sk1_hit_lv4";
  108. loopGroupBasic = ActivationTimeLineData( hitName, _currTrigger);
  109. }
  110. if (_currAllTime > _maxTime)
  111. {
  112. SkillPlayFinish();
  113. }
  114. }
  115. // protected override void ProDefaultTimeLineTrigger(string groupName, CombatHeroHitPoint targetEntity,
  116. // ITimelineFxLogic timelineFxLogic,
  117. // TriggerData triggerData)
  118. // {
  119. // long v = CombatCalculateTool.Instance.GetVlaueRatioForLong(CombatHeroEntity.CurrCombatHeroInfo.attack.Value,
  120. // _harm);
  121. // HarmReturnInfo harmReturnInfo = Harm(CombatHeroEntity, targetEntity,
  122. // v, AttType.Skill, triggerData);
  123. // }
  124. }
  125. }