using CodeStage.AntiCheat.ObscuredTypes;
using Gameplay.PlayerSkill.Data;
namespace Gameplay.Unit.Data
{
public class UnitAliveData
{
public GameUnit owner;
///
/// 血量
///
public ObscuredInt currentHp;
///
/// 护甲值
///
public ObscuredInt currentShield;
///
/// 士气值
///
public ObscuredInt currentMorale;
public int hpAndShield
{
get
{
return currentHp + currentShield;
}
}
public ObscuredInt maxHp;
public ObscuredInt maxShield;
public ObscuredInt maxMorale;
public UnitAliveData(GameUnit owner)
{
this.owner = owner;
}
public void Init(bool fillHp)
{
if (fillHp)
{
currentHp = maxHp;
currentShield = maxShield;
}
currentMorale = maxMorale;
}
public void Revive(UnitReviveData reviveData)
{
currentHp = (int)(maxHp * reviveData.hpPercent);
currentShield = (int)(maxShield * reviveData.shieldPercent);
}
public void FullStatus()
{
currentHp = maxHp;
currentShield = maxShield;
currentMorale = maxMorale;
}
}
}