Expand Semuta and Richese Homeworld shipments
Verify and publish checkpoint container / container (push) Successful in 10m7s
Verify and publish checkpoint container / container (push) Successful in 10m7s
This commit is contained in:
1 parent
1ba942138d
commit
4d769af8c7
15 files changed
+626
-39
No files matched your search
@@ -22,9 +22,8 @@ export function homeworldName(view: GameView, id: string): string {
|
||||
);
|
||||
}
|
||||
|
||||
/** Owner-only marker quote. The face stays private; the amount and invoice are
|
||||
* one regardless of denomination. Authoritative timing and payment remain in
|
||||
* the normal Homeworld shipment action. */
|
||||
/** Owner-only marker quote. The face stays private; the marker counts as one
|
||||
* regardless of denomination, plus any selected physical companions. */
|
||||
export function richeseHomeworldMarkerChoice(
|
||||
view: GameView,
|
||||
destination: string,
|
||||
@@ -71,11 +70,10 @@ export function richeseHomeworldMarkerChoice(
|
||||
}
|
||||
try {
|
||||
if (source === undefined) {
|
||||
if (forces !== undefined) {
|
||||
result.blocked = 'Physical forces may accompany only a deployed Homeworld No-Field.';
|
||||
return result;
|
||||
}
|
||||
quoteRicheseHomeworldMarkerShipment(context, custody, { player: me.id, destination, tokenId }, info.private);
|
||||
const quote = quoteRicheseHomeworldMarkerShipment(context, custody,
|
||||
{ player: me.id, destination, tokenId, ...(forces === undefined ? {} : { forces }) }, info.private);
|
||||
result.amount = quote.amount;
|
||||
result.cost = quote.cost;
|
||||
} else {
|
||||
const quote = quoteRicheseHomeworldMarkerTransfer(context, custody,
|
||||
{ player: me.id, destination, tokenId, source, ...(forces === undefined ? {} : { forces }) }, info.private);
|
||||
@@ -92,8 +90,8 @@ export function richeseHomeworldMarkerChoice(
|
||||
result.blocked = 'Your spice and selected allied contribution cannot pay this shipment.';
|
||||
return result;
|
||||
}
|
||||
const sources = source !== undefined && forces && forces.normal + forces.elite > 0
|
||||
? { [source]: forces } : {};
|
||||
const sources = forces && forces.normal + forces.elite > 0
|
||||
? { [source ?? 'homeworld:richese']: forces } : {};
|
||||
result.action = { type: 'homeworldShip', event: option.event, destination, sources,
|
||||
noField: tokenId, noFieldEvent: info.event, allyPayment, ...(source === undefined ? {} : { noFieldFrom: source }) };
|
||||
} catch (error) {
|
||||
@@ -412,7 +410,8 @@ export function homeworldShipmentActions(
|
||||
Math.max(0, 1 - (me.spice ?? 0)), source);
|
||||
if (quote.action) {
|
||||
actions.push(quote.action);
|
||||
const pool = source && view.homeworlds?.worlds?.find(world => world.id === source)?.forces[me.id];
|
||||
const pool = source ? view.homeworlds?.worlds?.find(world => world.id === source)?.forces[me.id] :
|
||||
{ normal: me.reserves - (me.elites?.reserves ?? 0), elite: me.elites?.reserves ?? 0 };
|
||||
if (pool && (pool.normal > 0 || pool.elite > 0)) {
|
||||
const forces = { normal: pool.normal > 0 ? 1 : 0, elite: pool.normal > 0 ? 0 : 1 };
|
||||
const initial = richeseHomeworldMarkerChoice(view, target.world.id, token.id, 0, source, forces);
|
||||
|
||||
Reference in new issue
Block a user