diff --git a/SerpentRace_Backend/src/Application/Services/CardDrawingService.ts b/SerpentRace_Backend/src/Application/Services/CardDrawingService.ts index cbb0d3bf..8b9f28cb 100644 --- a/SerpentRace_Backend/src/Application/Services/CardDrawingService.ts +++ b/SerpentRace_Backend/src/Application/Services/CardDrawingService.ts @@ -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) }; } diff --git a/SerpentRace_Backend/src/Application/Services/GameWebSocketService.ts b/SerpentRace_Backend/src/Application/Services/GameWebSocketService.ts index fd2fcf14..1343ff90 100644 --- a/SerpentRace_Backend/src/Application/Services/GameWebSocketService.ts +++ b/SerpentRace_Backend/src/Application/Services/GameWebSocketService.ts @@ -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 { 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; }