Release official game-length variants and accessible age-track rules

This commit is contained in:
coyotte508 2026-11-05 10:10:50 +00:00
commit a63d2c6be7
41 changed files with 1619 additions and 60 deletions

View file

@ -0,0 +1,99 @@
# Monumental game lengths — viewer 0.1.203 / engine 0.4.137
The five creation choices are approved for publication with the matching engine.
`web-client/bgs-length-option.json` is the publisher input; the original proposal
is retained as a matching reference. Existing saved games are not migrated.
## Selection and compatibility
A single `options.length` enum selects exactly one mode. Arrays, unknown enum names
and objects combining modes are rejected by serde, including the WASM option parser.
Civilization selection, Builder and balance-patch options remain independent.
There is no ambiguous `Short` alias. Missing length still means serialized `Standard` (displayed as **Normal**, 6 ages);
`Epic` still means 8 ages in ongoing games, archives and replays.
- `Shorter`: four ages and two initial settlers, including civilization-draft setup.
Nonfinal status phases give one free advance to every player in turn order, then
a second full pass. The second advance comes from supply, not the event tracker:
ordinary prerequisites, bonuses and advance listeners run, but no event marker
is consumed by that advance. Any nested choice retains its ordinary rules.
- `RollToEnd`: seven-age track. Roll before the first player's turn-start abilities
in each eligible round. The printed thresholds supplied by the user are:
| Round | End on |
| --- | --- |
| VI.2 | 6 |
| VI.3 | 5–6 |
| VII.1 | 4–6 |
| VII.2 | 3–6 |
| VII.3 | 2–6 |
The existing RNG/dice path has two faces for each number 1–6, and is therefore
uniform. It records the roll and uses the normal information-reveal undo barrier.
A successful roll enters final status immediately, without a player turn.
- `WonderfulEnding`: construction (not acquisition or capture) in those same five
rounds sets a persistent flag. Every remaining player finishes that round before
final status. Undoing a reversible construction also undoes the flag.
Every final status phase checks objectives only: no free advances, cards, razing,
government changes or first-player selection. Variable modes without a trigger
finish normally at the end of VII. Existing no-city and withdrawal endings remain.
## State and UI
Optional `variable_end` records the triggered ending and survives saves and replay.
It is absent in all old/default games. `SecondFreeAdvance` is a distinct persistent
status phase, reusing the normal free-advance request/benefit handler. First-pass
preselections remain compatible; the second pass uses ordinary live choices.
The viewer uses the saved length for the age track. The separate Game length
collapsible is removed. Tap/click any age (or use Tab and Enter/Space) to open
anchored rule details; Escape restores focus, and outside click dismisses them.
Hover titles and expanded/current-step semantics expose the same affordance.
The current mode's rules and all five mode names/age counts remain discoverable
there, including Shorter, Normal and legacy Epic. Normal is only a display name:
the serialized enum and creation option's value remain `Standard`.
Roll to End marks VI and VII with dice; Wonderful Ending marks them with a wonder.
VI.1 is explicitly ineligible in the details and its current-age icon is muted.
Details give all five eligible rounds, exact dice thresholds, immediate versus
end-of-round timing, objectives-only final status and the VII fallback.
The round caption shows the applicable dice threshold in Roll to End. Wonderful
Ending shows **Wonder to end** only during VI.2–VII.3; a recorded construction
trigger changes this to **Ends this round**. Both captions open the same details.
Mobile retains the age track on a compact row; details wrap within the viewport
and render above map controls. All 17 catalogs contain the active captions and
rule/log strings (native-language editorial review remains useful). Second-pass
research does not display a spurious event-trigger warning.
The legacy Macroquad client continues to show the current age and round and uses
the same engine rules; its rule-help/localization UI is not expanded here.
## Local verification
- Rust 1.94.1 workspace tests, formatting check and Clippy completed. Clippy still
reports the repository's existing warning backlog.
- Eleven focused native tests cover the printed track, option shapes, both advance
passes, incident-marker boundaries, normal bonuses and nested wonder-card choice
resumption across save/load, final status, construction versus acquisition,
remaining-player handoffs/drops, and round-start undo barriers (including a
first-player chooser selecting themselves).
- Frontend type checking, 1,028 tests, catalog parity/source checks and production
build completed against a locally rebuilt wasm-bindgen 0.2.105 bridge.
- Browser smoke checks (`node web-client/scripts/game-length-smoke.mjs`, after
building and starting the local preview at http://localhost:8671/) cover
1,400px and 390px EN/FR layouts, all five modes, actual age/phase-caption taps,
keyboard activation, Escape/focus restoration, outside dismissal, exact dice
thresholds, VI.1 inactivity, all five wonder-window rounds, triggered ending
labels, popover bounds/layering, no horizontal overflow and no page errors.
Screenshots are saved to `/tmp/clash-age-{roll,wonder}-{en,fr}-{1400,390}.png`.
One intermediate randomized native run failed in the unrelated Tributes /
Acamapichtli action validator; subsequent full runs passed. The failing randomized
state was retained at `/tmp/clash-length-random-action-failure.json`, not added to
tracked fixtures. This is not represented as a warning-free or exhaustive rules audit.
Release verification also checks the approved BGS creation choices against WASM,
including the missing-length Standard default, and runs the mode tests against
the packed 0.4.137 engine. Calendar privacy/history/undo and Voting/Sparta payment
regressions pass against that same package. The release workspace test run passed
(including random actions); the earlier randomized failure above did not recur.

View file

@ -0,0 +1,13 @@
{
"label": "Game length",
"type": "select",
"name": "length",
"default": "Standard",
"items": [
{ "name": "Standard", "label": "Normal — 6 ages" },
{ "name": "Shorter", "label": "Shorter — 4 ages, 2 settlers, two free advances" },
{ "name": "RollToEnd", "label": "Roll to End, up to 7 ages" },
{ "name": "WonderfulEnding", "label": "Wonderful Ending, up to 7 ages" },
{ "name": "Epic", "label": "Epic — 8 ages" }
]
}

View file

@ -122,7 +122,7 @@ fn advance_key(game: &Game) -> String {
}
fn advance_offer(game: &Game, player: usize) -> Option<Offer> {
if game.age >= game.options.length.ages() {
if game.variable_end.is_some() || game.age >= game.options.length.ages() {
return None;
}
let status = game

View file

@ -64,6 +64,9 @@ pub enum GameLength {
#[default]
Standard,
Epic,
Shorter,
RollToEnd,
WonderfulEnding,
}
impl GameLength {
@ -72,6 +75,8 @@ impl GameLength {
match self {
Self::Standard => crate::consts::AGES,
Self::Epic => 8,
Self::Shorter => 4,
Self::RollToEnd | Self::WonderfulEnding => 7,
}
}
@ -81,6 +86,25 @@ impl GameLength {
}
}
/// The printed seven-age track's final five rounds.
#[must_use]
pub fn variable_end_threshold(age: u32, round: u32) -> Option<u8> {
match (age, round) {
(6, 2) => Some(6),
(6, 3) => Some(5),
(7, 1) => Some(4),
(7, 2) => Some(3),
(7, 3) => Some(2),
_ => None,
}
}
#[derive(Serialize, Deserialize, PartialEq, Eq, Clone, Debug)]
pub enum VariableEnd {
RollToEnd,
WonderfulEnding,
}
#[derive(Serialize, Deserialize, PartialEq, Clone, Default)]
pub struct GameOptions {
// Read old saves only. Cleared on load; unrestricted undo is no longer a rule.
@ -162,6 +186,8 @@ pub struct Game {
pub undo_limit: usize,
pub actions_left: u32,
pub successful_cultural_influence: bool,
/// Set by a variable ending; `WonderfulEnding` waits until this round completes.
pub variable_end: Option<VariableEnd>,
pub round: u32, // starts at 1
pub age: u32, // starts at 1
pub messages: Vec<String>,
@ -414,7 +440,11 @@ impl Game {
pub(crate) fn start_turn(&mut self) {
let player = self.current_player_index;
add_turn_log(self, TurnType::Player(player));
self.start_turn_after_log();
}
fn start_turn_after_log(&mut self) {
let player = self.current_player_index;
self.actions_left = ACTIONS;
let lost_action = self
.permanent_effects
@ -456,7 +486,8 @@ impl Game {
pub fn increment_player_index(&mut self) {
// Barbarians and Pirates have the highest player indices
self.current_player_index += 1;
self.current_player_index %= self.human_players_count();
// Seat indices remain stable when a player drops.
self.current_player_index %= self.players.iter().filter(|p| p.is_human()).count();
}
#[must_use]
@ -537,6 +568,10 @@ impl Game {
}
fn next_round(&mut self) {
if self.variable_end == Some(VariableEnd::WonderfulEnding) {
enter_status_phase(self);
return;
}
self.round += 1;
self.skip_dropped_players();
if self.round > 3 {
@ -544,6 +579,30 @@ impl Game {
return;
}
add_round_log(self, self.round);
if self.options.length == GameLength::RollToEnd
&& let Some(threshold) = variable_end_threshold(self.age, self.round)
{
// Establish the log before rolling, but do not run any turn-start abilities.
add_turn_log(self, TurnType::Player(self.current_player_index));
add_start_turn_action_if_needed(self, self.current_player_index);
let roll = self.next_dice_roll().value;
self.log(
self.current_player_index,
&EventOrigin::Ability("Roll to End".into()),
&format!("Roll to End: {roll} (end on {threshold}–6)"),
);
if roll >= threshold {
self.variable_end = Some(VariableEnd::RollToEnd);
enter_status_phase(self);
} else {
self.start_turn_after_log();
}
// Final-status / turn-start logging can replace the current turn.
// Keep the reveal barrier in that new log too (including when the
// first-player chooser is also the next active player).
self.lock_undo();
return;
}
self.start_turn();
}
@ -611,6 +670,10 @@ impl Game {
true
}
/// Remove a player while keeping surviving seat indices and round order stable.
///
/// # Panics
/// Panics if the saved human-seat layout is inconsistent with its active players.
pub fn drop_player(&mut self, player_index: usize) {
if self.civilization_draft.is_some() {
crate::game_setup::drop_draft_player(self, player_index);
@ -626,12 +689,22 @@ impl Game {
"{} has left the game",
self.player_name(player_index)
));
let dropped_first = self.starting_player_index == player_index;
if dropped_first {
let seats = self.players.iter().filter(|p| p.is_human()).count();
self.starting_player_index = (1..seats)
.map(|offset| (player_index + offset) % seats)
.find(|p| !self.dropped_players.contains(p))
.expect("an active player remains");
}
if self.current_player_index != player_index {
return;
}
self.skip_dropped_players();
if self.current_player_index == self.starting_player_index {
if !dropped_first && self.current_player_index == self.starting_player_index {
self.next_round();
} else if self.events.is_empty() {
self.start_turn();
}
}

View file

@ -82,6 +82,8 @@ pub struct GameData {
#[serde(default)]
#[serde(skip_serializing_if = "std::ops::Not::not")]
successful_cultural_influence: bool,
#[serde(default, skip_serializing_if = "Option::is_none")]
variable_end: Option<crate::game::VariableEnd>,
round: u32,
age: u32,
messages: Vec<String>,
@ -156,6 +158,7 @@ pub fn from_data(data: GameData, cache: Cache, context: GameContext) -> Game {
calendar_incident_undo: None,
log_index: data.log_index,
undo_limit: data.undo_limit,
variable_end: data.variable_end,
round: data.round,
age: data.age,
messages: data.messages,
@ -218,6 +221,7 @@ pub fn data(game: Game) -> GameData {
undo_limit: game.undo_limit,
actions_left: game.actions_left,
successful_cultural_influence: game.successful_cultural_influence,
variable_end: game.variable_end.clone(),
round: game.round,
age: game.age,
messages: game.messages,
@ -262,6 +266,7 @@ pub fn cloned_data(game: &Game) -> GameData {
undo_limit: game.undo_limit,
actions_left: game.actions_left,
successful_cultural_influence: game.successful_cultural_influence,
variable_end: game.variable_end.clone(),
round: game.round,
age: game.age,
messages: game.messages.clone(),

View file

@ -0,0 +1,366 @@
use crate::action::Action;
use crate::advance::Advance;
use crate::content::persistent_events::EventResponse;
use crate::events::{EventOrigin, EventPlayer};
use crate::game::{
Game, GameContext, GameLength, GameOptions, GameState, VariableEnd, variable_end_threshold,
};
use crate::game_setup::{GameSetupBuilder, setup_game};
use crate::status_phase::{StatusPhaseState, enter_status_phase, get_status_phase};
use crate::unit::UnitType;
use crate::wonder::{Wonder, construct_wonder, gain_wonder};
fn setup(length: GameLength) -> Game {
let mut game = setup_game(
&GameSetupBuilder::new(2)
.seed("official-length-tests".into())
.assigned_civilizations(vec!["Rome".into(), "Greece".into()])
.options(GameOptions {
length,
..GameOptions::default()
})
.build(),
);
for p in &mut game.players {
p.objective_cards.clear();
}
game.starting_player_index = 0;
game.current_player_index = 0;
game
}
fn answer(game: Game, advance: Advance) -> Game {
let player = game.active_player();
crate::game_api::execute(
game,
Action::Response(EventResponse::SelectAdvance(advance)),
player,
)
}
#[test]
fn printed_track_and_legacy_options() {
for age in 0..=9 {
for round in 0..=4 {
let expected = match (age, round) {
(6, 2) => Some(6),
(6, 3) => Some(5),
(7, 1) => Some(4),
(7, 2) => Some(3),
(7, 3) => Some(2),
_ => None,
};
assert_eq!(variable_end_threshold(age, round), expected);
}
}
for (name, ages) in [
("Standard", 6),
("Epic", 8),
("Shorter", 4),
("RollToEnd", 7),
("WonderfulEnding", 7),
] {
let options: GameOptions = serde_json::from_value(
serde_json::json!({"length":name,"variant":"Builder","civilization":"DraftThree"}),
)
.expect("valid test options");
assert_eq!(options.length.ages(), ages);
assert_eq!(
serde_json::to_value(options).expect("valid test options")["variant"],
"Builder"
);
}
for length in [
serde_json::json!(["Shorter", "RollToEnd"]),
serde_json::json!("Short"),
serde_json::json!({"Shorter":true,"WonderfulEnding":true}),
] {
assert!(
serde_json::from_value::<GameOptions>(serde_json::json!({"length":length})).is_err()
);
}
assert_eq!(
serde_json::from_str::<GameOptions>("{}")
.expect("valid test options")
.length
.ages(),
6
);
}
#[test]
fn shorter_setup_and_two_complete_passes() {
let mut game = setup(GameLength::Shorter);
for p in game.players.iter().filter(|p| p.is_human()) {
assert_eq!(
p.units
.iter()
.filter(|u| u.unit_type == UnitType::Settler)
.count(),
2
);
}
game.starting_player_index = 1;
enter_status_phase(&mut game);
for (player, advance, phase) in [
(1, Advance::Storage, StatusPhaseState::FreeAdvance),
(0, Advance::Storage, StatusPhaseState::FreeAdvance),
(1, Advance::Irrigation, StatusPhaseState::SecondFreeAdvance),
(0, Advance::Irrigation, StatusPhaseState::SecondFreeAdvance),
] {
assert_eq!(game.active_player(), player);
assert_eq!(get_status_phase(&game), Some(&phase));
if phase == StatusPhaseState::SecondFreeAdvance {
game.player_mut(player).incident_tokens = 1;
}
let mood = game.player(player).resources.mood_tokens;
let before = game.player(player).incident_tokens;
game = answer(game, advance);
assert!(game.player(player).has_advance(advance));
if advance == Advance::Irrigation {
assert_eq!(game.player(player).resources.mood_tokens, mood + 1);
}
assert_eq!(
game.player(player).incident_tokens,
before - u8::from(phase == StatusPhaseState::FreeAdvance)
);
}
assert_ne!(
get_status_phase(&game),
Some(&StatusPhaseState::SecondFreeAdvance)
);
}
#[test]
fn final_status_never_awards_advances() {
for (length, age) in [
(GameLength::Shorter, 4),
(GameLength::Standard, 6),
(GameLength::Epic, 8),
(GameLength::RollToEnd, 7),
(GameLength::WonderfulEnding, 7),
] {
let mut game = setup(length);
game.age = age;
let advances = game.player(0).advances;
enter_status_phase(&mut game);
assert!(matches!(game.state, GameState::Finished));
assert_eq!(game.player(0).advances, advances);
assert!(game.events.is_empty());
}
}
#[test]
fn every_roll_boundary_precedes_turn_start_and_cannot_be_undone() {
for (age, round, threshold) in [(6, 2, 6), (6, 3, 5), (7, 1, 4), (7, 2, 3), (7, 3, 2)] {
for roll in 1..=6 {
let mut game = setup(GameLength::RollToEnd);
game.age = age;
game.round = round - 1;
game.current_player_index = 1;
game.dice_roll_outcomes = vec![(roll - 1) * 2];
// A turn-start penalty must remain untouched when the roll ends play.
game.permanent_effects
.push(crate::content::effects::PermanentEffect::RevolutionLoseAction(0));
game = crate::game_api::execute(
game,
Action::Playing(crate::playing_actions::PlayingAction::EndTurn),
1,
);
assert_eq!(game.dice_roll_log.last(), Some(&((roll - 1) * 2)));
assert_eq!(matches!(game.state, GameState::Finished), roll >= threshold);
assert_eq!(game.variable_end.is_some(), roll >= threshold);
assert!(!game.can_undo());
if roll >= threshold {
assert!(!game.permanent_effects.is_empty());
}
let restored =
Game::from_data(game.cloned_data(), game.cache.clone(), GameContext::Play);
assert_eq!(restored.variable_end, game.variable_end);
assert_eq!(restored.dice_roll_log, game.dice_roll_log);
assert!(!restored.can_undo());
}
}
}
#[test]
fn rolls_only_at_eligible_round_start_not_each_player() {
let mut game = setup(GameLength::RollToEnd);
game.age = 6;
game.dice_roll_outcomes = vec![0];
game.next_turn();
assert_eq!(game.dice_roll_outcomes.len(), 1);
game.next_turn();
assert!(game.dice_roll_outcomes.is_empty());
game.dice_roll_outcomes.push(10);
game.next_turn();
assert_eq!(game.dice_roll_outcomes.len(), 1);
assert!(!matches!(game.state, GameState::Finished));
}
#[test]
fn wonderful_ending_construction_only_and_finishes_whole_round() {
for (age, round, eligible) in [
(6, 1, false),
(6, 2, true),
(6, 3, true),
(7, 1, true),
(7, 2, true),
(7, 3, true),
] {
for builder in 0..2 {
let mut game = setup(GameLength::WonderfulEnding);
game.age = age;
game.round = round;
game.current_player_index = builder;
crate::log::add_start_turn_action_if_needed(&mut game, builder);
let player = EventPlayer::new(builder, EventOrigin::Wonder(Wonder::Colosseum));
let city = game.player(builder).cities[0].position;
construct_wonder(&mut game, &player, Wonder::Colosseum, city);
assert_eq!(game.variable_end.is_some(), eligible);
assert!(!matches!(game.state, GameState::Finished));
if builder == 0 {
game.next_turn();
assert_eq!(game.current_player_index, 1);
assert!(!matches!(game.state, GameState::Finished));
}
game.next_turn();
assert_eq!(matches!(game.state, GameState::Finished), eligible);
}
}
let mut game = setup(GameLength::WonderfulEnding);
game.age = 7;
game.round = 2;
crate::log::add_start_turn_action_if_needed(&mut game, 0);
let city = game.player(0).cities[0].position;
gain_wonder(
&mut game,
&EventPlayer::new(0, EventOrigin::Wonder(Wonder::Colosseum)),
Wonder::Colosseum,
city,
);
assert_eq!(game.variable_end, None);
game.variable_end = Some(VariableEnd::WonderfulEnding);
let restored = Game::from_data(game.cloned_data(), game.cache.clone(), GameContext::Play);
assert_eq!(restored.variable_end, game.variable_end);
}
#[test]
fn first_pass_still_triggers_an_incident() {
let mut game = setup(GameLength::Shorter);
game.player_mut(0).incident_tokens = 1;
enter_status_phase(&mut game);
let incidents = game.incidents_left.len();
game = answer(game, Advance::Storage);
assert_eq!(game.player(0).incident_tokens, 3);
assert!(game.incidents_left.len() < incidents);
}
#[test]
fn second_pass_preserves_initializers_and_save_load() {
let mut game = setup(GameLength::Shorter);
enter_status_phase(&mut game);
game = answer(game, Advance::Storage);
game = answer(game, Advance::Storage);
assert_eq!(
get_status_phase(&game),
Some(&StatusPhaseState::SecondFreeAdvance)
);
game = Game::from_data(game.cloned_data(), game.cache.clone(), GameContext::Play);
game.player_mut(0).incident_tokens = 1;
let cards = game.player(0).action_cards.len();
let objectives = game.player(0).objective_cards.len();
let culture = game.player(0).resources.culture_tokens;
game = answer(game, Advance::Writing);
assert_eq!(game.player(0).action_cards.len(), cards + 1);
assert_eq!(game.player(0).objective_cards.len(), objectives + 1);
assert_eq!(game.player(0).resources.culture_tokens, culture + 1);
assert_eq!(game.player(0).incident_tokens, 1);
assert_eq!(game.active_player(), 1);
assert_eq!(
get_status_phase(&game),
Some(&StatusPhaseState::SecondFreeAdvance)
);
}
#[test]
fn remaining_seats_finish_wonderful_round_after_a_drop() {
for dropped in 0..3 {
let mut game = setup_game(
&GameSetupBuilder::new(3)
.seed("drop-length".into())
.options(GameOptions {
length: GameLength::WonderfulEnding,
..GameOptions::default()
})
.build(),
);
for player in &mut game.players {
player.objective_cards.clear();
}
game.starting_player_index = 0;
game.current_player_index = 0;
game.age = 6;
game.round = 2;
game.variable_end = Some(VariableEnd::WonderfulEnding);
game.drop_player(dropped);
assert!(!matches!(game.state, GameState::Finished));
// The current round still gives each surviving seat its turn.
game.next_turn();
assert!(!matches!(game.state, GameState::Finished));
game.next_turn();
assert!(matches!(game.state, GameState::Finished));
}
}
#[test]
fn first_player_choosing_self_cannot_undo_round_start_roll() {
for roll in [0, 10] {
let mut game = setup(GameLength::RollToEnd);
game.age = 6;
game.round = 4;
game.dice_roll_outcomes = vec![roll];
crate::status_phase::status_phase_response(
&mut game,
StatusPhaseState::DetermineFirstPlayer(0),
);
game = crate::game_api::execute(game, Action::Response(EventResponse::SelectPlayer(0)), 0);
assert_eq!(game.age, 7);
assert_eq!(game.round, 1);
assert_eq!(game.dice_roll_log.last(), Some(&roll));
assert!(!game.can_undo());
assert_eq!(matches!(game.state, GameState::Finished), roll == 10);
}
}
#[test]
fn second_pass_resumes_after_normal_nested_wonder_choice() {
let mut game = setup(GameLength::Shorter);
enter_status_phase(&mut game);
game = answer(game, Advance::Storage);
game = answer(game, Advance::Storage);
game.player_mut(0).incident_tokens = 1;
game.permanent_effects
.push(crate::content::effects::PermanentEffect::PublicWonderCard(
Wonder::Colosseum,
));
game = answer(game, Advance::Engineering);
assert_eq!(game.active_player(), 0);
assert_eq!(
get_status_phase(&game),
Some(&StatusPhaseState::SecondFreeAdvance)
);
assert!(matches!(
game.events.last().map(|event| &event.event_type),
Some(crate::content::persistent_events::PersistentEventType::DrawWonderCard(_))
));
game = Game::from_data(game.cloned_data(), game.cache.clone(), GameContext::Play);
game = crate::game_api::execute(game, Action::Response(EventResponse::Bool(true)), 0);
assert!(game.player(0).wonder_cards.contains(&Wonder::Colosseum));
assert_eq!(game.player(0).incident_tokens, 1);
assert_eq!(game.active_player(), 1);
assert_eq!(
get_status_phase(&game),
Some(&StatusPhaseState::SecondFreeAdvance)
);
}

View file

@ -220,6 +220,7 @@ pub fn setup_game_with_cache(setup: &GameSetup, cache: Cache) -> Game {
undo_limit: 0,
actions_left: ACTIONS,
successful_cultural_influence: false,
variable_end: None,
round: 1,
age: 0,
messages: vec![],
@ -297,6 +298,9 @@ fn execute_setup_round(player_amount: usize, game: &mut Game, map_setup: Option<
gain_city(game, player, City::new(player_index, position));
set_city_mood(game, position, &origin, MoodState::Happy);
gain_unit(game, player, position, UnitType::Settler);
if game.options.length == crate::game::GameLength::Shorter {
gain_unit(game, player, position, UnitType::Settler);
}
}
}
}

View file

@ -83,3 +83,6 @@ pub mod utils;
pub mod victory_points;
pub mod web_view;
pub mod wonder;
#[cfg(test)]
mod game_length_tests;

View file

@ -35,6 +35,7 @@ pub enum StatusPhaseStateType {
pub enum StatusPhaseState {
CompleteObjectives,
FreeAdvance,
SecondFreeAdvance,
DrawCards,
RazeSize1City,
ChangeGovernmentType(bool),
@ -116,7 +117,8 @@ fn play_status_phase(game: &mut Game, mut phase: StatusPhaseState, response: boo
phase = match phase {
CompleteObjectives => {
if game.age >= game.options.length.ages()
if game.variable_end.is_some()
|| game.age >= game.options.length.ages()
|| game
.players
.iter()
@ -128,7 +130,10 @@ fn play_status_phase(game: &mut Game, mut phase: StatusPhaseState, response: boo
}
FreeAdvance
}
FreeAdvance => DrawCards,
FreeAdvance if game.options.length == crate::game::GameLength::Shorter => {
SecondFreeAdvance
}
FreeAdvance | SecondFreeAdvance => DrawCards,
DrawCards => RazeSize1City,
RazeSize1City => ChangeGovernmentType(false),
ChangeGovernmentType(_) => DetermineFirstPlayer(player_that_chooses_next_first_player(
@ -182,13 +187,13 @@ pub(crate) fn free_advance() -> Ability {
.collect_vec();
Some(AdvanceRequest::new(choices))
},
|game, c, _| {
|game, c, phase| {
gain_advance_without_payment(
game,
c.choice,
&c.player(),
ResourcePile::empty(),
true,
*phase != StatusPhaseState::SecondFreeAdvance,
);
},
)
@ -523,7 +528,9 @@ pub(crate) fn player_that_chooses_next_first_player(players: &[&Player]) -> usiz
pub fn status_phase_type(p: &StatusPhaseState) -> StatusPhaseStateType {
match p {
StatusPhaseState::CompleteObjectives => StatusPhaseStateType::CompleteObjectives,
StatusPhaseState::FreeAdvance => StatusPhaseStateType::FreeAdvance,
StatusPhaseState::FreeAdvance | StatusPhaseState::SecondFreeAdvance => {
StatusPhaseStateType::FreeAdvance
}
StatusPhaseState::DrawCards => StatusPhaseStateType::DrawCards,
StatusPhaseState::RazeSize1City => StatusPhaseStateType::RazeSize1City,
StatusPhaseState::ChangeGovernmentType(_) => StatusPhaseStateType::ChangeGovernmentType,

View file

@ -111,7 +111,12 @@ pub(super) fn advance_mode(game: &Game, handler: &PersistentEventHandler) -> &'s
// costs resources (e.g. Synergies). The Library only borrows an effect. Regular
// purchases, the status-phase advance, Dogma and leader research use a marker.
pub(super) fn advance_uses_event_marker(game: &Game, handler: &PersistentEventHandler) -> bool {
!matches!(handler.origin, EventOrigin::CivilCard(_))
!matches!(
game.events.last().map(|event| &event.event_type),
Some(PersistentEventType::StatusPhase(
crate::status_phase::StatusPhaseState::SecondFreeAdvance
))
) && !matches!(handler.origin, EventOrigin::CivilCard(_))
&& !matches!(&handler.origin, EventOrigin::Ability(name) if name == "Teach us")
&& advance_mode(game, handler) != "borrow"
}

View file

@ -9,7 +9,7 @@ use serde_json::{Value, json};
// This is a forecast from the visible board, not a simulated turn. In particular,
// do not trigger rewards, reveal secrets, or consume randomness while viewing it.
pub(super) fn trade_warning(game: &Game, seat: usize) -> Option<Value> {
if game.round == 3 && game.age >= game.options.length.ages() {
if game.variable_end.is_some() || (game.round == 3 && game.age >= game.options.length.ages()) {
return None; // No next turn after the final age.
}
let player = game.player(seat);

View file

@ -505,6 +505,16 @@ pub(crate) fn construct_wonder(
wonder: Wonder,
city_position: Position,
) {
if game.options.length == crate::game::GameLength::WonderfulEnding
&& crate::game::variable_end_threshold(game.age, game.round).is_some()
&& game.variable_end.is_none()
{
game.variable_end = Some(crate::game::VariableEnd::WonderfulEnding);
player.log(
game,
"Wonderful Ending: finish this round, then complete objectives",
);
}
player.get_mut(game).wonders_built.push(wonder);
activate_city(city_position, game, &EventOrigin::Wonder(wonder));
log_card_transfer(

View file

@ -4,7 +4,10 @@
"name": "length",
"default": "Standard",
"items": [
{ "name": "Standard", "label": "Standard — 6 ages" },
{ "name": "Standard", "label": "Normal — 6 ages" },
{ "name": "Shorter", "label": "Shorter — 4 ages, 2 settlers, two free advances" },
{ "name": "RollToEnd", "label": "Roll to End, up to 7 ages" },
{ "name": "WonderfulEnding", "label": "Wonderful Ending, up to 7 ages" },
{ "name": "Epic", "label": "Epic — 8 ages" }
]
}

View file

@ -953,3 +953,14 @@ Existing game history is not replayed or repaired.
Calendar now persists owner-only known-top state at the first legal turn boundary. Reopening a known card, Keep and Cancel are local: no backend move, history entry or clock credit. Replacement cards require an explicit new inspection; stale-safe paid burial records the existing actions. Historical views omit private knowledge, and reload/reconstruction preserve knowledge and undo floors.
Voting’s activation fee remains separate from Rituals’ city happiness conversions. Sparta can replace Draft tokens but cannot convert a recruited leader’s own mood fee. Both fees retain general Colosseum conversions. Publish the matching viewer and engine together; no production game repair or historical rewrite is needed.
# Viewer 0.1.203 / engine 0.4.137
Publish the matching engine, viewer and game-length creation options together.
Shorter adds four ages, two starting settlers and two free-advance passes;
Roll to End and Wonderful Ending use the official seven-age track and their
respective dice/construction ending windows. Normal retains serialized Standard
and the six-age default; legacy Epic remains eight ages. The accessible AgeTrack
provides localized mode rules and ending captions on desktop and mobile.
No existing games are migrated or replayed. See
[implementation and verification](../../docs/monumental-game-length.md).

View file

@ -1,12 +1,12 @@
{
"name": "@boardgamers/clash-web-client",
"version": "0.1.202",
"version": "0.1.203",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@boardgamers/clash-web-client",
"version": "0.1.202",
"version": "0.1.203",
"dependencies": {
"@boardgamers/protocol": "0.9.0",
"lucide-svelte": "^0.577.0",

View file

@ -1,6 +1,6 @@
{
"name": "@boardgamers/clash-web-client",
"version": "0.1.202",
"version": "0.1.203",
"private": true,
"type": "module",
"scripts": {

View file

@ -0,0 +1,156 @@
// Local built viewer: npm run build; preview must be serving on localhost:8671.
import assert from 'node:assert/strict';
import { createRequire } from 'node:module';
import { readFile } from 'node:fs/promises';
import { chromium } from 'playwright';
const engine = createRequire(import.meta.url)('../.engine/server.js');
const browser = await chromium.launch({
headless: true,
args: ['--use-gl=angle', '--use-angle=swiftshader'],
});
try {
for (const locale of ['en', 'fr']) {
const catalog = JSON.parse(
await readFile(new URL(`../src/localization/${locale}.json`, import.meta.url), 'utf8'),
);
for (const width of [1400, 390]) {
const page = await browser.newPage({ viewport: { width, height: 900 }, hasTouch: true });
const errors = [];
page.on('pageerror', (error) => errors.push(error.message));
await page.goto(`http://localhost:8671/?locale=${locale}`);
await page.waitForSelector('.age-track');
await page.waitForSelector(`[data-clash-locale="${locale}"]`);
async function emit(mode, age = 1, round = 1, triggered = false) {
const game = JSON.parse(await engine.init(2, [], { length: mode }, 'age-track-smoke', {}));
Object.assign(game, { age, round });
if (triggered) game.variable_end = 'WonderfulEnding';
const state = engine.stripSecret(JSON.stringify(game), game.current_player_index);
await page.evaluate((state) => host.emit('state', state), state);
await page.waitForTimeout(100);
}
for (const [mode, count, name] of [
['Shorter', 4, 'Shorter'],
['Standard', 6, 'Normal'],
['RollToEnd', 7, 'Roll to End'],
['WonderfulEnding', 7, 'Wonderful Ending'],
['Epic', 8, 'Epic'],
]) {
await emit(mode, 1, 1);
assert.equal(await page.locator('.age-step').count(), count);
await page.locator('.age-step').last().tap();
const details = page.locator('.age-length-details');
await details.waitFor();
assert.ok((await details.innerText()).includes(catalog[name]));
assert.equal(await details.locator('footer').count(), 0);
assert.ok(
(await details.locator('strong').innerText()).includes(
`${catalog['Age']} ${['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII'][count - 1]}`,
),
);
assert.doesNotMatch(await details.innerText(), /VI\.[123]|VII\.[123]/);
const box = await details.boundingBox();
assert.ok(box.x >= 0 && box.x + box.width <= width, `popover fits ${width}`);
await page.keyboard.press('Escape');
assert.equal(await details.count(), 0);
assert.equal(
await page
.locator('.age-step')
.last()
.evaluate((node) => document.activeElement === node),
true,
);
}
await emit('RollToEnd', 6, 1);
assert.equal(await page.locator('.age-phase').count(), 0);
assert.equal(await page.locator('.age-step.current .inactive').count(), 1);
for (const [age, round, threshold] of [
[6, 2, '6'],
[6, 3, '5–6'],
[7, 1, '4–6'],
[7, 2, '3–6'],
[7, 3, '2–6'],
]) {
await emit('RollToEnd', age, round);
assert.equal(await page.locator('.age-phase').innerText(), threshold);
}
await page.locator('.age-step').nth(5).focus();
await page.keyboard.press('Enter');
const rows = page.locator('.age-end-thresholds tbody tr');
assert.equal(await rows.count(), 5);
assert.deepEqual(
await rows.evaluateAll((nodes) =>
nodes.map((node) => [...node.cells].map((cell) => cell.textContent)),
),
[
['VI', '2', '6'],
['VI', '3', '5–6'],
['VII', '1', '4–6'],
['VII', '2', '3–6'],
['VII', '3', '2–6'],
],
);
assert.equal(await page.locator('.age-end-thresholds tr.current[aria-current="step"]').count(), 1);
assert.deepEqual(await page.locator('.age-end-thresholds tr.current td').allTextContents(), [
'VII',
'3',
'2–6',
]);
await page.screenshot({ path: `/tmp/clash-age-roll-${locale}-${width}.png` });
await page.locator('.age-details-close').click();
for (const [age, round] of [
[5, 3],
[6, 1],
]) {
await emit('WonderfulEnding', age, round);
assert.equal(await page.locator('.age-phase').count(), 0);
}
for (const [age, round] of [
[6, 2],
[6, 3],
[7, 1],
[7, 2],
[7, 3],
]) {
await emit('WonderfulEnding', age, round);
assert.equal(await page.locator('.age-phase').innerText(), catalog['Wonder to end']);
}
await emit('WonderfulEnding', 6, 2);
await page.locator('.age-phase').tap();
assert.ok(
(await page.locator('.age-length-details').innerText()).includes(
catalog[
'Starting from age 6, round 2, building a wonder ends the game after that round. Then complete objectives.'
],
),
);
assert.equal(await page.locator('.age-length-details p').count(), 1);
assert.equal(await page.locator('.age-length-details table, .age-length-details footer').count(), 0);
assert.ok(
await page.locator('.age-length-details').evaluate((node) => {
const box = node.getBoundingClientRect();
return node.contains(document.elementFromPoint(box.x + box.width / 2, box.y + box.height / 2));
}),
'details must render above the map action toolbar',
);
await page.screenshot({ path: `/tmp/clash-age-wonder-${locale}-${width}.png` });
await page.locator('.brand').click(); // Outside click dismisses the anchored details.
assert.equal(await page.locator('.age-length-details').count(), 0);
await emit('WonderfulEnding', 6, 2, true);
assert.equal(await page.locator('.age-phase').innerText(), catalog['Ends this round']);
await page.locator('.age-phase').tap();
assert.ok(
(await page.locator('.age-length-details').innerText()).includes(
catalog['Wonderful Ending: finish this round, then complete objectives'],
),
);
await page.keyboard.press('Escape');
assert.equal(await page.locator('.length-rule').count(), 0);
assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth));
assert.deepEqual(errors, []);
console.log(`Age-track tap/keyboard/round-window checks passed: ${locale}, ${width}px`);
await page.close();
}
}
} finally {
await browser.close();
}

View file

@ -0,0 +1,126 @@
<script lang="ts">
import { Dice5, Landmark, Info, X } from 'lucide-svelte';
import type { Game } from './types';
import { ageCount, ageLabel, lengthRule, lengthName, variableEndThreshold } from './game-length';
import { currentLocale, translateText } from './localization';
let {
game,
age,
round,
roundHint = '',
}: { game: Game | null; age: number; round: number; roundHint?: string | null } = $props();
const t = $derived((text: string) => translateText(text, $currentLocale));
let selected = $state<number | null>(null);
let root: HTMLDivElement;
let opener: HTMLButtonElement | undefined;
const mode = $derived(game?.options?.length ?? 'Standard');
const variable = $derived(mode === 'RollToEnd' || mode === 'WonderfulEnding');
const threshold = $derived(variableEndThreshold(age, round));
const triggered = $derived(game?.variable_end === 'WonderfulEnding' && game?.state !== 'Finished');
function toggle(value: number, event: MouseEvent) {
opener = event.currentTarget as HTMLButtonElement;
selected = selected === value ? null : value;
}
function close() {
selected = null;
opener?.focus();
}
</script>
<svelte:window
onkeydown={(event) => {
if (event.key === 'Escape' && selected !== null) {
event.stopPropagation();
close();
}
}}
onclick={(event) => {
if (selected !== null && !root?.contains(event.target as Node)) selected = null;
}}
/>
<div bind:this={root} class="age-track" role="group" aria-label={t('Game length')}>
<div class="age-steps">
{#each Array.from({ length: ageCount(game) }, (_, i) => i + 1) as step}
<button
type="button"
class="age-step"
class:current={step === age}
class:past={step < age}
aria-current={step === age ? 'step' : undefined}
aria-expanded={selected === step}
aria-controls="age-length-details"
aria-label={`${t('Game length')} · ${t(lengthName(game))} · ${ageLabel(step)}`}
title={`${t(lengthName(game))} · ${variable && step >= 6 ? t(lengthRule(game)) : t('Game length')}`}
onclick={(event) => toggle(step, event)}
>
{ageLabel(step)}
{#if variable && step >= 6}
<span class="age-end-icon" class:inactive={step === age && threshold === null} aria-hidden="true">
{#if mode === 'RollToEnd'}<Dice5 size={14} />{:else}<Landmark size={12} />{/if}
</span>
{:else if step === ageCount(game)}<span class="age-end-icon" aria-hidden="true"
><Info size={11} /></span
>{/if}
</button>
{/each}
</div>
<small class="round-label">
<span
>{round > 3 ? t('End of age') : `${t('Round')} ${round}/3`}{#if roundHint}
· {roundHint}{/if}</span
>
{#if mode === 'WonderfulEnding' && (threshold !== null || triggered)}
<button
class="age-phase"
onclick={(event) => toggle(age, event)}
aria-expanded={selected !== null}
aria-controls="age-length-details"
><Landmark size={12} />{t(triggered ? 'Ends this round' : 'Wonder to end')}</button
>
{:else if mode === 'RollToEnd' && threshold !== null}
<button
class="age-phase"
onclick={(event) => toggle(age, event)}
aria-label={t('Roll to End')}
title={t(lengthRule(game))}
aria-expanded={selected !== null}
aria-controls="age-length-details"
><Dice5 size={14} />{threshold === 6 ? '6' : `${threshold}–6`}</button
>
{/if}
</small>
{#if selected !== null}
<section id="age-length-details" class="age-length-details" aria-label={t('Game length')}>
<button class="age-details-close" onclick={close} aria-label={t('Close dialog')}><X size={16} /></button
>
<strong>{t(lengthName(game))} · {t('Age')} {ageLabel(selected)}</strong>
<p>{t(lengthRule(game))}</p>
{#if mode === 'RollToEnd'}
<table class="age-end-thresholds">
<thead
><tr
><th scope="col">{t('Age')}</th><th scope="col">{t('Round')}</th><th scope="col"
>{t('End on')}</th
></tr
></thead
>
<tbody>
{#each [[6, 2, 6], [6, 3, 5], [7, 1, 4], [7, 2, 3], [7, 3, 2]] as [endAge, endRound, endThreshold]}
<tr
class:current={age === endAge && round === endRound}
aria-current={age === endAge && round === endRound ? 'step' : undefined}
>
<td>{ageLabel(endAge)}</td><td>{endRound}</td><td
>{endThreshold === 6 ? '6' : `${endThreshold}–6`}</td
>
</tr>
{/each}
</tbody>
</table>
{/if}
{#if triggered}<p class="age-ending">
{t('Wonderful Ending: finish this round, then complete objectives')}
</p>{/if}
</section>
{/if}
</div>

View file

@ -125,7 +125,8 @@
import CollectionIndicators from './CollectionIndicators.svelte';
import { movementBonus } from './movement-bonus';
import { sinceLastTurn } from './playback';
import { ageCount, ageLabel } from './game-length';
import { ageLabel } from './game-length';
import AgeTrack from './AgeTrack.svelte';
import { roundProgress, personalRoundLabel } from './round-progress';
let { controller, concurrentPreview }: { controller: Controller; concurrentPreview?: { pending: boolean; waiting: boolean; seat: number; other: string; label?: string; pendingPlayer?: number; queued: number; ended: boolean; onUndo: () => void; onWait: () => void } } = $props();
const session = $derived(controller.session);
@ -832,31 +833,12 @@
>
</p>
</div>
<div
class="age-track"
role="group"
aria-label={`Age ${$session.playback?.frame?.age ?? $session.game?.age ?? 1} of ${ageCount($session.game)}`}
>
{#each Array.from({ length: ageCount($session.game) }, (_, i) => i + 1) as age}
<span
class="age-step"
class:current={age === ($session.playback?.frame?.age ?? $session.game?.age ?? 1)}
class:past={age < ($session.playback?.frame?.age ?? $session.game?.age ?? 1)}
title={`Age ${age} of ${ageCount($session.game)}`}
>
{ageLabel(age)}
</span>
{/each}
<small class="round-label"
>{($session.playback?.frame?.round ?? $session.game?.round ?? 1) > 3
? 'End of age'
: `Round ${$session.playback?.frame?.round ?? $session.game?.round ?? 1}/3`}{#if roundHint}<span
class="round-personal"
>
· {roundHint}</span
>{/if}</small
>
</div>
<AgeTrack
game={$session.game}
age={$session.playback?.frame?.age ?? $session.game?.age ?? 1}
round={$session.playback?.frame?.round ?? $session.game?.round ?? 1}
{roundHint}
/>
<nav class="header-actions">
{#if $session.view?.activeEffects?.length}
<button

View file

@ -21,7 +21,7 @@
Drama,
} from 'lucide-svelte';
import ResourceText from './ResourceText.svelte';
import { ageCount, ageLabel } from './game-length';
import { ageCount, ageLabel, lengthRule } from './game-length';
import type { Game } from './types';
let { game, onClose }: { game: Game | null; onClose: () => void } = $props();
const sections = $derived([
@ -153,6 +153,7 @@
>
<h2 id="how-to-play-title">How to play</h2>
<p class="guide-intro">Build your civilization over {ageCount(game)} ages. Most victory points wins.</p>
{#if lengthRule(game)}<p>{lengthRule(game)}</p>{/if}
{#if game?.options?.variant === 'Builder'}
<p class="guide-intro">
<strong>Builder:</strong> No military attacks against other players. Cultural Influence is allowed; barbarians

View file

@ -0,0 +1,162 @@
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { createRequire } from 'node:module';
import { readFileSync } from 'node:fs';
import { ageCount, ageLabel, lengthRule, lengthName, variableEndThreshold } from './game-length.ts';
import type { Game } from './types.ts';
const engine = createRequire(import.meta.url)(process.env.CLASH_TEST_ENGINE ?? '../.engine/server.js');
test('published creation choices match the approved modes and preserve the default', async () => {
const option = JSON.parse(readFileSync(new URL('../bgs-length-option.json', import.meta.url), 'utf8'));
const proposal = JSON.parse(
readFileSync(new URL('../../docs/monumental-length-option.proposal.json', import.meta.url), 'utf8'),
);
assert.deepEqual(option, proposal);
assert.equal(option.default, 'Standard');
assert.deepEqual(
option.items.map((item: { name: string }) => item.name),
['Standard', 'Shorter', 'RollToEnd', 'WonderfulEnding', 'Epic'],
);
for (const item of option.items) {
const game = JSON.parse(await engine.init(2, [], { length: item.name }, 'creation-options', {}));
assert.equal(game.options?.length ?? 'Standard', item.name);
}
const game = JSON.parse(await engine.init(2, [], {}, 'creation-default', {}));
assert.equal(game.options?.length ?? 'Standard', option.default);
});
test('saved length controls the track without changing standard or Epic', () => {
assert.equal(ageCount(null), 6);
for (const [length, count, label] of [
['Standard', 6, 'VI'],
['Epic', 8, 'VIII'],
['Shorter', 4, 'IV'],
['RollToEnd', 7, 'VII'],
['WonderfulEnding', 7, 'VII'],
] as const) {
assert.equal(ageCount({ options: { length } } as Game), count);
assert.equal(ageLabel(count), label);
}
assert.equal(variableEndThreshold(6, 1), null);
assert.deepEqual(
[
[6, 2],
[6, 3],
[7, 1],
[7, 2],
[7, 3],
].map(([a, r]) => variableEndThreshold(a, r)),
[6, 5, 4, 3, 2],
);
assert.equal(variableEndThreshold(7, 4), null);
assert.equal(variableEndThreshold(8, 1), null);
});
test('all active rule captions are translated in every locale', () => {
const locales = [
'en',
'de',
'fr',
'pl',
'ro',
'el',
'hi',
'ru',
'da',
'pt-BR',
'ko',
'zh-TW',
'zh-CN',
'vi',
'it',
'nl',
'fa',
];
for (const locale of locales) {
const catalog = JSON.parse(
readFileSync(new URL(`./localization/${locale}.json`, import.meta.url), 'utf8'),
);
for (const length of ['Standard', 'Epic', 'Shorter', 'RollToEnd', 'WonderfulEnding'] as const) {
const rule = lengthRule({ options: { length } } as Game);
assert.ok(catalog[rule], `${locale}: ${length}`);
if (locale !== 'en') assert.notEqual(catalog[rule], rule);
}
}
});
test('WASM accepts each exclusive mode with independent modules and preserves defaults', async () => {
for (const length of ['Standard', 'Epic', 'Shorter', 'RollToEnd', 'WonderfulEnding']) {
const text = await engine.init(2, [], { length, variant: 'Builder' }, 'length-web-test', {});
const game = JSON.parse(text);
assert.equal(game.options?.length ?? 'Standard', length);
assert.equal(game.options.variant, 'Builder');
for (const player of game.players.slice(0, 2)) {
assert.equal(
player.units.filter((unit: any) => unit.unit_type === 'Settler').length,
length === 'Shorter' ? 2 : 1,
);
}
assert.doesNotThrow(() => engine.webView(engine.stripSecret(text, 0), 0));
}
});
test('visible mode names retain the compatible Standard enum', () => {
assert.equal(lengthName(null), 'Normal');
assert.equal(lengthName({ options: { length: 'Standard' } } as Game), 'Normal');
for (const [length, label] of [
['Shorter', 'Shorter'],
['RollToEnd', 'Roll to End'],
['WonderfulEnding', 'Wonderful Ending'],
['Epic', 'Epic'],
] as const) {
assert.equal(lengthName({ options: { length } } as Game), label);
}
});
test('age-track captions exist in all 17 catalogs', () => {
const locales = [
'en',
'de',
'fr',
'pl',
'ro',
'el',
'hi',
'ru',
'da',
'pt-BR',
'ko',
'zh-TW',
'zh-CN',
'vi',
'it',
'nl',
'fa',
];
for (const locale of locales) {
const catalog = JSON.parse(
readFileSync(new URL(`./localization/${locale}.json`, import.meta.url), 'utf8'),
);
for (const key of [
'Normal',
'Wonderful Ending',
'Normal: 6 ages.',
'Epic: 8 ages.',
'Age',
'Round',
'End on',
'Wonder to end',
'Ends this round',
]) {
assert.ok(catalog[key], `${locale}: ${key}`);
}
}
});
test('wonder rule starts at a human-readable age and round', () => {
assert.equal(
lengthRule({ options: { length: 'WonderfulEnding' } } as Game),
'Starting from age 6, round 2, building a wonder ends the game after that round. Then complete objectives.',
);
});

View file

@ -1,8 +1,55 @@
import type { Game } from './types.ts';
export function ageCount(game: Game | null) {
return game?.options?.length === 'Epic' ? 8 : 6;
switch (game?.options?.length) {
case 'Epic':
return 8;
case 'Shorter':
return 4;
case 'RollToEnd':
case 'WonderfulEnding':
return 7;
default:
return 6;
}
}
export function ageLabel(age: number) {
return ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X'][age - 1] ?? String(age);
}
export function variableEndThreshold(age: number, round: number): number | null {
if (age === 6 && round === 2) return 6;
if (age === 6 && round === 3) return 5;
if (age === 7 && round >= 1 && round <= 3) return 5 - round;
return null;
}
export function lengthRule(game: Game | null): string {
switch (game?.options?.length) {
case 'Shorter':
return 'Shorter Game: 4 ages, 2 starting settlers. Between ages, take two free advances in two full turn-order passes; the second uses no event marker.';
case 'RollToEnd':
return 'Roll to End: roll at the start of each marked round, before any player acts. A matching result ends play immediately; only objectives follow.';
case 'WonderfulEnding':
return 'Starting from age 6, round 2, building a wonder ends the game after that round. Then complete objectives.';
case 'Epic':
return 'Epic: 8 ages.';
default:
return 'Normal: 6 ages.';
}
}
export function lengthName(game: Game | null): string {
switch (game?.options?.length) {
case 'Shorter':
return 'Shorter';
case 'RollToEnd':
return 'Roll to End';
case 'WonderfulEnding':
return 'Wonderful Ending';
case 'Epic':
return 'Epic';
default:
return 'Normal';
}
}

View file

@ -5255,5 +5255,24 @@
"Public bonuses only · excludes tactics, dice-symbol effects and unresolved choices": "Kun offentlige bonusser · uden taktikker, terningsymboleffekter og uafklarede valg",
"Steel Weapons not activated: +{p0} value if activated": "Stålvåben ikke aktiveret: +{p0} kampværdi ved aktivering",
"Round 1: total bonus capped at +2, including dice-symbol bonuses": "Runde 1: samlet bonus begrænset til +2, inklusive terningsymbolbonusser",
"Battle · Round": "Kamp · Runde"
"Battle · Round": "Kamp · Runde",
"Game length": "Spillængde",
"Shorter": "Kortere",
"Roll to End": "Slut med terningkast",
"Roll to End: {p0} (end on {p1}–6)": "Slut med terningkast: {p0} (slut ved {p1}–6)",
"Wonderful Ending: finish this round, then complete objectives": "Vidunderlig afslutning: afslut denne runde, og opfyld så mål",
"Shorter Game: 4 ages, 2 starting settlers. Between ages, take two free advances in two full turn-order passes; the second uses no event marker.": "Kortere spil: 4 tidsaldre, 2 nybyggere fra start. Mellem tidsaldre får hver spiller to gratis fremskridt i to fulde gennemløb i turrækkefølge; det andet bruger ingen begivenhedsmarkør.",
"Roll to End: roll at the start of each marked round, before any player acts. A matching result ends play immediately; only objectives follow.": "Slut med terningkast: kast ved starten af hver markeret runde, før nogen handler. Et matchende resultat afslutter spillet straks; derefter følger kun mål.",
"Starting from age 6, round 2, building a wonder ends the game after that round. Then complete objectives.": "Fra og med tidsalder 6, runde 2 afslutter opførelsen af et vidunder spillet efter den runde. Fuldfør derefter målene.",
"Normal": "Normal",
"Wonderful Ending": "Vidunderlig afslutning",
"Normal: 6 ages.": "Normal: 6 tidsaldre.",
"Epic: 8 ages.": "Episk: 8 tidsaldre.",
"Wonder to end": "Vidunder afslutter",
"Ends this round": "Slutter denne runde",
"{p0} · {p1} · {p2}": "{p0} · {p1} · {p2}",
"{p0} {p1}/3": "{p0} {p1}/3",
"{p0}–6": "{p0}–6",
"End on": "Slut ved",
"{p0} · {p1} {p2}": "{p0} · {p1} {p2}"
}

View file

@ -5255,5 +5255,24 @@
"Public bonuses only · excludes tactics, dice-symbol effects and unresolved choices": "Nur öffentliche Boni · ohne Taktiken, Würfelsymboleffekte und offene Entscheidungen",
"Steel Weapons not activated: +{p0} value if activated": "Stahlwaffen nicht aktiviert: +{p0} Kampfwert bei Aktivierung",
"Round 1: total bonus capped at +2, including dice-symbol bonuses": "Runde 1: Gesamtbonus auf +2 begrenzt, einschließlich Würfelsymbolboni",
"Battle · Round": "Kampf · Runde"
"Battle · Round": "Kampf · Runde",
"Game length": "Spieldauer",
"Shorter": "Kürzer",
"Roll to End": "Spielende auswürfeln",
"Roll to End: {p0} (end on {p1}–6)": "Spielende auswürfeln: {p0} (Ende bei {p1}–6)",
"Wonderful Ending: finish this round, then complete objectives": "Wunderbares Ende: diese Runde beenden, dann Ziele erfüllen",
"Shorter Game: 4 ages, 2 starting settlers. Between ages, take two free advances in two full turn-order passes; the second uses no event marker.": "Kürzeres Spiel: 4 Zeitalter, 2 Siedler zu Beginn. Zwischen Zeitaltern erhält jeder zwei kostenlose Fortschritte in zwei vollständigen Durchgängen in Zugreihenfolge; der zweite verbraucht keinen Ereignismarker.",
"Roll to End: roll at the start of each marked round, before any player acts. A matching result ends play immediately; only objectives follow.": "Spielende auswürfeln: Zu Beginn jeder markierten Runde würfeln, bevor jemand handelt. Ein passendes Ergebnis beendet das Spiel sofort; danach folgen nur Ziele.",
"Starting from age 6, round 2, building a wonder ends the game after that round. Then complete objectives.": "Ab Zeitalter 6, Runde 2 beendet der Bau eines Wunders das Spiel nach dieser Runde. Schließt anschließend die Ziele ab.",
"Normal": "Normal",
"Wonderful Ending": "Wundervolles Ende",
"Normal: 6 ages.": "Normal: 6 Zeitalter.",
"Epic: 8 ages.": "Episch: 8 Zeitalter.",
"Wonder to end": "Wunder beendet Spiel",
"Ends this round": "Ende dieser Runde",
"{p0} · {p1} · {p2}": "{p0} · {p1} · {p2}",
"{p0} {p1}/3": "{p0} {p1}/3",
"{p0}–6": "{p0}–6",
"End on": "Ende bei",
"{p0} · {p1} {p2}": "{p0} · {p1} {p2}"
}

View file

@ -5255,5 +5255,24 @@
"Public bonuses only · excludes tactics, dice-symbol effects and unresolved choices": "Μόνο δημόσια μπόνους · εξαιρούνται τακτικές, επιδράσεις συμβόλων ζαριών και εκκρεμείς επιλογές",
"Steel Weapons not activated: +{p0} value if activated": "Χαλύβδινα όπλα ανενεργά: +{p0} αξία αν ενεργοποιηθούν",
"Round 1: total bonus capped at +2, including dice-symbol bonuses": "Γύρος 1: συνολικό μπόνους έως +2, μαζί με τα μπόνους συμβόλων ζαριών",
"Battle · Round": "Μάχη · Γύρος"
"Battle · Round": "Μάχη · Γύρος",
"Game length": "Διάρκεια παιχνιδιού",
"Shorter": "Συντομότερο",
"Roll to End": "Λήξη με ζάρι",
"Roll to End: {p0} (end on {p1}–6)": "Λήξη με ζάρι: {p0} (λήξη με {p1}–6)",
"Wonderful Ending: finish this round, then complete objectives": "Θαυμαστό τέλος: ολοκληρώστε αυτόν τον γύρο και μετά τους στόχους",
"Shorter Game: 4 ages, 2 starting settlers. Between ages, take two free advances in two full turn-order passes; the second uses no event marker.": "Συντομότερο παιχνίδι: 4 εποχές, 2 αρχικοί άποικοι. Μεταξύ εποχών, κάθε παίκτης παίρνει δύο δωρεάν προόδους σε δύο πλήρεις κύκλους με τη σειρά παιξίματος· η δεύτερη δεν χρησιμοποιεί δείκτη γεγονότος.",
"Roll to End: roll at the start of each marked round, before any player acts. A matching result ends play immediately; only objectives follow.": "Λήξη με ζάρι: ρίξτε στην αρχή κάθε σημειωμένου γύρου, πριν παίξει οποιοσδήποτε. Κατάλληλο αποτέλεσμα τελειώνει αμέσως το παιχνίδι· ακολουθούν μόνο στόχοι.",
"Starting from age 6, round 2, building a wonder ends the game after that round. Then complete objectives.": "Από την εποχή 6, γύρο 2, η κατασκευή ενός θαύματος τελειώνει το παιχνίδι μετά από αυτόν τον γύρο. Έπειτα ολοκληρώστε τους στόχους.",
"Normal": "Κανονικό",
"Wonderful Ending": "Θαυμαστό τέλος",
"Normal: 6 ages.": "Κανονικό: 6 εποχές.",
"Epic: 8 ages.": "Επικό: 8 εποχές.",
"Wonder to end": "Θαύμα για τέλος",
"Ends this round": "Τέλος σε αυτόν τον γύρο",
"{p0} · {p1} · {p2}": "{p0} · {p1} · {p2}",
"{p0} {p1}/3": "{p0} {p1}/3",
"{p0}–6": "{p0}–6",
"End on": "Λήξη με",
"{p0} · {p1} {p2}": "{p0} · {p1} {p2}"
}

View file

@ -5255,5 +5255,24 @@
"Public bonuses only · excludes tactics, dice-symbol effects and unresolved choices": "Public bonuses only · excludes tactics, dice-symbol effects and unresolved choices",
"Steel Weapons not activated: +{p0} value if activated": "Steel Weapons not activated: +{p0} value if activated",
"Round 1: total bonus capped at +2, including dice-symbol bonuses": "Round 1: total bonus capped at +2, including dice-symbol bonuses",
"Battle · Round": "Battle · Round"
"Battle · Round": "Battle · Round",
"Game length": "Game length",
"Shorter": "Shorter",
"Roll to End": "Roll to End",
"Roll to End: {p0} (end on {p1}–6)": "Roll to End: {p0} (end on {p1}–6)",
"Wonderful Ending: finish this round, then complete objectives": "Wonderful Ending: finish this round, then complete objectives",
"Shorter Game: 4 ages, 2 starting settlers. Between ages, take two free advances in two full turn-order passes; the second uses no event marker.": "Shorter Game: 4 ages, 2 starting settlers. Between ages, take two free advances in two full turn-order passes; the second uses no event marker.",
"Roll to End: roll at the start of each marked round, before any player acts. A matching result ends play immediately; only objectives follow.": "Roll to End: roll at the start of each marked round, before any player acts. A matching result ends play immediately; only objectives follow.",
"Starting from age 6, round 2, building a wonder ends the game after that round. Then complete objectives.": "Starting from age 6, round 2, building a wonder ends the game after that round. Then complete objectives.",
"Normal": "Normal",
"Wonderful Ending": "Wonderful Ending",
"Normal: 6 ages.": "Normal: 6 ages.",
"Epic: 8 ages.": "Epic: 8 ages.",
"Wonder to end": "Wonder to end",
"Ends this round": "Ends this round",
"{p0} · {p1} · {p2}": "{p0} · {p1} · {p2}",
"{p0} {p1}/3": "{p0} {p1}/3",
"{p0}–6": "{p0}–6",
"End on": "End on",
"{p0} · {p1} {p2}": "{p0} · {p1} {p2}"
}

View file

@ -5255,5 +5255,24 @@
"Public bonuses only · excludes tactics, dice-symbol effects and unresolved choices": "فقط پاداش‌های عمومی · بدون تاکتیک‌ها، اثر نمادهای تاس و انتخاب‌های حل‌نشده",
"Steel Weapons not activated: +{p0} value if activated": "سلاح‌های فولادی فعال نیست: در صورت فعال‌سازی {p0}+ ارزش",
"Round 1: total bonus capped at +2, including dice-symbol bonuses": "دور ۱: مجموع پاداش حداکثر ۲+، شامل پاداش نمادهای تاس",
"Battle · Round": "نبرد · دور"
"Battle · Round": "نبرد · دور",
"Game length": "مدت بازی",
"Shorter": "کوتاه‌تر",
"Roll to End": "پایان با تاس",
"Roll to End: {p0} (end on {p1}–6)": "پایان با تاس: {p0} (پایان با {p1}–6)",
"Wonderful Ending: finish this round, then complete objectives": "پایان شگفت‌انگیز: این دور را تمام کنید، سپس اهداف را تکمیل کنید",
"Shorter Game: 4 ages, 2 starting settlers. Between ages, take two free advances in two full turn-order passes; the second uses no event marker.": "بازی کوتاه‌تر: ۴ عصر، ۲ مهاجر در آغاز. بین عصرها، هر بازیکن طی دو گردش کامل به ترتیب نوبت، دو پیشرفت رایگان می‌گیرد؛ دومی نشان رویداد مصرف نمی‌کند.",
"Roll to End: roll at the start of each marked round, before any player acts. A matching result ends play immediately; only objectives follow.": "پایان با تاس: در آغاز هر دور علامت‌گذاری‌شده، پیش از اقدام هر بازیکن، تاس بریزید. نتیجهٔ مطابق بازی را فوراً تمام می‌کند؛ سپس فقط اهداف بررسی می‌شوند.",
"Starting from age 6, round 2, building a wonder ends the game after that round. Then complete objectives.": "از دور ۲ عصر ۶ به بعد، ساختن یک شگفتی بازی را پس از همان دور پایان می‌دهد. سپس اهداف را تکمیل کنید.",
"Normal": "عادی",
"Wonderful Ending": "پایان شگفت‌انگیز",
"Normal: 6 ages.": "عادی: ۶ عصر.",
"Epic: 8 ages.": "حماسی: ۸ عصر.",
"Wonder to end": "شگفتی برای پایان",
"Ends this round": "پایان در این دور",
"{p0} · {p1} · {p2}": "{p0} · {p1} · {p2}",
"{p0} {p1}/3": "{p0} {p1}/3",
"{p0}–6": "{p0}–6",
"End on": "پایان با",
"{p0} · {p1} {p2}": "{p0} · {p1} {p2}"
}

View file

@ -5255,5 +5255,24 @@
"Public bonuses only · excludes tactics, dice-symbol effects and unresolved choices": "Bonus publics uniquement · hors tactiques, effets des symboles des dés et choix non résolus",
"Steel Weapons not activated: +{p0} value if activated": "Armes en acier non activées : +{p0} en valeur si activées",
"Round 1: total bonus capped at +2, including dice-symbol bonuses": "Manche 1 : bonus total limité à +2, y compris les bonus des symboles des dés",
"Battle · Round": "Bataille · Manche"
"Battle · Round": "Bataille · Manche",
"Game length": "Durée de la partie",
"Shorter": "Plus courte",
"Roll to End": "Fin au dé",
"Roll to End: {p0} (end on {p1}–6)": "Fin au dé : {p0} (fin sur {p1}–6)",
"Wonderful Ending: finish this round, then complete objectives": "Fin merveilleuse : terminer cette manche, puis accomplir les objectifs",
"Shorter Game: 4 ages, 2 starting settlers. Between ages, take two free advances in two full turn-order passes; the second uses no event marker.": "Partie plus courte : 4 âges, 2 colons au départ. Entre les âges, chacun reçoit deux progrès gratuits en deux passages complets dans l’ordre du tour ; le second ne consomme aucun marqueur d’événement.",
"Roll to End: roll at the start of each marked round, before any player acts. A matching result ends play immediately; only objectives follow.": "Fin au dé : lancer au début de chaque manche indiquée, avant toute action. Un résultat correspondant termine immédiatement la partie ; seuls les objectifs suivent.",
"Starting from age 6, round 2, building a wonder ends the game after that round. Then complete objectives.": "À partir de l’âge 6, manche 2, construire une merveille met fin à la partie après cette manche. Ensuite, accomplissez les objectifs.",
"Normal": "Normal",
"Wonderful Ending": "Fin merveilleuse",
"Normal: 6 ages.": "Normal : 6 âges.",
"Epic: 8 ages.": "Épique : 8 âges.",
"Wonder to end": "Merveille pour finir",
"Ends this round": "Fin à ce tour",
"{p0} · {p1} · {p2}": "{p0} · {p1} · {p2}",
"{p0} {p1}/3": "{p0} {p1}/3",
"{p0}–6": "{p0}–6",
"End on": "Fin sur",
"{p0} · {p1} {p2}": "{p0} · {p1} {p2}"
}

View file

@ -5255,5 +5255,24 @@
"Public bonuses only · excludes tactics, dice-symbol effects and unresolved choices": "केवल सार्वजनिक बोनस · रणनीतियाँ, पासों के चिह्नों के प्रभाव और लंबित विकल्प शामिल नहीं",
"Steel Weapons not activated: +{p0} value if activated": "इस्पात के हथियार सक्रिय नहीं: सक्रिय करने पर +{p0} युद्ध मूल्य",
"Round 1: total bonus capped at +2, including dice-symbol bonuses": "दौर 1: कुल बोनस अधिकतम +2, पासों के चिह्नों के बोनस सहित",
"Battle · Round": "युद्ध · दौर"
"Battle · Round": "युद्ध · दौर",
"Game length": "खेल की अवधि",
"Shorter": "छोटा",
"Roll to End": "पासे से अंत",
"Roll to End: {p0} (end on {p1}–6)": "पासे से अंत: {p0} ({p1}–6 पर अंत)",
"Wonderful Ending: finish this round, then complete objectives": "अजूबे वाला अंत: यह पूरा दौर समाप्त करें, फिर उद्देश्य पूरे करें",
"Shorter Game: 4 ages, 2 starting settlers. Between ages, take two free advances in two full turn-order passes; the second uses no event marker.": "छोटा खेल: 4 युग, शुरुआत में 2 बसने वाले। युगों के बीच बारी के क्रम में दो पूरे चक्र चलाकर हर खिलाड़ी को दो मुफ्त प्रगतियाँ मिलती हैं; दूसरी में घटना चिह्न नहीं लगता।",
"Roll to End: roll at the start of each marked round, before any player acts. A matching result ends play immediately; only objectives follow.": "पासे से अंत: हर चिह्नित दौर की शुरुआत में, किसी भी खिलाड़ी की कार्रवाई से पहले पासा फेंकें। उचित परिणाम आने पर खेल तुरंत समाप्त होता है; फिर केवल उद्देश्य पूरे किए जाते हैं।",
"Starting from age 6, round 2, building a wonder ends the game after that round. Then complete objectives.": "युग 6 के दौर 2 से, किसी अजूबे का निर्माण उस दौर के बाद खेल समाप्त कर देता है। फिर उद्देश्य पूरे करें।",
"Normal": "सामान्य",
"Wonderful Ending": "अद्भुत अंत",
"Normal: 6 ages.": "सामान्य: 6 युग।",
"Epic: 8 ages.": "महाकाव्य: 8 युग।",
"Wonder to end": "अंत के लिए अजूबा",
"Ends this round": "इस दौर में अंत",
"{p0} · {p1} · {p2}": "{p0} · {p1} · {p2}",
"{p0} {p1}/3": "{p0} {p1}/3",
"{p0}–6": "{p0}–6",
"End on": "समाप्ति का परिणाम",
"{p0} · {p1} {p2}": "{p0} · {p1} {p2}"
}

View file

@ -5255,5 +5255,24 @@
"Public bonuses only · excludes tactics, dice-symbol effects and unresolved choices": "Solo bonus pubblici · escluse tattiche, effetti dei simboli dei dadi e scelte irrisolte",
"Steel Weapons not activated: +{p0} value if activated": "Armi in acciaio non attivate: +{p0} al valore se attivate",
"Round 1: total bonus capped at +2, including dice-symbol bonuses": "Round 1: bonus totale limitato a +2, inclusi i bonus dei simboli dei dadi",
"Battle · Round": "Battaglia · Round"
"Battle · Round": "Battaglia · Round",
"Game length": "Durata della partita",
"Shorter": "Più breve",
"Roll to End": "Fine con il dado",
"Roll to End: {p0} (end on {p1}–6)": "Fine con il dado: {p0} (fine con {p1}–6)",
"Wonderful Ending: finish this round, then complete objectives": "Finale meraviglioso: completare questo round, poi gli obiettivi",
"Shorter Game: 4 ages, 2 starting settlers. Between ages, take two free advances in two full turn-order passes; the second uses no event marker.": "Partita più breve: 4 ere, 2 coloni iniziali. Tra le ere, ciascuno ottiene due progressi gratuiti in due giri completi nell’ordine di turno; il secondo non usa segnalini evento.",
"Roll to End: roll at the start of each marked round, before any player acts. A matching result ends play immediately; only objectives follow.": "Fine con il dado: tirare all’inizio di ogni round indicato, prima che agisca un giocatore. Un risultato corrispondente termina subito la partita; seguono solo gli obiettivi.",
"Starting from age 6, round 2, building a wonder ends the game after that round. Then complete objectives.": "A partire dall’epoca 6, turno 2, costruire una meraviglia termina la partita alla fine di quel turno. Poi completate gli obiettivi.",
"Normal": "Normale",
"Wonderful Ending": "Finale meraviglioso",
"Normal: 6 ages.": "Normale: 6 ere.",
"Epic: 8 ages.": "Epico: 8 ere.",
"Wonder to end": "Meraviglia per finire",
"Ends this round": "Fine in questo round",
"{p0} · {p1} · {p2}": "{p0} · {p1} · {p2}",
"{p0} {p1}/3": "{p0} {p1}/3",
"{p0}–6": "{p0}–6",
"End on": "Fine con",
"{p0} · {p1} {p2}": "{p0} · {p1} {p2}"
}

View file

@ -5255,5 +5255,24 @@
"Public bonuses only · excludes tactics, dice-symbol effects and unresolved choices": "공개 보너스만 표시 · 전술, 주사위 기호 효과 및 미결정 선택 제외",
"Steel Weapons not activated: +{p0} value if activated": "강철 무기 미활성: 활성화 시 전투 값 +{p0}",
"Round 1: total bonus capped at +2, including dice-symbol bonuses": "1라운드: 주사위 기호 보너스를 포함한 총 보너스는 최대 +2",
"Battle · Round": "전투 · 라운드"
"Battle · Round": "전투 · 라운드",
"Game length": "게임 길이",
"Shorter": "짧게",
"Roll to End": "주사위로 종료",
"Roll to End: {p0} (end on {p1}–6)": "주사위로 종료: {p0} ({p1}–6이면 종료)",
"Wonderful Ending: finish this round, then complete objectives": "불가사의 결말: 이번 라운드를 마친 뒤 목표만 처리합니다",
"Shorter Game: 4 ages, 2 starting settlers. Between ages, take two free advances in two full turn-order passes; the second uses no event marker.": "짧은 게임: 4시대, 시작 개척자 2명. 시대 사이에 차례 순서대로 전체 순환을 두 번 진행하여 각자 무료 발전을 두 개 얻습니다. 두 번째는 사건 표식을 사용하지 않습니다.",
"Roll to End: roll at the start of each marked round, before any player acts. A matching result ends play immediately; only objectives follow.": "주사위로 종료: 표시된 각 라운드가 시작될 때, 누구도 행동하기 전에 주사위를 굴립니다. 해당 범위가 나오면 즉시 게임이 끝나고 목표만 처리합니다.",
"Starting from age 6, round 2, building a wonder ends the game after that round. Then complete objectives.": "6시대 2라운드부터 불가사의를 건설하면 해당 라운드가 끝난 뒤 게임이 종료됩니다. 그런 다음 목표를 완료하세요.",
"Normal": "일반",
"Wonderful Ending": "불가사의한 결말",
"Normal: 6 ages.": "일반: 6시대.",
"Epic: 8 ages.": "서사시: 8시대.",
"Wonder to end": "불가사의로 종료",
"Ends this round": "이번 라운드에 종료",
"{p0} · {p1} · {p2}": "{p0} · {p1} · {p2}",
"{p0} {p1}/3": "{p0} {p1}/3",
"{p0}–6": "{p0}–6",
"End on": "종료 결과",
"{p0} · {p1} {p2}": "{p0} · {p1} {p2}"
}

View file

@ -5255,5 +5255,24 @@
"Public bonuses only · excludes tactics, dice-symbol effects and unresolved choices": "Alleen openbare bonussen · zonder tactieken, dobbelsteensymbooleffecten en onbesliste keuzes",
"Steel Weapons not activated: +{p0} value if activated": "Stalen wapens niet geactiveerd: +{p0} gevechtswaarde bij activering",
"Round 1: total bonus capped at +2, including dice-symbol bonuses": "Ronde 1: totale bonus maximaal +2, inclusief dobbelsteensymboolbonussen",
"Battle · Round": "Gevecht · Ronde"
"Battle · Round": "Gevecht · Ronde",
"Game length": "Spelduur",
"Shorter": "Korter",
"Roll to End": "Einde door dobbelworp",
"Roll to End: {p0} (end on {p1}–6)": "Einde door dobbelworp: {p0} (einde bij {p1}–6)",
"Wonderful Ending: finish this round, then complete objectives": "Wonderlijk einde: voltooi deze ronde, daarna de doelen",
"Shorter Game: 4 ages, 2 starting settlers. Between ages, take two free advances in two full turn-order passes; the second uses no event marker.": "Korter spel: 4 tijdperken, 2 kolonisten bij aanvang. Tussen tijdperken krijgt ieder twee gratis ontwikkelingen in twee volledige beurtrondes; de tweede gebruikt geen gebeurtenismarker.",
"Roll to End: roll at the start of each marked round, before any player acts. A matching result ends play immediately; only objectives follow.": "Einde door dobbelworp: werp aan het begin van elke gemarkeerde ronde, voordat iemand handelt. Een passend resultaat beëindigt het spel direct; alleen doelen volgen.",
"Starting from age 6, round 2, building a wonder ends the game after that round. Then complete objectives.": "Vanaf tijdperk 6, ronde 2 eindigt het spel na die ronde als er een wereldwonder wordt gebouwd. Voltooi daarna de doelen.",
"Normal": "Normaal",
"Wonderful Ending": "Wonderbaarlijk einde",
"Normal: 6 ages.": "Normaal: 6 tijdperken.",
"Epic: 8 ages.": "Episch: 8 tijdperken.",
"Wonder to end": "Wonder om te eindigen",
"Ends this round": "Eindigt deze ronde",
"{p0} · {p1} · {p2}": "{p0} · {p1} · {p2}",
"{p0} {p1}/3": "{p0} {p1}/3",
"{p0}–6": "{p0}–6",
"End on": "Einde bij",
"{p0} · {p1} {p2}": "{p0} · {p1} {p2}"
}

View file

@ -5255,5 +5255,24 @@
"Public bonuses only · excludes tactics, dice-symbol effects and unresolved choices": "Tylko publiczne premie · bez taktyk, efektów symboli kości i nierozstrzygniętych wyborów",
"Steel Weapons not activated: +{p0} value if activated": "Broń stalowa nieaktywna: +{p0} do wartości po aktywacji",
"Round 1: total bonus capped at +2, including dice-symbol bonuses": "Runda 1: łączna premia ograniczona do +2, w tym premie symboli kości",
"Battle · Round": "Bitwa · Runda"
"Battle · Round": "Bitwa · Runda",
"Game length": "Długość gry",
"Shorter": "Krótsza",
"Roll to End": "Koniec po rzucie",
"Roll to End: {p0} (end on {p1}–6)": "Koniec po rzucie: {p0} (koniec przy {p1}–6)",
"Wonderful Ending: finish this round, then complete objectives": "Cudowne zakończenie: dokończcie tę rundę, potem zrealizujcie cele",
"Shorter Game: 4 ages, 2 starting settlers. Between ages, take two free advances in two full turn-order passes; the second uses no event marker.": "Krótsza gra: 4 epoki, 2 osadników na początku. Między epokami każdy otrzymuje dwa darmowe postępy w dwóch pełnych kolejkach zgodnie z kolejnością graczy; drugi nie zużywa znacznika wydarzenia.",
"Roll to End: roll at the start of each marked round, before any player acts. A matching result ends play immediately; only objectives follow.": "Koniec po rzucie: rzut na początku każdej oznaczonej rundy, zanim ktokolwiek wykona akcję. Odpowiedni wynik natychmiast kończy grę; potem rozpatruje się tylko cele.",
"Starting from age 6, round 2, building a wonder ends the game after that round. Then complete objectives.": "Począwszy od 2. rundy 6. epoki, zbudowanie cudu kończy grę po tej rundzie. Następnie zrealizujcie cele.",
"Normal": "Normalna",
"Wonderful Ending": "Cudowne zakończenie",
"Normal: 6 ages.": "Normalna: 6 epok.",
"Epic: 8 ages.": "Epicka: 8 epok.",
"Wonder to end": "Cud kończy grę",
"Ends this round": "Koniec w tej rundzie",
"{p0} · {p1} · {p2}": "{p0} · {p1} · {p2}",
"{p0} {p1}/3": "{p0} {p1}/3",
"{p0}–6": "{p0}–6",
"End on": "Koniec przy",
"{p0} · {p1} {p2}": "{p0} · {p1} {p2}"
}

View file

@ -5255,5 +5255,24 @@
"Public bonuses only · excludes tactics, dice-symbol effects and unresolved choices": "Somente bônus públicos · exclui táticas, efeitos dos símbolos dos dados e escolhas pendentes",
"Steel Weapons not activated: +{p0} value if activated": "Armas de aço não ativadas: +{p0} de valor se ativadas",
"Round 1: total bonus capped at +2, including dice-symbol bonuses": "Rodada 1: bônus total limitado a +2, incluindo bônus dos símbolos dos dados",
"Battle · Round": "Batalha · Rodada"
"Battle · Round": "Batalha · Rodada",
"Game length": "Duração da partida",
"Shorter": "Mais curta",
"Roll to End": "Fim por dado",
"Roll to End: {p0} (end on {p1}–6)": "Fim por dado: {p0} (fim em {p1}–6)",
"Wonderful Ending: finish this round, then complete objectives": "Final maravilhoso: terminem esta rodada, depois cumpram os objetivos",
"Shorter Game: 4 ages, 2 starting settlers. Between ages, take two free advances in two full turn-order passes; the second uses no event marker.": "Partida mais curta: 4 eras, 2 colonos iniciais. Entre eras, cada jogador recebe dois avanços gratuitos em duas passagens completas na ordem dos turnos; o segundo não usa marcador de evento.",
"Roll to End: roll at the start of each marked round, before any player acts. A matching result ends play immediately; only objectives follow.": "Fim por dado: role no início de cada rodada marcada, antes de qualquer jogador agir. Um resultado correspondente encerra a partida imediatamente; seguem apenas os objetivos.",
"Starting from age 6, round 2, building a wonder ends the game after that round. Then complete objectives.": "A partir da era 6, rodada 2, construir uma maravilha encerra o jogo após essa rodada. Depois, concluam os objetivos.",
"Normal": "Normal",
"Wonderful Ending": "Final maravilhoso",
"Normal: 6 ages.": "Normal: 6 eras.",
"Epic: 8 ages.": "Épico: 8 eras.",
"Wonder to end": "Maravilha para encerrar",
"Ends this round": "Termina nesta rodada",
"{p0} · {p1} · {p2}": "{p0} · {p1} · {p2}",
"{p0} {p1}/3": "{p0} {p1}/3",
"{p0}–6": "{p0}–6",
"End on": "Termina com",
"{p0} · {p1} {p2}": "{p0} · {p1} {p2}"
}

View file

@ -5255,5 +5255,24 @@
"Public bonuses only · excludes tactics, dice-symbol effects and unresolved choices": "Doar bonusuri publice · fără tactici, efectele simbolurilor zarurilor și alegeri nerezolvate",
"Steel Weapons not activated: +{p0} value if activated": "Arme de oțel neactivate: +{p0} valoare dacă sunt activate",
"Round 1: total bonus capped at +2, including dice-symbol bonuses": "Runda 1: bonus total limitat la +2, inclusiv bonusurile simbolurilor zarurilor",
"Battle · Round": "Luptă · Runda"
"Battle · Round": "Luptă · Runda",
"Game length": "Durata jocului",
"Shorter": "Mai scurt",
"Roll to End": "Final prin zar",
"Roll to End: {p0} (end on {p1}–6)": "Final prin zar: {p0} (final la {p1}–6)",
"Wonderful Ending: finish this round, then complete objectives": "Final minunat: terminați această rundă, apoi îndepliniți obiectivele",
"Shorter Game: 4 ages, 2 starting settlers. Between ages, take two free advances in two full turn-order passes; the second uses no event marker.": "Joc mai scurt: 4 epoci, 2 coloniști inițiali. Între epoci, fiecare primește două progrese gratuite în două treceri complete în ordinea turelor; al doilea nu folosește un marcator de eveniment.",
"Roll to End: roll at the start of each marked round, before any player acts. A matching result ends play immediately; only objectives follow.": "Final prin zar: aruncați la începutul fiecărei runde marcate, înainte de acțiunea oricărui jucător. Un rezultat corespunzător încheie imediat jocul; urmează doar obiectivele.",
"Starting from age 6, round 2, building a wonder ends the game after that round. Then complete objectives.": "Începând cu epoca 6, runda 2, construirea unei minuni încheie jocul după acea rundă. Apoi îndepliniți obiectivele.",
"Normal": "Normal",
"Wonderful Ending": "Final minunat",
"Normal: 6 ages.": "Normal: 6 epoci.",
"Epic: 8 ages.": "Epic: 8 epoci.",
"Wonder to end": "Minune pentru final",
"Ends this round": "Se încheie în această rundă",
"{p0} · {p1} · {p2}": "{p0} · {p1} · {p2}",
"{p0} {p1}/3": "{p0} {p1}/3",
"{p0}–6": "{p0}–6",
"End on": "Sfârșit la",
"{p0} · {p1} {p2}": "{p0} · {p1} {p2}"
}

View file

@ -5255,5 +5255,24 @@
"Public bonuses only · excludes tactics, dice-symbol effects and unresolved choices": "Только открытые бонусы · без тактики, эффектов символов кубиков и нерешённых выборов",
"Steel Weapons not activated: +{p0} value if activated": "Стальное оружие не активировано: +{p0} к значению при активации",
"Round 1: total bonus capped at +2, including dice-symbol bonuses": "Раунд 1: общий бонус не более +2, включая бонусы символов кубиков",
"Battle · Round": "Битва · Раунд"
"Battle · Round": "Битва · Раунд",
"Game length": "Продолжительность игры",
"Shorter": "Короткая",
"Roll to End": "Конец по броску",
"Roll to End: {p0} (end on {p1}–6)": "Конец по броску: {p0} (конец при {p1}–6)",
"Wonderful Ending: finish this round, then complete objectives": "Чудесный финал: завершите этот раунд, затем выполните цели",
"Shorter Game: 4 ages, 2 starting settlers. Between ages, take two free advances in two full turn-order passes; the second uses no event marker.": "Короткая игра: 4 эпохи, 2 поселенца в начале. Между эпохами каждый получает два бесплатных достижения за два полных круга в порядке хода; второе не расходует маркер события.",
"Roll to End: roll at the start of each marked round, before any player acts. A matching result ends play immediately; only objectives follow.": "Конец по броску: бросайте в начале каждого отмеченного раунда, до действий игроков. Подходящий результат немедленно завершает игру; затем проверяются только цели.",
"Starting from age 6, round 2, building a wonder ends the game after that round. Then complete objectives.": "Начиная со 2-го раунда 6-й эпохи, строительство чуда завершает игру после этого раунда. Затем выполните цели.",
"Normal": "Обычная",
"Wonderful Ending": "Чудесное завершение",
"Normal: 6 ages.": "Обычная: 6 эпох.",
"Epic: 8 ages.": "Эпическая: 8 эпох.",
"Wonder to end": "Чудо завершает игру",
"Ends this round": "Конец в этом раунде",
"{p0} · {p1} · {p2}": "{p0} · {p1} · {p2}",
"{p0} {p1}/3": "{p0} {p1}/3",
"{p0}–6": "{p0}–6",
"End on": "Конец при",
"{p0} · {p1} {p2}": "{p0} · {p1} {p2}"
}

View file

@ -5255,5 +5255,24 @@
"Public bonuses only · excludes tactics, dice-symbol effects and unresolved choices": "Chỉ thưởng công khai · không gồm chiến thuật, hiệu ứng biểu tượng xúc xắc và lựa chọn chưa giải quyết",
"Steel Weapons not activated: +{p0} value if activated": "Vũ khí thép chưa kích hoạt: +{p0} giá trị nếu kích hoạt",
"Round 1: total bonus capped at +2, including dice-symbol bonuses": "Vòng 1: tổng thưởng tối đa +2, gồm cả thưởng biểu tượng xúc xắc",
"Battle · Round": "Trận chiến · Vòng"
"Battle · Round": "Trận chiến · Vòng",
"Game length": "Độ dài ván chơi",
"Shorter": "Ngắn hơn",
"Roll to End": "Kết thúc bằng xúc xắc",
"Roll to End: {p0} (end on {p1}–6)": "Kết thúc bằng xúc xắc: {p0} (kết thúc khi {p1}–6)",
"Wonderful Ending: finish this round, then complete objectives": "Kết thúc kỳ quan: hoàn tất vòng này, rồi hoàn thành mục tiêu",
"Shorter Game: 4 ages, 2 starting settlers. Between ages, take two free advances in two full turn-order passes; the second uses no event marker.": "Ván ngắn hơn: 4 thời đại, khởi đầu với 2 người định cư. Giữa các thời đại, mỗi người nhận hai tiến bộ miễn phí qua hai lượt đi hết thứ tự người chơi; tiến bộ thứ hai không dùng dấu sự kiện.",
"Roll to End: roll at the start of each marked round, before any player acts. A matching result ends play immediately; only objectives follow.": "Kết thúc bằng xúc xắc: gieo khi bắt đầu mỗi vòng được đánh dấu, trước khi bất kỳ ai hành động. Kết quả phù hợp kết thúc ván ngay lập tức; sau đó chỉ xét mục tiêu.",
"Starting from age 6, round 2, building a wonder ends the game after that round. Then complete objectives.": "Kể từ thời đại 6, vòng 2, việc xây dựng một kỳ quan sẽ kết thúc trò chơi sau vòng đó. Sau đó hoàn thành các mục tiêu.",
"Normal": "Thông thường",
"Wonderful Ending": "Kết thúc kỳ diệu",
"Normal: 6 ages.": "Thông thường: 6 thời đại.",
"Epic: 8 ages.": "Sử thi: 8 thời đại.",
"Wonder to end": "Kỳ quan để kết thúc",
"Ends this round": "Kết thúc vòng này",
"{p0} · {p1} · {p2}": "{p0} · {p1} · {p2}",
"{p0} {p1}/3": "{p0} {p1}/3",
"{p0}–6": "{p0}–6",
"End on": "Kết thúc khi ra",
"{p0} · {p1} {p2}": "{p0} · {p1} {p2}"
}

View file

@ -5255,5 +5255,24 @@
"Public bonuses only · excludes tactics, dice-symbol effects and unresolved choices": "仅公开加成 · 不含战术、骰子符号效果及未解决的选择",
"Steel Weapons not activated: +{p0} value if activated": "钢铁武器未激活:激活后战斗值+{p0}",
"Round 1: total bonus capped at +2, including dice-symbol bonuses": "第1回合:总加成上限为+2,包括骰子符号加成",
"Battle · Round": "战斗 · 回合"
"Battle · Round": "战斗 · 回合",
"Game length": "游戏时长",
"Shorter": "较短",
"Roll to End": "掷骰结束",
"Roll to End: {p0} (end on {p1}–6)": "掷骰结束:{p0}({p1}–6 时结束)",
"Wonderful Ending: finish this round, then complete objectives": "奇迹终局:完成本轮,然后结算目标",
"Shorter Game: 4 ages, 2 starting settlers. Between ages, take two free advances in two full turn-order passes; the second uses no event marker.": "较短游戏:4个时代,初始2名移民。时代之间按回合顺序完整进行两轮,每位玩家各获得两项免费进步;第二项不消耗事件标记。",
"Roll to End: roll at the start of each marked round, before any player acts. A matching result ends play immediately; only objectives follow.": "掷骰结束:在每个标记轮次开始时、任何玩家行动前掷骰。结果符合范围时立即结束游戏;随后只结算目标。",
"Starting from age 6, round 2, building a wonder ends the game after that round. Then complete objectives.": "从第6时代第2轮开始,建造奇迹会使游戏在该轮结束后结束。然后完成目标。",
"Normal": "普通",
"Wonderful Ending": "奇迹终局",
"Normal: 6 ages.": "普通:6个时代。",
"Epic: 8 ages.": "史诗:8个时代。",
"Wonder to end": "建奇迹结束游戏",
"Ends this round": "本轮结束游戏",
"{p0} · {p1} · {p2}": "{p0} · {p1} · {p2}",
"{p0} {p1}/3": "{p0} {p1}/3",
"{p0}–6": "{p0}–6",
"End on": "结束点数",
"{p0} · {p1} {p2}": "{p0} · {p1} {p2}"
}

View file

@ -5255,5 +5255,24 @@
"Public bonuses only · excludes tactics, dice-symbol effects and unresolved choices": "僅公開加成 · 不含戰術、骰子符號效果及未解決的選擇",
"Steel Weapons not activated: +{p0} value if activated": "鋼鐵武器未啟用:啟用後戰鬥值+{p0}",
"Round 1: total bonus capped at +2, including dice-symbol bonuses": "第1回合:總加成上限為+2,包括骰子符號加成",
"Battle · Round": "戰鬥 · 回合"
"Battle · Round": "戰鬥 · 回合",
"Game length": "遊戲時長",
"Shorter": "較短",
"Roll to End": "擲骰結束",
"Roll to End: {p0} (end on {p1}–6)": "擲骰結束:{p0}({p1}–6 時結束)",
"Wonderful Ending: finish this round, then complete objectives": "奇蹟終局:完成本輪,然後結算目標",
"Shorter Game: 4 ages, 2 starting settlers. Between ages, take two free advances in two full turn-order passes; the second uses no event marker.": "較短遊戲:4個時代,初始2名移民。時代之間按回合順序完整進行兩輪,每位玩家各獲得兩項免費進步;第二項不消耗事件標記。",
"Roll to End: roll at the start of each marked round, before any player acts. A matching result ends play immediately; only objectives follow.": "擲骰結束:在每個標記輪次開始時、任何玩家行動前擲骰。結果符合範圍時立即結束遊戲;隨後只結算目標。",
"Starting from age 6, round 2, building a wonder ends the game after that round. Then complete objectives.": "從第6時代第2輪開始,建造奇蹟會使遊戲在該輪結束後結束。然後完成目標。",
"Normal": "普通",
"Wonderful Ending": "奇蹟終局",
"Normal: 6 ages.": "普通:6個時代。",
"Epic: 8 ages.": "史詩:8個時代。",
"Wonder to end": "建奇蹟結束遊戲",
"Ends this round": "本輪結束遊戲",
"{p0} · {p1} · {p2}": "{p0} · {p1} · {p2}",
"{p0} {p1}/3": "{p0} {p1}/3",
"{p0}–6": "{p0}–6",
"End on": "結束點數",
"{p0} · {p1} {p2}": "{p0} · {p1} {p2}"
}

View file

@ -6470,3 +6470,165 @@ small {
.player-info .supporter-badge {
flex-shrink: 0;
}
/* Age-track rule affordances stay in the masthead, including on touch layouts. */
.age-track {
flex-direction: column;
gap: 2px;
padding: 0 8px;
max-width: 100%;
}
.age-steps {
display: flex;
gap: 14px;
align-items: center;
}
button.age-step {
border: 0;
background: transparent;
padding: 0;
cursor: pointer;
height: 30px;
}
button.age-step.current {
background: var(--green);
color: #fff7dc;
}
.age-step:focus-visible,
.age-phase:focus-visible {
outline: 2px solid var(--green);
outline-offset: 3px;
}
.age-end-icon {
position: absolute;
right: -8px;
top: -3px;
background: var(--paper);
color: var(--ink);
border-radius: 3px;
display: flex;
}
.age-end-icon.inactive {
opacity: 0.45;
}
.age-track .round-label {
position: static;
transform: none;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
gap: 3px 7px;
line-height: 1.3;
white-space: normal;
text-align: center;
}
.age-phase {
display: inline-flex;
align-items: center;
gap: 3px;
font: inherit;
color: var(--ink);
background: transparent;
padding: 2px;
border: 0;
cursor: pointer;
text-decoration: underline dotted;
text-underline-offset: 3px;
}
.age-length-details {
position: absolute;
top: calc(100% + 8px);
left: 50%;
transform: translateX(-50%);
width: min(340px, calc(100vw - 32px));
max-height: 65vh;
overflow-y: auto;
box-sizing: border-box;
z-index: 50;
padding: 14px;
border: 1px solid var(--line);
border-radius: 8px;
background: var(--paper);
color: var(--ink);
box-shadow: 0 8px 28px #0003;
font:
12px/1.5 'DM Sans',
sans-serif;
}
.age-length-details strong {
display: block;
padding-right: 24px;
}
.age-length-details p {
margin: 8px 0;
}
.age-end-thresholds {
width: 100%;
margin-top: 10px;
border-collapse: collapse;
text-align: center;
font-variant-numeric: tabular-nums;
}
.age-end-thresholds th,
.age-end-thresholds td {
padding: 4px 8px;
border-bottom: 1px solid var(--line);
}
.age-end-thresholds th {
color: var(--muted);
font-weight: 500;
}
.age-end-thresholds tr.current {
background: color-mix(in srgb, var(--ink) 9%, var(--paper));
font-weight: bold;
}
.age-details-close {
position: absolute;
top: 8px;
right: 8px;
display: grid;
place-items: center;
padding: 5px;
border: 0;
background: transparent;
color: inherit;
cursor: pointer;
}
.age-ending {
font-weight: bold;
}
@media (max-width: 1050px) {
.age-steps {
gap: 10px;
}
}
@media (max-width: 760px), (max-width: 1000px) and (max-height: 500px) {
.masthead {
grid-template-rows: 58px auto 44px;
grid-template-areas: 'brand actions' 'ages ages' 'resources resources';
}
.spectating .masthead {
grid-template-rows: 48px auto;
grid-template-areas: 'brand actions' 'ages ages';
}
.age-track {
display: flex;
width: 100%;
padding: 3px 0 7px;
}
.age-steps {
gap: 16px;
}
button.age-step {
width: 24px;
min-height: 30px;
}
.age-track .round-label {
font-size: 11px;
}
}
.masthead:has(.age-length-details) {
z-index: 90;
}

View file

@ -76,7 +76,8 @@ export interface Game {
action_cards_discarded?: number[];
incidents_discarded?: number[];
successful_cultural_influence?: boolean;
options?: { length?: 'Standard' | 'Epic'; variant?: 'Standard' | 'Builder' };
options?: { length?: 'Standard' | 'Epic' | 'Shorter' | 'RollToEnd' | 'WonderfulEnding'; variant?: 'Standard' | 'Builder' };
variable_end?: 'RollToEnd' | 'WonderfulEnding';
permanent_effects?: unknown[];
board_history?: { id: string; frames: BoardFrame[] };
state: unknown;