mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-16 22:10:26 +00:00
## Description: Adds the anti-stall **Doomsday Clock** to the public "special" modifier rotation, so it rolls into public games like the other spice modifiers, with a lobby badge. - `MapPlaylist`: new `isDoomsdayClock` ticket in `SPECIAL_MODIFIER_POOL` (weight 4, ~20% of special games). When rolled, enables `doomsdayClock` at a speed picked per game (slow/normal/fast/veryfast). - `PublicGameModifiers` (type + schema): `isDoomsdayClock` flag drives the badge. - `getActiveModifiers` + `en.json`: a "Doomsday Clock" badge/label. - Test covering the badge wiring. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory
20 lines
856 B
TypeScript
20 lines
856 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { getActiveModifiers } from "../../src/client/Utils";
|
|
|
|
// The doomsday clock is part of the public "special" modifier rotation, so an
|
|
// active isDoomsdayClock modifier must surface a lobby badge like every other
|
|
// rotation modifier.
|
|
describe("doomsday clock public modifier", () => {
|
|
it("surfaces a doomsday-clock badge when the modifier is active", () => {
|
|
const mods = getActiveModifiers({ isDoomsdayClock: true });
|
|
expect(mods).toHaveLength(1);
|
|
expect(mods[0].badgeKey).toBe("public_game_modifier.doomsday_clock");
|
|
expect(mods[0].labelKey).toBe("public_game_modifier.doomsday_clock_label");
|
|
});
|
|
|
|
it("omits the badge when the modifier is absent", () => {
|
|
expect(getActiveModifiers({})).toHaveLength(0);
|
|
expect(getActiveModifiers(undefined)).toHaveLength(0);
|
|
});
|
|
});
|