You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
440 B
13 lines
440 B
using System;
|
|
|
|
namespace Exsersewo.Nydaliv.Utilities
|
|
{
|
|
public static class NumberUtilities
|
|
{
|
|
public static ulong GetXPLevelRequirement(ulong level, double growthmod)
|
|
=> (ulong)Math.Round(Math.Pow(level, 2) * 50 * growthmod, MidpointRounding.AwayFromZero);
|
|
|
|
public static ulong GetLevelFromTotalXP(ulong totalxp, double growthmod)
|
|
=> (ulong)(Math.Sqrt(totalxp / (50 * growthmod)));
|
|
}
|
|
}
|
|
|