Allow Semuta recovery before native Ghola income
Reuse the exact ordinary-discard income qualification for admission and parent validation. Preserve physical revival and native conditional income through claim, decline, full-hand exchange and original allow/cancel.
This commit is contained in:
1 parent
19e554666e
commit
047011e243
11 files changed
+524
-19
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import type { Game } from './engine';
|
||||
|
||||
type OrdinaryDiscard = Extract<
|
||||
NonNullable<Game['pendingTreacheryDiscard']>['continuation'],
|
||||
{ kind: 'ordinaryCardDiscard' }
|
||||
>;
|
||||
|
||||
/** Only Ghola creates this conditional income after its physical effect. The
|
||||
* same source qualification governs the fresh offer and its saved parent. */
|
||||
export function ordinaryDiscardIncomeMatches(
|
||||
game: Pick<Game, 'players'>,
|
||||
continuation: Pick<OrdinaryDiscard, 'effect' | 'player' | 'resume'>,
|
||||
): boolean {
|
||||
const income = continuation.resume.response;
|
||||
const tleilaxu = game.players.find(player => player.faction === 'tleilaxu');
|
||||
return continuation.effect === 'ghola' && tleilaxu
|
||||
? income?.kind === 'revivalIncome' && income.owner === tleilaxu.id &&
|
||||
income.recipient === continuation.player && income.amount === 1 &&
|
||||
income.passed.length === 0
|
||||
: !income;
|
||||
}
|
||||
Reference in new issue
Block a user