koishi-plugin-ggcevo-game 0.3.17 → 0.3.19

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 +13 -7
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -394,7 +394,6 @@ ${itemDetails.join("\n")}`;
394
394
  }
395
395
  const now = /* @__PURE__ */ new Date();
396
396
  const chinatime = convertUTCtoChinaTime(now);
397
- const is23Hour = chinatime.getHours() === 23;
398
397
  const [record] = await ctx.database.get("ggcevo_sign", { handle });
399
398
  const [backpack] = await ctx.database.get("ggcevo_backpack", { handle, itemId: 1 });
400
399
  if (record) {
@@ -403,8 +402,10 @@ ${itemDetails.join("\n")}`;
403
402
  return `今天已经签到过了!连续签到 ${record.consecutiveDays} 天`;
404
403
  }
405
404
  }
406
- if (!is23Hour && !isSameDate(latestTime, chinatime)) {
407
- return "暂未查询到您今天最近的20场战绩内游玩过 咕咕虫-evolved 地图,请游玩1次后签到(对局记录上传有延迟)";
405
+ const targetDateChina = new Date(latestTime);
406
+ targetDateChina.setDate(targetDateChina.getDate() + 1);
407
+ if (!isSameDate(latestTime, chinatime) && !isSameDate(targetDateChina, chinatime)) {
408
+ return "暂未查询到您最近两天内游玩过 咕咕虫-evolved 地图,请游玩1次后签到(对局记录上传有延迟)";
408
409
  }
409
410
  const consecutiveDays = record ? checkConsecutive(convertUTCtoChinaTime(record.lastSign), chinatime) ? record.consecutiveDays + 1 : 1 : 1;
410
411
  const cycle = Math.floor((consecutiveDays - 1) / 30);
@@ -450,11 +451,16 @@ ${itemDetails.join("\n")}`;
450
451
  const lastSignChina = convertUTCtoChinaTime(new Date(record.lastSign));
451
452
  const targetDateChina = new Date(lastSignChina);
452
453
  targetDateChina.setDate(targetDateChina.getDate() + 1);
453
- targetDateChina.setHours(0, 0, 0, 0);
454
- const targetDateUTC = convertUTCtoChinaTime(new Date(targetDateChina.getTime() - 8 * 60 * 60 * 1e3));
454
+ const targetDateUTC = new Date(targetDateChina.getTime() - 8 * 60 * 60 * 1e3);
455
455
  const nowChina = convertUTCtoChinaTime(/* @__PURE__ */ new Date());
456
- if (targetDateChina >= nowChina) return "暂时没有可补签的日期。";
457
- const costPoints = 100;
456
+ const isToday = targetDateChina.getFullYear() === nowChina.getFullYear() && targetDateChina.getMonth() === nowChina.getMonth() && targetDateChina.getDate() === nowChina.getDate();
457
+ if (isToday) {
458
+ return "您需要补签的日期是今天,请进行正常签到。";
459
+ }
460
+ if (targetDateChina >= nowChina) {
461
+ return "暂时没有可补签的日期。";
462
+ }
463
+ const costPoints = 50;
458
464
  if (record.totalRewards < costPoints) return `补签需要消耗 ${costPoints} 金币,当前金币不足。`;
459
465
  const newConsecutiveDays = record.consecutiveDays + 1;
460
466
  const cycle = Math.floor((newConsecutiveDays - 1) / 30);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-ggcevo-game",
3
3
  "description": "星际争霸2游戏大厅地图咕咕虫-evo小游戏",
4
- "version": "0.3.17",
4
+ "version": "0.3.19",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [