Support current battle choice promises and persistent notices
Verify and publish checkpoint container / container (push) Successful in 11m42s
Verify and publish checkpoint container / container (push) Successful in 11m42s
This commit is contained in:
1 parent
77d02b3231
commit
bd8377d87b
16 files changed
+684
-32
No files matched your search
@@ -57,6 +57,7 @@ export function TurnActionGuideButton(props: TurnActionProps) {
|
||||
if (!guide) return null;
|
||||
const actor = game.me, turn = game.turn, phase = game.phase, event = guide.event, action = guide.action;
|
||||
const act = props.act, fillPlan = props.fillPlan, battle = game.battle;
|
||||
const chooserSource = action.type === 'chooseBattle' ? game.battleOrder?.event : null;
|
||||
const charity = game.charity;
|
||||
const charityOwner = action.type === 'charity' ? game.players.find(player => player.id === actor) : undefined;
|
||||
const charitySource = (current: GameView) => {
|
||||
@@ -504,6 +505,11 @@ export function TurnActionGuideButton(props: TurnActionProps) {
|
||||
const battlePreparation = genericCard && planWindow;
|
||||
const declaration = action.type === 'traitorCall' && typeof action.call === 'boolean' && !!battle && currentBattle && battle.revealed &&
|
||||
battle.traitorVoters.includes(actor) && !battle.traitorSubmitted.includes(actor);
|
||||
const chooseBattle = action.type === 'chooseBattle' && phase === 6 && !current.battle &&
|
||||
current.active === actor && !!chooserSource && current.battleOrder?.event === chooserSource &&
|
||||
Object.keys(action).every(key => ['type','territory','target','turnActionPromiseEvent','turnActionPromisePhase'].includes(key)) &&
|
||||
current.battleChoices.some(choice => choice.chooser === actor && choice.territory === action.territory &&
|
||||
(choice.attacker === actor ? choice.defender : choice.attacker) === action.target);
|
||||
const charityClaim = action.type === 'charity' && phase === 2 && !!me && me === charityOwner &&
|
||||
Object.keys(action).every(key => ['type', 'turnActionPromiseEvent', 'turnActionPromisePhase'].includes(key)) &&
|
||||
!current.ready.includes(actor) && me.charityClaimed === false && current.charity === charity &&
|
||||
@@ -523,7 +529,7 @@ export function TurnActionGuideButton(props: TurnActionProps) {
|
||||
Object.keys(action).every(key => ['type', 'amount', 'turnActionPromiseEvent', 'turnActionPromisePhase'].includes(key)) &&
|
||||
typeof action.amount === 'number' && Number.isSafeInteger(action.amount) &&
|
||||
action.amount >= stormDialSource.min && action.amount <= stormDialSource.max;
|
||||
const opportunity = currentStormDial || nativeSemuta || printedResidual || printedDistrans || printedSapho || printedBox || openingReady || earlyWindowReady || earlyWindowBox || printedWindow || ownedPower || payment || paidBox || printedHajr || printedGhola || plan || battlePreparation || declaration || nexusWindow && (ownedAlliance || action.type === 'ready') || (phase === 2
|
||||
const opportunity = currentStormDial || nativeSemuta || printedResidual || printedDistrans || printedSapho || printedBox || openingReady || earlyWindowReady || earlyWindowBox || printedWindow || ownedPower || payment || paidBox || printedHajr || printedGhola || plan || battlePreparation || declaration || chooseBattle || nexusWindow && (ownedAlliance || action.type === 'ready') || (phase === 2
|
||||
? charityClaim || !current.ready.includes(actor) && (action.type === 'ready' || genericCard)
|
||||
: phase === 3
|
||||
? invoice || nativePass || requiredBid || action.type === 'passBid' && !current.richeseAuction && currentAuction && current.auction?.active === actor
|
||||
@@ -585,6 +591,7 @@ export function TurnActionGuideButton(props: TurnActionProps) {
|
||||
: action.type === 'move' && flightInitial ? `Declare Ornithopter ${action.ornithopter === 'range3' ? 'three-territory' : 'two-group'} flight and move ${amount} physical forces to ${destination}${sector} while honoring your whole answer`
|
||||
: action.type === 'card' && windowEffect ? `Play ${windowRoleNames[windowEffect]} in its original native window${windowEffect === 'weather' ? ` with storm distance ${amount}` : ''} while honoring your whole answer`
|
||||
: action.type === 'battlePlan' ? 'Fill the quoted battle plan for review before sealing'
|
||||
: action.type === 'chooseBattle' ? `Choose the battle against ${recipient} in ${destination} while honoring your whole answer`
|
||||
: action.type === 'voice' ? `Declare native Voice: opponent ${action.must ? 'must' : 'cannot'} play ${battleCardLabel(String(action.kind))}`
|
||||
: action.type === 'prescience' ? `Request the ${String(action.field)} field with native Prescience while honoring your whole answer`
|
||||
: action.type === 'declineBattlePower' ? `Explicitly decline native ${power === 'voice' ? 'Voice' : 'Prescience'} while honoring your whole answer`
|
||||
|
||||
Reference in new issue
Block a user