koishi-plugin-ggcevo-game 1.3.52 → 1.3.53
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 +20 -12
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -3817,7 +3817,7 @@ ${itemDetails.join("\n")}`;
|
|
|
3817
3817
|
].join("\n");
|
|
3818
3818
|
});
|
|
3819
3819
|
ctx.command("ggcevo/赛季结算", "进行赛季结算并发放奖励", { authority: 3 }).action(async ({ session }) => {
|
|
3820
|
-
await session.send(`确定要进行赛季结算吗?(请在30
|
|
3820
|
+
await session.send(`确定要进行赛季结算吗?(请在30秒内回复"是"确认)`);
|
|
3821
3821
|
const confirm = await session.prompt(3e4);
|
|
3822
3822
|
if (confirm !== "是") return "已取消操作。";
|
|
3823
3823
|
const currentSeason = config.rankseason;
|
|
@@ -3886,23 +3886,31 @@ ${itemDetails.join("\n")}`;
|
|
|
3886
3886
|
const otherPlayers = await ctx.database.get("ggcevo_rank", {
|
|
3887
3887
|
Blacklist: false,
|
|
3888
3888
|
rankseason: currentSeason,
|
|
3889
|
-
handle: { $nin: rankedPlayers.map((p) => p.handle) }
|
|
3890
|
-
rank: { $ne: 0 }
|
|
3889
|
+
handle: { $nin: rankedPlayers.map((p) => p.handle) }
|
|
3891
3890
|
});
|
|
3892
3891
|
for (const player of otherPlayers) {
|
|
3893
|
-
if (player.rank > 0)
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3892
|
+
if (player.rank > 0) {
|
|
3893
|
+
positiveCount++;
|
|
3894
|
+
const gold = 1e3;
|
|
3895
|
+
const [signData] = await ctx.database.get("ggcevo_sign", { handle: player.handle });
|
|
3896
|
+
await ctx.database.upsert("ggcevo_sign", [{
|
|
3897
|
+
handle: player.handle,
|
|
3898
|
+
totalRewards: (signData?.totalRewards || 0) + gold
|
|
3899
|
+
}], ["handle"]);
|
|
3900
|
+
} else if (player.rank <= 0) {
|
|
3901
|
+
negativeCount++;
|
|
3902
|
+
const gold = 500;
|
|
3903
|
+
const [signData] = await ctx.database.get("ggcevo_sign", { handle: player.handle });
|
|
3904
|
+
await ctx.database.upsert("ggcevo_sign", [{
|
|
3905
|
+
handle: player.handle,
|
|
3906
|
+
totalRewards: (signData?.totalRewards || 0) + gold
|
|
3907
|
+
}], ["handle"]);
|
|
3908
|
+
}
|
|
3901
3909
|
}
|
|
3902
3910
|
report += "🎉 参与奖励发放:\n";
|
|
3903
3911
|
report += `✦ 积极玩家(分数>0):${positiveCount}人,每人获得1000枚金币
|
|
3904
3912
|
`;
|
|
3905
|
-
report += `✦ 奋斗玩家(
|
|
3913
|
+
report += `✦ 奋斗玩家(分数≤0):${negativeCount}人,每人获得500枚金币
|
|
3906
3914
|
|
|
3907
3915
|
`;
|
|
3908
3916
|
report += `✅ 总计发放:
|