diff --git a/Assets/Scripts/BloodSucker.cs b/Assets/Scripts/BloodSucker.cs index a2735fa..81e6187 100644 --- a/Assets/Scripts/BloodSucker.cs +++ b/Assets/Scripts/BloodSucker.cs @@ -72,10 +72,12 @@ public class BloodSucker : MonoBehaviour { void PerformSuck(float deltaTime) { currentSuckTimer -= deltaTime; if (currentSuckTimer < 0f) { + currentTarget.bloodTokens -= 1; // print("One token sucked"); - // TODO check if no token left - SetTarget(null); - isSucking = false; + if(currentTarget.bloodTokens == 0) { + SetTarget(null); + isSucking = false; + } } } diff --git a/Assets/Scripts/Entity.cs b/Assets/Scripts/Entity.cs index 2fa5851..fecedb5 100644 --- a/Assets/Scripts/Entity.cs +++ b/Assets/Scripts/Entity.cs @@ -6,6 +6,7 @@ using UnityEngine; public class Entity : MonoBehaviour { [field: SerializeField]public float Health { get; private set; } + public int bloodTokens = 1; [SerializeField]private float movementSpeed; [SerializeField]private float rotSpeed; [SerializeField]private float fov;