Plants now based on entity class
This commit is contained in:
parent
6c9909df30
commit
08d593175b
14 changed files with 38 additions and 65 deletions
|
|
@ -22,7 +22,7 @@ public partial class AloeBehaviour : BaseBehaviour
|
|||
var checkPos = GetParent<Node2D>().GlobalPosition + Vector2.Right * Utility.TileWidth;
|
||||
if(_charge && PoolContainer.Instance.TryGetEntity(checkPos, out RuntimePlantData plantData))
|
||||
{
|
||||
if((float)plantData.Hp / (float)plantData.MaxHp < _hpTreshold)
|
||||
if((float)plantData.HP / (float)plantData.MaxHP < _hpTreshold)
|
||||
{
|
||||
_charge = false;
|
||||
_tree.Set("parameters/conditions/heal",true);
|
||||
|
|
@ -36,7 +36,7 @@ public partial class AloeBehaviour : BaseBehaviour
|
|||
var checkPos = GetParent<Node2D>().GlobalPosition + Vector2.Right * Utility.TileWidth;
|
||||
if (PoolContainer.Instance.TryGetEntity(checkPos, out RuntimePlantData plantData))
|
||||
{
|
||||
plantData.Heal(3000 + 25 * plantData.MaxHp, GetParent());
|
||||
plantData.Heal(3000 + 25 * plantData.MaxHP, GetParent());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,6 @@ public partial class HpBasedBehaviour : BaseBehaviour
|
|||
|
||||
public void OnHPChanged(int amount,Node origin)
|
||||
{
|
||||
_tree.Set("parameters/blend_position",(float)_data.Hp/_data.MaxHp);
|
||||
_tree.Set("parameters/blend_position",(float)_data.HP/_data.MaxHP);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue