S3101.cs 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. using Fort23.Core;
  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.MagicSkill
  8. {
  9. /// <summary>
  10. /// 对敌人照成伤害,使敌人五行混乱。敌人的功法每次使用功法都将使用最低灵根属性作为伤害计算,持续{0}秒
  11. /// 使敌人的所有灵根降低10%持续5秒
  12. /// </summary>
  13. public class S3101 : MagicSkillBasic
  14. {
  15. private CombatHeroEntity target;
  16. protected override void ProMagicUseSkill()
  17. {
  18. // StraightLineShow straightLineShow = new StraightLineShow();
  19. // straightLineShow.Init(this);
  20. CombatHeroEntity[] allHero =
  21. CombatController.currActiveCombat.CombatHeroController.GetHero(!CombatHeroEntity.IsEnemy);
  22. if (allHero == null || allHero.Length <= 0)
  23. {
  24. SkillPlayFinish();
  25. return;
  26. }
  27. target = allHero[0];
  28. MagicAttShowBasic magicAttShowBasic = InitMagicAttShowBasic(allHero[0], Finish);
  29. SetMagicAttShowBasic(magicAttShowBasic);
  30. }
  31. protected override ILifetCycleHitPoint[] ProGetTineLineTargetEntity(
  32. TimeLineEventLogicBasic timeLineEventLogicBasic)
  33. {
  34. ILifetCycleHitPoint[] lifetCycleHitPoints = new ILifetCycleHitPoint[1];
  35. lifetCycleHitPoints[0] = target.GetMainHotPoin<ILifetCycleHitPoint>();
  36. return lifetCycleHitPoints;
  37. }
  38. private void Finish()
  39. {
  40. BuffInfo buffInfo = BuffInfo.GetBuffInfo(10091, effectValue[0], 1);
  41. BuffBasic buffBasic = target.BuffControl.AddBuff(CombatHeroEntity, buffInfo);
  42. if (buffBasic != null && SelfSkillConfig.level > 5)
  43. {
  44. float v = effectValue[0];
  45. target.CurrCombatHeroInfo.Metal -= v;
  46. target.CurrCombatHeroInfo.Wood -= v;
  47. target.CurrCombatHeroInfo.Water -= v;
  48. target.CurrCombatHeroInfo.Fire -= v;
  49. target.CurrCombatHeroInfo.Earth -= v;
  50. buffBasic.buffFinish=delegate ()
  51. {
  52. target.CurrCombatHeroInfo.Metal += v;
  53. target.CurrCombatHeroInfo.Wood += v;
  54. target.CurrCombatHeroInfo.Water += v;
  55. target.CurrCombatHeroInfo.Fire += v;
  56. target.CurrCombatHeroInfo.Earth += v;
  57. };
  58. }
  59. SkillPlayFinish();
  60. // Debug.Log("法宝对敌人照成伤害");
  61. // ILifetCycleHitPoint lifetCycleHitPoint = target.GetMainHotPoin<ILifetCycleHitPoint>();
  62. // if (lifetCycleHitPoint == null)
  63. // {
  64. // return;
  65. // }
  66. //
  67. // BetterList<ILifetCycleHitPoint> cBetterList = new BetterList<ILifetCycleHitPoint>(1);
  68. // cBetterList.Add(lifetCycleHitPoint);
  69. // ActivationTimeLineData("gongji", currTarget: cBetterList);
  70. // SkillPlayFinish();
  71. //
  72. // HarmReturnInfo harmReturnInfo = CObjectPool.Instance.Fetch<HarmReturnInfo>();
  73. // harmReturnInfo.source = CombatHeroEntity;
  74. // harmReturnInfo.target = target.GetMainHotPoin<CombatHeroHitPoint>();
  75. // harmReturnInfo.att = 200;
  76. // harmReturnInfo.attType = AttType.Normal;
  77. // harmReturnInfo.harmType = HarmType.Default;
  78. // harmReturnInfo.triggerData = triggerData;
  79. // target.HeroHurt(harmReturnInfo);
  80. // CombatCalculateTool.Instance.Harm(CombatHeroEntity, lifetCycleHitPoint as CombatHeroHitPoint, 200, AttType.Normal, triggerData,
  81. // HarmType.Default);
  82. }
  83. }
  84. }