S110002.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. using CombatLibrary.CombatLibrary.CombatCore.CustomizeTimeLogic.FxLogic;
  2. using GameLogic.Combat.CombatTool;
  3. using GameLogic.Combat.Hero;
  4. using UTool.CustomizeTimeLogic.FxLogic.TimeLineEventinterface;
  5. namespace GameLogic.Combat.Skill
  6. {
  7. /// <summary>
  8. /// 大蛇技能2,吐火焰经过的敌人收到伤害,没0.5秒收到一次伤害
  9. /// </summary>
  10. public class S110002 : SkillBasic
  11. {
  12. private float _harm;
  13. private float _currTime;
  14. private bool _isUpdate;
  15. // protected BetterList<CombatHeroEntity>
  16. protected override void ProInitSkill()
  17. {
  18. _harm = SelfSkillConfig.effectValue[0];
  19. }
  20. protected override void ProUseSkill()
  21. {
  22. int odds = CombatCalculateTool.Instance.GetOdd();
  23. string timeName = odds < 50 ? "sk2" : "sk3";
  24. ActivationTimeLineData(timeName);
  25. _currTime = 0;
  26. // _isUpdate = true;
  27. }
  28. // protected override ILifetCycleHitPoint[] ProGetTineLineTargetEntity(
  29. // TimeLineEventLogicBasic timeLineEventLogicBasic)
  30. // {
  31. // ILifetCycleHitPoint[] lifetCycleHitPoints = new ILifetCycleHitPoint[_enterAlertTarget.Count];
  32. //
  33. // for (int i = 0; i < _enterAlertTarget.Count; i++)
  34. // {
  35. // CombatHeroHitPoint combatHeroHitPoint = _enterAlertTarget[i].GetMainHotPoin<CombatHeroHitPoint>();
  36. // lifetCycleHitPoints[i] = combatHeroHitPoint;
  37. // }
  38. // return lifetCycleHitPoints;
  39. // }
  40. protected override void ProHeroEnter(TimeLineAlertSeriailztion timeLineAlertSeriailztion,
  41. CombatHeroEntity target)
  42. {
  43. // base.ProHeroEnter(timeLineAlertSeriailztion, target);
  44. }
  45. protected override void ProSkillPlayFinish()
  46. {
  47. _isUpdate = false;
  48. }
  49. protected override void ProDefaultTimeLineTrigger(string groupName, CombatHeroHitPoint targetEntity,
  50. ITimelineFxLogic timelineFxLogic,
  51. TriggerData triggerData)
  52. {
  53. _isUpdate = true;
  54. }
  55. protected override void ProCombatUpdate(float time)
  56. {
  57. if (!_isUpdate)
  58. {
  59. return;
  60. }
  61. _currTime += time;
  62. if (_currTime > 0.1f)
  63. {
  64. _currTime -= 0.1f;
  65. for (int i = 0; i < _enterAlertTarget.Count; i++)
  66. {
  67. long v = CombatCalculateTool.Instance.GetVlaueRatioForLong(
  68. CombatHeroEntity.CurrCombatHeroInfo.attack.Value,
  69. _harm);
  70. CombatHeroHitPoint combatHeroHitPoint = _enterAlertTarget[i].GetMainHotPoin<CombatHeroHitPoint>();
  71. HarmReturnInfo harmReturnInfo = Harm(CombatHeroEntity, combatHeroHitPoint,
  72. v, AttType.Skill, triggerData);
  73. }
  74. }
  75. }
  76. public override bool IsCanUse()
  77. {
  78. int odds = CombatCalculateTool.Instance.GetOdd();
  79. float bl = CombatHeroEntity.CurrCombatHeroInfo.hp.Value * 100.0f /
  80. CombatHeroEntity.MaxCombatHeroInfo.hp.Value;
  81. if (bl < 50 && odds < 50)
  82. {
  83. return true;
  84. }
  85. SkillCd = SkillMaxCd;
  86. return false;
  87. }
  88. }
  89. }