using Common.Combat.FxAILogic;
using Core.Triiger;
using GameLogic.Combat.CombatTool;
using GameLogic.Combat.Hero;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Logical;
using UnityEngine;
namespace GameLogic.Combat.Skill.MagicSkill
{
///
/// 玄龟盾:前方形成一个土系防御盾,抵挡敌人伤害
///
public class S901003 : MagicSkillBasic, ITriggerEntity, IBarrier
{
public string tag { get; }
private IUnRegister _unRegister;
private bool _use;
private long _currHp;
protected GameObject pengZhuang;
// protected bool
protected override void ProMagicUseSkill()
{
Own = CombatMagicWeaponEntity.RootMagicWeaponControl.combatHeroEntity;
if (pengZhuang == null)
{
pengZhuang = new GameObject("pengzhaung");
SphereCollider sphereCollider = pengZhuang.AddComponent();
sphereCollider.isTrigger = true;
sphereCollider.radius = 2.5f;
}
pengZhuang.SetActive(true);
BarrierEntityMono barrierEntityMono =
pengZhuang.GetOrAddComponent();
pengZhuang.transform.position = CombatMagicWeaponEntity.RootMagicWeaponControl.combatHeroEntity.dotPos;
pengZhuang.transform.SetParent(CombatMagicWeaponEntity.RootMagicWeaponControl.combatHeroEntity.GameObject
.transform);
barrierEntityMono.Barrier = this;
_use = true;
_currHp = (long)SelfSkillConfig.effectValue[0];
SkillPlayFinish();
}
public ShowBaiscEntity Own { get; set; }
public bool CollideTriiger(ITriggerEntity triggerEntity)
{
return !_use || _currHp <= 0;
}
protected override void ProDispose()
{
if (pengZhuang != null)
{
pengZhuang.SetActive(false);
pengZhuang = null;
}
}
public void Harm(HarmReturnInfo harmReturnInfo)
{
_currHp -= harmReturnInfo.att;
if (_currHp <= 0) //盾破
{
pengZhuang.SetActive(false);
Debug.Log("盾破了,做表现的时候一起做");
}
}
}
}