diff --git a/chat-plugins/scavengers.js b/chat-plugins/scavengers.js index f1b20a9acb..f9db0031a7 100644 --- a/chat-plugins/scavengers.js +++ b/chat-plugins/scavengers.js @@ -779,8 +779,27 @@ let commands = { if (!room.game || !room.game.scavGame) return this.errorReply(`There is no scavenger game currently running.`); let game = room.game.childGame || room.game; - let elapsed = Date.now() - game.startTime; - this.sendReplyBox(`The current ${game.gameType ? `${game.gameType} ` : ""}scavenger hunt by ${Chat.escapeHTML(Chat.toListString(game.hosts.map(h => h.name)))}${(game.hosts.some(h => h.userid === game.staffHostId) ? '' : ` (started by - ${Chat.escapeHTML(game.staffHostName)})`)} has been up for: ${Chat.toDurationString(elapsed, {hhmmss: true})}
Completed (${game.completed.length}): ${game.completed.map(u => Chat.escapeHTML(u.name)).join(', ')}
`); + if (game.hosts.some(h => h.userid === user.userid) || game.staffHostId === user.userid) { + let str = `
`; + for (let i = 0; i < game.questions.length; i++) { + let questionNum = i + 1; + let players = Object.values(game.players).filter(player => player.currentQuestion === i); + if (!players.length) { + str += ``; + } else { + str += Chat.html`
QuestionUsers on this Question
${questionNum}None
${questionNum}${players.map(pl => pl.name).join(", ")}`; + } + } + str += Chat.html`
Completed${game.completed.length ? game.completed.map(pl => pl.name).join(", ") : 'None'}`; + this.sendReply(`|raw|${str}
`); + } else { + const elapsedMsg = Chat.toDurationString(Date.now() - game.startTime, {hhmmss: true}); + const gameTypeMsg = game.gameType ? `${game.gameType} ` : ''; + const hostersMsg = Chat.toListString(game.hosts.map(h => h.name)); + const hostMsg = game.hosts.some(h => h.userid === game.staffHostId) ? '' : Chat.html` (started by - ${game.staffHostName})`; + const finishers = Chat.html`${game.completed.map(u => u.name).join(', ')}`; + this.sendReplyBox(`The current ${gameTypeMsg}scavenger hunt by ${hostersMsg}${hostMsg} has been up for: ${elapsedMsg}
Completed (${game.completed.length}): ${finishers}
`); + } }, hint: function (target, room, user) {