public void defend(float strength, float variation) { int damage = NegativeBinomialDistribution.fromMeanAndStandardDeviation(strength - 1, variation) + 1; hp -= damage; if (hp <= 0) { position.remove("Unit"); grid.remove(this); Object.Destroy(gameObject); } }
public int getDamage() { return(NegativeBinomialDistribution.fromMeanAndStandardDeviation(STRENGTH - 1, VARIATION) + 1); }