koishi-plugin-ggcevo-game 0.3.16 → 0.3.18
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.
- package/lib/index.js +13 -7
- 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
|
-
|
|
407
|
-
|
|
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.
|
|
454
|
-
const targetDateUTC = convertUTCtoChinaTime(new Date(targetDateChina.getTime() - 8 * 60 * 60 * 1e3));
|
|
454
|
+
const targetDateUTC = new Date(targetDateChina.getTime());
|
|
455
455
|
const nowChina = convertUTCtoChinaTime(/* @__PURE__ */ new Date());
|
|
456
|
-
|
|
457
|
-
|
|
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);
|