Win and loose conditions
This commit is contained in:
parent
804122a3bd
commit
b551c7f012
15 changed files with 193 additions and 122 deletions
|
|
@ -16,13 +16,13 @@ public partial class EntityHPObserver : Node
|
|||
|
||||
private void OnHPChanged(float delta, Node origin)
|
||||
{
|
||||
if (_setGreater == false && _observedEntity.HP / _observedEntity.MaxHP < _threshold)
|
||||
if (_setGreater == false && _observedEntity.HP / _observedEntity.MaxHP <= _threshold)
|
||||
{
|
||||
EmitSignal(SignalName.ThresholdReached);
|
||||
_observedEntity.OnHPChanged -= OnHPChanged;
|
||||
QueueFree();
|
||||
}
|
||||
else if (_setGreater && _observedEntity.HP / _observedEntity.MaxHP > _threshold)
|
||||
else if (_setGreater && _observedEntity.HP / _observedEntity.MaxHP >= _threshold)
|
||||
{
|
||||
EmitSignal(SignalName.ThresholdReached);
|
||||
_observedEntity.OnHPChanged -= OnHPChanged;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue