This commit is contained in:
CortexCore
2023-10-24 23:37:59 +08:00
parent 325f63d6bc
commit 3e39e627bc
388 changed files with 29043 additions and 889 deletions

View File

@@ -26,11 +26,24 @@ namespace BITFALL.Player.Survival
public override void OnAwake()
{
Elements = initialElements;
_health.OnSetAlive += OnSetAlive;
}
private void OnSetAlive(bool obj)
{
if (obj)
{
foreach (var VARIABLE in Elements)
{
VARIABLE.Value = 100;
}
}
}
public override void OnUpdate(float deltaTime)
{
if (_interval.AllowUpdate is false) return;
if (_health.IsAlive is false) return;
foreach (var x in Elements)
{
x.Value -= 1;
@@ -38,12 +51,12 @@ namespace BITFALL.Player.Survival
{
_damageService.Execute(new DamageMessage()
{
damageType = new SurvivalDamage()
DamageType = new SurvivalDamage()
{
element = x,
},
target = entity,
damage = 1,
Target = entity,
Damage = 1,
});
}
}