57 lines
1.3 KiB
C#
57 lines
1.3 KiB
C#
using CodeStage.AntiCheat.ObscuredTypes;
|
|
using Gameplay.PlayerSkill.Data;
|
|
namespace Gameplay.Unit.Data
|
|
{
|
|
public class UnitAliveData
|
|
{
|
|
|
|
public GameUnit owner;
|
|
|
|
/// <summary>
|
|
/// 血量
|
|
/// </summary>
|
|
public ObscuredInt currentHp;
|
|
/// <summary>
|
|
/// 护甲值
|
|
/// </summary>
|
|
public ObscuredInt currentShield;
|
|
/// <summary>
|
|
/// 士气值
|
|
/// </summary>
|
|
public ObscuredInt currentMorale;
|
|
|
|
|
|
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;
|
|
}
|
|
}
|
|
}
|