Compare commits
2 Commits
d257f93f3e
...
435ff3a4b5
Author | SHA1 | Date |
---|---|---|
|
435ff3a4b5 | |
|
c3f1b59416 |
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "schat2-clive",
|
"name": "schat2-clive",
|
||||||
"version": "1.19.0",
|
"version": "1.19.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "schat2-clive",
|
"name": "schat2-clive",
|
||||||
"version": "1.19.0",
|
"version": "1.19.1",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bhttp": "^1.2.8",
|
"bhttp": "^1.2.8",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "schat2-clive",
|
"name": "schat2-clive",
|
||||||
"version": "1.19.0",
|
"version": "1.19.1",
|
||||||
"description": "Game host for SChat 2-powered chat sites",
|
"description": "Game host for SChat 2-powered chat sites",
|
||||||
"main": "src/app.js",
|
"main": "src/app.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -74,7 +74,9 @@ function playLetter(playedLetter, context) {
|
||||||
renderBoard(context);
|
renderBoard(context);
|
||||||
|
|
||||||
if (game.partial.every((letter) => letter !== null)) {
|
if (game.partial.every((letter) => letter !== null)) {
|
||||||
context.sendMessage(style.bold('The word was completed!'), context.room.id);
|
context.sendMessage(`${style.bold('The word was completed.')} ${context.user.prefixedUsername} gets a point!`, context.room.id);
|
||||||
|
context.setPoints(context.user);
|
||||||
|
|
||||||
games.delete(context.room.id);
|
games.delete(context.room.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -91,8 +93,10 @@ function playWord(word, context) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
context.sendMessage('That\'s not it', context.room.id);
|
if (Math.abs(game.word.length - word.length) <= 1 && word.split('').some((letter, index) => game.word[index] === letter)) {
|
||||||
progress(context);
|
context.sendMessage(`That's not it, ${context.user.prefixedUsername}.`, context.room.id);
|
||||||
|
progress(context);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function stop(context) {
|
function stop(context) {
|
||||||
|
@ -124,7 +128,7 @@ function onCommand(args, context) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
context.logger.info(`Hangman played ${word.word} with ${getGuesses(word)} guesses`);
|
context.logger.info(`Hangman played '${word.word}' with ${getGuesses(word)} guesses`);
|
||||||
|
|
||||||
games.set(context.room.id, {
|
games.set(context.room.id, {
|
||||||
word: word.word,
|
word: word.word,
|
||||||
|
@ -160,4 +164,5 @@ module.exports = {
|
||||||
onCommand,
|
onCommand,
|
||||||
onMessage,
|
onMessage,
|
||||||
commands: ['hangman'],
|
commands: ['hangman'],
|
||||||
|
help: `Guess the word before the predator reaches its prey! Essentially, horizontal Hangman. Try ${config.prefix}hunt [length] for a specific word length.`,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue