S120001.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. using Animancer;
  2. using CombatLibrary.CombatLibrary.CombatCore.CustomizeTimeLogic.FxLogic;
  3. using GameLogic.Combat.CombatTool;
  4. using GameLogic.Combat.Hero;
  5. using GameLogic.Combat.Hero.SubStatus;
  6. using UnityEngine;
  7. using UnityEngine.AI;
  8. using UTool.CustomizeTimeLogic.FxLogic.TimeLineEventinterface;
  9. namespace GameLogic.Combat.Skill
  10. {
  11. /// <summary>
  12. /// 小蛇精英怪技能 向前冲撞,对冲撞的敌人造成伤害
  13. /// </summary>
  14. public class S120001 : SkillBasic
  15. {
  16. private float _harm;
  17. private bool _startMove;
  18. private Vector3 moveTargetPos;
  19. private Vector3 moveStartPos;
  20. private float _currTime;
  21. private float _currAddTime;
  22. // protected BetterList<CombatHeroEntity>
  23. protected override void ProInitSkillConfig()
  24. {
  25. _harm = SelfSkillConfig.effectValue[0];
  26. }
  27. protected override void ProUseSkill()
  28. {
  29. ActivationTimeLineData("sk1");
  30. }
  31. // protected override ILifetCycleHitPoint[] ProGetTineLineTargetEntity(
  32. // TimeLineEventLogicBasic timeLineEventLogicBasic)
  33. // {
  34. // ILifetCycleHitPoint[] lifetCycleHitPoints = new ILifetCycleHitPoint[_enterAlertTarget.Count];
  35. //
  36. // for (int i = 0; i < _enterAlertTarget.Count; i++)
  37. // {
  38. // CombatHeroHitPoint combatHeroHitPoint = _enterAlertTarget[i].GetMainHotPoin<CombatHeroHitPoint>();
  39. // lifetCycleHitPoints[i] = combatHeroHitPoint;
  40. // }
  41. // return lifetCycleHitPoints;
  42. // }
  43. protected override void ProDefaultTimeLineTrigger(string groupName, CombatHeroHitPoint targetEntity,
  44. ITimelineFxLogic timelineFxLogic,
  45. TriggerData triggerData)
  46. {
  47. _startMove = true;
  48. moveStartPos = CombatHeroEntity.dotPos;
  49. moveTargetPos = CombatHeroEntity.combatHeroGameObject.transform.TransformPoint(new Vector3(0, 0, 5));
  50. _currTime = 0;
  51. _currAddTime = 1.0f / 0.5f;
  52. }
  53. protected override void ProCombatUpdate(float time)
  54. {
  55. if (!_startMove)
  56. {
  57. return;
  58. }
  59. _currTime += time * _currAddTime;
  60. Vector3 t = Vector3.Lerp(moveStartPos, moveTargetPos, _currTime);
  61. CombatHeroEntity.CombatAIBasic.NavMeshAgent.Raycast(t,
  62. out NavMeshHit hit);
  63. if (!hit.hit)
  64. {
  65. CombatHeroEntity.combatHeroGameObject.SetPosition(t);
  66. }
  67. else
  68. {
  69. Debug.Log(("打到墙了" + hit.mask));
  70. }
  71. if (_currTime >= 1)
  72. {
  73. _startMove = false;
  74. }
  75. }
  76. protected override void ProHeroEnter(TimeLineAlertSeriailztion timeLineAlertSeriailztion,
  77. CombatHeroEntity target)
  78. {
  79. long v = CombatCalculateTool.Instance.GetVlaueRatioForLong(
  80. CombatHeroEntity.CurrCombatHeroInfo.attack.Value,
  81. _harm);
  82. CombatHeroHitPoint combatHeroHitPoint = target.GetMainHotPoin<CombatHeroHitPoint>();
  83. HarmReturnInfo harmReturnInfo = Harm(CombatHeroEntity, combatHeroHitPoint,
  84. v, AttType.Skill, triggerData);
  85. Vector3 dir = target.combatHeroGameObject.transform.forward * -1;
  86. float d = (target.dotPos - CombatHeroEntity.dotPos).magnitude;
  87. float moveDis = 3 - d;
  88. moveDis = Mathf.Clamp(moveDis, 0, 3);
  89. float jiao = Vector3.Dot(target.combatHeroGameObject.transform.forward,
  90. CombatHeroEntity.combatHeroGameObject.transform.forward);
  91. jiao = Mathf.Abs(jiao);
  92. if (jiao > 0.9)
  93. {
  94. dir += new Vector3(0.8f, 0, 0);
  95. }
  96. RepelledStatusState repelledStatusState = new RepelledStatusState(dir, moveDis*jiao, 10, null);
  97. target.CombatAIBasic.AddSubStatus(repelledStatusState);
  98. }
  99. protected override void ProSkillPlayFinish()
  100. {
  101. _startMove = false;
  102. }
  103. }
  104. }