nerf: vole d'une pièce

This commit is contained in:
Didictateur 2025-11-22 22:48:40 +01:00
parent 796d62d01c
commit 928a8b9068

View file

@ -1282,6 +1282,16 @@ io.on('connection', (socket) => {
try{ io.to(room.id).emit('card:effect:applied', { roomId: room.id, effect }); }catch(_){ } try{ io.to(room.id).emit('card:effect:applied', { roomId: room.id, effect }); }catch(_){ }
played.payload = Object.assign({}, payload, { applied: 'steal', appliedTo: target, fromColor: oldColor }); played.payload = Object.assign({}, payload, { applied: 'steal', appliedTo: target, fromColor: oldColor });
// after performing a piece-theft, the playing player immediately loses their turn
try{
if(board){
board.turn = (board.turn === 'w') ? 'b' : 'w';
// draw for the next player at the start of their turn
const nextColor = board.turn;
const nextPlayer = (room.players || []).find(p => (p.color && p.color[0]) === nextColor);
if(nextPlayer){ try{ drawCardForPlayer(room, nextPlayer.id); }catch(_){ } }
}
}catch(_){ }
} }
}catch(e){ console.error('steal effect error', e); } }catch(e){ console.error('steal effect error', e); }
} }