diff --git a/commands/games/sorting-hat.js b/commands/games/sorting-hat.js index a895013e..1fbcc617 100644 --- a/commands/games/sorting-hat.js +++ b/commands/games/sorting-hat.js @@ -59,11 +59,14 @@ module.exports = class SortingHatCommand extends Command { for (const [house, amount] of Object.entries(answer.points)) points[house] += amount; ++turn; } - const house = Object.keys(points).sort((a, b) => points[b] - points[a])[0]; + const houseResult = Object.keys(points).sort((a, b) => points[b] - points[a]); this.playing.delete(msg.channel.id); + const totalPoints = points.g + points.s + points.h + points.r; return msg.say(stripIndents` - You are a member of... **${houses[house]}**! - _${descriptions[house]}_ + You are a member of... **${houses[houseResult[0]]}**! + _${descriptions[houseResult[0]]}_ + + ${houseResult.map(house => `${houses[house]}: ${Math.round(points[house] / totalPoints)}%`).join('\n')} `); } catch (err) { this.playing.delete(msg.channel.id); diff --git a/package.json b/package.json index f8b9936b..9611b4b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "101.10.1", + "version": "101.10.2", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {