balance(achievements): strictly-escalating milestone coin rewards
CI/CD / CI - API (dotnet build + engine sim) (push) Successful in 32s
CI/CD / CI - Web (tsc + next build) (push) Successful in 1m9s
CI/CD / Deploy - local stack (db + server + web) (push) Successful in 1m0s

The old reward formula rounded (40+6g)/50 on the raw goal, so adjacent
milestones could pay the same (e.g. "1 win" and "5 wins" both 50) and the curve
was lumpy — not a standard escalating-reward ladder. Reward now scales by tier
index: 50, 150, 250 … capped at 1500, strictly increasing per milestone.
Mirrored client (gamification.ts) + server (Gamification.cs) so live grants match.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-15 11:28:08 +03:30
parent 974a6bf0ae
commit 6502b17356
2 changed files with 6 additions and 4 deletions
+3 -2
View File
@@ -253,12 +253,13 @@ function tier(
faDesc: (g: string) => string,
enDesc: (g: number) => string
): AchievementDef[] {
return goals.map((g) => ({
return goals.map((g, i) => ({
id: `${prefix}_${g}`,
category,
metric,
goal: g,
coinReward: Math.min(1500, Math.max(50, Math.round((40 + g * 6) / 50) * 50)),
// Reward escalates strictly per milestone tier (50, 150, 250 … capped 1500).
coinReward: Math.min(1500, 50 + i * 100),
icon,
nameFa: faName(faNum(g)),
nameEn: enName(g),