S9054.cs 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. /// </summary>
  13. public class S9054 : SkillBasic
  14. {
  15. protected float _currTime;
  16. protected override void ProUseSkill()
  17. {
  18. }
  19. protected override void ProDefaultTimeLineTrigger(string groupName, CombatHeroHitPoint targetEntity,
  20. ITimelineFxLogic timelineFxLogic,
  21. TriggerData triggerData, ISkillFeatures skillFeatures)
  22. {
  23. float harmBl = 0;
  24. b_1018 b1018 = targetEntity.combatHeroEntity.BuffControl.GetBuffBasicForType<b_1018>();
  25. if (b1018 != null) //消耗一层感电,额外照成伤害
  26. {
  27. harmBl += b1018.buffCount * effectValue[1];
  28. }
  29. long v = CombatCalculateTool.Instance.GetVlaueRatioForLong(CombatHeroEntity.CurrCombatHeroInfo.attack.Value,
  30. harmBl);
  31. HarmReturnInfo harmReturnInfo = CombatCalculateTool.Instance.Harm(CombatHeroEntity, targetEntity, v,
  32. AttType.Skill, triggerData,
  33. wuXingType, skillFeatures,
  34. HarmType.Default);
  35. }
  36. protected override void ProCombatUpdate(float time)
  37. {
  38. _currTime += time;
  39. if (_currTime >= effectValue[0])
  40. {
  41. _currTime = 0;
  42. // CombatHeroEntity[] allHero =
  43. // CombatController.currActiveCombat.CombatHeroController.GetHero(!CombatHeroEntity.IsEnemy);
  44. CombatHeroEntity targetHeroEntity = CombatHeroEntity.CombatAIBasic.currFocusTarget;
  45. if (targetHeroEntity != null)
  46. {
  47. b_1018 b1018 = targetHeroEntity.BuffControl.GetBuffBasicForType<b_1018>();
  48. if (b1018 != null)
  49. {
  50. Vector3 targetPos = targetHeroEntity.dotPos;
  51. ActivationTimeLineData("9053_fashe", customizePos: new Vector3[] { targetPos });
  52. int count = b1018.buffCount;
  53. float harmBl = count * effectValue[1];
  54. long v = CombatCalculateTool.Instance.GetVlaueRatioForLong(
  55. CombatHeroEntity.CurrCombatHeroInfo.attack.Value,
  56. harmBl);
  57. HarmReturnInfo harmReturnInfo = CombatCalculateTool.Instance.Harm(CombatHeroEntity,
  58. targetHeroEntity, v,
  59. AttType.Skill, triggerData,
  60. wuXingType, null,
  61. HarmType.Default);
  62. }
  63. }
  64. }
  65. }
  66. }
  67. }