mirror of
https://github.com/AlecM33/Werewolf.git
synced 2025-12-26 07:47:50 +01:00
reveal role functionality, beginnings of mod transfer
This commit is contained in:
@@ -102,10 +102,29 @@ class GameManager {
|
||||
let person = game.people.find((person) => person.id === personId)
|
||||
if (person && !person.out) {
|
||||
this.logger.debug('game ' + accessCode + ': killing player ' + person.name);
|
||||
person.userType = globals.USER_TYPES.KILLED_PLAYER;
|
||||
person.out = true;
|
||||
namespace.in(accessCode).emit(globals.CLIENT_COMMANDS.KILL_PLAYER, person.id)
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
socket.on(globals.CLIENT_COMMANDS.REVEAL_PLAYER, (accessCode, personId) => {
|
||||
let game = this.activeGameRunner.activeGames[accessCode];
|
||||
if (game) {
|
||||
let person = game.people.find((person) => person.id === personId)
|
||||
if (person && !person.revealed) {
|
||||
this.logger.debug('game ' + accessCode + ': revealing player ' + person.name);
|
||||
person.revealed = true;
|
||||
namespace.in(accessCode).emit(
|
||||
globals.CLIENT_COMMANDS.REVEAL_PLAYER,
|
||||
{
|
||||
id: person.id,
|
||||
gameRole: person.gameRole,
|
||||
alignment: person.alignment
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user