public void DamageShield(int dmg) { shieldHealth -= dmg; if (shieldHealth < 0) { // Keep track of damage left int dmgLeft = shieldHealth; //If shield health is below 0 we set is back to 0 shieldHealth = 0; // Apply remaining damages to cell selfOrganism.DamageOrganism(Mathf.Abs(dmgLeft)); } //Change shield size according to health UpdateShieldSize(); }
protected virtual void ApplyDamage(Organism o) { o.DamageOrganism(damage); }