cs2-outnumbered/Outnumbered/Domain/ProgressionModel.cs
Kamal Tufekcic d701598350
All checks were successful
CI / build (push) Successful in 32s
CI / release (push) Successful in 32s
CI / lint (push) Successful in 30s
initial commit
2026-07-05 13:28:35 +03:00

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);
}