Grant Duke Vidal through occupied Ecaz Homeworld
This commit is contained in:
1 parent
d5c5342d2d
commit
78bcf22bca
18 files changed
+1291
-9
No files matched your search
@@ -1,6 +1,7 @@
|
||||
'use client';
|
||||
import { TraitorDecisionPromises } from './traitor-decision-promises';
|
||||
import { MovementPromises } from './movement-promises';
|
||||
import { HomeworldEcazDuke } from './homeworld-ecaz-duke';
|
||||
import { integerInputValue } from '../lib/integer-input';
|
||||
import { EcazSetup } from './ecaz-setup';
|
||||
import { StormCardInspector, StormCardLogInspector } from './storm-cards';
|
||||
@@ -1973,6 +1974,7 @@ export function GameTable({
|
||||
</div>
|
||||
{g.battle?.revealed && <a className="battle-display-link" href="#revealed-battle-plans">Compare revealed battle plans</a>}
|
||||
<PrivateBattlePlan game={g} />
|
||||
<HomeworldEcazDuke game={g} act={act} busy={reactionBusy || !!g.roomControl?.paused || !!g.roomControl?.closed || !!me.autopilot} />
|
||||
<MovementPromises game={g} act={act} busy={reactionBusy} />
|
||||
{!reactionOwnsControls && g.semutaReaction && <SemutaReaction game={g} act={act} busy={reactionBusy} />}
|
||||
{g.karamaBlocked && <p className="notice" role="status">{g.karamaBlocked}</p>}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
'use client';
|
||||
|
||||
import type { Action, GameView } from '@/game/engine';
|
||||
import { Button } from './ui/button';
|
||||
|
||||
export function HomeworldEcazDuke({
|
||||
game,
|
||||
act,
|
||||
busy,
|
||||
}: {
|
||||
game: GameView;
|
||||
act: (action: Action) => void;
|
||||
busy: boolean;
|
||||
}) {
|
||||
const offer = game.homeworldEcazDuke;
|
||||
if (!offer || offer.occupier !== game.me) return null;
|
||||
const blocked = offer.blocked ?? (!offer.event
|
||||
? 'This Duke grant is not currently available.'
|
||||
: !offer.recipients.length ? 'No eligible recipient is currently available.' : null);
|
||||
const disabled = busy || blocked !== null;
|
||||
return (
|
||||
<section className="notice space-y-3" aria-label="Occupied Ecaz Duke grant">
|
||||
<h3 className="font-serif text-xl">Occupied Ecaz: grant Duke Vidal</h3>
|
||||
<p className="muted">
|
||||
Provisional occupation benefit: grant the living shared Duke Vidal to
|
||||
yourself or your reciprocal ally. The recipient may use him in one
|
||||
battle, following the Duke’s ordinary lifecycle. Only Ecaz may revive him.
|
||||
</p>
|
||||
{blocked !== null && (
|
||||
<p className="notice" id="homeworld-ecaz-duke-unavailable">{blocked}</p>
|
||||
)}
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{offer.recipients.map((recipient) => (
|
||||
<Button
|
||||
key={recipient.id}
|
||||
data-testid={`homeworld-ecaz-duke-${recipient.id}`}
|
||||
className="game-action min-h-11 whitespace-normal"
|
||||
disabled={disabled}
|
||||
aria-describedby={blocked !== null ? 'homeworld-ecaz-duke-unavailable' : undefined}
|
||||
onClick={() => {
|
||||
if (!disabled && offer.event)
|
||||
act({ type: 'homeworldDuke', event: offer.event, recipient: recipient.id });
|
||||
}}
|
||||
>
|
||||
Grant Duke Vidal to {recipient.name}
|
||||
</Button>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user