Пример #1
0
    public void Attack(EntityStats target)
    {
        int totalDamage = 0;
        int damage      = stats.damage.GetValue();
        int strength    = stats.strength.GetValue();

        totalDamage = damage + Mathf.RoundToInt(strength * Random.Range(0f, 2f));

        target.Damage(totalDamage);

        if (OnAttack != null)
        {
            OnAttack();
        }
    }