Example #1
0
        DamageInfo ComputePhysicalDamage(MagnitudeRange damageRange, int armor, int critFactor, int reduction)
        {
            int        mitigation   = ArmorToMitigation(armor);
            int        rawDamage    = critFactor * damageRange.Interpolate(QualityRoll.GetRandom());
            int        afterArmor   = ApplyMitigation(rawDamage, mitigation);
            DamageInfo damageResult = new DamageInfo(rawDamage, rawDamage - afterArmor, 0, reduction);

            return(damageResult);
        }
Example #2
0
        DamageInfo ComputeDamage(MagnitudeRange damageRange, int mitigation, int absorption, int reduction)
        {
            int        rawDamage       = damageRange.Interpolate(QualityRoll.GetRandom());
            int        afterResistance = ApplyMitigation(rawDamage, mitigation);
            int        absorbed        = rawDamage - ApplyMitigation(rawDamage, absorption);
            DamageInfo damageResult    = new DamageInfo(rawDamage, rawDamage - afterResistance, absorbed, reduction);

            return(damageResult);
        }
Example #3
0
        Item BuildRare(ItemTemplate template)
        {
            template.StartBuilding();
            int numPrefixes = UnityEngine.Random.Range(1, maxSuffixesOnRare);
            int numSuffixes = UnityEngine.Random.Range(1, maxPrefixesOnRare);

            foreach (var affix in GetAffixesForRareItem(template.Slot, numPrefixes, numSuffixes))
            {
                template.AddAffix(affix, QualityRoll.GetRandom());
            }
            // Will most likely replace with a random name generator, similar in design to how the rare enemy
            // name generator works.
            return(template.FinishBuilding($"Rare {template.Name}"));
        }
Example #4
0
        Item BuildMagic(ItemTemplate template)
        {
            template.StartBuilding();
            var affixes = GetAffixesForRareItem(template.Slot, 1, 1);

            foreach (var affix in GetAffixesForRareItem(template.Slot, 1, 1))
            {
                template.AddAffix(affix, QualityRoll.GetRandom());
            }
            var prefix = affixes.First(aff => aff.IsPrefix);
            var suffix = affixes.First(aff => aff.IsSuffix);

            return(template.FinishBuilding($"{prefix.Name} {template.Name} of {suffix.Name}"));
        }