update scripts

This commit is contained in:
2022-04-25 16:23:25 +07:00
parent e1d0bbc1eb
commit 290f5515b7
13 changed files with 120 additions and 47 deletions

View File

@ -21,6 +21,17 @@ public class CharacterCondition
OnChangeHealthEvent?.Invoke(value);
}
}
public int GetHealthPointsInQuantile()
{
if (health < 25)
return 0;
else if (health < 50)
return 1;
else if (health < 75)
return 2;
else return 3;
}
private int armour;
public int ArmourPoints
{
@ -51,9 +62,9 @@ public class CharacterCondition
public CharacterCondition()
{
var settings = SettingsReader.Instance.GetSettings;
ammo = settings.maxAmmo;
health = settings.maxHealth;
armour = settings.maxArmour;
ammo = settings.MaxAmmo;
health = settings.MaxHealth;
armour = settings.MaxArmour;
}
public void GiveHealth(int health) => HealthPoints = Mathf.Clamp(health + HealthPoints, 0, 100);