Compare commits

...

2 Commits

Author SHA1 Message Date
Niels Simenon ed87ce1759 1.23.5 2023-02-02 01:45:41 +01:00
Niels Simenon 6c3a887f3f Hinting punctuation in Trivia. 2023-02-02 01:45:37 +01:00
3 changed files with 6 additions and 6 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "schat2-clive",
"version": "1.23.4",
"version": "1.23.5",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "schat2-clive",
"version": "1.23.4",
"version": "1.23.5",
"license": "ISC",
"dependencies": {
"bhttp": "^1.2.8",

View File

@ -1,6 +1,6 @@
{
"name": "schat2-clive",
"version": "1.23.4",
"version": "1.23.5",
"description": "Game host for SChat 2-powered chat sites",
"main": "src/app.js",
"scripts": {

View File

@ -61,10 +61,10 @@ async function playRound(context, round = 0) {
// replace space with U+2003 Em Space to separate words, since a single space separates the placeholders, and double spaces are removed during Markdown render
if (question.answer.length >= 3) {
context.sendMessage(`${style.bold(style.green(`${Math.floor(game.timeout / 3) * 2} seconds`))} left, first hint for ${style.bold(style.pink(`question ${round + 1}/${game.questions.length}`))}: ${style.bold(`${question.answer.slice(0, 1)} ${question.answer.slice(1).replace(/\s/g, '').replace(/[^\s]/g, '_ ').trim()}`)}`, context.room.id);
context.sendMessage(`${style.bold(style.green(`${Math.floor(game.timeout / 3) * 2} seconds`))} left, first hint for ${style.bold(style.pink(`question ${round + 1}/${game.questions.length}`))}: ${style.bold(`${question.answer.slice(0, 1)} ${question.answer.slice(1).replace(/\s/g, '').replace(/[a-zA-Z0-9]/g, '_ ').trim()}`)}`, context.room.id);
} else {
// giving the first letter gives too much away, only give the placeholders
context.sendMessage(`${style.bold(style.green(`${Math.floor(game.timeout / 3) * 2} seconds`))} left, first hint for ${style.bold(style.pink(`question ${round + 1}/${game.questions.length}`))}: ${style.bold(`${question.answer.replace(/\s/g, '').replace(/[^\s]/g, '_ ').trim()}`)}`, context.room.id);
context.sendMessage(`${style.bold(style.green(`${Math.floor(game.timeout / 3) * 2} seconds`))} left, first hint for ${style.bold(style.pink(`question ${round + 1}/${game.questions.length}`))}: ${style.bold(`${question.answer.replace(/\s/g, '').replace(/[^a-zA-Z0-9]/g, '_ ').trim()}`)}`, context.room.id);
}
await timers.setTimeout((game.timeout / 3) * 1000, null, {
@ -72,7 +72,7 @@ async function playRound(context, round = 0) {
});
if (question.answer.length >= 4) {
context.sendMessage(`${style.bold(style.green(`${Math.floor(game.timeout / 3)} seconds`))} left, second hint for ${style.bold(style.pink(`question ${round + 1}/${game.questions.length}`))}: ${style.bold(`${question.answer.slice(0, 1)} ${question.answer.slice(1, -1).replace(/\s/g, '').replace(/[^\s]/g, '_ ')}${question.answer.slice(-1)}`)}`, context.room.id);
context.sendMessage(`${style.bold(style.green(`${Math.floor(game.timeout / 3)} seconds`))} left, second hint for ${style.bold(style.pink(`question ${round + 1}/${game.questions.length}`))}: ${style.bold(`${question.answer.slice(0, 1)} ${question.answer.slice(1, -1).replace(/\s/g, '').replace(/[a-zA-Z]/g, '_ ')}${question.answer.slice(-1)}`)}`, context.room.id);
}
await timers.setTimeout((game.timeout / 3) * 1000, null, {