Support staged group Emperor aid
Verify and publish checkpoint container / container (push) Successful in 10m13s

This commit is contained in:
Quintine committed 2026-10-28 23:33:37 +11:00
1 parent b89c225d5b
commit 9081249574
10 files changed
+413 -17

No files matched your search

+9 -6
View File
@@ -3426,8 +3426,11 @@ function policyActions(g: GameView): Action[] {
}
if (g.fremenRevivalGrant && !g.fremenRevivalGrant.granted && !g.fremenRevivalGrant.blocked)
actions.push({ type: 'grantRevival' });
if (me.faction === 'emperor' && me.ally && level > 0) {
const ally = g.players.find((p) => p.id === me.ally)!;
const emperorGroup = g.coalitionEmperor;
const emperorAllies = me.ally ? [me.ally] : emperorGroup?.allies ?? [];
if (me.faction === 'emperor' && level > 0) for (const allyId of emperorAllies) {
const ally = g.players.find((p) => p.id === allyId)!;
const available = emperorGroup?.availableSpice ?? me.spice ?? 0;
const extra =
g.revivalPrevention?.player === ally.id
? 0
@@ -3439,7 +3442,7 @@ function policyActions(g: GameView): Action[] {
eliteRevivalRemaining(ally, g.advanced),
),
3 - (g.emperorExtra[ally.id] ?? 0),
Math.floor(Math.max(0, (me.spice ?? 0) - 3) / 2),
Math.floor(Math.max(0, available - 3) / 2),
);
for (let amount = extra; amount > 0; amount--) {
const minimumElite = Math.max(
@@ -3450,8 +3453,8 @@ function policyActions(g: GameView): Action[] {
Math.min(amount, eliteRevivalRemaining(ally, g.advanced)),
minimumElite,
]))
if (paidForceRevivalCost(ally, amount, elite) <= (me.spice ?? 0) - 3)
actions.push({ type: 'emperorRevival', amount, elite });
if (paidForceRevivalCost(ally, amount, elite) <= available - 3)
actions.push({ type: 'emperorRevival', amount, elite, ...(emperorGroup ? {target: ally.id} : {}) });
}
}
const freeRemaining = g.revival.freeRemaining;
@@ -3505,7 +3508,7 @@ function policyActions(g: GameView): Action[] {
return !g.revival.orderBlocked &&
(action.type === 'ready' || action.type === 'cancelLeaderRequest' || !g.revival.prevented);
if (action.type === 'emperorRevival' && g.revivalOrder)
return g.revivalOrder.remaining[0] === me.ally;
return g.revivalOrder.remaining[0] === (action.target ?? me.ally);
return true;
});
}