development
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user