S901003.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. // protected bool
  20. protected override void ProMagicUseSkill()
  21. {
  22. Own = CombatMagicWeaponEntity.RootMagicWeaponControl.combatHeroEntity;
  23. if (pengZhuang == null)
  24. {
  25. pengZhuang = new GameObject("pengzhaung");
  26. SphereCollider sphereCollider = pengZhuang.AddComponent<SphereCollider>();
  27. sphereCollider.isTrigger = true;
  28. sphereCollider.radius = 2.5f;
  29. }
  30. pengZhuang.SetActive(true);
  31. BarrierEntityMono barrierEntityMono =
  32. pengZhuang.GetOrAddComponent<BarrierEntityMono>();
  33. pengZhuang.transform.position = CombatMagicWeaponEntity.RootMagicWeaponControl.combatHeroEntity.dotPos;
  34. pengZhuang.transform.SetParent(CombatMagicWeaponEntity.RootMagicWeaponControl.combatHeroEntity.GameObject
  35. .transform);
  36. barrierEntityMono.Barrier = this;
  37. _use = true;
  38. _currHp = (long)SelfSkillConfig.effectValue[0];
  39. SkillPlayFinish();
  40. }
  41. public ShowBaiscEntity Own { get; set; }
  42. public bool CollideTriiger(ITriggerEntity triggerEntity)
  43. {
  44. return !_use || _currHp <= 0;
  45. }
  46. protected override void ProDispose()
  47. {
  48. if (pengZhuang != null)
  49. {
  50. pengZhuang.SetActive(false);
  51. pengZhuang = null;
  52. }
  53. }
  54. public void Harm(HarmReturnInfo harmReturnInfo)
  55. {
  56. _currHp -= harmReturnInfo.att;
  57. if (_currHp <= 0) //盾破
  58. {
  59. pengZhuang.SetActive(false);
  60. Debug.Log("盾破了,做表现的时候一起做");
  61. }
  62. }
  63. }
  64. }