Files
Dune/game/ecaz-cards.ts
T
Quintine c04cb93830 Connect the Recruits independent-card revival preview
The explicit development initializer now includes the complete three-card Ecaz Treachery variant before genuine Basic/Advanced faction setup. Recruits has owned play/discard controls, full inspection, a public current-rate table, shared authoritative revival quotes, all four AI profiles and persistent exact free-use ledgers. Existing CHOAM/Tleilaxu choices settle before returning forces. Inactive games retain their prior allowance arithmetic.

Clean activation before normal returns or after exactly recorded free returns is connected. Prior-paid/unknown use, later Fremen grants, pending repricing, same-turn recovered-card replay and additional optional modules stay gated. Native unlimited faction advantages remain unlimited. The independent seven-force cap after faction cancellation is explicitly documented as an inference from independent effects, not a direct combined FAQ. Reinforcements and Harass & Withdraw remain unfinished; public starts and publication stay gated.

Independent rules/privacy/persistence review passed. Review fixed auction alias double-counting after a physical card sale, malformed canonical cards, legacy zero-ledger activation, a seat-control validation bypass and an ordinary-start bypass. Focused tests cover readiness and turn expiry as well as authenticated restart, exact free/paid accounting, stale/duplicate requests, competing writes and malformed-save rejection. Types, lint, 4743 offline tests, build and 43 HTTP tests passed with unchanged source.

Eight fixed-seed genuine six-seat samples finish: basic/Easy: 1961 accepted, 0 Recruits plays, 53 JSON restores; basic/Medium: 711 accepted, 0 Recruits plays, 19 JSON restores; basic/Hard: 239 accepted, 0 Recruits plays, 6 JSON restores; basic/Brutal: 1367 accepted, 1 Recruits plays, 36 JSON restores; advanced/Easy: 1402 accepted, 0 Recruits plays, 37 JSON restores; advanced/Medium: 530 accepted, 0 Recruits plays, 14 JSON restores; advanced/Hard: 545 accepted, 1 Recruits plays, 14 JSON restores; advanced/Brutal: 1240 accepted, 1 Recruits plays, 33 JSON restores. Reports retain rejected candidates and earlier harness attempts. All 216 game-source hashes remain identical to the samples; a later presentation-test expectation update changes no game code. Actual card use, custody and periodic/terminal private views are checked; this is bounded playability evidence, not full variant acceptance or AI calibration. A separate conserved browser Revival fixture verifies the full inspector, physical play, public rates, four free returns and active/resolved refresh.

All 902 opening games and original seat/recovery records remain unchanged (936 after checks). All 903 present immediately before broad checks are also preserved. Database integrity and foreign keys pass. The healthy server recovered after the power failure and was reused without restart, reset or recurring automation.

Verified source tree: 1f934f996268b35c8a20d0d617fa962aad878108496fa1a4a05323360757b0e3
2026-09-14 03:44:21 +10:00

183 lines
8.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import type { Card } from './cards';
export type EcazTreacheryEffect =
| 'recruits'
| 'reinforcements'
| 'harassWithdraw';
export type EcazTreacheryCardId =
| 'ecaz-recruits'
| 'ecaz-reinforcements'
| 'ecaz-harass-withdraw';
export type EcazTreacheryCard = Card & {
id: EcazTreacheryCardId;
kind: 'special';
effect: EcazTreacheryEffect;
};
export type EcazTreacheryDefinition = Readonly<{
card: Readonly<EcazTreacheryCard>;
quantity: 1;
timing: 'revival' | 'battle-plan';
battleSlots: readonly ('weapon' | 'defense')[];
weaponCategory: false;
defenseCategory: false;
discard: 'after-use';
summary: string;
gameplay: readonly string[];
verification: Readonly<{
inventory: 'verified';
sourceRules: 'verified';
runtime: 'prototype' | 'not-implemented';
combinedInteractions: 'incomplete';
unresolved: readonly string[];
}>;
}>;
/** Metadata only. Selecting an expansion faction must never activate this module implicitly. */
export const ECAZ_TREACHERY_VARIANT = Object.freeze({
id: 'ecaz-treachery',
name: 'Ecaz & Moritani treachery cards',
physicalCards: 3,
independentOfFactions: true,
independentOfOtherVariants: true,
activation: 'audit-prototype',
audit: 'docs/ECAZ_TREACHERY_RULES.md',
} as const);
const define = (definition: EcazTreacheryDefinition): EcazTreacheryDefinition =>
Object.freeze({
...definition,
card: Object.freeze({ ...definition.card }),
battleSlots: Object.freeze([...definition.battleSlots]),
gameplay: Object.freeze([...definition.gameplay]),
verification: Object.freeze({
...definition.verification,
unresolved: Object.freeze([...definition.verification.unresolved]),
}),
});
/**
* One physical copy of each verified identity. Text below is an original gameplay
* guide, not a transcription or artwork reproduction. Unresolved source questions
* are developer metadata and must not become guessed gameplay instructions.
*/
export const ECAZ_TREACHERY_DEFINITIONS: readonly EcazTreacheryDefinition[] =
Object.freeze([
define({
card: {
id: 'ecaz-recruits',
name: 'Recruits',
kind: 'special',
effect: 'recruits',
},
quantity: 1,
timing: 'revival',
battleSlots: [],
weaponCategory: false,
defenseCategory: false,
discard: 'after-use',
summary:
'During Revival, double every faction’s current free-revival rate for this turn and raise the ordinary force-revival limit to seven.',
gameplay: [
'Play during the Revival phase. Every faction receives twice its current free-revival rate for this turn; the effect applies across the table.',
'The ordinary limit on force revival becomes seven for the turn. A doubled free allowance still respects that limit where it applies: a current free rate of four doubles to eight, but an ordinary faction can revive only seven forces.',
'The doubled rate changes how many revivals are free. It does not make additional paid revivals free or state a separate spice payment to play this card.',
'Discard Recruits after use. Its change lasts for this turn and does not permanently alter faction revival rates.',
],
verification: {
inventory: 'verified',
sourceRules: 'verified',
runtime: 'prototype',
combinedInteractions: 'incomplete',
unresolved: [
'Timing after earlier completed revivals, refunds, reopening opportunities and any already pending transaction.',
'Interactions with unlimited CHOAM/Tleilaxu revival, Karama limits, prevented free revival, Fremen ally grants, special units and changing Homeworld thresholds.',
],
},
}),
define({
card: {
id: 'ecaz-reinforcements',
name: 'Reinforcements',
kind: 'special',
effect: 'reinforcements',
},
quantity: 1,
timing: 'battle-plan',
battleSlots: ['weapon', 'defense'],
weaponCategory: false,
defenseCategory: false,
discard: 'after-use',
summary:
'Commit in either battle-card slot to increase the dialed number by two, transferring three of your reserve forces to the Tanks.',
gameplay: [
'Include Reinforcements in either the weapon slot or the defense slot of your Battle Plan. You must have at least three of your own forces in reserves to use it.',
'Increase the dialed number by two and transfer three of your reserve forces to the Tanks. These forces come from reserves; the card does not ship them into the battle territory. No separate spice payment is specified by the card.',
'Although it occupies a battle-card slot, Reinforcements is neither a weapon nor a defense. If Prescience asks about the category of the slot it occupies, declare no card of that category without revealing Reinforcements’ identity.',
'Discard Reinforcements after use.',
],
verification: {
inventory: 'verified',
sourceRules: 'verified',
runtime: 'not-implemented',
combinedInteractions: 'incomplete',
unresolved: [
'Reserve-cost timing when either side calls a traitor and in explosion or instant-outcome battles.',
'Whether the additional dial number affects advanced spice support or on-board casualties, the eligible regular/elite reserve mix, and battle-loss bookkeeping.',
'Disposal when a battle effect is canceled or defeated before normal use resolution.',
],
},
}),
define({
card: {
id: 'ecaz-harass-withdraw',
name: 'Harass & Withdraw',
kind: 'special',
effect: 'harassWithdraw',
},
quantity: 1,
timing: 'battle-plan',
battleSlots: ['weapon', 'defense'],
weaponCategory: false,
defenseCategory: false,
discard: 'after-use',
summary:
'Commit in either battle-card slot to return your undialed forces to reserves when revealed. An opponent’s traitor call cancels this effect.',
gameplay: [
'Include Harass & Withdraw in either the weapon slot or the defense slot of your Battle Plan. You cannot use it on your own Homeworld.',
'When the plan is revealed, return your undialed forces to reserves. Your leader can still be killed normally. A traitor called by your opponent cancels the withdrawal effect.',
'A Face Dancer affecting your leader does not affect the undialed forces returned to reserves. When Ecaz and an ally are together, only the card user’s undialed forces return; the other ally resolves normally.',
'Harass & Withdraw is neither a weapon nor a defense, despite occupying one of those slots. If Prescience asks about that category, declare no card of that category without disclosing this card’s identity.',
'No separate spice charge is specified by the card. Discard Harass & Withdraw after use.',
],
verification: {
inventory: 'verified',
sourceRules: 'verified',
runtime: 'not-implemented',
combinedInteractions: 'incomplete',
unresolved: [
'Withdrawal ordering with Lasgun/Shield explosions and other instant outcomes.',
'Physical dialed/undialed accounting for advanced half-strength and double-strength units, Ecaz support, zero commitments and multiple sectors.',
'Whether a traitor-canceled special counts as used for mandatory disposal or winner retention.',
],
},
}),
]);
/** Inventory factory only: never composes, activates or changes an existing game deck. */
export function ecazTreacheryCards(): EcazTreacheryCard[] {
return ECAZ_TREACHERY_DEFINITIONS.map(({ card }) => ({ ...card }));
}
/** Resolve a canonical physical identity, not an arbitrary special with a similar name. */
export function ecazTreacheryDefinition(
card: Pick<Card, 'id' | 'name' | 'kind' | 'effect'>,
): EcazTreacheryDefinition | undefined {
return ECAZ_TREACHERY_DEFINITIONS.find(
(definition) =>
definition.card.id === card.id &&
definition.card.name === card.name &&
definition.card.kind === card.kind &&
definition.card.effect === card.effect,
);
}