Connect native paired E2 Bureaucrat funding
This commit is contained in:
1 parent
c3d1896673
commit
b207dd0479
13 files changed
+998
-49
No files matched your search
+5
-5
@@ -7,7 +7,7 @@ import { quoteSpicePlacement, stormExposesTerritory, stormSectorAfter, wormConsu
|
||||
import { isStormCardDistance, type StormCardComponent } from './storm-cards';
|
||||
import { createLeaderSkills, validateLeaderSkills, dealLeaderSkills, chooseLeaderSkill, returnDeadLeaderSkills, offerRevivedLeaderSkill, drawRevivedLeaderSkills, declineRevivedLeaderSkill, LeaderSkillError, type LeaderSkillsState, type LeaderSkillsView } from './leader-skills';
|
||||
import { leaderSkillCard } from './leader-skill-cards';
|
||||
import { bureaucratPaymentModeSupported, bureaucratPaymentSignature, bureaucratUsed, quoteBureaucratPayment, type BureaucratPaymentSource, type BureaucratPaymentUse, type BureaucratPaymentView } from './bureaucrat-payment';
|
||||
import { bureaucratAlliedFundingModeSupported, bureaucratPaymentModeSupported, bureaucratPaymentSignature, bureaucratUsed, quoteBureaucratPayment, type BureaucratPaymentSource, type BureaucratPaymentUse, type BureaucratPaymentView } from './bureaucrat-payment';
|
||||
import { MENTAT_EMPTY_HAND, MentatQuestionError, mentatQuestionModeSupported, mentatWeaponNames, mentatHand, quoteMentatReveal, mentatSignature, type MentatQuestionReceipt, type MentatObservation, type MentatView } from './mentat-question';
|
||||
import {
|
||||
canUsePlanetologistBattleSpecial,
|
||||
@@ -8460,8 +8460,8 @@ function checkBureaucratContributors(g: Game,payee:string|undefined,shares:{paye
|
||||
if (!owner || owner === payee || bureaucratUsed(g.bureaucratPayments?.used ?? [],g.turn,g.phase) ||
|
||||
!paid.some(share => share.amount >= 5 && share.payer !== owner && share.payer !== payee)) return;
|
||||
requireRule(bureaucratPaymentModeSupported(g),'Bureaucrat with other optional modules is still being integrated.');
|
||||
requireRule(paid.length === 1 && !privateFunding || !g.homeworlds && !g.expansions.length,
|
||||
'Bureaucrat on allied funding or multiple payer contributions with Homeworlds or expansion factions is awaiting integration.');
|
||||
requireRule(paid.length === 1 && !privateFunding || bureaucratAlliedFundingModeSupported(g),
|
||||
'Bureaucrat on allied funding or multiple payer contributions in this module composition is awaiting integration.');
|
||||
}
|
||||
function stampBureaucratPayment(g: Game,kind:BureaucratPaymentSource['kind'],payer:string,payee:string,amount:number,
|
||||
contributions?:BureaucratPaymentSource['contributions']):
|
||||
@@ -8477,7 +8477,7 @@ function stampBureaucratContributors(g:Game,kind:'auction'|'shipment',payee:stri
|
||||
const paid = shares.filter(share => share.amount > 0);
|
||||
if (!privateFunding && paid.length === 1)
|
||||
return stampBureaucratPayment(g,kind,paid[0].payer,payee,paid[0].amount);
|
||||
if (g.homeworlds || g.expansions.length) return {};
|
||||
if (!bureaucratAlliedFundingModeSupported(g)) return {};
|
||||
const owner = nativeBureaucrat(g)?.owner;
|
||||
const qualifying = paid.find(share => share.amount >= 5 && share.payer !== owner && share.payer !== payee);
|
||||
return qualifying ? stampBureaucratPayment(g,kind,qualifying.payer,payee,
|
||||
@@ -8499,7 +8499,7 @@ function validateBureaucratSource(g: Game,source:BureaucratPaymentSource) {
|
||||
Number.isSafeInteger(source.amount) && source.amount >= 5 && source.signature === bureaucratPaymentSignature(source),
|
||||
'The saved Bureaucrat payment changed its actual payer, payee, amount or event.');
|
||||
if (source.contributions) {
|
||||
requireRule(!g.homeworlds && !g.expansions.length && source.privateFunding === true &&
|
||||
requireRule(bureaucratAlliedFundingModeSupported(g) && source.privateFunding === true &&
|
||||
(source.kind === 'auction' || source.kind === 'shipment') &&
|
||||
source.contributions.length >= 1 && source.contributions.length <= 2 &&
|
||||
source.contributions.every(share => g.players.some(player => player.id === share.payer)) &&
|
||||
|
||||
Reference in new issue
Block a user