Support group-funded Karama shipment pricing
Verify and publish checkpoint container / container (push) Canceled after 0s
Verify and publish checkpoint container / container (push) Canceled after 0s
This commit is contained in:
1 parent
40c9651b80
commit
9cc659602c
7 files changed
+89
-10
No files matched your search
+5
-5
@@ -16096,12 +16096,12 @@ function applyCoalitionTransition(g: Game, result: CoalitionTransition) {
|
||||
}
|
||||
syncCoalitionEscrow(g, before);
|
||||
}
|
||||
/** Staged group-funding scope: ordinary Basic planet shipments and bids;
|
||||
* independent purchased rates and special transactions remain separate. */
|
||||
/** Staged group-funding scope: Basic physical shipments and ordinary bids;
|
||||
* optional modules and special transactions remain separate. */
|
||||
function coalitionFundingAvailable(g: Game, p: Player, committedBid = false): boolean {
|
||||
if (!g.coalitionEscrow || !g.coalitionState || g.status !== 'playing' || g.advanced || ![3, 5].includes(g.phase) ||
|
||||
g.expansions.length || g.homeworlds || g.nexusCards || g.leaderSkills || g.techTokens ||
|
||||
g.strongholdCards || g.ecazTreachery || g.discoveryEnabled || g.karamaShipping ||
|
||||
g.strongholdCards || g.ecazTreachery || g.discoveryEnabled ||
|
||||
g.spiceBankerIncomePreview || g.kullPreview || g.richeseAuction || g.ixAuction ||
|
||||
(!committedBid && (g.bidPromises?.length || g.phaseBidPromises?.length || g.turnActionPromises?.length ||
|
||||
g.revivalPromises?.length || g.bribePromises?.length))) return false;
|
||||
@@ -38526,7 +38526,7 @@ function commitGuildTransport(
|
||||
const groupContributors = groupShares ? [{payer:p.id, amount:cost-groupTotal},
|
||||
...groupShares.map(share => ({payer:share.donor, amount:share.amount}))]
|
||||
.filter(share => share.payer !== guild?.id && share.amount > 0) : null;
|
||||
const guildPayment = groupContributors ? groupContributors.reduce((sum, share) => sum + share.amount, 0) : guildShipmentIncome({
|
||||
const guildPayment = g.karamaShipping?.player === p.id ? 0 : groupContributors ? groupContributors.reduce((sum, share) => sum + share.amount, 0) : guildShipmentIncome({
|
||||
guild: guild?.id, shipper: p.id, ally: p.ally, cost, allyPayment,
|
||||
bankOnly: g.karamaShipping?.player === p.id,
|
||||
});
|
||||
@@ -38802,7 +38802,7 @@ function commitShipment(g: Game, shipment: PendingShipment, settlement?: {recipi
|
||||
const groupContributors = groupShares ? [{payer:p.id, amount:cost - groupTotal},
|
||||
...groupShares.map(share => ({payer:share.donor, amount:share.amount}))]
|
||||
.filter(share => share.payer !== guild?.id && share.amount > 0) : null;
|
||||
const guildPayment = groupContributors ? groupContributors.reduce((sum, share) => sum + share.amount, 0) : guildShipmentIncome({
|
||||
const guildPayment = g.karamaShipping?.player === p.id ? 0 : groupContributors ? groupContributors.reduce((sum, share) => sum + share.amount, 0) : guildShipmentIncome({
|
||||
guild: guild?.id,
|
||||
shipper: p.id,
|
||||
ally: p.ally,
|
||||
|
||||
Reference in new issue
Block a user