S3101.cs 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. target= CombatMagicWeaponEntity.RootMagicWeaponControl.combatHeroEntity.CombatAIBasic.currFocusTarget;
  21. if (target == null)
  22. {
  23. SkillPlayFinish();
  24. return;
  25. }
  26. MagicAttShowBasic magicAttShowBasic = InitMagicAttShowBasic(target, Finish);
  27. SetMagicAttShowBasic(magicAttShowBasic);
  28. }
  29. protected override ILifetCycleHitPoint[] ProGetTineLineTargetEntity(
  30. TimeLineEventLogicBasic timeLineEventLogicBasic)
  31. {
  32. ILifetCycleHitPoint[] lifetCycleHitPoints = new ILifetCycleHitPoint[1];
  33. lifetCycleHitPoints[0] = target.GetMainHotPoin<ILifetCycleHitPoint>();
  34. return lifetCycleHitPoints;
  35. }
  36. private void Finish()
  37. {
  38. BuffInfo buffInfo = BuffInfo.GetBuffInfo(10091, effectValue[1], 1);
  39. BuffBasic buffBasic = target.BuffControl.AddBuff(CombatHeroEntity, buffInfo);
  40. if (buffBasic != null && SelfSkillConfig.level > 5)
  41. {
  42. float v = effectValue[2];
  43. target.CurrCombatHeroInfo.Metal -= v;
  44. target.CurrCombatHeroInfo.Wood -= v;
  45. target.CurrCombatHeroInfo.Water -= v;
  46. target.CurrCombatHeroInfo.Fire -= v;
  47. target.CurrCombatHeroInfo.Earth -= v;
  48. buffBasic.buffFinish = delegate()
  49. {
  50. target.CurrCombatHeroInfo.Metal += v;
  51. target.CurrCombatHeroInfo.Wood += v;
  52. target.CurrCombatHeroInfo.Water += v;
  53. target.CurrCombatHeroInfo.Fire += v;
  54. target.CurrCombatHeroInfo.Earth += v;
  55. };
  56. }
  57. //
  58. Debug.Log("法宝对敌人照成伤害");
  59. ILifetCycleHitPoint lifetCycleHitPoint = target.GetMainHotPoin<ILifetCycleHitPoint>();
  60. if (lifetCycleHitPoint == null)
  61. {
  62. SkillPlayFinish();
  63. return;
  64. }
  65. BetterList<ILifetCycleHitPoint> cBetterList = new BetterList<ILifetCycleHitPoint>(1);
  66. cBetterList.Add(lifetCycleHitPoint);
  67. ActivationTimeLineData("sk1_hit", currTarget: cBetterList);
  68. SkillPlayFinish();
  69. long att = CombatMagicWeaponEntity.RootMagicWeaponControl.combatHeroEntity.CurrCombatHeroInfo.attack.Value;
  70. long harm = CombatCalculateTool.Instance.GetVlaueRatioForLong(att, effectValue[0]);
  71. CombatCalculateTool.Instance.Harm(CombatMagicWeaponEntity.RootMagicWeaponControl.combatHeroEntity,
  72. lifetCycleHitPoint as CombatHeroHitPoint, harm, AttType.FaBao, triggerData, wuXingType, null,
  73. HarmType.Default);
  74. }
  75. }
  76. }