development

This commit is contained in:
Donat Magda
2025-11-27 00:31:15 +01:00
parent f82bd6d304
commit d25e3f505e
2 changed files with 11 additions and 3 deletions
@@ -286,7 +286,7 @@ export class CardDrawingService {
return {
correct: true, // Luck cards are always "correct" since no answer is needed
consequence: consequence,
description: `🍀 ${this.getConsequenceDescription(consequence, true)}`
description: card.question || this.getConsequenceDescription(consequence, true)
};
}
@@ -1234,7 +1234,7 @@ export class GameWebSocketService {
// Process luck card with multi-turn support
// Note: processLuckCard will update position again if consequence moves player
if (card.consequence) {
await this.processLuckCard(gameCode, playerId, playerName, card.consequence, position);
await this.processLuckCard(gameCode, playerId, playerName, card.consequence, position, card.question);
} else {
// Fallback to old method if no consequence object
await this.applyCardConsequence(gameCode, playerId, playerName, result.consequence);
@@ -2238,7 +2238,8 @@ export class GameWebSocketService {
playerId: string,
playerName: string,
consequence: { type: number; value?: number },
currentPosition: number
currentPosition: number,
lucktext?: string
): Promise<void> {
const gameRoomName = `game_${gameCode}`;
let newPosition = currentPosition;
@@ -2343,6 +2344,13 @@ export class GameWebSocketService {
message: `${playerName} goes back to START!`,
timestamp: new Date().toISOString()
});
this.io.of('/game').to(gameRoomName).emit('game:player-arrived', {
playerId,
playerName,
position: 1,
fieldType: 'luck',
timestamp: new Date().toISOString()
});
break;
}