Ejemplo n.º 1
0
    public void beDamagedBy(Projectile p)
    {
        float minD = p.SourceTower.Attributes[Tower.AttributeType.minDamage];
        float maxD = p.SourceTower.Attributes[Tower.AttributeType.maxDamage];
        float delta = maxD - minD;

        float dam = Random.value * delta + minD;

        this.Health -= dam;

        p.onTroopHit(this);
    }