Show active effects and card choices; warn on costly influence sources
This commit is contained in:
parent
5a1e1e2940
commit
dbdd5ba4eb
34 changed files with 566 additions and 42 deletions
|
|
@ -23,7 +23,7 @@ pub(crate) fn trojan_incidents() -> Vec<Incident> {
|
|||
vec![trojan_horse(), solar_eclipse(), anarchy(), guillotine()]
|
||||
}
|
||||
|
||||
const TROJAN_DESCRIPTION: &str = "In a land battle against a defended city \
|
||||
const TROJAN_DESCRIPTION: &str = "In a land battle against another player's defended city \
|
||||
(Army unit or Fortress), \
|
||||
the attacker may pay 1 wood and 1 culture token to get 1 victory point and to \
|
||||
deny the defender tactics cards in the first round of combat.";
|
||||
|
|
@ -85,6 +85,7 @@ pub(crate) fn decide_trojan_horse() -> Ability {
|
|||
fn is_land_battle_against_defended_city(game: &Game, player_index: usize, combat: &Combat) -> bool {
|
||||
combat.is_land_battle(game)
|
||||
&& combat.attacker() == player_index
|
||||
&& game.player(combat.defender()).is_human()
|
||||
&& combat.defender_city(game).is_some()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ use serde_json::{Value, json};
|
|||
mod actions;
|
||||
mod collection_potential;
|
||||
mod decisions;
|
||||
mod effects;
|
||||
mod journal;
|
||||
mod turn;
|
||||
mod waiting;
|
||||
|
|
@ -103,6 +104,7 @@ pub fn view(game: &Game, seat: Option<usize>) -> Value {
|
|||
);
|
||||
let can_play = seat == Some(active) && playing;
|
||||
let event_catalog = journal::catalog(game);
|
||||
let active_effects = effects::describe(game);
|
||||
// Static rules reference: includes no hand identities or deck order.
|
||||
let card_catalog = game.cache.get_action_cards().iter()
|
||||
.chain(game.cache.get_incidents().iter().filter_map(|i| i.action_card.as_ref()))
|
||||
|
|
@ -229,7 +231,7 @@ pub fn view(game: &Game, seat: Option<usize>) -> Value {
|
|||
"cities": p.cities.iter().map(|c| json!({"position": c.position, "size": c.size(), "capacity": c.mood_modified_size(p), "mood": c.mood_state, "activations": c.activations,"protection":crate::content::civilizations::egypt::protection(p,c.position),"independentPort":crate::content::civilizations::phoenicia::independent_port(game,c.pieces.port),"influenceMarker":c.influence_marker})).collect::<Vec<_>>()
|
||||
})).collect::<Vec<_>>();
|
||||
let Some(seat) = seat else {
|
||||
return json!({"logOriginNames":log_origin_names,"builtWonders":built_wonders,"cardCatalog":card_catalog,"eventCatalog":event_catalog,"pendingEvent":pending_event,"civilizationDraft":civilization_draft,"waitingFor":waiting_for,"activePlayers":active_players,"activePlayer": active, "canPlay": false, "supportedPhase": supported_phase, "players": players, "cities": [], "advances": [], "objectiveCards": [], "wonderCards": [], "wonderCatalog":wonder_catalog, "objectiveDecision": null, "cityActions": [], "settlers": [], "stopMovement": null, "canUndo": false, "canEndTurn": false, "barbarianGuide":barbarian_guide,"pirateSpawns":pirate_spawns,"seaRoutes":sea_routes});
|
||||
return json!({"logOriginNames":log_origin_names,"builtWonders":built_wonders,"cardCatalog":card_catalog,"eventCatalog":event_catalog,"activeEffects":active_effects,"pendingEvent":pending_event,"civilizationDraft":civilization_draft,"waitingFor":waiting_for,"activePlayers":active_players,"activePlayer": active, "canPlay": false, "supportedPhase": supported_phase, "players": players, "cities": [], "advances": [], "objectiveCards": [], "wonderCards": [], "wonderCatalog":wonder_catalog, "objectiveDecision": null, "cityActions": [], "settlers": [], "stopMovement": null, "canUndo": false, "canEndTurn": false, "barbarianGuide":barbarian_guide,"pirateSpawns":pirate_spawns,"seaRoutes":sea_routes});
|
||||
};
|
||||
let p = game.player(seat);
|
||||
let wonder_cards = p.wonder_cards.iter().filter(|wonder| **wonder != Wonder::Hidden).map(|wonder| {
|
||||
|
|
@ -367,7 +369,7 @@ pub fn view(game: &Game, seat: Option<usize>) -> Value {
|
|||
item
|
||||
}).collect::<Vec<_>>();
|
||||
advances.sort_by_key(|a| a["name"].as_str().unwrap_or_default().to_string());
|
||||
json!({"logOriginNames":log_origin_names,"cardCatalog":card_catalog,"eventCatalog":event_catalog,"pendingEvent":pending_event,"civilizationDraft":civilization_draft,"waitingFor":waiting_for,"activePlayers":active_players,"activePlayer":active,"canPlay":can_play,"supportedPhase":supported_phase,"players":players,"cities":cities,"advances":advances,"objectiveCards":objective_cards,"objectiveDecision":objective_decision(game, seat),
|
||||
let mut result = json!({"logOriginNames":log_origin_names,"cardCatalog":card_catalog,"eventCatalog":event_catalog,"pendingEvent":pending_event,"civilizationDraft":civilization_draft,"waitingFor":waiting_for,"activePlayers":active_players,"activePlayer":active,"canPlay":can_play,"supportedPhase":supported_phase,"players":players,"cities":cities,"advances":advances,"objectiveCards":objective_cards,"objectiveDecision":objective_decision(game, seat),
|
||||
"influenceContext":decisions::influence_context(game, seat), "choiceDecision":choice, "explorationDecision":exploration, "wonderCards":wonder_cards, "wonderCatalog":wonder_catalog, "builtWonders":built_wonders, "decision":decision,
|
||||
"civilizations":crate::game_setup::civilization_choices(game, seat).iter().map(|c|json!({"name":c.name,
|
||||
"advances":c.special_advances.iter().map(|a|json!({"name":a.name,"description":a.description,"requirement":a.requirement.name(game)})).collect::<Vec<_>>(),
|
||||
|
|
@ -383,7 +385,9 @@ pub fn view(game: &Game, seat: Option<usize>) -> Value {
|
|||
"endTurnTradeWarning":if can_play { turn::trade_warning(game, seat) } else { None },
|
||||
"cityActions":actions::cities(game, seat, can_play), "settlers":actions::settlers(game, seat, (can_play && PlayingActionType::MoveUnits.is_available(game,seat).is_ok()) || (moving && seat == active)),
|
||||
"stopMovement":if moving && seat == active {Some(Action::Movement(crate::movement::MovementAction::Stop))} else {None},
|
||||
"canUndo":seat == active && game.can_undo(),"canRedo":seat == active && game.can_redo(),"canEndTurn":can_play && PlayingActionType::EndTurn.is_available(game, seat).is_ok()})
|
||||
"canUndo":seat == active && game.can_undo(),"canRedo":seat == active && game.can_redo(),"canEndTurn":can_play && PlayingActionType::EndTurn.is_available(game, seat).is_ok()});
|
||||
result["activeEffects"] = json!(active_effects);
|
||||
result
|
||||
}
|
||||
|
||||
fn movement_notes(
|
||||
|
|
@ -556,10 +560,26 @@ fn choice_decision(game: &Game, seat: usize) -> Option<Value> {
|
|||
}),
|
||||
PersistentEventType::ChooseActionCard => game.action_cards_discarded.last().map(|id| {
|
||||
let card = game.cache.get_action_card(*id);
|
||||
json!({"name":card.civil_card.name,"rules":[card.civil_card.description]})
|
||||
let mut rules = vec![if card.civil_card.action_type.free { "Free action".to_string() } else { "Costs 1 action".to_string() }, card.civil_card.description.clone()];
|
||||
if let Some(tactics) = &card.tactics_card {
|
||||
rules.push(format!("Battle use — {}: {}", tactics.name, tactics.description));
|
||||
}
|
||||
json!({"name":card.civil_card.name,"rules":rules})
|
||||
}),
|
||||
_ => None,
|
||||
}
|
||||
} else if handler.origin.name(game) == "Draw Wonder Card" {
|
||||
game.permanent_effects.iter().find_map(|effect| {
|
||||
if let crate::content::effects::PermanentEffect::PublicWonderCard(wonder) = effect {
|
||||
let info = wonder.info(game);
|
||||
Some(json!({"name": info.name(), "rules": [], "wonder": {
|
||||
"id": wonder, "name": info.name(), "description": info.description,
|
||||
"cost": info.cost.default_payment(), "requiredAdvance": info.required_advance.name(game),
|
||||
"requiredAdvanceOwned": game.player(seat).has_advance(info.required_advance),
|
||||
"builtPoints": info.built_victory_points, "ownedPoints": info.owned_victory_points
|
||||
}}))
|
||||
} else { None }
|
||||
})
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
|
@ -692,6 +712,31 @@ mod tests {
|
|||
game_api::init(2, "web-view-test".into(), GameOptions::default())
|
||||
}
|
||||
#[test]
|
||||
fn public_wonder_choice_shows_the_card_without_drawing_it() {
|
||||
let mut game = game();
|
||||
let seat = game.active_player();
|
||||
game.permanent_effects
|
||||
.push(crate::content::effects::PermanentEffect::PublicWonderCard(
|
||||
Wonder::Colosseum,
|
||||
));
|
||||
crate::wonder::draw_wonder_card(
|
||||
&mut game,
|
||||
&crate::events::EventPlayer::new(
|
||||
seat,
|
||||
crate::events::EventOrigin::Advance(Advance::Engineering),
|
||||
),
|
||||
);
|
||||
let before = serde_json::to_string(&game.cloned_data()).unwrap();
|
||||
let displayed = view(&game, Some(seat));
|
||||
let card = &displayed["choiceDecision"]["preview"]["wonder"];
|
||||
assert_eq!(card["id"], "Colosseum");
|
||||
assert!(card["description"].as_str().unwrap().contains("combat"));
|
||||
assert!(card["cost"].is_object());
|
||||
assert!(card["requiredAdvance"].is_string());
|
||||
assert!(view(&game, Some(1 - seat))["choiceDecision"].is_null());
|
||||
assert_eq!(before, serde_json::to_string(&game.cloned_data()).unwrap());
|
||||
}
|
||||
#[test]
|
||||
fn spectators_and_waiting_players_have_no_actions() {
|
||||
let game = game();
|
||||
assert_eq!(view(&game, None)["canPlay"], false);
|
||||
|
|
|
|||
93
server/src/web_view/effects.rs
Normal file
93
server/src/web_view/effects.rs
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
use crate::content::effects::{CollectEffect, ConstructEffect, PermanentEffect};
|
||||
use crate::game::Game;
|
||||
use serde_json::{Value, json};
|
||||
|
||||
pub(super) fn describe(game: &Game) -> Vec<Value> {
|
||||
game.permanent_effects.iter().map(|effect| {
|
||||
let (name, players): (&str, Vec<usize>) = match effect {
|
||||
PermanentEffect::Pestilence => ("Pestilence", vec![]),
|
||||
PermanentEffect::TrojanHorse => ("Trojan Horse", vec![]),
|
||||
PermanentEffect::SolarEclipse => ("Solar Eclipse", vec![]),
|
||||
PermanentEffect::Construct(ConstructEffect::CityDevelopment) => ("City Development", vec![game.active_player()]),
|
||||
PermanentEffect::Construct(ConstructEffect::GreatEngineer) => ("Great Engineer", vec![game.active_player()]),
|
||||
PermanentEffect::Collect(CollectEffect::ProductionFocus) => ("Production Focus", vec![game.active_player()]),
|
||||
PermanentEffect::Collect(CollectEffect::MassProduction) => ("Mass Production", vec![game.active_player()]),
|
||||
PermanentEffect::CulturalTakeover => ("Cultural Takeover", vec![game.active_player()]),
|
||||
PermanentEffect::DiplomaticRelations(r) => ("Great Diplomat", vec![r.active_player, r.passive_player]),
|
||||
PermanentEffect::Negotiations(n) => ("Negotiations", vec![n.relations.active_player, n.relations.passive_player]),
|
||||
PermanentEffect::RevolutionLoseAction(p) => ("Civil War", vec![*p]),
|
||||
PermanentEffect::AssassinationLoseAction(p) => ("Assassination", vec![*p]),
|
||||
PermanentEffect::Anarchy(a) => ("Anarchy", vec![a.player]),
|
||||
PermanentEffect::GreatSeer(s) => ("Great Seer", s.assigned_objectives.iter().map(|o| o.player).collect()),
|
||||
PermanentEffect::PublicWonderCard(_) => ("Public wonder", vec![]),
|
||||
};
|
||||
let incident = match effect {
|
||||
PermanentEffect::Pestilence => Some(1),
|
||||
PermanentEffect::TrojanHorse => Some(42),
|
||||
PermanentEffect::SolarEclipse => Some(41),
|
||||
PermanentEffect::Construct(ConstructEffect::GreatEngineer) => Some(26),
|
||||
_ => None,
|
||||
};
|
||||
// Base effects and initial event decisions have already resolved.
|
||||
let mut rules = incident.map_or_else(|| effect.description(game), |id| game.cache.get_incident(id).description(game).into_iter().rev().take(1).collect());
|
||||
if rules.first().is_some_and(|line| line == name) { rules.remove(0); }
|
||||
match effect {
|
||||
PermanentEffect::Pestilence => rules = vec!["You cannot construct buildings or wonders until you research Sanitation.".into()],
|
||||
PermanentEffect::Construct(ConstructEffect::GreatEngineer) => rules = vec!["Construct a building in one of your cities at its normal resource cost, without spending an additional action or activating the city.".into()],
|
||||
PermanentEffect::Collect(CollectEffect::MassProduction) => rules = vec![game.cache.get_civil_card(29).description.clone()],
|
||||
_ => {}
|
||||
}
|
||||
if let PermanentEffect::PublicWonderCard(wonder) = effect {
|
||||
let info = wonder.info(game);
|
||||
rules.extend([
|
||||
info.description.clone(),
|
||||
format!("Requires {}. Base construction cost: {}.", info.required_advance.name(game), info.cost.default_payment()),
|
||||
format!("{} VP for building · {} VP for owning", info.built_victory_points, info.owned_victory_points),
|
||||
]);
|
||||
}
|
||||
// Objective assignments remain private even when this view is built from a full game.
|
||||
if let PermanentEffect::GreatSeer(_) = effect {
|
||||
rules = vec!["The next time each listed player draws an objective from the pile, they receive their designated card instead. The assigned cards remain private.".into()];
|
||||
}
|
||||
if matches!(effect, PermanentEffect::DiplomaticRelations(_)) {
|
||||
rules.push("The agreement ends when either player attacks the other. The card's owner may also end it as a regular action.".into());
|
||||
}
|
||||
let scope = if players.is_empty() { "All players".to_string() }
|
||||
else { players.iter().map(|p| game.player_name(*p)).collect::<Vec<_>>().join(" · ") };
|
||||
json!({"name": name, "scope": scope, "players": players, "rules": rules})
|
||||
}).collect()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::content::incidents::great_diplomat::DiplomaticRelations;
|
||||
#[test]
|
||||
fn shared_effects_show_scope_and_rules() {
|
||||
let mut game = crate::game_api::init(2, "effects".into(), Default::default());
|
||||
game.permanent_effects = vec![
|
||||
PermanentEffect::TrojanHorse,
|
||||
PermanentEffect::DiplomaticRelations(DiplomaticRelations::new(0, 1)),
|
||||
];
|
||||
let effects = describe(&game);
|
||||
assert_eq!(effects[0]["scope"], "All players");
|
||||
assert!(effects[0]["rules"].to_string().contains("another player's"));
|
||||
assert_eq!(effects[1]["players"], json!([0, 1]));
|
||||
assert!(effects[1]["rules"].to_string().contains("2 culture tokens"));
|
||||
game.permanent_effects = vec![PermanentEffect::GreatSeer(
|
||||
crate::content::effects::GreatSeerEffect {
|
||||
player: 0,
|
||||
assigned_objectives: vec![crate::content::effects::GreatSeerObjective {
|
||||
player: 1,
|
||||
objective_card: 34,
|
||||
}],
|
||||
},
|
||||
)];
|
||||
let seer = describe(&game);
|
||||
assert_eq!(seer[0]["players"], json!([1]));
|
||||
assert!(!seer[0]["rules"].to_string().contains("Mercantile"));
|
||||
assert!(!seer[0]["rules"].to_string().contains("Traders"));
|
||||
game.permanent_effects.clear();
|
||||
assert!(describe(&game).is_empty());
|
||||
}
|
||||
}
|
||||
|
|
@ -439,6 +439,51 @@ fn test_envoy() {
|
|||
|
||||
const TROJAN: JsonTest = JsonTest::child("incidents", "trojan");
|
||||
|
||||
#[test]
|
||||
fn trojan_horse_only_offered_against_another_players_defended_city() {
|
||||
use server::content::effects::PermanentEffect;
|
||||
use server::events::EventOrigin;
|
||||
|
||||
for (defender, city, fortress, active, expected) in [
|
||||
(1, true, false, true, true),
|
||||
(1, true, true, true, true),
|
||||
(2, true, false, true, false),
|
||||
(2, false, false, true, false),
|
||||
(1, false, false, true, false),
|
||||
(1, true, false, false, false),
|
||||
] {
|
||||
let mut game = TROJAN.load_game("trojan_horse");
|
||||
let target = Position::from_offset("C1");
|
||||
if active {
|
||||
game.permanent_effects.push(PermanentEffect::TrojanHorse);
|
||||
}
|
||||
let mut target_city = game.player_mut(1).cities.remove(0);
|
||||
let units = std::mem::take(&mut game.player_mut(1).units);
|
||||
if fortress {
|
||||
target_city.pieces.fortress = Some(defender);
|
||||
} else {
|
||||
game.player_mut(defender).units = units;
|
||||
}
|
||||
if city {
|
||||
game.player_mut(defender).cities.push(target_city);
|
||||
}
|
||||
let game = server::game_api::execute(game, move_action(vec![0, 1, 2, 3], target), 0);
|
||||
let offered = game
|
||||
.current_event_handler()
|
||||
.is_some_and(|handler| handler.origin == EventOrigin::Ability("Trojan Horse".into()));
|
||||
assert_eq!(
|
||||
offered, expected,
|
||||
"defender {defender}, city {city}, fortress {fortress}, active {active}"
|
||||
);
|
||||
assert_eq!(
|
||||
game.permanent_effects
|
||||
.iter()
|
||||
.any(|effect| matches!(effect, PermanentEffect::TrojanHorse)),
|
||||
active
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_trojan_horse() {
|
||||
TROJAN.test(
|
||||
|
|
|
|||
|
|
@ -201,3 +201,29 @@ fn test_great_wall() {
|
|||
],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn great_mausoleum_previews_visible_discards() {
|
||||
let game = JSON.load_game("great_mausoleum");
|
||||
let game = server::game_api::execute(game, Action::Playing(PlayingAction::ActionCard(123)), 0);
|
||||
let game = server::game_api::execute(game, Action::Response(EventResponse::Bool(true)), 0);
|
||||
let displayed = server::web_view::view(&game, Some(0));
|
||||
let preview = &displayed["choiceDecision"]["preview"];
|
||||
assert!(preview["name"].is_string());
|
||||
assert!(preview["rules"].as_array().unwrap().len() >= 2);
|
||||
let game = server::game_api::execute(game, Action::Response(EventResponse::Bool(false)), 0);
|
||||
let game = server::game_api::execute(
|
||||
game,
|
||||
advance_action(Advance::Storage, ResourcePile::ideas(2)),
|
||||
0,
|
||||
);
|
||||
let displayed = server::web_view::view(&game, Some(0));
|
||||
assert!(displayed["choiceDecision"]["preview"]["name"].is_string());
|
||||
assert!(
|
||||
displayed["choiceDecision"]["preview"]["rules"]
|
||||
.as_array()
|
||||
.unwrap()
|
||||
.len()
|
||||
>= 2
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,3 +87,5 @@ Viewer 0.1.43 and engine 0.4.49 fix Sparta comparing unit IDs instead of fightin
|
|||
Viewer 0.1.44 and engine 0.4.50 enforce Technology Trade’s 2-space range when choosing a partner, using the same unit-or-city proximity check as card availability and Inspiration. Both copies of the card exclude distant players even when another nearby player makes the card playable. Regression coverage includes unit and city contact at exactly 2 spaces and at 3 spaces. Publish the matching viewer and engine together. Already-selected trade partners in saved games are preserved.
|
||||
|
||||
Viewer 0.1.45 uses the printed English Monumental Edition names for Objectives, Actions, Tactics, Events and Wonders, verified against all 38 objective, 42 action, 58 event and 8 wonder card scans recorded in `docs/card-text-audit.json`. The Markets objective is Mercantile; the three-route objective is Trader. Names are corrected in hands, decisions, completed objectives, journal references, combat and replay, including Great Pyramids. Saved engine names, card IDs, commands, objective readiness and historical outcomes remain unchanged; Great Migration is distinguished from the Migration event. Existing locale keys remain available alongside printed-name aliases. Engine 0.4.50 is unchanged.
|
||||
|
||||
Viewer 0.1.46 and engine 0.4.51 add an Effects indicator with a count and a rules dialog for active public effects, including Trojan Horse, Great Diplomat agreements, Negotiations and public wonders. Scopes distinguish shared effects, affected players and the current player's temporary action effects. Great Seer assignments remain private. Public-wonder draw choices display the wonder's effect, construction cost, required advance and points; Great Mausoleum discard previews include event rules and both uses of action cards. Trojan Horse now requires another human player's defended city, as stated on printed E42, and is no longer offered against barbarians. Existing saved activation prompts remain valid: decline an already-pending barbarian activation to continue without paying. Publish the matching viewer and engine together; historical battle outcomes are preserved. Cultural influence warns before rolling when another eligible city has a lower range cost, offers a source switch with the culture saving, and requires an explicit second click to retain the more expensive source. Automatic movement-group selection and switching seats during movement now select the whole compatible group instead of only its first unit.
|
||||
|
|
|
|||
4
web-client/package-lock.json
generated
4
web-client/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@boardgamers/clash-web-client",
|
||||
"version": "0.1.45",
|
||||
"version": "0.1.46",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@boardgamers/clash-web-client",
|
||||
"version": "0.1.45",
|
||||
"version": "0.1.46",
|
||||
"dependencies": {
|
||||
"@boardgamers/protocol": "0.9.0",
|
||||
"lucide-svelte": "^0.577.0",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@boardgamers/clash-web-client",
|
||||
"version": "0.1.45",
|
||||
"version": "0.1.46",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
|
|
|||
62
web-client/src/ActiveEffectsDialog.svelte
Normal file
62
web-client/src/ActiveEffectsDialog.svelte
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
<script lang="ts">
|
||||
import { Sparkles, X } from 'lucide-svelte';
|
||||
import type { ActiveEffect, View } from './types';
|
||||
import { printedCardName } from './card-names';
|
||||
import ResourceText from './ResourceText.svelte';
|
||||
let {
|
||||
effects,
|
||||
players,
|
||||
onClose,
|
||||
}: { effects: ActiveEffect[]; players: View['players']; onClose: () => void } = $props();
|
||||
function show(node: HTMLDialogElement) {
|
||||
node.showModal();
|
||||
}
|
||||
</script>
|
||||
|
||||
<dialog
|
||||
class="field-guide active-effects-dialog"
|
||||
aria-label="Active effects"
|
||||
use:show
|
||||
onclose={onClose}
|
||||
onclick={(e) => {
|
||||
if (e.target === e.currentTarget) onClose();
|
||||
}}
|
||||
onkeydown={(e) => {
|
||||
if (e.key === 'Escape') onClose();
|
||||
}}
|
||||
>
|
||||
<button class="close-guide icon-button" aria-label="Close active effects" onclick={onClose}
|
||||
><X size={20} /></button
|
||||
>
|
||||
<h2><Sparkles size={23} /> Active effects</h2>
|
||||
{#each effects as effect}
|
||||
<section class="active-effect-rule">
|
||||
<h3>{printedCardName(effect.name)}</h3>
|
||||
<small
|
||||
>{effect.players.length
|
||||
? effect.players
|
||||
.map((index) => players.find((player) => player.index === index)?.civilization ?? effect.scope)
|
||||
.join(' · ')
|
||||
: effect.scope}</small
|
||||
>
|
||||
{#each effect.rules as rule}<p><ResourceText text={rule} /></p>{/each}
|
||||
</section>
|
||||
{:else}<p>No active effects.</p>{/each}
|
||||
</dialog>
|
||||
|
||||
<style>
|
||||
.active-effect-rule {
|
||||
padding: 1.1rem 0;
|
||||
border-top: 1px solid var(--border, #3b5564);
|
||||
}
|
||||
.active-effect-rule h3 {
|
||||
margin: 0 0 0.3rem;
|
||||
}
|
||||
.active-effect-rule small {
|
||||
color: var(--muted, #9ab8c7);
|
||||
}
|
||||
.active-effect-rule p {
|
||||
margin: 0.7rem 0 0;
|
||||
line-height: 1.6;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -12,6 +12,7 @@
|
|||
import InfluenceFlow from './InfluenceFlow.svelte';
|
||||
import BattlePlayback from './BattlePlayback.svelte';
|
||||
import PublicEffects from './PublicEffects.svelte';
|
||||
import ActiveEffectsDialog from './ActiveEffectsDialog.svelte';
|
||||
import EventMarkers from './EventMarkers.svelte';
|
||||
import CivilizationPicker from './CivilizationPicker.svelte';
|
||||
import TilePanel from './TilePanel.svelte';
|
||||
|
|
@ -84,6 +85,7 @@
|
|||
import ExplorationPanel from './ExplorationPanel.svelte';
|
||||
import ScoreDialog from './ScoreDialog.svelte';
|
||||
import WondersDialog from './WondersDialog.svelte';
|
||||
import WonderReferenceDialog from './WonderReferenceDialog.svelte';
|
||||
import HowToPlay from './HowToPlay.svelte';
|
||||
import CardReveal from './CardReveal.svelte';
|
||||
import ActivationStatus from './ActivationStatus.svelte';
|
||||
|
|
@ -104,7 +106,7 @@
|
|||
import { mobilePanels } from './mobile-panels';
|
||||
import AbilitiesPanel from './AbilitiesPanel.svelte';
|
||||
import type { Controller } from './controller';
|
||||
import type { Resource, JournalEntry, View } from './types';
|
||||
import type { Resource, JournalEntry, View, WonderCard } from './types';
|
||||
import { researchReferences, type ResearchReference } from './research-links';
|
||||
import { resources, resourceNames, playerColor, playerSymbol } from './types';
|
||||
import { journal, pileText } from './model';
|
||||
|
|
@ -125,10 +127,12 @@
|
|||
let boardHost: HTMLDivElement;
|
||||
let world: World;
|
||||
let boardError = $state('');
|
||||
let effectsOpen = $state(false);
|
||||
let fullscreenEnabled = $state(false);
|
||||
let fullscreen = $state(false);
|
||||
let confirmEnd = $state(false);
|
||||
let cardReference = $state<CardRule | null>(null);
|
||||
let wonderReference = $state<WonderCard | null>(null);
|
||||
const journalCards = $derived(cardReferences($session.view));
|
||||
function showJournalCard(reference: CardReference) {
|
||||
cardReference = reference.card;
|
||||
|
|
@ -758,6 +762,11 @@
|
|||
>
|
||||
</div>
|
||||
<nav class="header-actions">
|
||||
{#if $session.view?.activeEffects?.length}
|
||||
<button class="text-button effects-button" aria-label={`Active effects: ${$session.view.activeEffects.length}`} onclick={() => effectsOpen = true}>
|
||||
<Sparkles size={17} /><span>Effects</span><span class="card-count">{$session.view.activeEffects.length}</span>
|
||||
</button>
|
||||
{/if}
|
||||
{#if $session.seat !== undefined}
|
||||
<button
|
||||
class="text-button cards-button"
|
||||
|
|
@ -1352,11 +1361,13 @@
|
|||
context={$session.view.influenceContext}
|
||||
/>{:else}<h2>{printedCardName(choiceDecision.name)}</h2>{/if}
|
||||
{#if choiceDecision.preview}
|
||||
<section class="decision-card-preview" aria-label="Discarded card rules">
|
||||
<section class="decision-card-preview" aria-label="Card rules">
|
||||
{#if choiceDecision.preview.wonder}<button class="text-button" onclick={() => wonderReference = choiceDecision.preview!.wonder!}><Landmark size={17} />{printedCardName(choiceDecision.preview.wonder.name)}<BookOpen size={15} /></button>{:else}
|
||||
<h3>{printedCardName(choiceDecision.preview.name)}</h3>
|
||||
{#if choiceDecision.preview.affected}<small>Affects: {choiceDecision.preview.affected}</small
|
||||
>{/if}
|
||||
{#each choiceDecision.preview.rules as rule}<p><ResourceText text={rule} /></p>{/each}
|
||||
{/if}
|
||||
</section>
|
||||
{/if}
|
||||
<div
|
||||
|
|
@ -1732,6 +1743,7 @@
|
|||
<BattlePlayback {controller} />
|
||||
</div>{/if}
|
||||
</main>
|
||||
{#if wonderReference}<WonderReferenceDialog card={wonderReference} onClose={() => wonderReference = null} />{/if}
|
||||
{#if cardReference}<CardReferenceDialog
|
||||
card={cardReference}
|
||||
onDismiss={() => (cardReference = null)}
|
||||
|
|
@ -1752,6 +1764,7 @@
|
|||
{#if !$session.playback}<CardReveal {controller} />{/if}
|
||||
<PlaybackPanel {controller} />
|
||||
<PublicEffects {controller} />
|
||||
{#if effectsOpen}<ActiveEffectsDialog effects={$session.view?.activeEffects ?? []} players={$session.view?.players ?? []} onClose={() => effectsOpen = false} />{/if}
|
||||
{#if $session.toast}<div class="toast" role="status"><Check size={16} />{$session.toast}</div>{/if}
|
||||
{#if $session.objectivesOpen && $session.seat !== undefined}
|
||||
<dialog
|
||||
|
|
|
|||
|
|
@ -1,7 +1,17 @@
|
|||
<script lang="ts">
|
||||
import { Drama, ArrowRight, ArrowLeft, Landmark, Footprints, RotateCcw, Zap, X } from 'lucide-svelte';
|
||||
import {
|
||||
Drama,
|
||||
ArrowRight,
|
||||
ArrowLeft,
|
||||
Landmark,
|
||||
Footprints,
|
||||
RotateCcw,
|
||||
Zap,
|
||||
X,
|
||||
TriangleAlert,
|
||||
} from 'lucide-svelte';
|
||||
import type { Controller } from './controller';
|
||||
import { activeInfluence, influenceKey, influenceUpfrontCost } from './influence';
|
||||
import { activeInfluence, influenceKey, influenceUpfrontCost, cheaperInfluenceOrigin } from './influence';
|
||||
import ResourceAmount from './ResourceAmount.svelte';
|
||||
let {
|
||||
controller,
|
||||
|
|
@ -12,6 +22,21 @@
|
|||
const offers = $derived(influence?.offers ?? []);
|
||||
const target = $derived(influence?.target ?? null);
|
||||
const origin = $derived(influence?.origin ?? null);
|
||||
const cheaper = $derived(cheaperInfluenceOrigin(target, origin));
|
||||
const attemptKey = $derived(`${target ? influenceKey(target) : ''}:${origin?.position}`);
|
||||
let confirmedSource = $state<string | null>(null);
|
||||
$effect(() => {
|
||||
attemptKey;
|
||||
confirmedSource = null;
|
||||
});
|
||||
function roll() {
|
||||
if (!target) return;
|
||||
if (cheaper && confirmedSource !== attemptKey) {
|
||||
confirmedSource = attemptKey;
|
||||
return;
|
||||
}
|
||||
controller.startInfluence(origin?.action ?? target.action, actionPayment, rangePayment);
|
||||
}
|
||||
const rangePayment = $derived(origin?.payment ?? target?.payment ?? {});
|
||||
const actionPayment = $derived(origin?.actionPayment ?? target?.actionPayment ?? {});
|
||||
const upfront = $derived(influenceUpfrontCost(actionPayment, rangePayment));
|
||||
|
|
@ -116,15 +141,36 @@
|
|||
: 'After rolling, you can choose whether to spend culture to reach 5.'}{#if origin?.reroll}
|
||||
Buddhism offers one optional reroll.{/if}
|
||||
</p>
|
||||
<button
|
||||
class="primary wide"
|
||||
disabled={$session.pending}
|
||||
onclick={() =>
|
||||
controller.startInfluence(origin?.action ?? target.action, actionPayment, rangePayment)}
|
||||
>
|
||||
{Object.values(upfront).some(Boolean)
|
||||
? 'Pay & roll'
|
||||
: 'Roll for influence'}{#if Object.values(upfront).some(Boolean)}<ResourceAmount
|
||||
{#if cheaper}
|
||||
<div class="influence-source-warning" role="status">
|
||||
<p>
|
||||
<TriangleAlert size={16} />{cheaper.position} can influence this same target with a lower range cost.
|
||||
</p>
|
||||
<button
|
||||
class="secondary wide"
|
||||
disabled={$session.pending}
|
||||
onclick={() => {
|
||||
controller.selectInfluenceOrigin(cheaper.position);
|
||||
confirmedSource = null;
|
||||
}}
|
||||
>
|
||||
Switch source to {cheaper.position}<span
|
||||
>Save <ResourceAmount
|
||||
pile={{
|
||||
culture_tokens: (rangePayment.culture_tokens ?? 0) - (cheaper.payment.culture_tokens ?? 0),
|
||||
}}
|
||||
compact
|
||||
/></span
|
||||
>
|
||||
</button>
|
||||
</div>
|
||||
{/if}
|
||||
<button class="primary wide" disabled={$session.pending} onclick={roll}>
|
||||
{cheaper && confirmedSource === attemptKey
|
||||
? `Use ${origin?.position ?? target.origin} anyway`
|
||||
: Object.values(upfront).some(Boolean)
|
||||
? 'Pay & roll'
|
||||
: 'Roll for influence'}{#if Object.values(upfront).some(Boolean)}<ResourceAmount
|
||||
pile={upfront}
|
||||
compact
|
||||
/>{/if}<ArrowRight size={16} />
|
||||
|
|
@ -132,3 +178,27 @@
|
|||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.influence-source-warning {
|
||||
margin: 0.8rem 0;
|
||||
padding: 0.75rem;
|
||||
border: 1px solid var(--gold, #b79351);
|
||||
border-radius: 6px;
|
||||
}
|
||||
.influence-source-warning p {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
align-items: start;
|
||||
margin: 0 0 0.65rem;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
.influence-source-warning p :global(svg) {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.influence-source-warning button > span {
|
||||
display: inline-flex;
|
||||
gap: 0.4rem;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
import { Landmark, GraduationCap, Check, Trophy } from 'lucide-svelte';
|
||||
import { wonderIcons } from './wonder-icons';
|
||||
import ResourceAmount from './ResourceAmount.svelte';
|
||||
import ResourceText from './ResourceText.svelte';
|
||||
import type { WonderCard } from './types';
|
||||
let { card }: { card: WonderCard } = $props();
|
||||
let Icon = $derived(wonderIcons[card.id] ?? Landmark);
|
||||
|
|
@ -17,7 +18,7 @@
|
|||
<h3>{printedCardName(card.name)}</h3>
|
||||
</div>
|
||||
</div>
|
||||
<p class="wonder-effect">{card.description}</p>
|
||||
<p class="wonder-effect"><ResourceText text={card.description} /></p>
|
||||
<div class="wonder-requirement">
|
||||
<GraduationCap size={16} /><span>Requires <strong>{card.requiredAdvance}</strong></span
|
||||
>{#if card.requiredAdvanceOwned}<Check size={15} aria-label="Researched" />{/if}
|
||||
|
|
|
|||
28
web-client/src/WonderReferenceDialog.svelte
Normal file
28
web-client/src/WonderReferenceDialog.svelte
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<script lang="ts">
|
||||
import { X } from 'lucide-svelte';
|
||||
import { printedCardName } from './card-names';
|
||||
import type { WonderCard as Card } from './types';
|
||||
import WonderCard from './WonderCard.svelte';
|
||||
let { card, onClose }: { card: Card; onClose: () => void } = $props();
|
||||
function show(node: HTMLDialogElement) {
|
||||
node.showModal();
|
||||
}
|
||||
</script>
|
||||
|
||||
<dialog
|
||||
class="field-guide"
|
||||
aria-label={`${printedCardName(card.name)} rules`}
|
||||
use:show
|
||||
onclose={onClose}
|
||||
onclick={(e) => {
|
||||
if (e.target === e.currentTarget) onClose();
|
||||
}}
|
||||
onkeydown={(e) => {
|
||||
if (e.key === 'Escape') onClose();
|
||||
}}
|
||||
>
|
||||
<button class="close-guide icon-button" aria-label="Close card rules" onclick={onClose}
|
||||
><X size={20} /></button
|
||||
>
|
||||
<WonderCard {card} />
|
||||
</dialog>
|
||||
|
|
@ -2322,3 +2322,22 @@ test('city, tile and unit clicks inspect the same city until Move is opened', as
|
|||
app.close();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
test('automatic next movement group selects all its units after a group finishes moving', async () => {
|
||||
const app = paymentController(), c = app.controller;
|
||||
try {
|
||||
const g = JSON.parse(fixture('movement/movement'));
|
||||
g.players[0].advances.push('Tactics');
|
||||
g.players[0].units.push({ id: 8, position: 'B2', unit_type: 'Settler' });
|
||||
g.players[0].next_unit_id = 9;
|
||||
c.setPlayer(0);
|
||||
await c.load(engine.stripSecret(JSON.stringify(g), 0));
|
||||
c.focusUnitPosition('C2');
|
||||
g.state.Movement.moved_units = [0, 1, 2, 3, 5, 6, 7];
|
||||
await c.load(engine.stripSecret(JSON.stringify(g), 0));
|
||||
assert.equal(app.session().unitPosition, 'B2');
|
||||
assert.deepEqual(app.session().selectedUnits, [4, 8]);
|
||||
assert.deepEqual(app.sent, [], 'preselection does not perform a move');
|
||||
} finally { app.close(); }
|
||||
});
|
||||
|
|
|
|||
|
|
@ -581,7 +581,7 @@ export class Controller {
|
|||
);
|
||||
if (view.stopMovement && !get(this.session).moveDestinations.length) {
|
||||
const next = view.units?.find((unit) => this.movementDestinations([unit.id]).length);
|
||||
if (next) this.selectUnits([next.id]);
|
||||
if (next) this.focusUnitPosition(next.position, next.id);
|
||||
}
|
||||
if (quiet) {
|
||||
// Effects of a withdrawn prediction must not linger on the board.
|
||||
|
|
@ -949,7 +949,7 @@ export class Controller {
|
|||
});
|
||||
if (view.stopMovement) {
|
||||
const next = view.units?.find((unit) => this.movementDestinations([unit.id]).length);
|
||||
if (next) this.selectUnits([next.id]);
|
||||
if (next) this.focusUnitPosition(next.position, next.id);
|
||||
}
|
||||
const loaded = get(this.session);
|
||||
if (index !== undefined && loaded.game) this.afterPlaybackLoad({ ...loaded, game: null }, loaded.game);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { createRequire } from 'node:module';
|
|||
import { readFileSync } from 'node:fs';
|
||||
import {
|
||||
activeInfluence,
|
||||
cheaperInfluenceOrigin,
|
||||
influenceKey,
|
||||
influenceMapPick,
|
||||
influencePaymentMatches,
|
||||
|
|
@ -100,7 +101,11 @@ test('influence map clicks choose the exact clicked building and only auto-pick
|
|||
const temple = offers.find((o) => o.name === 'Temple')!;
|
||||
assert.deepEqual(influenceTarget(temple), { kind: 'structure', structure: 'Building:Temple' });
|
||||
assert.equal(influenceMapPick(offers, 'C1', { kind: 'city', structure: 'Building:Temple' }), temple);
|
||||
assert.equal(influenceMapPick(offers, 'C1', { kind: 'city' }), null, 'two buildings: the city opens a list');
|
||||
assert.equal(
|
||||
influenceMapPick(offers, 'C1', { kind: 'city' }),
|
||||
null,
|
||||
'two buildings: the city opens a list',
|
||||
);
|
||||
assert.equal(influenceMapPick(offers, 'C1', { kind: 'city', structure: 'CityCenter' }), null);
|
||||
assert.equal(influenceMapPick(offers, 'A1', { kind: 'city' }), null);
|
||||
const lone = view(influenceFixture()).influence!;
|
||||
|
|
@ -119,3 +124,27 @@ test('influence map clicks choose the exact clicked building and only auto-pick
|
|||
assert.deepEqual(chosen.selected, ['C1', 'A1']);
|
||||
assert.deepEqual(chosen.positions, ['C1', 'A1'], 'the source city is highlighted with the targets');
|
||||
});
|
||||
|
||||
test('influence warns about a cheaper eligible city for the same target', () => {
|
||||
const g = influenceFixture();
|
||||
g.players[0].cities.push({ position: 'B1', mood_state: 'Happy' });
|
||||
const offer = view(g).influence!.find((o) => o.position === 'C1' && o.name === 'Temple')!;
|
||||
const remote = offer.origins!.find((o) => o.position === 'A1')!;
|
||||
const closer = cheaperInfluenceOrigin(offer, remote)!;
|
||||
assert.equal(closer.position, 'B1');
|
||||
assert.ok((closer.payment.culture_tokens ?? 0) < (remote.payment.culture_tokens ?? 0));
|
||||
assert.equal(cheaperInfluenceOrigin(offer, closer), null, 'no warning once the cheaper city is chosen');
|
||||
const switched = move(g, closer.action);
|
||||
const context = view(switched).influenceContext;
|
||||
if (context) assert.equal(context.source, 'B1');
|
||||
assert.equal(
|
||||
cheaperInfluenceOrigin({ ...offer, origins: [remote, { ...closer, settlers: true }] }, remote),
|
||||
null,
|
||||
'do not present settlers as a closer city',
|
||||
);
|
||||
assert.equal(
|
||||
cheaperInfluenceOrigin({ ...offer, origins: [remote, { ...closer, payment: remote.payment }] }, remote),
|
||||
null,
|
||||
'equal range costs need no warning',
|
||||
);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -95,3 +95,22 @@ export function activeInfluence(s: Session) {
|
|||
selected: [position, source].filter((p): p is string => !!p),
|
||||
};
|
||||
}
|
||||
|
||||
/** Recommend only an eligible city for this same target and action variant. */
|
||||
export function cheaperInfluenceOrigin(
|
||||
offer: InfluenceOffer | null,
|
||||
selected: NonNullable<InfluenceOffer['origins']>[number] | null,
|
||||
) {
|
||||
if (!offer) return null;
|
||||
const currentCost = (selected?.payment ?? offer.payment).culture_tokens ?? 0;
|
||||
return (
|
||||
(offer.origins ?? [])
|
||||
.filter(
|
||||
(from) =>
|
||||
!from.settlers &&
|
||||
from.position !== (selected?.position ?? offer.origin) &&
|
||||
(from.payment.culture_tokens ?? 0) < currentCost,
|
||||
)
|
||||
.sort((a, b) => (a.payment.culture_tokens ?? 0) - (b.payment.culture_tokens ?? 0))[0] ?? null
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4746,5 +4746,9 @@
|
|||
"Great Statesman": "Ældre statsmand",
|
||||
"Great Oracle": "Stor seer",
|
||||
"Severe Famine": "Alvorlig hungersnød",
|
||||
"Great Pyramids": "Stor Pyramide"
|
||||
"Great Pyramids": "Stor Pyramide",
|
||||
"Active effects": "Aktive effekter",
|
||||
"Active effects: {p0}": "Aktive effekter: {p0}",
|
||||
"Close active effects": "Luk aktive effekter",
|
||||
"No active effects.": "Ingen aktive effekter."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4746,5 +4746,9 @@
|
|||
"Great Statesman": "Älterer Staatsmann",
|
||||
"Great Oracle": "Großer Seher",
|
||||
"Severe Famine": "Schwere Hungersnot",
|
||||
"Great Pyramids": "Große Pyramide"
|
||||
"Great Pyramids": "Große Pyramide",
|
||||
"Active effects": "Aktive Effekte",
|
||||
"Active effects: {p0}": "Aktive Effekte: {p0}",
|
||||
"Close active effects": "Aktive Effekte schließen",
|
||||
"No active effects.": "Keine aktiven Effekte."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4746,5 +4746,9 @@
|
|||
"Great Statesman": "Πρεσβύτερος Πολιτικός",
|
||||
"Great Oracle": "Μεγάλος Μάντης",
|
||||
"Severe Famine": "Σφοδρός λιμός",
|
||||
"Great Pyramids": "Μεγάλη Πυραμίδα"
|
||||
"Great Pyramids": "Μεγάλη Πυραμίδα",
|
||||
"Active effects": "Ενεργά αποτελέσματα",
|
||||
"Active effects: {p0}": "Ενεργά αποτελέσματα: {p0}",
|
||||
"Close active effects": "Κλείσιμο ενεργών αποτελεσμάτων",
|
||||
"No active effects.": "Δεν υπάρχουν ενεργά αποτελέσματα."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4746,5 +4746,9 @@
|
|||
"Great Statesman": "Great Statesman",
|
||||
"Great Oracle": "Great Oracle",
|
||||
"Severe Famine": "Severe Famine",
|
||||
"Great Pyramids": "Great Pyramids"
|
||||
"Great Pyramids": "Great Pyramids",
|
||||
"Active effects": "Active effects",
|
||||
"Active effects: {p0}": "Active effects: {p0}",
|
||||
"Close active effects": "Close active effects",
|
||||
"No active effects.": "No active effects."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4746,5 +4746,9 @@
|
|||
"Great Statesman": "سیاستمدار کهنهکار",
|
||||
"Great Oracle": "پیشگوی بزرگ",
|
||||
"Severe Famine": "قحطی شدید",
|
||||
"Great Pyramids": "هرم بزرگ"
|
||||
"Great Pyramids": "هرم بزرگ",
|
||||
"Active effects": "اثرات فعال",
|
||||
"Active effects: {p0}": "اثرات فعال: {p0}",
|
||||
"Close active effects": "بستن اثرات فعال",
|
||||
"No active effects.": "هیچ اثر فعالی وجود ندارد."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4746,5 +4746,9 @@
|
|||
"Great Statesman": "Homme d'État âgé",
|
||||
"Great Oracle": "Grand Voyant",
|
||||
"Severe Famine": "Famine sévère",
|
||||
"Great Pyramids": "Grande Pyramide"
|
||||
"Great Pyramids": "Grande Pyramide",
|
||||
"Active effects": "Effets actifs",
|
||||
"Active effects: {p0}": "Effets actifs: {p0}",
|
||||
"Close active effects": "Fermer les effets actifs",
|
||||
"No active effects.": "Aucun effet actif."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4746,5 +4746,9 @@
|
|||
"Great Statesman": "वरिष्ठ राजनेता",
|
||||
"Great Oracle": "महान द्रष्टा",
|
||||
"Severe Famine": "भीषण अकाल",
|
||||
"Great Pyramids": "महान पिरामिड"
|
||||
"Great Pyramids": "महान पिरामिड",
|
||||
"Active effects": "सक्रिय प्रभाव",
|
||||
"Active effects: {p0}": "सक्रिय प्रभाव: {p0}",
|
||||
"Close active effects": "सक्रिय प्रभाव बंद करें",
|
||||
"No active effects.": "कोई सक्रिय प्रभाव नहीं।"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4746,5 +4746,9 @@
|
|||
"Great Statesman": "Anziano Statista",
|
||||
"Great Oracle": "Grande Veggente",
|
||||
"Severe Famine": "Carestia grave",
|
||||
"Great Pyramids": "Grande Piramide"
|
||||
"Great Pyramids": "Grande Piramide",
|
||||
"Active effects": "Effetti attivi",
|
||||
"Active effects: {p0}": "Effetti attivi: {p0}",
|
||||
"Close active effects": "Chiudi effetti attivi",
|
||||
"No active effects.": "Nessun effetto attivo."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4746,5 +4746,9 @@
|
|||
"Great Statesman": "원로 정치가",
|
||||
"Great Oracle": "위대한 선견자",
|
||||
"Severe Famine": "극심한 기근",
|
||||
"Great Pyramids": "대피라미드"
|
||||
"Great Pyramids": "대피라미드",
|
||||
"Active effects": "활성 효과",
|
||||
"Active effects: {p0}": "활성 효과: {p0}",
|
||||
"Close active effects": "활성 효과 닫기",
|
||||
"No active effects.": "활성 효과가 없습니다."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4746,5 +4746,9 @@
|
|||
"Great Statesman": "Oudere Staatsman",
|
||||
"Great Oracle": "Groot Ziener",
|
||||
"Severe Famine": "Ernstige hongersnood",
|
||||
"Great Pyramids": "Grote Piramide"
|
||||
"Great Pyramids": "Grote Piramide",
|
||||
"Active effects": "Actieve effecten",
|
||||
"Active effects: {p0}": "Actieve effecten: {p0}",
|
||||
"Close active effects": "Actieve effecten sluiten",
|
||||
"No active effects.": "Geen actieve effecten."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4746,5 +4746,9 @@
|
|||
"Great Statesman": "Starszy mąż stanu",
|
||||
"Great Oracle": "Wielki Jasnowidz",
|
||||
"Severe Famine": "Dotkliwy głód",
|
||||
"Great Pyramids": "Wielka Piramida"
|
||||
"Great Pyramids": "Wielka Piramida",
|
||||
"Active effects": "Aktywne efekty",
|
||||
"Active effects: {p0}": "Aktywne efekty: {p0}",
|
||||
"Close active effects": "Zamknij aktywne efekty",
|
||||
"No active effects.": "Brak aktywnych efektów."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4746,5 +4746,9 @@
|
|||
"Great Statesman": "Estadista Ancião",
|
||||
"Great Oracle": "Grande Vidente",
|
||||
"Severe Famine": "Fome severa",
|
||||
"Great Pyramids": "Grande Pirâmide"
|
||||
"Great Pyramids": "Grande Pirâmide",
|
||||
"Active effects": "Efeitos ativos",
|
||||
"Active effects: {p0}": "Efeitos ativos: {p0}",
|
||||
"Close active effects": "Fechar efeitos ativos",
|
||||
"No active effects.": "Nenhum efeito ativo."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4746,5 +4746,9 @@
|
|||
"Great Statesman": "Om de Stat Venerabil",
|
||||
"Great Oracle": "Mare Vizionar",
|
||||
"Severe Famine": "Foamete severă",
|
||||
"Great Pyramids": "Marea Piramidă"
|
||||
"Great Pyramids": "Marea Piramidă",
|
||||
"Active effects": "Efecte active",
|
||||
"Active effects: {p0}": "Efecte active: {p0}",
|
||||
"Close active effects": "Închide efectele active",
|
||||
"No active effects.": "Nu există efecte active."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4746,5 +4746,9 @@
|
|||
"Great Statesman": "Старейшина",
|
||||
"Great Oracle": "Великий провидец",
|
||||
"Severe Famine": "Сильный голод",
|
||||
"Great Pyramids": "Великая пирамида"
|
||||
"Great Pyramids": "Великая пирамида",
|
||||
"Active effects": "Активные эффекты",
|
||||
"Active effects: {p0}": "Активные эффекты: {p0}",
|
||||
"Close active effects": "Закрыть активные эффекты",
|
||||
"No active effects.": "Нет активных эффектов."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4746,5 +4746,9 @@
|
|||
"Great Statesman": "Chính khách Lão luyện",
|
||||
"Great Oracle": "Nhà tiên kiến vĩ đại",
|
||||
"Severe Famine": "Nạn đói nghiêm trọng",
|
||||
"Great Pyramids": "Đại Kim tự tháp"
|
||||
"Great Pyramids": "Đại Kim tự tháp",
|
||||
"Active effects": "Hiệu ứng đang hoạt động",
|
||||
"Active effects: {p0}": "Hiệu ứng đang hoạt động: {p0}",
|
||||
"Close active effects": "Đóng hiệu ứng đang hoạt động",
|
||||
"No active effects.": "Không có hiệu ứng đang hoạt động."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4746,5 +4746,9 @@
|
|||
"Great Statesman": "資深政治家",
|
||||
"Great Oracle": "大預言家",
|
||||
"Severe Famine": "嚴重饑荒",
|
||||
"Great Pyramids": "大金字塔"
|
||||
"Great Pyramids": "大金字塔",
|
||||
"Active effects": "生效中的效果",
|
||||
"Active effects: {p0}": "生效中的效果: {p0}",
|
||||
"Close active effects": "關閉生效中的效果",
|
||||
"No active effects.": "目前沒有生效中的效果。"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -259,7 +259,14 @@ export interface InfluenceContext {
|
|||
rollBonus: number;
|
||||
threshold: number;
|
||||
}
|
||||
export interface ActiveEffect {
|
||||
name: string;
|
||||
scope: string;
|
||||
players: number[];
|
||||
rules: string[];
|
||||
}
|
||||
export interface View {
|
||||
activeEffects?: ActiveEffect[];
|
||||
cardCatalog?: Pick<ActionCard, 'id' | 'name' | 'description' | 'free' | 'tactics'>[];
|
||||
influenceContext?: InfluenceContext | null;
|
||||
waitingFor?: { player: number; action: string; source: string | null } | null;
|
||||
|
|
@ -333,7 +340,7 @@ export interface View {
|
|||
choiceDecision?: {
|
||||
name: string;
|
||||
binary?: boolean;
|
||||
preview?: { name: string; rules: string[]; affected?: string } | null;
|
||||
preview?: { name: string; rules: string[]; affected?: string; wonder?: WonderCard } | null;
|
||||
choices: { name: string; description?: string | null; pile?: Pile; action: Move }[];
|
||||
} | null;
|
||||
advances: AdvanceView[];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue