public virtual bool Heal(float amount) { float currentHealth = stats.GetStat("health"); if (currentHealth < MAX_HEALTH) { stats.SetStat("health", Mathf.Min(MAX_HEALTH, currentHealth + amount)); controller.RespondToEntityAction(this, "health"); return(true); } return(false); }
public override void Setup() { base.Setup(); anim = GetComponent <Animator> (); //durability = MAX_DURABILITY; targetsHit = new List <Entity> (); //damageQueue = new List<Entity> (); owner = GetComponentInParent <Entity> (); stats = new StatInfo(); for (int i = 0; i < statNames.Length; i++) { stats.SetStat(statNames [i], statValues [i]); } }