Expand website and game trackers
Some checks failed
Test and deploy staging / staging (push) Failing after 5m29s

This commit is contained in:
2026-09-25 22:43:04 +00:00
parent f6b34150d4
commit c2ba8febb4
4076 changed files with 97237 additions and 1453 deletions

View File

@@ -0,0 +1,43 @@
import type { MasteryRules } from './mastery';
export type RankLimits = {
maxLevel: number | null;
maxPrestige: number;
canPrestigeOnlyAtMaxLevel: boolean;
rankable: boolean;
};
const capsFor = (rules: MasteryRules) => rules.rankCaps;
export function playerRankLimits(rules: MasteryRules): RankLimits {
const caps = capsFor(rules)?.player;
return {
maxLevel: caps?.level ?? null,
maxPrestige: caps?.prestige ?? 1000,
canPrestigeOnlyAtMaxLevel: false,
rankable: true
};
}
export function weaponRankLimits(
rules: MasteryRules,
weapon: Pick<{ category: string; name: string }, 'category' | 'name'>
): RankLimits {
const caps = capsFor(rules);
if (!caps) {
return {
maxLevel: null,
maxPrestige: 1000,
canPrestigeOnlyAtMaxLevel: false,
rankable: true
};
}
const maxLevel =
caps.weaponLevelOverrides?.[weapon.name] ?? caps.weaponLevelsByClass[weapon.category] ?? null;
return {
maxLevel,
maxPrestige: caps.weaponPrestige,
canPrestigeOnlyAtMaxLevel: true,
rankable: maxLevel !== null
};
}