/// <summary> /// Returns the effective value of a given stat for an NPC /// </summary> /// <returns>The effective value (permanent + modifier) of the stat</returns> /// <param name="stat">Statistic to return</param> internal virtual int GetEffectiveStat(Enums.Attribute stat) { // In the original code, NPCs have a static maximum of 25 int max = 25; // Run the mob's stats and max through URange for the answer return(Helpers.Miscellaneous.URange(3, PermanentStats[(int)stat] + ModifiedStats[(int)stat], max)); }
internal override int GetEffectiveStat(Enums.Attribute stat) { // Base ceiling is the race's max stat +4 int max = Race.MaxStats[(int)stat] + 4; // 2 point bonus for the class's prime attribute if (Class.PrimeAttribute == stat) { max += 2; } // 1 point bonus for humans if (Race.Name.ToLower().Equals("human")) { max++; } // Set the ceiling to the lower of the calculated ceiling and 25 max = Helpers.Miscellaneous.LowestOf(new int[] { max, 25 }); // Final answer is calculated from an old alias called URANGE return(Helpers.Miscellaneous.URange(3, PermanentStats[(int)stat] + ModifiedStats[(int)stat], max)); }