Settle CHOAM charity claims after depleted funding

Keep CHOAM's own poverty claim bank-funded. Prototype full other-faction
claims using available CHOAM cash and an explicitly provisional bank residual;
retain original eligibility, cancellation, Homeworld portions and claim limits.
Connect persistent controls and genuine public setup/bribe evidence. Complete
rules and deployed acceptance remain open.
This commit is contained in:
Quintine committed 2026-10-24 18:03:08 +11:00
1 parent 52832dc0fd
commit d63efccb55
15 files changed
+798 -58

No files matched your search

+53
View File
@@ -0,0 +1,53 @@
'use client';
import { ArrowRight } from 'lucide-react';
import { Button } from '@/components/ui/button';
import type { Action, GameView } from '@/game/engine';
export function CharityClaim({
game,
act,
busy,
}: {
game: GameView;
act: (action: Action) => void;
busy: boolean;
}) {
const me = game.players.find((player) => player.id === game.me);
if (game.status !== 'playing' || game.phase !== 2 || !me) return null;
const disabled = busy || !!game.truthtrance || !!game.nexusTraitors?.pending ||
!!me.charityClaimed || game.charity.incomePending || game.charity.amount === 0;
return (
<>
<p className="muted">
{game.charity.multiplier === 0
? 'Inflation cancels charity for every faction this turn.'
: game.charity.multiplier === 2
? 'Inflation doubles the amount of charity you receive. Ordinary eligibility still requires fewer than two spice; advanced Bene Gesserit receives four regardless of wealth.'
: game.advanced && me.faction === 'beneGesserit'
? 'Receive two spice once per turn. If you already hold two or more, opponents may cancel the faction benefit with Karama.'
: 'If you have fewer than two spice, claim charity once to reach two.'}
</p>
<p className="fine">
{game.charity.payer
? `The ordinary claim is ${game.charity.ordinary} spice. CHOAM pays as much of the ordinary claim as it can; the Spice Bank supplies any shortfall. This funding rule is provisional.`
: 'Charity is paid by the Spice Bank.'}
{game.charity.homeworld > 0 &&
` Low Homeworld population adds ${game.charity.homeworld} spice directly from the bank${game.charity.multiplier === 2 ? ' after Inflation doubles the bonus' : ''}.`}
</p>
<Button
data-testid="charity-claim-submit"
className="game-action"
disabled={disabled}
onClick={() => {
if (!disabled) act({ type: 'charity' });
}}
>
{game.charity.amount > 0
? `Claim ${game.charity.amount} charity spice`
: 'Claim charity'}
<ArrowRight size={15} />
</Button>
</>
);
}
+2 -29
View File
@@ -51,6 +51,7 @@ import { NexusAdvisors } from './nexus-advisors';
import { NexusSardaukar } from './nexus-sardaukar';
import { TerrorBoardMarkers } from './terror-board-markers';
import { AmbassadorBoardMarkers } from './ambassador-board-markers';
import { CharityClaim } from './charity-claim';
import { homeworldRevivalActionBlock } from '@/game/homeworld-revival-deployment-options';
import { GuildHomeworldShipment } from './guild-homeworld-shipment';
import { JunctionTransport } from './junction-transport';
@@ -4204,35 +4205,7 @@ export function GameTable({
Ready the table to reveal the next spice blow.
</p>
)}
{g.phase === 2 && (
<>
<p className="muted">
{g.charity.multiplier === 0
? 'Inflation cancels charity for every faction this turn.'
: g.charity.multiplier === 2
? 'Inflation doubles the amount of charity you receive. Ordinary eligibility still requires fewer than two spice; advanced Bene Gesserit receives four regardless of wealth.'
: g.advanced && me.faction === 'beneGesserit'
? 'Receive two spice once per turn. If you already hold two or more, opponents may cancel the faction benefit with Karama.'
: 'If you have fewer than two spice, claim charity once to reach two.'}
</p>
<p className="fine">
{g.charity.payer
? `The ordinary ${g.charity.ordinary} spice is paid from ${g.players.find((p) => p.id === g.charity.payer)?.name}’s spice.`
: 'Charity is paid by the Spice Bank.'}
{g.charity.homeworld > 0 &&
` Low Homeworld population adds ${g.charity.homeworld} spice directly from the bank${g.charity.multiplier === 2 ? ' after Inflation doubles the bonus' : ''}.`}
</p>
{actionButton(
g.charity.amount > 0
? `Claim ${g.charity.amount} charity spice`
: 'Claim charity',
{ type: 'charity' },
me.charityClaimed ||
g.charity.incomePending ||
g.charity.amount === 0,
)}
</>
)}
{g.phase === 2 && <CharityClaim game={g} act={act} busy={busy} />}
{g.phase === 3 && g.richeseAuction && (
<RicheseAuctionLot
key={`${g.richeseAuction.event}-${g.me}`}