mirror of
https://github.com/Such-Software/wownerogue.git
synced 2026-10-19 07:08:33 +02:00
game and display mostly working, using autostart for now to work on lighting (dim explored tiles out of FoV)
This commit is contained in:
@@ -133,17 +133,17 @@ function checkGamesTimeout(currentHeight) {
|
||||
activeGames.forEach((game, socketId) => {
|
||||
const user = getUserBySocket(socketId);
|
||||
|
||||
// Player must escape before the next block after their start block
|
||||
// If they started on block 2, they must escape before block 3 is found
|
||||
if (user && user.blockRec && currentHeight > user.blockRec) {
|
||||
console.log(`Game timeout for player ${socketId}: started on block ${user.blockRec}, current block ${currentHeight}`);
|
||||
// Player has 3 blocks to complete the dungeon
|
||||
// If they started on block 2, they must escape before block 5 is found
|
||||
if (user && user.blockRec && currentHeight > user.blockRec + 2) {
|
||||
console.log(`Game timeout for player ${socketId}: started on block ${user.blockRec}, current block ${currentHeight} (allowed until block ${user.blockRec + 2})`);
|
||||
|
||||
// Game has timed out - player didn't escape in time
|
||||
game.gameState = 'lost';
|
||||
io.to(socketId).emit('game_over', {
|
||||
status: 'lost',
|
||||
reason: 'timeout',
|
||||
message: 'You didn\'t escape before the next block was found!'
|
||||
message: 'You didn\'t escape before the block time limit!'
|
||||
});
|
||||
|
||||
activeGames.delete(socketId);
|
||||
|
||||
Reference in New Issue
Block a user