Show projected net worth and public-game scores

This commit is contained in:
coyotte508 2026-10-24 22:57:43 +02:00
commit 95b5c9ba86
28 changed files with 512 additions and 12 deletions

View file

@ -1,10 +1,16 @@
# Acquire private beta — 24 October 2026
Private BGS registration: `acquire`, version `1`. Engine `0.0.2`, viewer `0.0.15`.
Private BGS registration: `acquire`, version `1`. Engine `0.0.3`, viewer `0.0.16`.
Source: <https://github.com/boardgamers/mergers-game>. Keep `public: false`.
## Validation
- Public-holdings games show projected net worth and an expandable cash/share/bonus breakdown.
BGS scores use the same valuation, combining teammates or taking the richest four-hands seat.
Future bank-mode bonuses are excluded. Checks cover ties/rounding, inactive shares, partial
mergers without duplicate bonuses, final settlement, privacy and independence from hidden draws.
Partial replay entries omit the forecast. All 17 languages are checked on desktop and phones.
- Safe chains have a contrasting double perimeter, with interior tile seams left unchanged.
The chain table's safe label uses the same double border. Checks cover the 11-tile threshold,
irregular shapes and holes, board edges, placement/undo, both themes and narrow screens.
@ -33,7 +39,7 @@ Source: <https://github.com/boardgamers/mergers-game>. Keep `public: false`.
requests, hidden-information masking, replay, bank mode, four-hands, teams and dropped players.
Desktop/phone checks exercise repeated undo, saved-state refreshes, final history and clock totals.
- `pnpm check`: formatting, lint, TypeScript/Svelte checks, 207 engine tests,
- `pnpm check`: formatting, lint, TypeScript/Svelte checks, 214 engine tests,
66 viewer/tutorial tests, and the production build. Two pre-existing lint warnings
remain (an unused test import and Svelte's `bind:this` assignment).
- Protocol diagnostics: all eight required engine methods; full core/chat/replay

View file

@ -9,6 +9,7 @@ export * from "./src/legal.js";
export * from "./src/bonuses.js";
export * from "./src/merger.js";
export * from "./src/scoring.js";
export * from "./src/net-worth.js";
export * from "./src/bank.js";
export * from "./src/options.js";
export * from "./src/autoplay.js";

View file

@ -1,6 +1,6 @@
{
"name": "acquire-engine",
"version": "0.0.2",
"version": "0.0.3",
"description": "Acquire rules engine for boardgamers.space",
"license": "AGPL-3.0-only",
"files": [

View file

@ -173,7 +173,7 @@ test("§13 scores are 0 during play while holdings are private, then the final c
assert.deepEqual(wrapper.scores(state), [4000, 7000]);
});
test("§13 scores are live cash while holdings are public", () => {
test("§13 public net worth equals live cash when no shares are held", () => {
const state = scenario({
seats: 2,
board: SAFE_TOWER,

View file

@ -0,0 +1,156 @@
import assert from "node:assert/strict";
import { test } from "node:test";
import * as wrapper from "../wrapper.js";
import { applyMove } from "./moves.js";
import { projectedNetWorth } from "./net-worth.js";
import { endGame } from "./scoring.js";
import { chainAt, row, scenario } from "./test/helpers.js";
const publicHoldings = { publicHoldings: true };
const total = (state: Parameters<typeof projectedNetWorth>[0]) => projectedNetWorth(state)!.map((seat) => seat.total);
test("public net worth includes cash, active shares and bonuses and matches actual final settlement", () => {
const state = scenario({
board: chainAt("tower", row("A", 1, 11)),
hands: [["12I"], ["11I"], ["10I"]],
shares: [{ tower: 4, festival: 6 }, { tower: 2 }, { tower: 1 }],
options: publicHoldings,
});
const before = structuredClone(state);
assert.deepEqual(projectedNetWorth(state), [
{ cash: 6000, stock: 2800, bonuses: 7000, total: 15800 },
{ cash: 6000, stock: 1400, bonuses: 3500, total: 10900 },
{ cash: 6000, stock: 700, bonuses: 0, total: 6700 },
]);
assert.deepEqual(wrapper.scores(state), [15800, 10900, 6700]);
assert.deepEqual(projectedNetWorth(wrapper.stripSecret(state)), projectedNetWorth(state));
assert.deepEqual(state, before, "valuation does not change cash, RNG, log, or any saved state");
endGame(state, "announced");
assert.deepEqual(wrapper.scores(state), [15800, 10900, 6700]);
assert.ok(projectedNetWorth(state)!.every((seat) => seat.stock === 0 && seat.bonuses === 0));
});
test("projected shareholder bonuses preserve majority/minority ties, rounding and sole holders", () => {
for (const [holdings, bonuses] of [
[
[3, 3, 3],
[1500, 1500, 1500],
],
[
[3, 1, 1],
[3000, 800, 800],
],
[
[3, 0, 0],
[4500, 0, 0],
],
] as const) {
const state = scenario({
board: chainAt("tower", row("A", 1, 3)),
hands: [["12I"], ["11I"], ["10I"]],
shares: holdings.map((tower) => ({ tower })),
options: publicHoldings,
});
assert.deepEqual(
projectedNetWorth(state)!.map((seat) => seat.bonuses),
bonuses
);
const expected = total(state);
endGame(state, "announced");
assert.deepEqual(
state.seats.map((seat) => seat.cash),
expected
);
}
});
test("private or masked holdings cannot reveal net worth through helpers or public BGS scores", () => {
const state = scenario({ shares: [{ tower: 5 }], hands: [["12I"], ["11I"], ["10I"]] });
assert.equal(projectedNetWorth(state), undefined);
assert.equal(projectedNetWorth(wrapper.stripSecret(state, 0)), undefined);
assert.deepEqual(wrapper.scores(state), [0, 0, 0]);
const masked = wrapper.stripSecret(state, 0);
masked.options.publicHoldings = true;
assert.equal(projectedNetWorth(masked), undefined);
assert.deepEqual(wrapper.scores(masked), [0, 0, 0]);
state.options.publicHoldings = true;
assert.deepEqual(total(state), [6000, 6000, 6000], "inactive shares have no liquidation value");
});
test("bank-mode forecasts omit uncertain bonuses and are independent of secret hands and draws", () => {
const state = scenario({
seats: 2,
board: chainAt("tower", ["1A", "2A"]),
hands: [["12I"], ["11I"]],
shares: [{ tower: 7 }, { tower: 3 }],
options: publicHoldings,
});
assert.deepEqual(total(state), [7400, 6600]);
assert.ok(projectedNetWorth(state)!.every((seat) => seat.bonuses === 0));
const masked = wrapper.stripSecret(state);
assert.deepEqual(wrapper.scores(masked), wrapper.scores(state));
state.pool.reverse();
state.seed = "different secret";
assert.deepEqual(wrapper.scores(state), [7400, 6600]);
});
test("merger estimates avoid double-paid bonuses and stop valuing kept defunct shares after disposal", () => {
const state = scenario({
board: { ...chainAt("tower", ["1A", "2A", "3A"]), ...chainAt("luxor", ["5A", "6A"]) },
hands: [["4A"], ["11I"], ["10I"]],
shares: [{ tower: 2, luxor: 3 }, { tower: 1, luxor: 2 }, { luxor: 1 }],
options: publicHoldings,
});
applyMove(state, { type: "place", tile: "4A" }, 0);
assert.deepEqual(projectedNetWorth(state), [
{ cash: 8000, stock: 1800, bonuses: 6000, total: 15800 },
{ cash: 7000, stock: 1000, bonuses: 3000, total: 11000 },
{ cash: 6000, stock: 200, bonuses: 0, total: 6200 },
]);
applyMove(state, { type: "dispose", sell: 0, trade: 0 }, 0);
assert.deepEqual(total(state), [15200, 11000, 6200]);
applyMove(state, { type: "dispose", sell: 2, trade: 0 }, 1);
assert.deepEqual(total(state), [15200, 11000, 6200]);
applyMove(state, { type: "dispose", sell: 0, trade: 0 }, 2);
assert.equal(state.merger, null);
assert.deepEqual(total(state), [15200, 11000, 6000]);
});
test("multi-chain estimates include outstanding bonuses once through order selection and each disposal", () => {
const state = scenario({
board: {
...chainAt("tower", ["1D", "2D", "3D", "3C"]),
...chainAt("luxor", ["4B", "4C"]),
...chainAt("festival", ["4E", "4F"]),
},
hands: [["4D"], ["11I"], ["10I"]],
shares: [{ tower: 1, luxor: 1, festival: 1 }],
options: publicHoldings,
});
applyMove(state, { type: "place", tile: "4D" }, 0);
assert.equal(state.phase, "defunctOrder");
const estimate = total(state);
applyMove(state, { type: "defunctOrder", chains: ["luxor", "festival"] }, 0);
assert.deepEqual(total(state), estimate);
applyMove(state, { type: "dispose", sell: 1, trade: 0 }, 0);
assert.deepEqual(total(state), estimate);
applyMove(state, { type: "dispose", sell: 1, trade: 0 }, 0);
assert.equal(state.merger, null);
assert.deepEqual(total(state), estimate);
});
test("public BGS forecasts use the team's combined value or the richest seat in four-hands", () => {
const teams = scenario({
seats: 4,
hands: [["12I"], ["11I"], ["10I"], ["9I"]],
cash: [5000, 4000, 2000, 7000],
options: { ...publicHoldings, teamPlay: true },
});
assert.deepEqual(wrapper.scores(teams), [7000, 11000, 7000, 11000]);
const four = scenario({
hands: [["12I"], ["11I"], ["10I"], ["9I"]],
cash: [9000, 8000, 1000, 8500],
options: { ...publicHoldings, twoPlayerMode: "fourHands" },
});
assert.deepEqual(wrapper.scores(four), [9000, 8500]);
});

View file

@ -0,0 +1,59 @@
import { isBankMode } from "./bank.js";
import { activeChains, chainSize, connectedLoose } from "./board.js";
import { computeBonuses } from "./bonuses.js";
import { majorityBonus, minorityBonus, sharePrice } from "./prices.js";
import type { GameState } from "./types.js";
export interface NetWorth {
cash: number;
stock: number;
bonuses: number;
total: number;
}
/** Public liquidation estimate, without inspecting hands, future draws or random state. */
export function projectedNetWorth(state: GameState): NetWorth[] | undefined {
if (!state.ended && !state.options.publicHoldings) {
return undefined;
}
if (state.seats.some((seat) => seat.cash < 0 || Object.values(seat.shares).some((count) => count < 0))) {
return undefined;
}
const worth = state.seats.map((seat) => ({ cash: seat.cash, stock: 0, bonuses: 0, total: seat.cash }));
if (state.ended) {
return worth; // Final sales and bonuses are already in cash.
}
const m = state.merger;
for (const chain of activeChains(state.board)) {
let size = chainSize(state.board, chain);
let bonusPending = true;
let sellers: number[] | undefined;
if (m?.survivor && m.sizes[chain] !== undefined) {
if (chain === m.survivor) {
size =
Object.values(m.sizes).reduce((sum, count) => sum + count, 0) + connectedLoose(state.board, m.tile).length;
} else if (m.current === chain) {
// This bonus has already been paid. Only players still disposing may sell these shares.
bonusPending = false;
sellers = m.disposers;
} else if (m.current !== null && !m.defunct.includes(chain)) {
continue; // Resolved, absorbed chain: retained shares are now inactive.
}
}
const price = sharePrice(chain, size);
const bonuses =
bonusPending && !isBankMode(state)
? computeBonuses(
state.seats.map((seat) => seat.shares[chain]),
majorityBonus(chain, size),
minorityBonus(chain, size)
)
: state.seats.map(() => 0);
for (const [seat, value] of worth.entries()) {
value.stock += sellers === undefined || sellers.includes(seat) ? state.seats[seat]!.shares[chain] * price : 0;
value.bonuses += bonuses[seat]!;
value.total = value.cash + value.stock + value.bonuses;
}
}
return worth;
}

View file

@ -1,5 +1,6 @@
import { activeChains, chainSize, endConditionHolds } from "./board.js";
import { payBonuses } from "./merger.js";
import { projectedNetWorth } from "./net-worth.js";
import { sharePrice } from "./prices.js";
import type { GameState } from "./types.js";
@ -46,9 +47,12 @@ export function endGame(state: GameState, reason: EndReason): void {
* What each real player is ranked by: their cash; with teamPlay at the end, their team's
* combined cash (seats 1+3 and 2+4); in fourHands, the single richest seat they control.
*/
function playerValues(state: GameState): number[] {
const cash = state.seats.map((seat) => seat.cash);
if (state.options.teamPlay && state.ended) {
function playerValues(
state: GameState,
cash = state.seats.map((seat) => seat.cash),
combineTeams = state.ended
): number[] {
if (state.options.teamPlay && combineTeams) {
return cash.map((_, seat) => cash[seat % 2]! + cash[(seat % 2) + 2]!);
}
return Array.from({ length: state.players }, (_, player) =>
@ -82,5 +86,15 @@ export function playerScores(state: GameState): number[] {
if (!state.ended && !state.options.publicHoldings) {
return Array.from({ length: state.players }, () => 0);
}
if (!state.ended) {
const worth = projectedNetWorth(state);
return worth
? playerValues(
state,
worth.map((seat) => seat.total),
true
)
: Array(state.players).fill(0);
}
return playerValues(state);
}

View file

@ -1,6 +1,6 @@
{
"name": "acquire-viewer",
"version": "0.0.15",
"version": "0.0.16",
"private": true,
"description": "Browser viewer for Acquire on boardgamers.space",
"license": "AGPL-3.0-only",

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { CHAIN_IDS, HIDDEN, currentSeat, type GameState } from "acquire-engine";
import { CHAIN_IDS, HIDDEN, currentSeat, isBankMode, projectedNetWorth, type GameState } from "acquire-engine";
import ChainMark from "./ChainMark.svelte";
import PlayerName from "./PlayerName.svelte";
import { useStore } from "./store.svelte";
@ -9,6 +9,8 @@
const acting = $derived(currentSeat(state));
const store = useStore();
const t = $derived(store.lang.t);
// Partial replay log entries are not complete decision states (bonuses/sales may be mid-update).
const worth = $derived(store.replayAt === undefined ? projectedNetWorth(state) : undefined);
</script>
<section aria-label={t("players.label")}>
@ -18,7 +20,9 @@
<thead>
<tr>
<th>{t("players.player")}</th>
<th class="num">{t("players.cash")}</th>
<th class="num"
>{#if worth}{t("players.netWorth")}<small>{t("players.cash")}</small>{:else}{t("players.cash")}{/if}</th
>
<th>{t("players.stock")}</th>
<th class="num">{t("players.tiles")}</th>
</tr>
@ -37,7 +41,14 @@
>{/if}
{#if seat.dropped}<span class="tag">{t("players.left")}</span>{/if}
</td>
<td class="num" class:hidden-value={hidden}>{store.lang.money(seat.cash)}</td>
{#if worth}
<td class="num net-worth"
><strong><bdi dir="ltr">{state.ended ? "" : "≈ "}{store.lang.money(worth[index]!.total)}</bdi></strong
><small>{store.lang.money(seat.cash)}</small></td
>
{:else}
<td class="num" class:hidden-value={hidden}>{store.lang.money(seat.cash)}</td>
{/if}
<td>
{#if hidden}
<span class="hidden-value">{t("hidden")}</span>
@ -57,9 +68,58 @@
</tbody>
</table>
</div>
{#if worth && !state.ended}
<details class="worth-details">
<summary>{t("players.worthBreakdown")}</summary>
<p>{t(isBankMode(state) ? "players.worthBank" : "players.worthNote")}</p>
{#if state.options.teamPlay}<p>{t("players.worthTeams")}</p>{/if}
{#if state.players !== state.seats.length}<p>{t("players.worthFourHands")}</p>{/if}
<div class="table-scroll">
<table>
<thead
><tr
><th>{t("players.player")}</th><th class="num">{t("players.cash")}</th><th class="num"
>{t("players.stock")}</th
><th class="num">{t("players.bonuses")}</th></tr
></thead
>
<tbody>
{#each worth as value, index (index)}
<tr
><td><PlayerName {state} seat={index} /></td><td class="num">{store.lang.money(value.cash)}</td><td
class="num">{store.lang.money(value.stock)}</td
><td class="num">{isBankMode(state) ? "—" : store.lang.money(value.bonuses)}</td></tr
>
{/each}
</tbody>
</table>
</div>
</details>
{/if}
</section>
<style>
.net-worth {
white-space: nowrap;
}
.net-worth small,
th small {
display: block;
font-size: 12px;
font-weight: 400;
color: var(--ink-muted);
}
.worth-details {
margin-top: 8px;
font-size: 13px;
}
.worth-details summary {
cursor: pointer;
color: var(--ink-muted);
}
.worth-details p {
margin: 8px 0;
}
.you td {
font-weight: 600;
}

View file

@ -98,6 +98,15 @@ export const da: Catalog = {
"players.title": "Spillere",
"players.player": "Spiller",
"players.cash": "Penge",
"players.netWorth": "Formue",
"players.worthBreakdown": "Formueoversigt",
"players.bonuses": "Bonusser",
"players.worthNote":
"Kontanter + aktieværdi + forventede majoritets-/minoritetsbonusser. Skønnet ændrer sig med aktiebeholdninger og fusionsvalg.",
"players.worthBank":
"Kontanter + aktieværdi. Fremtidige bonusser er udeladt: bankens beholdning kendes først ved udbetaling.",
"players.worthTeams": "BGS-point lægger begge holdkammerater sammen.",
"players.worthFourHands": "BGS-point bruger din rigeste plads.",
"players.stock": "Aktier",
"players.tiles": "Brikker",
"players.acting": "handler nu",

View file

@ -98,6 +98,15 @@ export const de: Catalog = {
"players.title": "Spieler",
"players.player": "Spieler",
"players.cash": "Geld",
"players.netWorth": "Vermögen",
"players.worthBreakdown": "Vermögensübersicht",
"players.bonuses": "Boni",
"players.worthNote":
"Bargeld + Aktienwert + voraussichtliche Mehrheits-/Minderheitsboni. Die Schätzung ändert sich mit Aktienbesitz und Fusionsentscheidungen.",
"players.worthBank":
"Bargeld + Aktienwert. Künftige Boni sind ausgeschlossen: Der Aktienbesitz der Bank ist erst bei der Auszahlung bekannt.",
"players.worthTeams": "BGS-Punkte addieren beide Teammitglieder.",
"players.worthFourHands": "BGS-Punkte richten sich nach deinem reichsten Sitz.",
"players.stock": "Aktien",
"players.tiles": "Plättchen",
"players.acting": "ist am Zug",

View file

@ -98,6 +98,15 @@ export const el: Catalog = {
"players.title": "Παίκτες",
"players.player": "Παίκτης",
"players.cash": "Μετρητά",
"players.netWorth": "Περιουσία",
"players.worthBreakdown": "Ανάλυση περιουσίας",
"players.bonuses": "Μπόνους",
"players.worthNote":
"Μετρητά + αξία μετοχών + εκτιμώμενα μπόνους πλειοψηφίας/μειοψηφίας. Η εκτίμηση αλλάζει με τις μετοχές και τις επιλογές συγχώνευσης.",
"players.worthBank":
"Μετρητά + αξία μετοχών. Χωρίς μελλοντικά μπόνους: οι μετοχές της τράπεζας αποκαλύπτονται κατά την πληρωμή.",
"players.worthTeams": "Τα σκορ BGS αθροίζουν τους δύο συμπαίκτες.",
"players.worthFourHands": "Τα σκορ BGS βασίζονται στην πλουσιότερη θέση σου.",
"players.stock": "Μετοχές",
"players.tiles": "Πλακίδια",
"players.acting": "παίζει τώρα",

View file

@ -109,6 +109,14 @@ export const en = {
"players.title": "Players",
"players.player": "Player",
"players.cash": "Cash",
"players.netWorth": "Net worth",
"players.worthBreakdown": "Net worth breakdown",
"players.bonuses": "Bonuses",
"players.worthNote":
"Cash + share value + projected majority/minority bonuses. This estimate changes with holdings and merger choices.",
"players.worthBank": "Cash + share value. Future bonuses excluded: the bank’s holding is unknown until payout.",
"players.worthTeams": "BGS scores combine both teammates.",
"players.worthFourHands": "BGS scores use your richest seat.",
"players.stock": "Stock",
"players.tiles": "Tiles",
"players.acting": "acting now",

View file

@ -98,6 +98,14 @@ export const fa: Catalog = {
"players.title": "بازیکنان",
"players.player": "بازیکن",
"players.cash": "پول",
"players.netWorth": "دارایی خالص",
"players.worthBreakdown": "جزئیات دارایی",
"players.bonuses": "پاداش‌ها",
"players.worthNote":
"پول نقد + ارزش سهام + پاداش‌های تخمینی اکثریت/اقلیت. این برآورد با تغییر سهام و انتخاب‌های ادغام تغییر می‌کند.",
"players.worthBank": "پول نقد + ارزش سهام. پاداش‌های آینده محاسبه نمی‌شوند؛ تعداد سهام بانک تا زمان پرداخت مشخص نیست.",
"players.worthTeams": "امتیاز BGS مجموع دارایی دو هم‌تیمی است.",
"players.worthFourHands": "امتیاز BGS بر اساس ثروتمندترین جایگاه شماست.",
"players.stock": "سهام",
"players.tiles": "کاشی‌ها",
"players.acting": "در حال تصمیم",

View file

@ -102,6 +102,15 @@ export const fr: Catalog = {
"players.title": "Joueurs",
"players.player": "Joueur",
"players.cash": "Argent",
"players.netWorth": "Patrimoine",
"players.worthBreakdown": "Détail du patrimoine",
"players.bonuses": "Primes",
"players.worthNote":
"Argent + valeur des actions + primes de majorité/minorité estimées. Cette estimation varie selon les participations et les choix de fusion.",
"players.worthBank":
"Argent + valeur des actions. Primes futures exclues : la participation de la banque est inconnue avant le versement.",
"players.worthTeams": "Les scores BGS cumulent les deux coéquipiers.",
"players.worthFourHands": "Les scores BGS retiennent votre siège le plus riche.",
"players.stock": "Actions",
"players.tiles": "Tuiles",
"players.acting": "doit jouer",

View file

@ -97,6 +97,13 @@ export const hi: Catalog = {
"players.title": "खिलाड़ी",
"players.player": "खिलाड़ी",
"players.cash": "नकदी",
"players.netWorth": "कुल संपत्ति",
"players.worthBreakdown": "संपत्ति का विवरण",
"players.bonuses": "बोनस",
"players.worthNote": "नकद + शेयरों का मूल्य + अनुमानित बहुमत/अल्पमत बोनस। यह अनुमान शेयरों और विलय के विकल्पों के साथ बदलता है।",
"players.worthBank": "नकद + शेयरों का मूल्य। भविष्य के बोनस शामिल नहीं हैं: भुगतान तक बैंक के शेयरों की संख्या अज्ञात रहती है।",
"players.worthTeams": "BGS स्कोर दोनों साथियों की संपत्ति जोड़ता है।",
"players.worthFourHands": "BGS स्कोर आपकी सबसे धनी सीट पर आधारित है।",
"players.stock": "शेयर",
"players.tiles": "टाइलें",
"players.acting": "अभी चल रहे हैं",

View file

@ -103,6 +103,15 @@ export const it: Catalog = {
"players.title": "Giocatori",
"players.player": "Giocatore",
"players.cash": "Denaro",
"players.netWorth": "Patrimonio",
"players.worthBreakdown": "Dettaglio del patrimonio",
"players.bonuses": "Bonus",
"players.worthNote":
"Contanti + valore delle azioni + bonus di maggioranza/minoranza stimati. La stima varia con le partecipazioni e le scelte nelle fusioni.",
"players.worthBank":
"Contanti + valore delle azioni. Bonus futuri esclusi: la quota della banca è sconosciuta fino al pagamento.",
"players.worthTeams": "I punteggi BGS sommano entrambi i compagni di squadra.",
"players.worthFourHands": "I punteggi BGS usano il tuo posto più ricco.",
"players.stock": "Azioni",
"players.tiles": "Tessere",
"players.acting": "sta decidendo",

View file

@ -98,6 +98,14 @@ export const ko: Catalog = {
"players.title": "플레이어",
"players.player": "플레이어",
"players.cash": "현금",
"players.netWorth": "순자산",
"players.worthBreakdown": "순자산 내역",
"players.bonuses": "보너스",
"players.worthNote":
"현금 + 주식 가치 + 예상 대주주/소주주 보너스입니다. 보유 주식과 합병 선택에 따라 추정치가 달라집니다.",
"players.worthBank": "현금 + 주식 가치입니다. 은행의 보유량은 지급 시에만 알 수 있으므로 향후 보너스는 제외합니다.",
"players.worthTeams": "BGS 점수는 두 팀원의 자산을 합산합니다.",
"players.worthFourHands": "BGS 점수는 내 좌석 중 가장 부유한 좌석을 기준으로 합니다.",
"players.stock": "주식",
"players.tiles": "타일",
"players.acting": "결정 중",

View file

@ -98,6 +98,15 @@ export const nl: Catalog = {
"players.title": "Spelers",
"players.player": "Speler",
"players.cash": "Geld",
"players.netWorth": "Vermogen",
"players.worthBreakdown": "Vermogensoverzicht",
"players.bonuses": "Bonussen",
"players.worthNote":
"Contant geld + aandelenwaarde + verwachte meerderheids-/minderheidsbonussen. De schatting verandert met aandelenbezit en fusiekeuzes.",
"players.worthBank":
"Contant geld + aandelenwaarde. Toekomstige bonussen tellen niet mee: het bankbezit is pas bij uitbetaling bekend.",
"players.worthTeams": "BGS-scores tellen beide teamgenoten bij elkaar op.",
"players.worthFourHands": "BGS-scores gebruiken je rijkste zitplaats.",
"players.stock": "Aandelen",
"players.tiles": "Tegels",
"players.acting": "is aan zet",

View file

@ -103,6 +103,14 @@ export const pl: Catalog = {
"players.title": "Gracze",
"players.player": "Gracz",
"players.cash": "Gotówka",
"players.netWorth": "Majątek",
"players.worthBreakdown": "Składniki majątku",
"players.bonuses": "Premie",
"players.worthNote":
"Gotówka + wartość akcji + przewidywane premie większościowe i mniejszościowe. Szacunek zmienia się wraz z akcjami i decyzjami podczas fuzji.",
"players.worthBank": "Gotówka + wartość akcji. Bez przyszłych premii: udziały banku są nieznane do wypłaty.",
"players.worthTeams": "Wyniki BGS sumują majątek obu członków drużyny.",
"players.worthFourHands": "Wyniki BGS uwzględniają twój najbogatszy fotel.",
"players.stock": "Akcje",
"players.tiles": "Płytki",
"players.acting": "teraz działa",

View file

@ -102,6 +102,15 @@ export const ptBR: Catalog = {
"players.title": "Jogadores",
"players.player": "Jogador",
"players.cash": "Dinheiro",
"players.netWorth": "Patrimônio",
"players.worthBreakdown": "Detalhes do patrimônio",
"players.bonuses": "Bônus",
"players.worthNote":
"Dinheiro + valor das ações + bônus estimados de maioria/minoria. A estimativa muda com as participações e decisões nas fusões.",
"players.worthBank":
"Dinheiro + valor das ações. Sem bônus futuros: a participação do banco só é conhecida no pagamento.",
"players.worthTeams": "As pontuações BGS somam os dois colegas de equipe.",
"players.worthFourHands": "As pontuações BGS usam seu assento mais rico.",
"players.stock": "Ações",
"players.tiles": "Peças",
"players.acting": "jogando agora",

View file

@ -102,6 +102,15 @@ export const ro: Catalog = {
"players.title": "Jucători",
"players.player": "Jucător",
"players.cash": "Bani",
"players.netWorth": "Avere",
"players.worthBreakdown": "Detaliile averii",
"players.bonuses": "Bonusuri",
"players.worthNote":
"Numerar + valoarea acțiunilor + bonusuri estimate de majoritate/minoritate. Estimarea variază cu deținerile și alegerile la fuziune.",
"players.worthBank":
"Numerar + valoarea acțiunilor. Fără bonusuri viitoare: deținerea băncii este necunoscută până la plată.",
"players.worthTeams": "Scorurile BGS însumează ambii coechipieri.",
"players.worthFourHands": "Scorurile BGS folosesc cel mai bogat loc al tău.",
"players.stock": "Acțiuni",
"players.tiles": "Piese",
"players.acting": "acționează acum",

View file

@ -103,6 +103,14 @@ export const ru: Catalog = {
"players.title": "Игроки",
"players.player": "Игрок",
"players.cash": "Деньги",
"players.netWorth": "Капитал",
"players.worthBreakdown": "Состав капитала",
"players.bonuses": "Бонусы",
"players.worthNote":
"Наличные + стоимость акций + ожидаемые бонусы большинства/меньшинства. Оценка меняется с пакетами акций и решениями при слиянии.",
"players.worthBank": "Наличные + стоимость акций. Будущие бонусы исключены: пакет банка неизвестен до выплаты.",
"players.worthTeams": "Очки BGS складывают капитал обоих союзников.",
"players.worthFourHands": "Очки BGS учитывают ваше самое богатое место.",
"players.stock": "Акции",
"players.tiles": "Фишки",
"players.acting": "ходит сейчас",

View file

@ -98,6 +98,15 @@ export const vi: Catalog = {
"players.title": "Người chơi",
"players.player": "Người chơi",
"players.cash": "Tiền",
"players.netWorth": "Tổng tài sản",
"players.worthBreakdown": "Chi tiết tài sản",
"players.bonuses": "Tiền thưởng",
"players.worthNote":
"Tiền mặt + giá trị cổ phiếu + thưởng đa số/thiểu số dự kiến. Ước tính thay đổi theo lượng cổ phiếu và lựa chọn khi sáp nhập.",
"players.worthBank":
"Tiền mặt + giá trị cổ phiếu. Không tính thưởng tương lai: số cổ phiếu của ngân hàng chưa được biết cho đến khi trả thưởng.",
"players.worthTeams": "Điểm BGS cộng tài sản của cả hai đồng đội.",
"players.worthFourHands": "Điểm BGS lấy ghế giàu nhất của bạn.",
"players.stock": "Cổ phiếu",
"players.tiles": "Ô",
"players.acting": "đang quyết định",

View file

@ -97,6 +97,13 @@ export const zhCN: Catalog = {
"players.title": "玩家",
"players.player": "玩家",
"players.cash": "现金",
"players.netWorth": "资产总值",
"players.worthBreakdown": "资产明细",
"players.bonuses": "奖金",
"players.worthNote": "现金 + 股票价值 + 预计的大股东/次股东奖金。估值会随持股和合并选择而变动。",
"players.worthBank": "现金 + 股票价值。不含未来奖金:银行持股数要到发放时才会揭晓。",
"players.worthTeams": "BGS 分数合计两位队友的资产。",
"players.worthFourHands": "BGS 分数采用你最富有的席位。",
"players.stock": "股票",
"players.tiles": "板块",
"players.acting": "正在行动",

View file

@ -97,6 +97,13 @@ export const zhTW: Catalog = {
"players.title": "玩家",
"players.player": "玩家",
"players.cash": "現金",
"players.netWorth": "資產總值",
"players.worthBreakdown": "資產明細",
"players.bonuses": "獎金",
"players.worthNote": "現金 + 股票價值 + 預估的大股東/次股東獎金。估值會隨持股和合併選擇而變動。",
"players.worthBank": "現金 + 股票價值。不含未來獎金:銀行持股數要到發放時才會揭曉。",
"players.worthTeams": "BGS 分數合計兩位隊友的資產。",
"players.worthFourHands": "BGS 分數採用你最富有的席位。",
"players.stock": "股票",
"players.tiles": "板塊",
"players.acting": "正在行動",

View file

@ -298,7 +298,14 @@ Each viewer must only receive information their player is entitled to.
the *current* holdings and cash are hidden, even though they can be reconstructed
from the log.
- **[DECISION] Scores during play:** When `publicHoldings` is off, every player's score
is 0 until the game ends. When it is on, the score is the player's live cash.
is 0 until the game ends. When it is on, the score is projected net worth: cash,
current share sale values and majority/minority bonuses at current holdings (including
ties and rounding). Future bonuses are excluded in two-player bank mode because the
bank's holding is drawn only at payout. In-progress mergers never count paid bonuses
twice; absorbed shares kept after disposal are worth zero, while outstanding disposal
shares retain their sale value. The survivor uses its known post-merger size.
Team scores combine both seats; four-hands scores use the richest controlled seat.
These are estimates during play; final scores remain the actual settled cash.
Hidden information must be stripped on the engine side, not merely hidden in the viewer.

View file

@ -103,6 +103,61 @@ try {
assert.equal(report.diagnostics.compatible, true);
assert.equal(report.diagnostics.recommended.percent, 100);
for (const width of [1280, 390, 320]) {
await page.setViewportSize({ width, height: 900 });
await open("players=3&hotseat=0&view=0&theme=dark");
await page.evaluate((state) => {
state.options.publicHoldings = true;
window.acquireDev.load(state);
}, preparedPosition("scoring"));
await page.waitForSelector(".net-worth");
assert.deepEqual(await page.locator(".net-worth strong").allTextContents(), ["≈ $15,800", "≈ $10,900", "≈ $6,700"]);
assert.deepEqual(
await page.evaluate(() => window.acquireDev.engine.scores(window.acquireDev.state)),
[15800, 10900, 6700]
);
await page.locator(".worth-details summary").click();
assert.deepEqual(await page.locator(".worth-details tbody tr").first().locator("td.num").allTextContents(), [
"$6,000",
"$2,800",
"$7,000",
]);
for (const theme of ["dark", "light"]) {
await page.evaluate((theme) => window.acquireDev.emitter.emit("theme", { dark: theme === "dark" }), theme);
for (const locale of locales) {
await preferences({ locale });
assert.ok(
await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1),
`net worth ${locale} ${theme} ${width}px`
);
}
await preferences({ locale: "en" });
await page.locator(".players").screenshot({ path: new URL(`net-worth-${theme}-${width}.png`, output).pathname });
}
await page.evaluate(() => {
const state = structuredClone(window.acquireDev.state);
state.options.publicHoldings = false;
window.acquireDev.load(state);
});
await settle();
assert.equal(await page.locator(".net-worth, .worth-details").count(), 0);
assert.deepEqual(await page.evaluate(() => window.acquireDev.engine.scores(window.acquireDev.state)), [0, 0, 0]);
}
await open("players=2&publicHoldings=1&theme=dark");
await page.locator(".worth-details summary").click();
assert.match(await page.locator(".worth-details").innerText(), /Future bonuses excluded/);
assert.deepEqual(await page.locator(".worth-details tbody tr td:last-child").allTextContents(), ["—", "—"]);
await page.evaluate(() => window.acquireDev.emitter.emit("replay:start"));
await settle();
assert.equal(
await page.locator(".net-worth, .worth-details").count(),
0,
"partial replay log entries do not show a misleading forecast"
);
report.scenarios.push(
"public net worth and score equality, expandable cash/stock/bonus breakdown, all locales and themes, privacy, bank-mode note and replay masking"
);
// Show the known growth before the sell/trade decision, including on narrow/RTL screens.
for (const width of [1280, 390, 320]) {
await page.setViewportSize({ width, height: 900 });