Prototype Tleilaxu special Karama Truthtrance
Verify and publish checkpoint container / container (push) Successful in 11m6s
Verify and publish checkpoint container / container (push) Successful in 11m6s
This commit is contained in:
1 parent
5b8d510470
commit
cfccfe5acb
15 files changed
+391
-20
No files matched your search
+23
-3
@@ -19003,7 +19003,8 @@ function karamaSpendingBlock(g: Game, p: Player, card: Card, purpose?: KullPurpo
|
||||
required.effect === 'karamaHarkonnenSpecial' && purpose === 'special:harkonnen' ||
|
||||
required.effect === 'karamaEmperorSpecial' && purpose === 'special:emperor' ||
|
||||
required.effect === 'karamaAtreidesSpecial' && purpose === 'special:atreides' ||
|
||||
required.effect === 'karamaFremenSpecial' && purpose === 'special:fremen') &&
|
||||
required.effect === 'karamaFremenSpecial' && purpose === 'special:fremen' ||
|
||||
required.effect === 'karamaTleilaxuSpecial' && purpose === 'special:tleilaxu') &&
|
||||
windowCardOpportunity(g, required.effect)?.source === required.source))
|
||||
return 'Retain this opportunity without a forbidden printed Karama cost.';
|
||||
const kullBlock = kullKaramaBlock(g, p, purpose);
|
||||
@@ -20495,7 +20496,7 @@ function spendKarama(g: Game, p: Player, card: Card, use: KaramaUse, kullOffered
|
||||
// still-open Harkonnen special promise before a foreign response can park
|
||||
// the shared reconciler.
|
||||
if (card.kind === 'special' && card.effect === 'karama' && auctionRows.some(row => {
|
||||
return (['karamaHarkonnenSpecial', 'karamaEmperorSpecial', 'karamaAtreidesSpecial', 'karamaFremenSpecial'] as const).some(effect => {
|
||||
return (['karamaHarkonnenSpecial', 'karamaEmperorSpecial', 'karamaAtreidesSpecial', 'karamaFremenSpecial', 'karamaTleilaxuSpecial'] as const).some(effect => {
|
||||
const stage = row.windowCards?.[effect];
|
||||
return stage && !stage.closed && windowCardOpportunity(g, effect, stage.source)?.source === stage.source;
|
||||
});
|
||||
@@ -22395,6 +22396,19 @@ function emptyFremenSpecialWormTerritory(g: Game, id: string): boolean {
|
||||
function* nativeWindowCardActions(g: Game, actor: string, effect: WindowCardEffect): Generator<Action> {
|
||||
if (!windowCardOpportunity(g, effect)) return;
|
||||
const player = getPlayer(g, actor);
|
||||
if (effect === 'karamaTleilaxuSpecial') {
|
||||
if (player.faction !== 'tleilaxu' || g.kullPreview || g.pendingKull || g.semutaPreview ||
|
||||
g.semutaRecruitsPreview || g.semutaAdvancedOrdinaryPreview || g.truthtrance || g.response ||
|
||||
g.decision || g.phaseOpening || g.pendingKarama || g.pendingTreacheryDiscard ||
|
||||
g.pendingNullentropy || g.pendingRevival) return;
|
||||
for (const card of player.hand.filter(card => card.kind === 'special' && card.effect === 'karama'))
|
||||
for (const target of g.players) {
|
||||
const action: Action = { type: 'card', mode: 'special', card: card.id, target: target.id };
|
||||
try { if (prepareSpecialKaramaIntent(g, actor, action).kind === 'tleilaxu') yield action; }
|
||||
catch (error) { if (!(error instanceof RuleError)) throw error; }
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (effect === 'karamaFremenSpecial') {
|
||||
if (player.faction !== 'fremen' || g.expansions.length || g.nexusCards || g.homeworlds || g.discoveryEnabled ||
|
||||
g.kullPreview || g.pendingKull || g.semutaPreview || g.semutaRecruitsPreview || g.semutaAdvancedOrdinaryPreview ||
|
||||
@@ -23808,7 +23822,8 @@ function projectedTurnActionGuide(g: Game, player: Player): { event: string; act
|
||||
? player.faction === 'harkonnen' ? 'karamaHarkonnenSpecial'
|
||||
: player.faction === 'emperor' ? 'karamaEmperorSpecial'
|
||||
: player.faction === 'atreides' ? 'karamaAtreidesSpecial'
|
||||
: player.faction === 'fremen' ? 'karamaFremenSpecial' : null
|
||||
: player.faction === 'fremen' ? 'karamaFremenSpecial'
|
||||
: player.faction === 'tleilaxu' ? 'karamaTleilaxuSpecial' : null
|
||||
: isWindowCardEffect(held?.effect) ? held.effect : null;
|
||||
const windows: WindowCardEffect[] = printedWindow ? [printedWindow]
|
||||
: action.type === 'decision' && action.karama === true ? ['karamaAuction']
|
||||
@@ -42774,7 +42789,12 @@ function resolveSpecialKaramaEffect(g: Game, p: Player, card: Card, intent: Spec
|
||||
});
|
||||
} else if (intent.kind === 'tleilaxu') {
|
||||
const target = intent.target;
|
||||
const opportunity = windowCardOpportunity(g, 'karamaTleilaxuSpecial');
|
||||
if (opportunity && card.kind === 'special' && card.effect === 'karama')
|
||||
recordNativeTurnActionWindowCard(g, p.id, 'karamaTleilaxuSpecial', opportunity.source);
|
||||
p.specialKaramaUsed = true;
|
||||
if (liveTurnActionPromises(g.turnActionPromises ?? [], p.id, g.turn).length)
|
||||
guardTurnActionPrintedCardCost(g, p, card);
|
||||
g.revivalPrevention = { player: target, turn: g.turn };
|
||||
if (g.pendingRevival?.nexusEmperorEvent)
|
||||
finishNexusEmperorRevival(g, g.pendingRevival, 'denied');
|
||||
|
||||
@@ -3366,6 +3366,7 @@ export const RULE_TOPICS: RuleTopic[] = [
|
||||
'A current-lot Karama condition counts a future physical printed Karama cost for this original ordinary auction card, either immediate purchase or its winning invoice. Bidding alone, another Karama role, a converted Worthless card, an earlier play, recovery or a later lot does not count. A bid-and-Karama answer must retain the real bid before the purchase; free acquisition still uses the original native controls and hand limit. A whole No shares its payment and bid funding without assuming a forbidden free invoice. Unseen future auction cards cannot fund another promised card play; actual owned knowledge remains usable.',
|
||||
'In a quiet Advanced Bidding window, a whole answer can name Harkonnen’s successful once-game special Karama. The original owner and Bidding turn bind the interval across lots. Only a future actual physical printed Karama used for that special counts; ordinary roles and failed use do not. No and native hand-exchange timing remain authoritative. The shared witness returns unseen drawn cards without sampling their faces; Kull, Semuta and other faction special powers remain outside this prototype.',
|
||||
'A separate Emperor special-Karama condition covers quiet Advanced Revival. It names an actual physical printed Karama activation and its real free leader or force return, preserving the existing return-before-cost order. Kull, Semuta and broader interactions remain outside the bounded profile.',
|
||||
'A separate Tleilaxu special-Karama condition covers quiet Advanced Revival. Its source names the owner and turn; a successful future special use spends the original physical printed Karama and prevents the chosen player’s remaining force and leader revivals, including Tleilaxu itself. Kull, Semuta, pending revival decisions and other interruptions are outside this bounded profile. Runtime coverage uses a conserved Truthtrance card swap.',
|
||||
'A separate Atreides special-Karama condition covers a clean Advanced battle before plans reveal. It binds the original public battle, and the private witness pays the real card without reading an opposing sealed plan. Actual inspection and target-first sequencing remain native; Kull, Semuta and broader interactions remain outside the bounded profile. Guides select the actual special-use promise even when another answer was recorded first.',
|
||||
'A Fremen special-Karama condition covers clean Advanced classic pre-blow. Its owned witness executes an empty sand appearance without spice; standalone Yes may choose a native destination, while populated destinations remain guarded with other commitments. Kull, Semuta and other modules remain excluded.',
|
||||
'A printed Karama shipment-price clause names the current beneficiary’s unused native shipment. The giver spends the physical printed card; the beneficiary still pays the native bank tariff, such as two spice becoming one. Playing that cost counts even if its price is unused. The source remains while that original recipient is entitled, including another actor’s turn; a different beneficiary or a Cunning second opportunity has its own interval. Own shipping or ending must preserve the whole answer before a foreign counter, while foreign actions retain their rights.',
|
||||
|
||||
+7
-1
@@ -5,7 +5,7 @@ import { parseTravelActionClaim, type TravelClaim } from './travel-expression-pr
|
||||
import { parseTurnActionLeaf, TURN_ACTION_MAX_DEPTH, TURN_ACTION_MAX_LEAVES,
|
||||
turnActionPromiseModeSupported, type TurnActionClaim } from './turn-action-promises';
|
||||
import { battlePowerOf, nativeBattlePowerOpportunity } from './battle-power-question';
|
||||
import { parseKaramaShipmentSource, parseKaramaBattleCancelSource, parseKaramaHarkonnenSpecialSource, parseKaramaEmperorSpecialSource, parseKaramaAtreidesSpecialSource, parseKaramaFremenSpecialSource, karamaBattleCancelOpportunity, windowCardOpportunity } from './window-card-play';
|
||||
import { parseKaramaShipmentSource, parseKaramaBattleCancelSource, parseKaramaHarkonnenSpecialSource, parseKaramaEmperorSpecialSource, parseKaramaAtreidesSpecialSource, parseKaramaFremenSpecialSource, parseKaramaTleilaxuSpecialSource, karamaBattleCancelOpportunity, windowCardOpportunity } from './window-card-play';
|
||||
import { nativeStormDialOpportunity } from './storm-dial-question';
|
||||
import { parseTraitorActionClaim, type MixedTraitorClaim } from './mixed-traitor-question';
|
||||
import { parseBattleActionClaim, MIXED_BATTLE_MAX_NODES, MIXED_BATTLE_MAX_TERMS, MIXED_BATTLE_MAX_DEPTH,
|
||||
@@ -521,6 +521,10 @@ function parseQuestion(g: Game, asker: string, value: unknown): TruthQuestion {
|
||||
g.expansions.length === 0 && !g.nexusCards && !g.homeworlds && !g.discoveryEnabled &&
|
||||
!g.spiceWindow && !g.spiceSequence && !g.spiceResolution && !g.nexus && !g.summonedWorm && !g.wormRides.length,
|
||||
'Choose Fremen’s own special Karama in a supported clean Spice Blow profile.');
|
||||
if (action.effect === 'karamaTleilaxuSpecial')
|
||||
check(parseKaramaTleilaxuSpecialSource(action.source)?.owner === respondent.id &&
|
||||
!g.kullPreview && !g.semutaPreview && !g.semutaRecruitsPreview && !g.semutaAdvancedOrdinaryPreview && !g.pendingRevival,
|
||||
'Choose Tleilaxu’s own special Karama in a supported clean Revival profile.');
|
||||
}
|
||||
if (action.kind === 'battlePlan' || action.kind === 'traitorCall' || action.kind === 'battlePower') {
|
||||
const battle = g.battle;
|
||||
@@ -929,6 +933,8 @@ export function truthQuestionText(
|
||||
return 'you use Atreides’ special Karama after this answer in this battle';
|
||||
if (action.effect === 'karamaFremenSpecial')
|
||||
return 'you use Fremen’s special Karama after this answer during Spice Blow';
|
||||
if (action.effect === 'karamaTleilaxuSpecial')
|
||||
return 'you use Tleilaxu’s special Karama after this answer during Revival';
|
||||
if (action.effect === 'karamaBattleCancel') {
|
||||
const response = parseKaramaBattleCancelSource(action.source);
|
||||
return `you spend a printed Karama after this answer to cancel ${response?.kind === 'voice' ? 'Voice' : 'Prescience'} in this original battle response`;
|
||||
|
||||
@@ -7,7 +7,7 @@ import { RevivalExpressionPromiseError, type RevivalExpressionReturn } from './r
|
||||
import { parseBattleActionClaim, type MixedBattleActionClaim } from './mixed-battle-question';
|
||||
import { PlanClaimError } from './battle-promises';
|
||||
import { PRINTED_CARD_EFFECTS, type PrintedCardEffect } from './printed-card-play';
|
||||
import { WINDOW_CARD_EFFECTS, parseKaramaHarkonnenSpecialSource, parseKaramaEmperorSpecialSource, parseKaramaAtreidesSpecialSource, parseKaramaFremenSpecialSource, type WindowCardEffect } from './window-card-play';
|
||||
import { WINDOW_CARD_EFFECTS, parseKaramaHarkonnenSpecialSource, parseKaramaEmperorSpecialSource, parseKaramaTleilaxuSpecialSource, parseKaramaAtreidesSpecialSource, parseKaramaFremenSpecialSource, type WindowCardEffect } from './window-card-play';
|
||||
import { StormDialQuestionError, parseStormDialClaim, parseStormDialSource, stormDialMatches, type StormDialClaim } from './storm-dial-question';
|
||||
import { nativePromiseScopeSupported, type NativePromiseScope } from './native-promise-scope';
|
||||
import { BattlePowerQuestionError, battlePowerMatches, battlePowerOf, parseBattlePowerClaim,
|
||||
@@ -171,6 +171,8 @@ export function parseTurnActionLeaf(value: unknown): TurnActionLeaf {
|
||||
'Retain the original Harkonnen special Karama Bidding window.');
|
||||
if (value.effect === 'karamaEmperorSpecial') check(!!parseKaramaEmperorSpecialSource(value.source),
|
||||
'Retain the original Emperor special Karama Revival window.');
|
||||
if (value.effect === 'karamaTleilaxuSpecial') check(!!parseKaramaTleilaxuSpecialSource(value.source),
|
||||
'Retain the original Tleilaxu special Karama Revival window.');
|
||||
if (value.effect === 'karamaFremenSpecial') check(!!parseKaramaFremenSpecialSource(value.source),
|
||||
'Choose the original Fremen special-Karama window.');
|
||||
if (value.effect === 'karamaAtreidesSpecial') check(!!parseKaramaAtreidesSpecialSource(value.source),
|
||||
@@ -381,6 +383,11 @@ function readPromise(promise: TurnActionPromise): CompiledMixedAction<TurnAction
|
||||
check(binding && binding.turn === promise.turn && binding.owner === promise.player,
|
||||
'Retain the respondent’s original Emperor special Karama Revival window.');
|
||||
}
|
||||
for (const source of windowSources.get('karamaTleilaxuSpecial') ?? []) {
|
||||
const binding = parseKaramaTleilaxuSpecialSource(source);
|
||||
check(binding && binding.turn === promise.turn && binding.owner === promise.player,
|
||||
'Retain the respondent’s original Tleilaxu special Karama Revival window.');
|
||||
}
|
||||
for (const source of windowSources.get('karamaFremenSpecial') ?? []) {
|
||||
const parsed = parseKaramaFremenSpecialSource(source);
|
||||
check(parsed && parsed.turn === promise.turn && parsed.owner === promise.player,
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import { harvesterAvailable } from './cards';
|
||||
|
||||
export const WINDOW_CARD_EFFECTS = ['weather', 'atomics', 'harvester', 'karamaAuction', 'karamaShipment', 'karamaBattleCancel', 'karamaHarkonnenSpecial', 'karamaEmperorSpecial', 'karamaAtreidesSpecial', 'karamaFremenSpecial', 'thumper', 'amal'] as const;
|
||||
export const WINDOW_CARD_EFFECTS = ['weather', 'atomics', 'harvester', 'karamaAuction', 'karamaShipment', 'karamaBattleCancel', 'karamaHarkonnenSpecial', 'karamaEmperorSpecial', 'karamaAtreidesSpecial', 'karamaFremenSpecial', 'karamaTleilaxuSpecial', 'thumper', 'amal'] as const;
|
||||
export type WindowCardEffect = typeof WINDOW_CARD_EFFECTS[number];
|
||||
export function windowCardNativeEffect(effect: WindowCardEffect): 'weather' | 'atomics' | 'harvester' | 'karama' | 'thumper' | 'amal' {
|
||||
return effect === 'karamaAuction' || effect === 'karamaShipment' || effect === 'karamaBattleCancel' || effect === 'karamaHarkonnenSpecial' || effect === 'karamaEmperorSpecial' || effect === 'karamaAtreidesSpecial' || effect === 'karamaFremenSpecial' ? 'karama' : effect;
|
||||
return effect === 'karamaAuction' || effect === 'karamaShipment' || effect === 'karamaBattleCancel' || effect === 'karamaHarkonnenSpecial' || effect === 'karamaEmperorSpecial' || effect === 'karamaAtreidesSpecial' || effect === 'karamaFremenSpecial' || effect === 'karamaTleilaxuSpecial' ? 'karama' : effect;
|
||||
}
|
||||
export type KaramaHarkonnenSpecialSource = { turn: number; owner: string };
|
||||
export type KaramaEmperorSpecialSource = { turn: number; owner: string };
|
||||
export type KaramaTleilaxuSpecialSource = { turn: number; owner: string };
|
||||
export type KaramaFremenSpecialSource = { turn: number; owner: string };
|
||||
export type KaramaAtreidesSpecialSource = { turn: number; owner: string; battle: string; territory: string };
|
||||
export type KaramaBattleCancelSource = {
|
||||
@@ -90,6 +91,16 @@ export function parseKaramaEmperorSpecialSource(source: unknown): KaramaEmperorS
|
||||
return { turn: tuple[1], owner: tuple[2] };
|
||||
}
|
||||
|
||||
/** Decode the public owner and turn even after the special power is spent. */
|
||||
export function parseKaramaTleilaxuSpecialSource(source: unknown): KaramaTleilaxuSpecialSource | null {
|
||||
if (!identifier(source)) return null;
|
||||
let tuple: unknown;
|
||||
try { tuple = JSON.parse(source); } catch { return null; }
|
||||
if (!Array.isArray(tuple) || tuple.length !== 3 || tuple[0] !== 'karamaTleilaxuSpecial' ||
|
||||
!whole(tuple[1]) || tuple[1] < 1 || !identifier(tuple[2]) || JSON.stringify(tuple) !== source) return null;
|
||||
return { turn: tuple[1], owner: tuple[2] };
|
||||
}
|
||||
|
||||
/** Decode the public phase window even after the special power is spent. */
|
||||
export function parseKaramaFremenSpecialSource(source: unknown): KaramaFremenSpecialSource | null {
|
||||
if (!identifier(source)) return null;
|
||||
@@ -225,6 +236,17 @@ function globalWindowCardOpportunity(game: WindowCardGame, effect: WindowCardEff
|
||||
if (owners.length !== 1 || owners[0].specialKaramaUsed === true) return null;
|
||||
return { effect, turn: game.turn, source: JSON.stringify([effect, game.turn, owners[0].id]) };
|
||||
}
|
||||
if (effect === 'karamaTleilaxuSpecial') {
|
||||
const players = game.players;
|
||||
if (game.advanced !== true || game.phase !== 4 || !Array.isArray(players) || !players.length ||
|
||||
!players.every(player => object(player) && identifier(player.id) &&
|
||||
typeof player.faction === 'string' && (player.specialKaramaUsed === undefined ||
|
||||
typeof player.specialKaramaUsed === 'boolean')) ||
|
||||
new Set(players.map(player => player.id)).size !== players.length) return null;
|
||||
const owners = players.filter(player => player.faction === 'tleilaxu');
|
||||
if (owners.length !== 1 || owners[0].specialKaramaUsed === true) return null;
|
||||
return { effect, turn: game.turn, source: JSON.stringify([effect, game.turn, owners[0].id]) };
|
||||
}
|
||||
if (effect === 'karamaFremenSpecial') {
|
||||
const players = game.players;
|
||||
if (game.advanced !== true || game.phase !== 1 || !Array.isArray(players) || !players.length ||
|
||||
|
||||
Reference in new issue
Block a user