koishi-plugin-wordle-game 2.1.2 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +3 -3
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -899,7 +899,7 @@ async function apply(ctx, config) {
899
899
  const htmlImgString = generateImageTags(imageBuffers);
900
900
  imageBuffer = await generateWordlesImage(htmlImgString);
901
901
  }
902
- const gameMode = `游戏开始!\n当前游戏模式为:【${exam}${wordlesNum > 1 ? `(x${wordlesNum})` : ''}${isFreeMode && exam === '汉兜' ? `(自由)` : ''}${isHardMode ? `(${isUltraHardMode ? '超' : ''}困难)` : ''}${isAbsurdMode ? `(变态${isChallengeMode ? '挑战' : ''})` : ''}】`;
902
+ const gameMode = `游戏开始!\n当前游戏模式为:【${exam}${wordlesNum > 1 ? `(x${wordlesNum})` : ''}${isFreeMode && exam === '汉兜' || isFreeMode && exam === '词影' ? `(自由)` : ''}${isHardMode ? `(${isUltraHardMode ? '超' : ''}困难)` : ''}${isAbsurdMode ? `(变态${isChallengeMode ? '挑战' : ''})` : ''}】`;
903
903
  const challengeInfo = isChallengeMode ? `\n目标单词为:【${randomWord}】` : '';
904
904
  const wordLength = `${exam === 'Numberle' ? '数字' : exam === 'Math' ? '数学方程式' : '单词'}长度为:【${guessWordLength}】`;
905
905
  const guessChance = `猜${exam === '汉兜' || exam === '词影' ? '词语|成语' : exam === 'Numberle' ? '数字' : exam === 'Math' ? '数学方程式' : '单词'}机会为:【${isAbsurdMode ? '♾️' : exam === '汉兜' ? `${10 + wordlesNum - 1}` : exam === 'Math' ? `${6 + wordlesNum - 1}` : exam === '词影' ? `${6 + wordlesNum - 1}` : guessWordLength + 1 + wordlesNum - 1}】`;
@@ -1216,7 +1216,7 @@ async function apply(ctx, config) {
1216
1216
  emptyGridHtml = generateEmptyGridHtmlForHandle(gameInfo.isWin || isWin ? 0 : isLose ? 0 : 1, 4);
1217
1217
  }
1218
1218
  else if (gameMode === '词影') {
1219
- emptyGridHtml = generateEmptyGridHtmlForCiying(gameInfo.isWin || isWin ? 0 : isLose ? 0 : 1, 4, true) + generateEmptyGridHtmlForCiying(gameInfo.isWin ? gameInfo.remainingGuessesCount : gameInfo.remainingGuessesCount - 1 - 1, 4, false);
1219
+ emptyGridHtml = generateEmptyGridHtmlForCiying(gameInfo.isWin || isWin ? 0 : isLose ? 0 : 1, 4, true) + generateEmptyGridHtmlForCiying(gameInfo.isWin || isWin ? gameInfo.remainingGuessesCount - 1 : gameInfo.remainingGuessesCount - 1 - 1, 4, false);
1220
1220
  }
1221
1221
  else {
1222
1222
  emptyGridHtml = generateEmptyGridHtml(gameInfo.isWin ? gameInfo.remainingGuessesCount : gameInfo.remainingGuessesCount - 1, gameInfo.guessWordLength);
@@ -1235,7 +1235,7 @@ async function apply(ctx, config) {
1235
1235
  }
1236
1236
  imageBuffers.push(imageBuffer);
1237
1237
  // 更新游戏记录
1238
- const remainingGuessesCount = isAbsurd ? gameInfo.remainingGuessesCount : gameInfo.remainingGuessesCount - 1;
1238
+ const remainingGuessesCount = isAbsurd || gameMode === '词影' && (gameInfo.isWin || isWin) ? gameInfo.remainingGuessesCount : gameInfo.remainingGuessesCount - 1;
1239
1239
  if (wordleIndex === 1 && !gameInfo.isWin) {
1240
1240
  await ctx.database.set('wordle_game_records', { channelId }, {
1241
1241
  isWin,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-wordle-game",
3
3
  "description": "欢迎来到 [Wordle](https://www.nytimes.com/games/wordle/index.html) | [汉兜](https://handle.antfu.me/) | [词影](https://cy.surprising.studio/) |... 猜单词|猜成语|猜数字|猜数学方程式|... 的小游戏,包含多种词库、多种主题、多种游戏设置和排行榜系统。",
4
- "version": "2.1.2",
4
+ "version": "2.1.3",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [