Allow bribes during native Basic response windows

This commit is contained in:
Quintine committed 2026-11-20 18:39:24 +11:00
1 parent de7fe7d64a
commit 812fe9d6e0
10 files changed
+346 -2

No files matched your search

+44 -1
View File
@@ -18243,12 +18243,19 @@ function bribePaymentPreservesPromises(g: Game, p: Player, recipient: string, am
* advancing their pending state. Existing whole-promise planners retain their
* original timing boundary until those compositions are implemented. */
function basicBribeInterrupt(g: Game, p: Player): boolean {
const battlePowerResponse = !!g.battle &&
(g.response?.kind === 'voice' || g.response?.kind === 'prescience') &&
// A mixed answer may or may not have a private residual promise. The
// public interruption must not reveal which case its private fact created.
!(g.mixedBattleQuestions ?? []).some(question => question.turn === g.turn && question.battle === g.battle?.event) &&
!g.battle.truthPromises?.some(promise => !promise.released) &&
!g.battle.traitorDecisionPromises?.length;
if (g.status !== 'playing' || g.advanced ||
g.inflation?.side === 'double' || g.techTokens || g.strongholdCards || g.leaderSkills ||
g.homeworlds || g.nexusCards || g.discoveryEnabled || g.discoveries || g.discoveryStash || g.greatMaker || g.coalitionState ||
g.ecazTreachery || g.semutaRecruitsPreview || g.truthtrance ||
g.pendingKarama || g.pendingKull || g.pendingTreacheryDiscard || g.pendingNullentropy ||
g.bureaucratPayments?.pending || g.battle || g.pendingRicheseGift || g.pendingShipment ||
g.bureaucratPayments?.pending || g.battle && !battlePowerResponse || g.pendingRicheseGift || g.pendingShipment ||
g.pendingGuildTransport || g.pendingArrivalOverlap || g.pendingAmbassador || g.pendingEmperorAuctionGift ||
liveShipmentPromises(g.shipmentPromises ?? [], p.id, g.turn).length ||
liveTravelPromises(g.travelPromises ?? [], p.id, g.turn).length ||
@@ -18271,6 +18278,42 @@ function basicBribeInterrupt(g: Game, p: Player): boolean {
const classic = ['atreides', 'beneGesserit', 'emperor', 'fremen', 'guild', 'harkonnen'];
const nativeRoster = !g.expansions.length
? g.players.every(seat => classic.includes(seat.faction)) : selectedPhaseModuleRoster(g);
// These responses have no outstanding invoice: the original battle power
// has been declared, the worm awaits its native outcome, or the shipment
// was already paid before the Guild's income response opened. Keep the
// original response, its passes and any committed arrival in place.
const response = g.response;
if (nativeRoster && !g.phaseOpening && !g.choamMarket && !g.ixAuction && response && !g.decision &&
Array.isArray(response.passed) && new Set(response.passed).size === response.passed.length &&
response.passed.every(id => g.players.some(seat => seat.id === id))) {
const pending = Object.entries(g).filter(([key, value]) => key.startsWith('pending') &&
(Array.isArray(value) ? value.length > 0 : value !== null && value !== undefined && value !== false));
const owner = g.players.find(seat => seat.id === response.owner);
if (battlePowerResponse && !pending.length && g.phase === 6 &&
Object.keys(response).sort().join(',') === 'kind,owner,passed') {
try {
currentCombatResponseQuote(g, {kind:'response', response:{kind:response.kind as 'voice' | 'prescience',
owner:response.owner}, canceled:false});
return true;
} catch (error) { if (error instanceof RuleError) return false; throw error; }
}
if (response.kind === 'wormSurvival' && !pending.length && !g.battle && g.phase === 1 &&
owner?.faction === 'fremen' && !!response.location && at(owner, response.location) > 0 &&
Object.keys(response).every(key => ['kind','owner','passed','location','recipient'].includes(key)))
return true;
const arrivals = g.pendingArrivalReaction;
if (response.kind === 'guildIncome' && !g.battle && g.phase === 5 && owner?.faction === 'guild' &&
Object.keys(response).sort().join(',') === 'amount,kind,owner,passed' &&
Number.isSafeInteger(response.amount) && response.amount! > 0 &&
pending.length === 1 && pending[0][0] === 'pendingArrivalReaction' && arrivals?.length === 1) {
const arrival = arrivals[0], entrant = g.players.find(seat => seat.id === arrival.entrant);
return arrival.turn === g.turn && arrival.phase === 5 && arrival.cause === 'shipment' &&
arrival.resume === 'none' && arrival.entrant === g.active && !!entrant &&
(entrant.forces[location(arrival.territory,arrival.sector)] ?? 0) >= arrival.amount &&
arrival.amount > 0 && arrival.elite >= 0 && arrival.elite <= arrival.amount &&
Object.keys(arrival).every(key => ['entrant','territory','sector','amount','elite','cause','resume','turn','phase'].includes(key));
}
}
if (nativeRoster && !g.phaseOpening && !g.choamMarket && !g.ixAuction && basicPendingMovement(g)) return true;
if (nativeRoster && !g.phaseOpening && !g.choamMarket && !g.ixAuction &&
!Object.entries(g).some(([key, value]) => key.startsWith('pending') &&