koishi-plugin-ggcevo-game 1.2.69 → 1.2.71
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 +12 -5
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -3400,7 +3400,7 @@ ${achievementList.join("\n")}`;
|
|
|
3400
3400
|
pageNum < totalPages ? `输入 pk榜 ${pageNum + 1} 查看下一页` : "已是最后一页"
|
|
3401
3401
|
].join("\n");
|
|
3402
3402
|
});
|
|
3403
|
-
ctx.command("ggcevo/切换pk
|
|
3403
|
+
ctx.command("ggcevo/切换pk", "切换玩家对战状态").action(async ({ session }) => {
|
|
3404
3404
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
3405
3405
|
if (!profile) return "您暂未绑定句柄。";
|
|
3406
3406
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
@@ -4184,13 +4184,16 @@ ${validTypes.join("、")}`;
|
|
|
4184
4184
|
});
|
|
4185
4185
|
ctx.command("兑换红晶", "使用金币兑换红晶").action(async ({ session }) => {
|
|
4186
4186
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
4187
|
-
if (!profile) return "
|
|
4188
|
-
const {
|
|
4189
|
-
const handle = `${regionId}-S2-${realmId}-${profileId}`;
|
|
4187
|
+
if (!profile) return "⚠️ 需要先绑定游戏句柄";
|
|
4188
|
+
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
4190
4189
|
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
4191
4190
|
if (existingEntries.length > 0) {
|
|
4192
4191
|
return `❌ 拒绝访问,您已被列入黑名单。`;
|
|
4193
4192
|
}
|
|
4193
|
+
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
4194
|
+
if (!careerData || careerData.group !== "辛迪加海盗") {
|
|
4195
|
+
return "🚫 该功能需要【辛迪加海盗】阵营权限";
|
|
4196
|
+
}
|
|
4194
4197
|
await session.send(`请输入你想要兑换多少红晶?(请在30秒内回复数字,回复“0”为取消兑换)
|
|
4195
4198
|
注意:每块红晶需要950金币。`);
|
|
4196
4199
|
const exchangeInput = await session.prompt(3e4);
|
|
@@ -4264,7 +4267,7 @@ ${validTypes.join("、")}`;
|
|
|
4264
4267
|
if (userCoins < 2e3) {
|
|
4265
4268
|
return `加入辛迪加海盗需要2000金币,你当前拥有${userCoins}金币`;
|
|
4266
4269
|
}
|
|
4267
|
-
if (!pkData?.enable) {
|
|
4270
|
+
if (pkData && !pkData?.enable) {
|
|
4268
4271
|
return "当前PK功能未开启,无法加入辛迪加海盗。";
|
|
4269
4272
|
}
|
|
4270
4273
|
await session.send(`请问你确定要缴纳2000金币并且永久开启PK功能加入辛迪加海盗吗?(请在30秒内输入“是”确定加入)`);
|
|
@@ -4576,6 +4579,10 @@ ${validTypes.join("、")}`;
|
|
|
4576
4579
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
4577
4580
|
if (!profile) return "您暂未绑定句柄。";
|
|
4578
4581
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
4582
|
+
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
4583
|
+
if (existingEntries.length > 0) {
|
|
4584
|
+
return "❌ 拒绝访问,您已被列入黑名单";
|
|
4585
|
+
}
|
|
4579
4586
|
try {
|
|
4580
4587
|
const items = await ctx.database.get("ggcevo_warehouse", { handle });
|
|
4581
4588
|
const targetItem = items.find((warehouseItem) => {
|