Check Advanced victory after Mentat actions
Verify and publish checkpoint container / container (push) Successful in 10m42s

This commit is contained in:
Quintine committed 2026-10-29 09:15:34 +11:00
1 parent c608d6fea6
commit 64706cc7e0
12 files changed
+339 -27

No files matched your search

+18 -5
View File
@@ -1497,6 +1497,8 @@ export type Game = {
/** Agreed addition to the ordinary stronghold win targets. Older games omit it. */
victoryExtraStrongholds?: number;
victoryContinuation?: VictoryContinuation | null;
/** Fresh Advanced non-CHOAM Mentat phases check victory after their opportunities. */
mentatVictoryAfterActions?: number;
charityPromises?: CharityPromise[];
revivalOrder?: RevivalOrder;
charityOrder?: CharityOrder;
@@ -13862,7 +13864,7 @@ function finishMoritaniPlacement(g: Game) {
return;
}
requireRule(!obligation, 'Finish the pending Extortion payments first.');
if (!byFaction(g, 'choam')) victory(g);
if (!byFaction(g, 'choam') && g.mentatVictoryAfterActions !== g.turn) victory(g);
}
function finishSetup(g: Game) {
const tleilaxu = byFaction(g, 'tleilaxu');
@@ -30338,6 +30340,10 @@ function advancePhase(g: Game) {
g.decision = { kind: 'choamMentat', player: choam.id };
return;
}
if (g.phase === 8 && g.mentatVictoryAfterActions === g.turn) {
victory(g, undefined, 'advance');
if (g.status !== 'playing' || g.victoryContinuation) return;
}
const ecaz = byFaction(g, 'ecaz');
if (g.phase === 4 && ecaz && g.ecazPlacementTurn !== g.turn) {
g.ecazAmbassadors ??= createAmbassadors(random);
@@ -30388,7 +30394,10 @@ function completePhase(g: Game) {
}
if (g.phase === 8)
requireRule(!g.moritaniExtortion, 'Settle Extortion before ending the turn.');
if (g.phase === 8) settleStrongholdOwnership(g);
if (g.phase === 8) {
settleStrongholdOwnership(g);
delete g.mentatVictoryAfterActions;
}
g.phase++;
if (g.phase === 9) {
if (g.dukeVidal) g.dukeVidal = expireDuke(g.dukeVidal, g.turn);
@@ -30556,6 +30565,7 @@ function beginPhase(g: Game) {
collect(g);
}
if (g.phase === 8) {
if (g.advanced && !byFaction(g, 'choam')) g.mentatVictoryAfterActions = g.turn;
collectBankerIncome(g);
drawHarkonnenNexusBetrayalReplacement(g);
replaceMoritaniAssassinationTraitors(g);
@@ -37585,9 +37595,12 @@ function currentPlacementCancellationQuote(g: Game, response: ResponseWindow) {
),
);
} else if (receipt.kind === 'moritaniPlacement') {
// Mentat opening income is already settled. CHOAM retains its own later
// market/Mentat choice; otherwise this receipt reaches victory now.
if (!byFaction(g, 'choam')) finalVictory = currentVictoryQuote(g);
// Fresh Advanced Mentat phases and CHOAM retain their later victory check.
// Older unstamped phases keep their original opening-time check.
if (!byFaction(g, 'choam')) {
const quote = currentVictoryQuote(g);
if (g.mentatVictoryAfterActions !== g.turn) finalVictory = quote;
}
} else if (!byFaction(g, 'choam')) {
const resources = currentPhaseResources(g);
if (!g.expansions.includes('ix')) {
+2 -2
View File
@@ -173,7 +173,7 @@ const phaseDetails = [
'Review the table chronicle and your spice, then mark yourself ready.',
],
[
'Deferred bribes become available when Mentat begins. At CHOAM tables, victory waits until Mentat actions, the closing market and a final Trip to Gamont opportunity finish. Other tables currently check victory on entering the phase.',
'Deferred bribes become available when Mentat begins. In fresh Advanced phases, victory waits until players finish their Mentat opportunities; CHOAM tables also finish the closing market and its final opportunity. Basic and older already-open non-CHOAM phases retain their opening-time check. The Advanced end-of-phase order is a provisional online interpretation.',
'A single faction needs three strongholds; an alliance or a player in a two-player game needs four. A stronghold still occupied by opponents under storm does not count toward victory.',
'On the final turn, check normal wins, then the Fremen special condition, then Guild. Without Guild, Fremen wins; without either faction, the highest individual stronghold count wins, including ties.',
'If play continues, mark yourself ready to start the next turn.',
@@ -4504,7 +4504,7 @@ export const RULE_TOPICS: RuleTopic[] = [
summary:
'Stronghold targets, storm-contested occupation, prediction and final-turn fallback.',
steps: [
'Victory is checked when the Mentat pause begins. A faction normally needs three strongholds, or four when allied or playing a two-player game. Allies combine distinct qualifying strongholds. The host may enable the printed optional three-stronghold target for two-member alliances with at least three controllers; two-controller games retain their four-stronghold target.',
'In fresh Advanced phases, victory is checked after Mentat opportunities; Basic and older already-open non-CHOAM phases retain their opening-time check. This end-of-phase order is a provisional online interpretation. A faction normally needs three strongholds, or four when allied or playing a two-player game. Allies combine distinct qualifying strongholds. The host may enable the printed optional three-stronghold target for two-member alliances with at least three controllers; two-controller games retain their four-stronghold target.',
'In the provisional two-person setup, each person controls two separately played factions and switches between their seats. They are not automatically allied and do not pool holdings unless they form an alliance. Each side needs four strongholds. Ordinary two-seat games also use four.',
'Ecaz and its reciprocal ally can also win by jointly occupying three strongholds: both factions need non-advisor presence in each, without opposing fighters. The ordinary four-stronghold alliance route remains available. Occupy cancellation does not remove this victory condition. A concealed No-Field supplies public presence; its secret value is not revealed by this check.',
'The separately marked fresh native Ecaz Homeworld preview has another printed route: native Ecaz must currently have at least seven reserves, the reciprocal alliance must jointly hold one actual uncontested stronghold, and it must occupy worlds of two other native factions. Two Emperor worlds count as one faction. This joins normal winners before a correct BG prediction or final-turn fallback; it adds no ordinary stronghold points.',