balance(achievements): strictly-escalating milestone coin rewards
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:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user