16 lines
798 B
C#
16 lines
798 B
C#
using Outnumbered.Config;
|
|
|
|
namespace Outnumbered.Domain;
|
|
|
|
// XP/level/prestige curves (pure). The stateful level-up loop + its side effects (chat/sound/clan) stay engine-side;
|
|
// this owns only the formulas it walks.
|
|
public static class ProgressionModel
|
|
{
|
|
// XP required to go from `level` to `level+1`. LevelXpExponent shapes the curve (1 = linear, >1 = accelerating).
|
|
public static long XpToNext(int level, ProgressionConfig c) =>
|
|
c.LevelXpBase + (long)Math.Round(c.LevelXpStep * Math.Pow(Math.Max(0, level - 1), c.LevelXpExponent));
|
|
|
|
// Cumulative prestige XP boost (prestige never lowers difficulty; it only speeds the climb).
|
|
public static double PrestigeXpMultiplier(int prestige, ProgressionConfig c) =>
|
|
1.0 + prestige * (c.PrestigeXpBoostPercent / 100.0);
|
|
}
|