Improved Letters distribution. Added conundrum to mash.

This commit is contained in:
Niels Simenon
2023-04-10 16:06:53 +02:00
parent f4776df853
commit 91eaa9d709
4 changed files with 50 additions and 11 deletions

View File

@@ -48,7 +48,12 @@ function start(length, context, attempt = 0) {
const newMash = mashes.get(context.room.id);
context.sendMessage(`Stomp stomp, here's your mash: ${style.bold(style.pink(newMash.anagram))}`, context.room.id);
if (context.command === 'conundrum') {
context.sendMessage(`Here is your conundrum: ${style.bold(style.pink(newMash.anagram))}`, context.room.id);
} else {
context.sendMessage(`Stomp stomp, here's your mash: ${style.bold(style.pink(newMash.anagram))}`, context.room.id);
}
context.logger.info(`Mash started, '${anagram}' with answers ${answers.map((answer) => `'${answer.word}'`).join(', ')}`);
}
@@ -193,6 +198,11 @@ function onCommand(args, context) {
return;
}
if (context.command === 'conundrum') {
start(9, context);
return;
}
if (!Number.isNaN(length)) {
start(length, context);
return;
@@ -221,7 +231,7 @@ function onMessage(message, context) {
module.exports = {
name: 'Mash',
commands: ['mash', 'wordmash', ...defineCommands, ...resolveCommands],
commands: ['mash', 'wordmash', 'conundrum', ...defineCommands, ...resolveCommands],
onCommand,
onMessage,
help: `Resolve the anagram. Get a new mash with ${config.prefix}mash [length], look up definitions with ${config.prefix}define [word], resolve an anagram (that's not currently in play) with ${config.prefix}solve [anagram].`,