koishi-plugin-ggcevo-game 1.3.60 → 1.3.61
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 +14 -2
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -2405,7 +2405,9 @@ function apply(ctx, config) {
|
|
|
2405
2405
|
startTime: { $lte: /* @__PURE__ */ new Date() },
|
|
2406
2406
|
endTime: { $gte: /* @__PURE__ */ new Date() },
|
|
2407
2407
|
isused: false
|
|
2408
|
+
// 只查询未使用过的双倍祈愿
|
|
2408
2409
|
});
|
|
2410
|
+
const doubleWishIds = doubleWishRecords.map((r) => r.id);
|
|
2409
2411
|
const doubleWishHandles = new Set(doubleWishRecords.map((r) => r.handle));
|
|
2410
2412
|
const top20 = damageRecords.slice(0, 20);
|
|
2411
2413
|
top20.forEach((record, index) => {
|
|
@@ -2437,7 +2439,9 @@ function apply(ctx, config) {
|
|
|
2437
2439
|
const reward = {
|
|
2438
2440
|
guguCoins,
|
|
2439
2441
|
gold,
|
|
2440
|
-
playerName: record.playerName
|
|
2442
|
+
playerName: record.playerName,
|
|
2443
|
+
hasDoubleWish
|
|
2444
|
+
// 标记该记录使用了双倍祈愿
|
|
2441
2445
|
};
|
|
2442
2446
|
rewardMap.set(record.handle, reward);
|
|
2443
2447
|
const bonusNote = hasDoubleWish ? " (🧝♀ 精灵双倍祈愿生效)" : "";
|
|
@@ -2465,7 +2469,9 @@ function apply(ctx, config) {
|
|
|
2465
2469
|
rewardMap.set(record.handle, {
|
|
2466
2470
|
guguCoins,
|
|
2467
2471
|
gold,
|
|
2468
|
-
playerName: record.playerName
|
|
2472
|
+
playerName: record.playerName,
|
|
2473
|
+
hasDoubleWish
|
|
2474
|
+
// 标记该记录使用了双倍祈愿
|
|
2469
2475
|
});
|
|
2470
2476
|
});
|
|
2471
2477
|
rewardMessages.push(`其他参与者获得基础奖励: 3 咕咕币 + 500 金币`);
|
|
@@ -2495,6 +2501,12 @@ function apply(ctx, config) {
|
|
|
2495
2501
|
quantity: (backpackData?.quantity || 0) + reward.guguCoins
|
|
2496
2502
|
}], ["handle", "itemId"]);
|
|
2497
2503
|
}
|
|
2504
|
+
if (doubleWishIds.length > 0) {
|
|
2505
|
+
await ctx2.database.set("ggcevo_Wish_Record", { id: { $in: doubleWishIds } }, {
|
|
2506
|
+
isused: true
|
|
2507
|
+
// 将使用过的双倍祈愿标记为已使用
|
|
2508
|
+
});
|
|
2509
|
+
}
|
|
2498
2510
|
});
|
|
2499
2511
|
return { rewardMessages };
|
|
2500
2512
|
}
|