S901003.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. using Common.Combat.FxAILogic;
  2. using Core.Triiger;
  3. using GameLogic.Combat.CombatTool;
  4. using GameLogic.Combat.Hero;
  5. using OfficeOpenXml.FormulaParsing.Excel.Functions.Logical;
  6. using UnityEngine;
  7. namespace GameLogic.Combat.Skill.MagicSkill
  8. {
  9. /// <summary>
  10. /// 玄龟盾:前方形成一个土系防御盾,抵挡敌人伤害
  11. /// </summary>
  12. public class S901003 : MagicSkillBasic, ITriggerEntity, IBarrier
  13. {
  14. public string tag { get; }
  15. private IUnRegister _unRegister;
  16. private bool _use;
  17. private long _currHp;
  18. protected GameObject pengZhuang;
  19. private bool isUpdate;
  20. // protected bool
  21. private SpecialDotInfo specialDotInfo;
  22. protected override void ProMagicUseSkill()
  23. {
  24. isUpdate = false;
  25. specialDotInfo =
  26. CombatMagicWeaponEntity.RootMagicWeaponControl.combatHeroEntity.GetSpecialDotInfo("zdpos1");
  27. MagicAttShowBasic magicAttShowBasic = InitXiaoShiAndShow(specialDotInfo.GetWorlPos(), Finish);
  28. SetMagicAttShowBasic(magicAttShowBasic);
  29. }
  30. public ShowBaiscEntity Own { get; set; }
  31. private void Finish()
  32. {
  33. isUpdate = true;
  34. ActivationTimeLineData("sk1");
  35. Own = CombatMagicWeaponEntity.RootMagicWeaponControl.combatHeroEntity;
  36. if (pengZhuang == null)
  37. {
  38. pengZhuang = new GameObject("pengzhaung");
  39. SphereCollider sphereCollider = pengZhuang.AddComponent<SphereCollider>();
  40. sphereCollider.isTrigger = true;
  41. sphereCollider.radius = 2.5f;
  42. }
  43. pengZhuang.SetActive(true);
  44. BarrierEntityMono barrierEntityMono =
  45. pengZhuang.GetOrAddComponent<BarrierEntityMono>();
  46. pengZhuang.transform.position = CombatMagicWeaponEntity.RootMagicWeaponControl.combatHeroEntity.dotPos;
  47. pengZhuang.transform.SetParent(CombatMagicWeaponEntity.RootMagicWeaponControl.combatHeroEntity.GameObject
  48. .transform);
  49. barrierEntityMono.Barrier = this;
  50. _use = true;
  51. _currHp = (long)SelfSkillConfig.effectValue[0];
  52. }
  53. public bool CollideTriiger(ITriggerEntity triggerEntity)
  54. {
  55. return !_use || _currHp <= 0;
  56. }
  57. protected override void ProDispose()
  58. {
  59. if (pengZhuang != null)
  60. {
  61. pengZhuang.SetActive(false);
  62. pengZhuang = null;
  63. }
  64. }
  65. protected override void MagicSkillUpdate(float time)
  66. {
  67. if (isUpdate)
  68. {
  69. CombatMagicWeaponEntity.GameObject.transform.position = specialDotInfo.GetWorlPos();
  70. }
  71. }
  72. public void Harm(HarmReturnInfo harmReturnInfo)
  73. {
  74. _currHp -= harmReturnInfo.att;
  75. if (_currHp <= 0) //盾破
  76. {
  77. isUpdate = false;
  78. SkillPlayFinish();
  79. pengZhuang.SetActive(false);
  80. Debug.Log("盾破了,做表现的时候一起做");
  81. }
  82. }
  83. }
  84. }