diff --git a/components/choam-baliset.tsx b/components/choam-baliset.tsx index a0370731..162a505d 100644 --- a/components/choam-baliset.tsx +++ b/components/choam-baliset.tsx @@ -1,5 +1,7 @@ 'use client'; import { useState } from 'react'; +import { ChoamPowerCost, useChoamPower } from './choam-power-cost'; +import { choamPowerAction } from '@/game/choam-power-options'; import { Button } from '@/components/ui/button'; import { HelpTip } from './help-tip'; import type { Action, GameView } from '@/game/engine'; @@ -14,12 +16,12 @@ export function ChoamBaliset({ act: (a: Action) => void; busy: boolean; }) { + const power = useChoamPower(g, 'baliset'); const [target, setTarget] = useState(''); const [territory, setTerritory] = useState(''); if (!g.choamWorthless || g.phase !== 5) return null; const d = g.decision?.kind === 'choamMovement' ? g.decision : null; - const card = g.choamWorthless.cards.find((c) => c.name === 'Baliset'); - if (!card && !d) return null; + if (!power.play && !d) return null; const players = g.players.filter((p) => p.faction !== 'choam'); const selectedPlayer = d?.mover ?? players.find((p) => p.id === target)?.id ?? players[0]?.id; @@ -50,7 +52,7 @@ export function ChoamBaliset({ forces have moved yet.

) : ( - card && ( + power.play && ( <> - {card ? ( + + {power.play ? ( diff --git a/components/choam-worthless.tsx b/components/choam-worthless.tsx index 14d99b07..727d3c51 100644 --- a/components/choam-worthless.tsx +++ b/components/choam-worthless.tsx @@ -1,5 +1,7 @@ 'use client'; import { useState } from 'react'; +import { ChoamPowerCost, useChoamPower } from './choam-power-cost'; +import { choamPowerAction, choamPowerPlays } from '@/game/choam-power-options'; import { HelpTip } from './help-tip'; import { Button } from '@/components/ui/button'; import type { Action, GameView } from '@/game/engine'; @@ -13,7 +15,7 @@ export function ChoamWorthless({ busy: boolean; }) { const [target, setTarget] = useState(''); - const me = g.players.find((p) => p.id === g.me)!; + const power = useChoamPower(g, g.phase === 4 ? 'laLaLa' : 'kulon'); const reactive = g.decision?.kind === 'choamFreeRevival'; if (!g.choamWorthless || ![4, 5].includes(g.phase)) return null; const selected = g.choamWorthless.targets.includes(target) @@ -53,32 +55,34 @@ export function ChoamWorthless({ force revival.

)} - {g.choamWorthless.cards - .filter((c) => - g.phase === 4 ? c.name === 'La La La' : c.name === 'Kulon', - ) - .map((c) => ( - - ))} + + {power.play && ( + + )} + {choamPowerPlays(g, 'kull').some( + (play) => play.source === 'nexus' && play.effect === 'kull', + ) && ( +

+ Kull Wahad’s Karama prevention effect is not implemented. CHOAM + Cunning cannot use it yet. +

+ )} {reactive && (