'use client'; import type { Action, GameView } from '@/game/engine'; import { battleCardLabel } from '@/game/battle-cards'; import { Button } from './ui/button'; export function DiplomatDefense({ game, act, busy, }: { game: GameView; act: (action: Action) => void; busy: boolean; }) { const decision = game.decision?.kind === 'diplomatDefense' ? game.decision : null; if (!decision || decision.player !== game.me) return null; const me = game.players.find((player) => player.id === game.me); const visibleCards = [...(game.battle?.cards ?? []), ...(me?.hand ?? [])]; const card = (id: string) => visibleCards.find((entry) => entry.id === id); const source = card(decision.source); const copiedDefense = source ? battleCardLabel(source.kind) : 'defense'; return (
The opposing committed defense,{' '} {source?.name ?? decision.source}, provides{' '} {copiedDefense} protection. Diplomat can copy that protection onto one of your committed Worthless cards.
Choose one committed Worthless card as the copied defense. That card must be discarded after this battle. Decline to proceed without a copied defense.
{decision.cards.map((id) => ( ))}