예제 #1
0
    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);
        }
    }
예제 #2
0
 public int getDamage()
 {
     return(NegativeBinomialDistribution.fromMeanAndStandardDeviation(STRENGTH - 1, VARIATION) + 1);
 }