S9053.cs 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. using CombatLibrary.CombatLibrary.CombatCore.CustomizeTimeLogic.FxLogic;
  2. using GameLogic.Combat.Buff;
  3. using GameLogic.Combat.CombatTool;
  4. using GameLogic.Combat.Hero;
  5. using UnityEngine;
  6. using UTool.CustomizeTimeLogic.FxLogic.TimeLineEventinterface;
  7. namespace GameLogic.Combat.Skill
  8. {
  9. /// <summary>
  10. /// 引雷
  11. /// 请求仰天施法,引导天雷,天雷在战场上随机落下,{0}%概率击中目标,每层感电额外+{1}%概率
  12. /// ,最多被击中{2}次,每次击中消耗一层感电额外照成{3}伤害。引雷可以击中弹道.持续{4}秒
  13. /// </summary>
  14. public class S9053 : SkillBasic
  15. {
  16. private float _currTime;
  17. private int _hitCount;
  18. private bool _isUpdate;
  19. private float _jianGe;
  20. protected override void ProUseSkill()
  21. {
  22. ballisticsCount = (int)effectValue[0];
  23. }
  24. protected override void ProDefaultTimeLineTrigger(string groupName, CombatHeroHitPoint targetEntity,
  25. ITimelineFxLogic timelineFxLogic,
  26. TriggerData triggerData, ISkillFeatures skillFeatures)
  27. {
  28. float harmBl = effectValue[1];
  29. b_1018 b1018 = targetEntity.combatHeroEntity.BuffControl.GetBuffBasicForType<b_1018>();
  30. if (b1018 != null)//消耗一层感电,额外照成伤害
  31. {
  32. b1018.ReduceCount(1);
  33. harmBl += effectValue[3];
  34. }
  35. long v = CombatCalculateTool.Instance.GetVlaueRatioForLong(CombatHeroEntity.CurrCombatHeroInfo.attack.Value,
  36. harmBl);
  37. HarmReturnInfo harmReturnInfo = CombatCalculateTool.Instance.Harm(CombatHeroEntity, targetEntity, v,
  38. AttType.Skill, triggerData,
  39. wuXingType, skillFeatures,
  40. HarmType.Default);
  41. // if (harmReturnInfo.isHitHero)
  42. // {
  43. // BuffInfo buffInfo = BuffInfo.GetBuffInfo(10181, 1);
  44. // targetEntity.combatHeroEntity.BuffControl.AddBuff(CombatHeroEntity, buffInfo);
  45. // }
  46. }
  47. private void SetJianGe()
  48. {
  49. _jianGe = CombatCalculateTool.Instance.GetOdd(20, 100) / 100f;
  50. }
  51. protected override void ProCombatUpdate(float time)
  52. {
  53. if (!_isUpdate)
  54. {
  55. return;
  56. }
  57. _currTime += time;
  58. if (_currTime >= _jianGe)
  59. {
  60. _currTime = 0;
  61. SetJianGe();
  62. //发射一道闪电
  63. int odds = CombatCalculateTool.Instance.GetOdd(0, 100);
  64. if (odds <= effectValue[0])
  65. {
  66. //击中目标
  67. }
  68. }
  69. }
  70. }
  71. }