S30001.cs 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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 ProInitSkillConfig()
  24. {
  25. _harm = SelfSkillConfig.effectValue[0];
  26. _maxTime = SelfSkillConfig.effectValue[1];
  27. }
  28. protected override void ProInitSkill()
  29. {
  30. SkillBasic skillBasic = CombatHeroEntity.CombatHeroSkillControl.GetSkillBasic(30004);
  31. if (skillBasic != null)
  32. {
  33. _maxTime +=skillBasic.SelfSkillConfig.effectValue[0];
  34. }
  35. }
  36. // protected override ILifetCycleHitPoint[] ProGetTineLineTargetEntity(
  37. // TimeLineEventLogicBasic timeLineEventLogicBasic)
  38. // {
  39. // ILifetCycleHitPoint[] allHero = new ILifetCycleHitPoint[_enterAlertTarget.Count];
  40. // for (int i = 0; i < _enterAlertTarget.Count; i++)
  41. // {
  42. // allHero[i] = _enterAlertTarget[i].GetMainHotPoin<ILifetCycleHitPoint>();
  43. // }
  44. //
  45. // return allHero;
  46. // }
  47. protected override void ProUseSkill()
  48. {
  49. _finishTimeLineGroupName = "-1";
  50. currMyLoopGroupBasic = ActivationTimeLineData("sk1");
  51. _isUpdate = true;
  52. _currTime = 0;
  53. _currAllTime = 0;
  54. }
  55. protected override void ProBreakSkill()
  56. {
  57. Finish();
  58. }
  59. protected void Finish()
  60. {
  61. currMyLoopGroupBasic?.BreakTimeLine(CombatHeroEntity);
  62. if (loopGroupBasic != null)
  63. {
  64. loopGroupBasic.BreakTimeLine(CombatHeroEntity);
  65. }
  66. loopGroupBasic = null;
  67. _isUpdate = false;
  68. SpecialDotInfo specialDotInfo = CombatHeroEntity.GetMainHotPoin<ILifetCycleHitPoint>(true)
  69. .GetSpecialDotInfo("sk1_trigger");
  70. specialDotInfo.targetTran.gameObject.SetActive(false);
  71. }
  72. protected override void ProSkillPlayFinish()
  73. {
  74. Finish();
  75. }
  76. protected override void ProCombatUpdate(float time)
  77. {
  78. if (!_isUpdate)
  79. {
  80. return;
  81. }
  82. // _allAddJiaoDu += addXuanZhuang;
  83. // if (_allAddJiaoDu > 5 || _allAddJiaoDu < -5)
  84. // {
  85. // addXuanZhuang *= -1;
  86. // }
  87. //
  88. // CombatHeroEntity.combatHeroGameObject.transform.Rotate(Vector3.up, addXuanZhuang);
  89. _currTime += time;
  90. _currAllTime += time;
  91. if (_currTime > 0.2f)
  92. {
  93. _currTime -= 0.2f;
  94. long v = CombatCalculateTool.Instance.GetVlaueRatioForLong(
  95. CombatHeroEntity.CurrCombatHeroInfo.attack.Value,
  96. _harm);
  97. if (loopGroupBasic != null)
  98. {
  99. loopGroupBasic.BreakTimeLine(CombatHeroEntity);
  100. }
  101. // for (int i = 0; i < _currTrigger.Count; i++)
  102. // {
  103. // _currTrigger[i].IfLifeCycle.This<CombatHeroEntity>().H
  104. // }
  105. _currTrigger.Clear();
  106. // ILifetCycleHitPoint[] allHero = new ILifetCycleHitPoint[_enterAlertTarget.Count];
  107. for (int i = 0; i < _enterAlertTarget.Count; i++)
  108. {
  109. ILifetCycleHitPoint targetEntity = _enterAlertTarget[i].GetMainHotPoin<ILifetCycleHitPoint>();
  110. _currTrigger.Add(targetEntity);
  111. HarmReturnInfo harmReturnInfo = Harm(CombatHeroEntity, targetEntity as CombatHeroHitPoint,
  112. v, AttType.Skill, triggerData);
  113. }
  114. // "sk1_hit"
  115. string hitName = "sk1_hit_lv4";
  116. loopGroupBasic = ActivationTimeLineData(hitName, _currTrigger);
  117. }
  118. if (_currAllTime > _maxTime)
  119. {
  120. SkillPlayFinish();
  121. }
  122. }
  123. // protected override void ProDefaultTimeLineTrigger(string groupName, CombatHeroHitPoint targetEntity,
  124. // ITimelineFxLogic timelineFxLogic,
  125. // TriggerData triggerData)
  126. // {
  127. // long v = CombatCalculateTool.Instance.GetVlaueRatioForLong(CombatHeroEntity.CurrCombatHeroInfo.attack.Value,
  128. // _harm);
  129. // HarmReturnInfo harmReturnInfo = Harm(CombatHeroEntity, targetEntity,
  130. // v, AttType.Skill, triggerData);
  131. // }
  132. }
  133. }