Пример #1
0
    private Damage CalculateDamage()
    {
        var physicalDmg = sourceStats.GetRealDamage(baseDamage, Damage.Type.Physical);
        var rand        = random.NextDouble(); // [0.0, 1.0[

        if (sourceStats.percentCritic > 0 && rand <= sourceStats.percentCritic)
        {
            physicalDmg += sourceStats.CalculateDamageCritic(physicalDmg);
        }

        return(new Damage(physicalDmg, Damage.Type.Physical));
    }
Пример #2
0
    private Damage CalculateDamage()
    {
        var fireDmg = sourceStats.GetRealDamage(damagePerTick, Damage.Type.Fire);
        var rand    = random.NextDouble(); // [0.0, 1.0[

        if (sourceStats.percentCritic > 0 && rand <= sourceStats.percentCritic)
        {
            fireDmg += sourceStats.CalculateDamageCritic(fireDmg);
        }

        return(new Damage(fireDmg, Damage.Type.Fire));
    }