Exemple #1
0
        /// <summary>
        /// Calculates the total value of a stat, factoring in StatModifiers
        /// </summary>
        /// <param name="statModType">The type of the stat to apply StatModifiers to</param>
        /// <returns>The total value of the stat with all StatModifiers factored in</returns>
        protected int CalculateTotalStat(StatModifiers.StatModTypes statModType)
        {
            int stat  = GetStatForStatMod(statModType);
            int total = (int)((stat + StatModifications.GetModifierAmount(statModType)) * StatModifications.GetModifierPercent(statModType));

            /*Debug.Log($"BASE STAT OF TYPE {statModType}: {stat}");
             * Debug.Log($"AMOUNT MODIFIER: {StatModifications.GetModifierAmount(statModType)}");
             * Debug.Log($"PERCENTAGE MODIFIER: {StatModifications.GetModifierPercent(statModType)}");
             * Debug.Log($"TOTAL: {total}");*/
            return(total);
        }
Exemple #2
0
        /// <summary>
        /// Returns the value of the appropriate stat based on the StatModType passed in
        /// </summary>
        /// <param name="statModType">The type of the stat</param>
        /// <returns>The value of the stat that corresponds to the StatModType passed in</returns>
        protected int GetStatForStatMod(StatModifiers.StatModTypes statModType)
        {
            switch (statModType)
            {
            default:
            case StatModifiers.StatModTypes.Attack: return(Attack);

            case StatModifiers.StatModTypes.Defense: return(Defense);

            case StatModifiers.StatModTypes.MagicAtk: return(MagicAtk);

            case StatModifiers.StatModTypes.MagicDef: return(MagicDef);

            case StatModifiers.StatModTypes.Speed: return(Speed);
            }
        }
Exemple #3
0
 public bool RemoveStatModifierPercentage(StatModifiers.StatModTypes statModType, float percentage)
 {
     return(StatModifications.RemoveModifierWithPercentage(statModType, percentage));
 }
Exemple #4
0
 public bool RemoveStatModifierAmount(StatModifiers.StatModTypes statModType, int amount)
 {
     return(StatModifications.RemoveModifierWithAmount(statModType, amount));
 }
Exemple #5
0
 public void AddStatModifier(StatModifiers.StatModTypes statModType, int amount, float percentage)
 {
     StatModifications.AddModifier(statModType, amount, percentage);
 }