Compare commits
No commits in common. "43478b3cc6a5a5e2aa7ad1af7d4c4fac02d94ba8" and "6adb443aff3ad62e3eabb2c690f5d876d0369329" have entirely different histories.
43478b3cc6
...
6adb443aff
|
@ -79,17 +79,17 @@ module.exports = {
|
||||||
timeout: 60,
|
timeout: 60,
|
||||||
},
|
},
|
||||||
riddle: {
|
riddle: {
|
||||||
timeout: 30,
|
timeout: 20,
|
||||||
score: false,
|
score: false,
|
||||||
},
|
},
|
||||||
dice: {
|
dice: {
|
||||||
maxRolls: 20,
|
maxRolls: 10,
|
||||||
maxFaces: 1000,
|
maxFaces: 1000,
|
||||||
},
|
},
|
||||||
hunt: {
|
hangman: {
|
||||||
minLength: 5,
|
minLength: 5,
|
||||||
maxLength: 9,
|
maxLength: 9,
|
||||||
guesses: [4, 4, 6, 7, 9],
|
guesses: [2, 3, 4, 5, 6, 7], // by word length, last number repeats for longer words
|
||||||
// guesses: [2, 3, 4, 5, 6, 7], // by word length, last number repeats for longer words
|
// guesses: 6, // fixed
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "schat2-clive",
|
"name": "schat2-clive",
|
||||||
"version": "1.19.6",
|
"version": "1.19.5",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "schat2-clive",
|
"name": "schat2-clive",
|
||||||
"version": "1.19.6",
|
"version": "1.19.5",
|
||||||
"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.6",
|
"version": "1.19.5",
|
||||||
"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": {
|
||||||
|
|
|
@ -29,7 +29,7 @@ function onCommand(args, context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const results = Array.from({ length: rolls }, () => {
|
const results = Array.from({ length: rolls }, () => {
|
||||||
const result = crypto.randomInt(1, faces + 1);
|
const result = crypto.randomInt(1, faces);
|
||||||
|
|
||||||
// using U+2003 Em Space after dice to create double space that doesn't get filtered in SChat
|
// using U+2003 Em Space after dice to create double space that doesn't get filtered in SChat
|
||||||
return `${style.grey(dieFaces[result - 1] || '☐')} ${style.bold(result)}`; // eslint-disable-line no-irregular-whitespace
|
return `${style.grey(dieFaces[result - 1] || '☐')} ${style.bold(result)}`; // eslint-disable-line no-irregular-whitespace
|
||||||
|
|
|
@ -14,11 +14,11 @@ const trees = ['🌴', '🌳', '🌲', '🌵'];
|
||||||
const flowers = ['🌹', '🌻', '🌷', '🌱', '🍄', '🪨'];
|
const flowers = ['🌹', '🌻', '🌷', '🌱', '🍄', '🪨'];
|
||||||
|
|
||||||
function getGuesses(word) {
|
function getGuesses(word) {
|
||||||
if (Array.isArray(config.hunt.guesses)) {
|
if (Array.isArray(config.hangman.guesses)) {
|
||||||
return config.hunt.guesses[word.length - 1] || config.hunt.guesses.at(-1);
|
return config.hangman.guesses[word.length - 1] || config.hangman.guesses.at(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return config.hunt.guesses;
|
return config.hangman.guesses;
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderBoard(context) {
|
function renderBoard(context) {
|
||||||
|
@ -117,8 +117,8 @@ function onCommand(args, context) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const minLength = Number(args[0]) || config.hunt.minLength;
|
const minLength = Number(args[0]) || config.hangman.minLength;
|
||||||
const maxLength = Number(args[0]) || config.hunt.maxLength;
|
const maxLength = Number(args[0]) || config.hangman.maxLength;
|
||||||
|
|
||||||
const playableWords = Array.from({ length: (maxLength - minLength) + 1 }, (value, index) => Object.values(words[index + minLength] || {})).flat(2);
|
const playableWords = Array.from({ length: (maxLength - minLength) + 1 }, (value, index) => Object.values(words[index + minLength] || {})).flat(2);
|
||||||
const word = pickRandom(playableWords);
|
const word = pickRandom(playableWords);
|
||||||
|
|
Loading…
Reference in New Issue