S9102.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System.Collections.Generic;
  2. using CombatLibrary.CombatLibrary.CombatCore.CustomizeTimeLogic.FxLogic;
  3. using GameLogic.Combat.Buff;
  4. using GameLogic.Combat.CombatTool;
  5. using GameLogic.Combat.Hero;
  6. using UTool.CustomizeTimeLogic.FxLogic.TimeLineEventinterface;
  7. namespace GameLogic.Combat.Skill
  8. {
  9. /// <summary>
  10. /// 狐狸随机为队友清除一个debuff
  11. /// </summary>
  12. public class S9102 : SkillBasic
  13. {
  14. protected override void ProUseSkill()
  15. {
  16. CombatHeroEntity[] allHero =
  17. CombatController.currActiveCombat.CombatHeroController.GetHero(CombatHeroEntity.IsEnemy);
  18. List<CombatHeroEntity> debuffHero = new List<CombatHeroEntity>();
  19. for (int i = 0; i < allHero.Length; i++)
  20. {
  21. List<BuffBasic> allBuff = allHero[i].BuffControl.GetBuffBasicForBuffType(2, 1);
  22. if (allBuff.Count > 0)
  23. {
  24. debuffHero.Add(allHero[i]);
  25. }
  26. }
  27. CombatHeroEntity target = null;
  28. if (debuffHero.Count > 0)
  29. {
  30. int index = CombatCalculateTool.Instance.GetOdd(0, debuffHero.Count);
  31. target = debuffHero[index];
  32. }
  33. else if (allHero.Length > 0)
  34. {
  35. int index = CombatCalculateTool.Instance.GetOdd(0, allHero.Length);
  36. target = allHero[index];
  37. }
  38. BetterList<ILifetCycleHitPoint> currTarget = new BetterList<ILifetCycleHitPoint>();
  39. if (target != null)
  40. {
  41. currTarget.Add(target.GetMainHotPoin<CombatHeroHitPoint>());
  42. }
  43. ActivationTimeLineData("9102", currTarget: currTarget);
  44. }
  45. protected override void ProDefaultTimeLineTrigger(string groupName, CombatHeroHitPoint targetEntity,
  46. ITimelineFxLogic timelineFxLogic,
  47. TriggerData triggerData, ISkillFeatures skillFeatures)
  48. {
  49. List<BuffBasic> allBuff = targetEntity.combatHeroEntity.BuffControl.GetBuffBasicForBuffType(2, 1);
  50. if (allBuff.Count > 0)
  51. {
  52. int index = CombatCalculateTool.Instance.GetOdd(0, allBuff.Count);
  53. targetEntity.combatHeroEntity.BuffControl.RemoveBuff(allBuff[index]);
  54. }
  55. }
  56. }
  57. }