Connect Basic shared Ecaz Orgiz Collection settlement

This commit is contained in:
Quintine committed 2026-10-14 20:07:59 +11:00
1 parent bcd1b1041a
commit 1f38f12beb
11 files changed
+196 -73

No files matched your search

+9 -10
View File
@@ -305,7 +305,7 @@ import {
} from './board-resolution-quote';
import {
quoteDiscoveryCollection,
quoteAdvancedSharedOrgiz,
quoteSharedOrgiz,
DiscoveryCollectionError,
type DiscoveryCollectionQuote,
} from './discovery-collection';
@@ -19690,15 +19690,14 @@ function decideSharedSpice(g: Game, id: string, action: Action) {
`${territory(receipt.territory).name} shared collection: Ecaz received ${receipt.ecazAmount} spice and ${faction(getPlayer(g, receipt.ally).faction).name} received ${receipt.allyAmount}, ${receipt.method === 'agreement' ? 'by agreement' : 'using the equal split with any odd spice going to the ally'}.`,
{ faction: 'ecaz', name: 'Shared collection' },
);
if (g.advanced) {
const balances = Object.fromEntries(g.players.map(player => [player.id,player.spice]));
const transfers = nexusRule(() => quoteAdvancedSharedOrgiz(g,receipt,balances));
for (const transfer of transfers) {
getPlayer(g,transfer.from).spice -= transfer.amount;
getPlayer(g,transfer.player).spice += transfer.amount;
log(g, `${faction(getPlayer(g,transfer.player).faction).name} took ${transfer.amount} spice from ${faction(getPlayer(g,transfer.from).faction).name} through Orgiz Processing Station after the original shared territory allocation.`,
{faction:getPlayer(g,transfer.player).faction,name:'Orgiz Processing Station'});
}
const balances = Object.fromEntries(g.players.map(player => [player.id,player.spice]));
const transfers = nexusRule(() => quoteSharedOrgiz(g,receipt,balances,pending.sourceSpice));
for (const transfer of transfers) {
getPlayer(g,transfer.from).spice -= transfer.amount;
getPlayer(g,transfer.player).spice += transfer.amount;
recordFremenCollection(g,transfer.player,`orgiz:shared:${transfer.location}:${transfer.player}`,transfer.amount);
log(g, `${faction(getPlayer(g,transfer.player).faction).name} took ${transfer.amount} spice from ${faction(getPlayer(g,transfer.from).faction).name} through Orgiz Processing Station after the original shared territory allocation.`,
{faction:getPlayer(g,transfer.player).faction,name:'Orgiz Processing Station'});
}
} else
log(