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 { return {
correct: true, // Luck cards are always "correct" since no answer is needed correct: true, // Luck cards are always "correct" since no answer is needed
consequence: consequence, 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 // Process luck card with multi-turn support
// Note: processLuckCard will update position again if consequence moves player // Note: processLuckCard will update position again if consequence moves player
if (card.consequence) { if (card.consequence) {
await this.processLuckCard(gameCode, playerId, playerName, card.consequence, position); await this.processLuckCard(gameCode, playerId, playerName, card.consequence, position, card.question);
} else { } else {
// Fallback to old method if no consequence object // Fallback to old method if no consequence object
await this.applyCardConsequence(gameCode, playerId, playerName, result.consequence); await this.applyCardConsequence(gameCode, playerId, playerName, result.consequence);
@@ -2238,7 +2238,8 @@ export class GameWebSocketService {
playerId: string, playerId: string,
playerName: string, playerName: string,
consequence: { type: number; value?: number }, consequence: { type: number; value?: number },
currentPosition: number currentPosition: number,
lucktext?: string
): Promise<void> { ): Promise<void> {
const gameRoomName = `game_${gameCode}`; const gameRoomName = `game_${gameCode}`;
let newPosition = currentPosition; let newPosition = currentPosition;
@@ -2343,6 +2344,13 @@ export class GameWebSocketService {
message: `${playerName} goes back to START!`, message: `${playerName} goes back to START!`,
timestamp: new Date().toISOString() 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; break;
} }