feat: roomier BO2 companion with +/- rank stepping
All checks were successful
Test and deploy staging / staging (push) Successful in 2m29s
All checks were successful
Test and deploy staging / staging (push) Successful in 2m29s
- Scale the COD page to the screen: larger gun art, text and progress ribbon, sized from one viewport unit so it fills a MacBook Pro 16" and big monitors and still fits 1280x720 without scrolling. - Five columns on wide screens and four below, picked by CSS, so the server-rendered page already has the final layout. - Replace the tabs/filters/overview rows with one toolbar of matching controls. - Player and weapon ranks step with + and -: level 55 + 1 is the next prestige at level 1, up to max prestige. Presses show at once, batch while a save is running, and stepRank does the arithmetic in SQL. - Clicking a rank still opens exact entry for big jumps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
gameRanksProgress,
|
||||
hasReachedMaxLevel,
|
||||
rankProgress,
|
||||
stepRank,
|
||||
weaponFinished,
|
||||
weaponLevelsProgress
|
||||
} from './rank-progress';
|
||||
@@ -72,6 +73,24 @@ describe('BO2 rank progression', () => {
|
||||
expect(weaponFinished(rules, m27, { level: 16, prestige: 2 }, () => true)).toBe(false);
|
||||
expect(weaponFinished(rules, m27, { level: 17, prestige: 2 }, () => true)).toBe(true);
|
||||
});
|
||||
it('steps level and prestige as one counter', () => {
|
||||
const player = playerRankLimits(rules);
|
||||
expect(stepRank(player, null, 1)).toEqual({ level: 2, prestige: 0 });
|
||||
expect(stepRank(player, null, -1)).toEqual({ level: 1, prestige: 0 });
|
||||
expect(stepRank(player, { level: 55, prestige: 0 }, 1)).toEqual({ level: 1, prestige: 1 });
|
||||
expect(stepRank(player, { level: 1, prestige: 1 }, -1)).toEqual({ level: 55, prestige: 0 });
|
||||
expect(stepRank(player, { level: 54, prestige: 10 }, 1)).toEqual({ level: 55, prestige: 10 });
|
||||
expect(stepRank(player, { level: 55, prestige: 10 }, 1)).toEqual({ level: 55, prestige: 10 });
|
||||
const m27Limits = weaponRankLimits(rules, m27);
|
||||
expect(stepRank(m27Limits, { level: 17, prestige: 1 }, 1)).toEqual({ level: 1, prestige: 2 });
|
||||
expect(stepRank(m27Limits, { level: 16, prestige: 0 }, 3)).toEqual({ level: 2, prestige: 1 });
|
||||
// Historic out-of-range prestiges count as max prestige instead of growing further.
|
||||
expect(stepRank(m27Limits, { level: 1, prestige: 4 }, -1)).toEqual({ level: 17, prestige: 1 });
|
||||
expect(stepRank(m27Limits, { level: 1, prestige: 4 }, 1)).toEqual({ level: 2, prestige: 2 });
|
||||
const uncapped = weaponRankLimits({ ...rules, rankCaps: undefined }, m27);
|
||||
expect(stepRank(uncapped, { level: 40, prestige: 3 }, 1)).toEqual({ level: 41, prestige: 3 });
|
||||
expect(stepRank(uncapped, { level: 1, prestige: 3 }, -1)).toEqual({ level: 1, prestige: 3 });
|
||||
});
|
||||
it('bounds historic out-of-range values without mutating saved data', () => {
|
||||
const rank = { level: 100, prestige: 999 };
|
||||
expect(rankProgress(weaponRankLimits(rules, m27), rank)).toEqual({ value: 51, total: 51 });
|
||||
|
||||
Reference in New Issue
Block a user