diff --git a/client/src/components/GameBoard.tsx b/client/src/components/GameBoard.tsx index fd48870..a73cd35 100644 --- a/client/src/components/GameBoard.tsx +++ b/client/src/components/GameBoard.tsx @@ -15,6 +15,10 @@ export default function GameBoard({ gameState, currentPlayerId, actions }: GameB // Hooks para FASE REVEAL ROLE const [revealCard, setRevealCard] = useState(false); + // Orden aleatorio de cartas de misión (se genera una vez) + const [cardOrder] = useState(() => Math.random() > 0.5); + + // Timer para avanzar automáticamente en REVEAL_ROLE useEffect(() => { if (gameState.phase === 'reveal_role' as any) { @@ -463,109 +467,104 @@ export default function GameBoard({ gameState, currentPlayerId, actions }: GameB ) : (
VOTO REGISTRADO. ESPERANDO AL RESTO... + ```
)} )} {/* FASE: MISIÓN */} - {gameState.phase === GamePhase.MISSION && (() => { - // Generar orden aleatorio de cartas (solo una vez por jugador) - const [cardOrder] = useState(() => Math.random() > 0.5); - const successFirst = cardOrder; + {gameState.phase === GamePhase.MISSION && ( + + {gameState.proposedTeam.includes(currentPlayerId) ? ( +
+

+ 🎯 ¡ESTÁS EN LA MISIÓN! +

+

+ Elige el resultado de tu participación +

- return ( - - {gameState.proposedTeam.includes(currentPlayerId) ? ( -
-

- 🎯 ¡ESTÁS EN LA MISIÓN! -

-

- Elige el resultado de tu participación -

+ {/* DEBUG INFO - TEMPORAL */} +
+ Debug: Tu ID: {currentPlayerId} | Equipo: [{gameState.proposedTeam.join(', ')}] +
- {/* DEBUG INFO - TEMPORAL */} -
- Debug: Tu ID: {currentPlayerId} | Equipo: [{gameState.proposedTeam.join(', ')}] -
+ {/* Cartas en orden aleatorio */} +
+ {cardOrder ? ( + <> + {/* Carta de Éxito primero */} + - {/* Cartas en orden aleatorio */} -
- {successFirst ? ( - <> - {/* Carta de Éxito primero */} - - - {/* Carta de Sabotaje segundo (solo para espías) */} - {currentPlayer?.faction === 'spies' && ( - - )} - - ) : ( - <> - {/* Carta de Sabotaje primero (solo para espías) */} - {currentPlayer?.faction === 'spies' && ( - - )} - - {/* Carta de Éxito segundo */} - - - )} -
+ )} + + {/* Carta de Éxito segundo */} + + + )}
- ) : ( -
-
- La misión está en curso...
- Esperando a que el equipo complete su votación. -
- )} - - ); - })()} +
+ ) : ( +
+
+ La misión está en curso...
+ Esperando a que el equipo complete su votación. +
+ )} +
+ )} {/* FASE: REVELACIÓN DE CARTAS */} {gameState.phase === 'mission_reveal' as any && (