Пример #1
0
 /// <summary>
 /// Gets the total amount of damage per stats in a DamagePerStats object.
 /// </summary>
 /// <param name="damagePerStat">The object to get the total damage from.</param>
 /// <returns></returns>
 public static int GetDamagePerStatAsInt(DamagePerStat damagePerStat)
 {
     return(GetDamageTypesAsInt(damagePerStat.Strength)
            + GetDamageTypesAsInt(damagePerStat.Dexterity)
            + GetDamageTypesAsInt(damagePerStat.Agility)
            + GetDamageTypesAsInt(damagePerStat.Intelligence)
            + GetDamageTypesAsInt(damagePerStat.Constitution));
 }
Пример #2
0
        /// <summary>
        /// Returns a DamageTypes object that contains the amount of each type of damage is deal given a DamagePerStat amount
        /// and a character's stats.
        /// </summary>
        /// <param name="damagePerStat">The amount of damage dealt per point of each type of stat.</param>
        /// <param name="stats">The amount of each stat type to calculate with.</param>
        /// <returns>A DamageTypes object containing the amount of damage of each type.</returns>
        public static DamageTypes GetDamagePerStat(DamagePerStat damagePerStat, CharacterStats stats)
        {
            var result = new DamageTypes();

            result += damagePerStat.Strength * stats.Strength;
            result += damagePerStat.Dexterity * stats.Dexterity;
            result += damagePerStat.Agility * stats.Agility;
            result += damagePerStat.Intelligence * stats.Intelligence;
            result += damagePerStat.Constitution * stats.Constitution;

            return(result);
        }