diff --git a/apps/web/src/arcade-games/rithmomachia/components/RithmomachiaGame.tsx b/apps/web/src/arcade-games/rithmomachia/components/RithmomachiaGame.tsx index 56914e76..537eabf7 100644 --- a/apps/web/src/arcade-games/rithmomachia/components/RithmomachiaGame.tsx +++ b/apps/web/src/arcade-games/rithmomachia/components/RithmomachiaGame.tsx @@ -25,43 +25,19 @@ import { import { PieceRenderer } from './PieceRenderer' /** - * Error dialog when no capture is possible + * Error dialog when no capture is possible - simple one-liner */ function CaptureErrorDialog({ targetPos, cellSize, - moverPiece, - targetPiece, onClose, closing, }: { targetPos: { x: number; y: number } cellSize: number - moverPiece: Piece - targetPiece: Piece onClose: () => void closing: boolean }) { - const moverValue = getEffectiveValue(moverPiece) - const targetValue = getEffectiveValue(targetPiece) - - // Get explanations for why each relation failed - const explanations: string[] = [] - if ( - moverValue !== undefined && - moverValue !== null && - targetValue !== undefined && - targetValue !== null - ) { - explanations.push(checkEqual(moverValue, targetValue).explanation || '') - explanations.push(checkMultiple(moverValue, targetValue).explanation || '') - explanations.push(checkDivisor(moverValue, targetValue).explanation || '') - explanations.push('SUM: No friendly piece can serve as helper') - explanations.push('DIFF: No friendly piece can serve as helper') - explanations.push('PRODUCT: No friendly piece can serve as helper') - explanations.push('RATIO: No friendly piece can serve as helper') - } - const entranceSpring = useSpring({ from: { scale: 0, opacity: 0 }, scale: closing ? 0 : 1, @@ -80,66 +56,38 @@ function CaptureErrorDialog({ )} >
e.stopPropagation()} > -
- ❌ Capture Not Possible -
-
- No mathematical relation works: -
-
- {explanations.filter(Boolean).map((exp, i) => ( -
- • {exp} -
- ))} -
+
No valid mathematical relation