2023-10-19 15:00:19 +08:00
|
|
|
|
using CodeStage.AntiCheat.ObscuredTypes;
|
2023-12-19 15:01:19 +08:00
|
|
|
|
using Gameplay.PlayerSkill.Data;
|
2023-12-13 16:20:41 +08:00
|
|
|
|
namespace Gameplay.Unit.Data
|
2023-08-22 19:08:45 +08:00
|
|
|
|
{
|
|
|
|
|
|
public class UnitAliveData
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
public GameUnit owner;
|
2023-12-19 14:26:50 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 血量
|
|
|
|
|
|
/// </summary>
|
2023-10-19 15:00:19 +08:00
|
|
|
|
public ObscuredInt currentHp;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 护甲值
|
|
|
|
|
|
/// </summary>
|
2023-10-19 15:00:19 +08:00
|
|
|
|
public ObscuredInt currentShield;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 士气值
|
|
|
|
|
|
/// </summary>
|
2023-10-19 15:00:19 +08:00
|
|
|
|
public ObscuredInt currentMorale;
|
2024-07-19 15:39:08 +08:00
|
|
|
|
|
|
|
|
|
|
public int hpAndShield
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return currentHp + currentShield;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-08-22 19:08:45 +08:00
|
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
|
|
|
|
|
|
|
public ObscuredInt maxHp;
|
|
|
|
|
|
public ObscuredInt maxShield;
|
|
|
|
|
|
public ObscuredInt maxMorale;
|
2023-12-19 14:26:50 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
public UnitAliveData(GameUnit owner)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.owner = owner;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-19 14:26:50 +08:00
|
|
|
|
public void Init(bool fillHp)
|
2023-08-22 19:08:45 +08:00
|
|
|
|
{
|
2023-12-19 14:26:50 +08:00
|
|
|
|
if (fillHp)
|
|
|
|
|
|
{
|
|
|
|
|
|
currentHp = maxHp;
|
|
|
|
|
|
currentShield = maxShield;
|
|
|
|
|
|
}
|
2023-08-22 19:08:45 +08:00
|
|
|
|
currentMorale = maxMorale;
|
|
|
|
|
|
}
|
2023-12-19 15:01:19 +08:00
|
|
|
|
|
|
|
|
|
|
public void Revive(UnitReviveData reviveData)
|
|
|
|
|
|
{
|
|
|
|
|
|
currentHp = (int)(maxHp * reviveData.hpPercent);
|
|
|
|
|
|
currentShield = (int)(maxShield * reviveData.shieldPercent);
|
|
|
|
|
|
}
|
2024-05-31 19:44:10 +08:00
|
|
|
|
|
|
|
|
|
|
public void FullStatus()
|
|
|
|
|
|
{
|
|
|
|
|
|
currentHp = maxHp;
|
|
|
|
|
|
currentShield = maxShield;
|
|
|
|
|
|
currentMorale = maxMorale;
|
|
|
|
|
|
}
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|