chore(SCOPONE-0006): complete iteration 0 — fix scopa rule and improve AI intelligence

This commit is contained in:
Giancarmine Salucci
2026-04-01 09:44:15 +02:00
parent 185f7c36c7
commit 30897c5eb3
2 changed files with 395 additions and 137 deletions

View File

@@ -147,10 +147,13 @@ export function applyMove(
// Add played card + captured to player's pile
player.pile.push(card, ...capturedCards);
// Scopa: cleared the table
// Scopa: cleared the table (but NOT on the last play of the round)
if (state2.table.length === 0) {
player.scope += 1;
isScopa = true;
const allHandsEmptyNow = state2.players.every(p => p.hand.length === 0);
if (!allHandsEmptyNow) {
player.scope += 1;
isScopa = true;
}
}
// Track which team made last capture