koishi-plugin-ggcevo-game 1.6.54 → 1.6.55
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 +30 -3
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -5511,6 +5511,15 @@ var ggcevoUpdates = [
|
|
|
5511
5511
|
- 调整了祈愿“夜市赠礼”和“喵喵财源”效果
|
|
5512
5512
|
- 暂时禁用了“兑换赞助物品”指令
|
|
5513
5513
|
`.trim()
|
|
5514
|
+
},
|
|
5515
|
+
{
|
|
5516
|
+
version: "1.6.55",
|
|
5517
|
+
time: "2025-07-31",
|
|
5518
|
+
content: `
|
|
5519
|
+
- 签到奖励回调了咕咕币奖励
|
|
5520
|
+
- 回调了祈愿“喵喵财源”效果
|
|
5521
|
+
- 兑换赞助物品新增当前赛季场数要求
|
|
5522
|
+
`.trim()
|
|
5514
5523
|
}
|
|
5515
5524
|
];
|
|
5516
5525
|
function compareVersions(a, b) {
|
|
@@ -7465,7 +7474,7 @@ function apply(ctx, config) {
|
|
|
7465
7474
|
initial: false
|
|
7466
7475
|
}
|
|
7467
7476
|
}, {
|
|
7468
|
-
primary: "handle"
|
|
7477
|
+
primary: ["handle", "rankseason"]
|
|
7469
7478
|
});
|
|
7470
7479
|
ctx.model.extend("ggcevo_punishment", {
|
|
7471
7480
|
id: "unsigned",
|
|
@@ -8725,6 +8734,11 @@ ${ticketMessage}${effectMessage}`;
|
|
|
8725
8734
|
return `⛔ 您已被列入黑名单。`;
|
|
8726
8735
|
}
|
|
8727
8736
|
const currentSeason = config.rankseason;
|
|
8737
|
+
const [seasonRecord] = await ctx.database.get("ggcevo_rank", {
|
|
8738
|
+
handle,
|
|
8739
|
+
rankseason: currentSeason
|
|
8740
|
+
});
|
|
8741
|
+
const seasonMatches = seasonRecord?.matches || 0;
|
|
8728
8742
|
const backpackItems = await ctx.database.get("ggcevo_backpack", { handle });
|
|
8729
8743
|
const normalCoupon = backpackItems.find((item) => item.itemId === 2);
|
|
8730
8744
|
const petCoupons = backpackItems.filter((item) => item.itemId >= 3 && item.itemId <= 6);
|
|
@@ -8785,6 +8799,8 @@ ${ticketMessage}${effectMessage}`;
|
|
|
8785
8799
|
message += `普通兑奖券: ${normalCoupon?.quantity || 0}张
|
|
8786
8800
|
`;
|
|
8787
8801
|
message += `宠物扭蛋券: ${petCouponInfo}
|
|
8802
|
+
`;
|
|
8803
|
+
message += `本赛季场次: ${seasonMatches}场
|
|
8788
8804
|
|
|
8789
8805
|
`;
|
|
8790
8806
|
message += "请在30秒内输入可兑换物品名称(显示格式:物品名 [剩余/总量]):\n";
|
|
@@ -8802,6 +8818,17 @@ ${items.join("、")}
|
|
|
8802
8818
|
if (!name2) return "已取消操作,请重新输入。";
|
|
8803
8819
|
const configname = itemConfig[name2];
|
|
8804
8820
|
if (!configname) return "无效的物品名称,请重新输入。";
|
|
8821
|
+
const matchesRequirement = {
|
|
8822
|
+
t3: 150,
|
|
8823
|
+
t2: 200,
|
|
8824
|
+
t1: 250,
|
|
8825
|
+
t0: 350
|
|
8826
|
+
};
|
|
8827
|
+
const requiredMatches = matchesRequirement[configname.quality];
|
|
8828
|
+
if (seasonMatches < requiredMatches) {
|
|
8829
|
+
return `❌ 兑换【${name2}】需要在本赛季完成${requiredMatches}场游戏
|
|
8830
|
+
您当前赛季场次: ${seasonMatches}场(还需${requiredMatches - seasonMatches}场)`;
|
|
8831
|
+
}
|
|
8805
8832
|
const userRecords = await ctx.database.get("ggcevo_exchange", { handle, item: name2 });
|
|
8806
8833
|
if (userRecords.length > 0) return "您已经兑换过该物品。";
|
|
8807
8834
|
if (configname.quantity !== void 0 && (configname.isLimited || config.ignoreGlobalLimit === false)) {
|
|
@@ -8821,7 +8848,7 @@ ${items.join("、")}
|
|
|
8821
8848
|
);
|
|
8822
8849
|
let cost = configname.cost;
|
|
8823
8850
|
let itemId = 2;
|
|
8824
|
-
let couponName = "
|
|
8851
|
+
let couponName = "普通兑奖券";
|
|
8825
8852
|
if (petItems.has(name2)) {
|
|
8826
8853
|
const specialCoupon = backpackItems.find(
|
|
8827
8854
|
(item) => item.itemId === qualityMap[configname.quality]
|
|
@@ -8856,7 +8883,7 @@ ${items.join("、")}
|
|
|
8856
8883
|
});
|
|
8857
8884
|
});
|
|
8858
8885
|
return `🎉 恭喜!您使用${cost}个${couponName}兑换了【${name2}】
|
|
8859
|
-
⚠️
|
|
8886
|
+
⚠️ 兑换完成后请寻找活动管理员登记,否则将无法在游戏中使用!`;
|
|
8860
8887
|
} catch (error) {
|
|
8861
8888
|
console.error("兑换失败:", error);
|
|
8862
8889
|
return "兑换失败,请稍后再试";
|