diff --git a/assets/json/sorting-hat.json b/assets/json/sorting-hat.json index caf2498e..efc2791c 100644 --- a/assets/json/sorting-hat.json +++ b/assets/json/sorting-hat.json @@ -1285,7 +1285,7 @@ { "text": "No, I agree with her.", "points": { - "b": 100 + "b": 99999999 } } ] diff --git a/commands/games-sp/sorting-hat.js b/commands/games-sp/sorting-hat.js index 943f8d7e..46199262 100644 --- a/commands/games-sp/sorting-hat.js +++ b/commands/games-sp/sorting-hat.js @@ -68,13 +68,15 @@ module.exports = class SortingHatCommand extends Command { }); if (!choice.size) return msg.say('Oh no, you ran out of time! Too bad.'); if (choice.first().content.toUpperCase() === 'END') return msg.say('See you next time!'); - const answer = answers[choices.indexOf(choice.first().content.toUpperCase())]; + const answer = answers[choices.indexOf(choice.first().content.toUpperCase()) - 1]; for (const [house, amount] of Object.entries(answer.points)) points[house] += amount; ++turn; } const houseResult = Object.keys(points).filter(h => points[h] > 0).sort((a, b) => points[b] - points[a]); const totalPoints = houseResult.reduce((a, b) => a + points[b], 0); - const lb = houseResult.map(house => `${houses[house]}: ${Math.round((points[house] / totalPoints) * 100)}%`).join('\n'); + const lb = houseResult.map( + house => `${houses[house]}: ${Math.round((points[house] / totalPoints) * 100)}%` + ).join('\n'); return msg.say(stripIndents` You are a member of... **${houses[houseResult[0]]}**! _${descriptions[houseResult[0]]}_