koishi-plugin-ggcevo-game 1.0.7 → 1.0.9
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 +32 -33
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -195,16 +195,12 @@ function apply(ctx, config) {
|
|
|
195
195
|
async function gachaWithHiddenAward(handle) {
|
|
196
196
|
const backpackItems = await ctx.database.get("ggcevo_backpack", {
|
|
197
197
|
handle,
|
|
198
|
-
itemId: { $in: [
|
|
198
|
+
itemId: { $in: [2, 3] }
|
|
199
199
|
});
|
|
200
200
|
const itemMap = new Map(backpackItems.map((item) => [item.itemId, item]));
|
|
201
201
|
const isWin = HiddenAward();
|
|
202
202
|
if (isWin) {
|
|
203
203
|
const updates = [
|
|
204
|
-
{
|
|
205
|
-
itemId: 1,
|
|
206
|
-
addAmount: 100
|
|
207
|
-
},
|
|
208
204
|
{
|
|
209
205
|
itemId: 2,
|
|
210
206
|
addAmount: 1
|
|
@@ -293,7 +289,7 @@ function apply(ctx, config) {
|
|
|
293
289
|
`🎰 您使用了 ${quantity} 枚咕咕币`,
|
|
294
290
|
winCount > 0 ? `🎉 其中获得 ${winCount} 张兑换券!` : "💔 本次未获得任何兑换券",
|
|
295
291
|
`📊 当前保底进度:${record.pityCounter}/90`,
|
|
296
|
-
...hiddenWinCount > 0 ? [`🎉 恭喜你抽中隐藏奖励,额外获得 ${hiddenWinCount
|
|
292
|
+
...hiddenWinCount > 0 ? [`🎉 恭喜你抽中隐藏奖励,额外获得 ${hiddenWinCount} 张兑换券和 ${hiddenWinCount} 枚扭蛋币!`] : []
|
|
297
293
|
].join("\n");
|
|
298
294
|
});
|
|
299
295
|
ctx.command("ggcevo/单抽").action(async (argv) => {
|
|
@@ -325,7 +321,7 @@ function apply(ctx, config) {
|
|
|
325
321
|
const [record] = await ctx.database.get("ggcevo_records", { handle });
|
|
326
322
|
return [
|
|
327
323
|
`${result ? "🎉 获得兑换券!" : "❌ 未中奖"} 保底进度:${record.pityCounter}/90`,
|
|
328
|
-
...HiddenAward2 ? [`🎉 恭喜你抽中隐藏奖励,额外获得
|
|
324
|
+
...HiddenAward2 ? [`🎉 恭喜你抽中隐藏奖励,额外获得 1 张兑换券和 1 枚扭蛋币!`] : []
|
|
329
325
|
].join("\n");
|
|
330
326
|
});
|
|
331
327
|
ctx.command("ggcevo/十连抽").action(async (argv) => {
|
|
@@ -364,7 +360,7 @@ function apply(ctx, config) {
|
|
|
364
360
|
"十连抽结果:",
|
|
365
361
|
...results.map((r) => r ? "⭐获得兑换券" : "❌未中奖"),
|
|
366
362
|
`保底进度:${record.pityCounter}/90`,
|
|
367
|
-
...hiddenWinCount > 0 ? [`🎉 恭喜你抽中隐藏奖励,额外获得 ${hiddenWinCount
|
|
363
|
+
...hiddenWinCount > 0 ? [`🎉 恭喜你抽中隐藏奖励,额外获得 ${hiddenWinCount} 张兑换券和 ${hiddenWinCount} 枚扭蛋币!`] : []
|
|
368
364
|
].join("\n");
|
|
369
365
|
});
|
|
370
366
|
ctx.command("ggcevo/抽奖记录").action(async (argv) => {
|
|
@@ -1044,27 +1040,27 @@ ID:${activity.id}
|
|
|
1044
1040
|
].join("\n");
|
|
1045
1041
|
});
|
|
1046
1042
|
const itemConfig = {
|
|
1047
|
-
"拾荒者": { quality: "t3", type: "皮肤", cost: 3 },
|
|
1048
|
-
"劳工": { quality: "t3", type: "皮肤", cost: 3 },
|
|
1049
|
-
"老兵": { quality: "t2", type: "皮肤", cost: 4 },
|
|
1050
|
-
"合成人": { quality: "t2", type: "皮肤", cost: 4 },
|
|
1051
|
-
"阿斯塔特": { quality: "t1", type: "皮肤", cost: 5 },
|
|
1052
|
-
"皇家指挥官": { quality: "t1", type: "皮肤", cost: 5 },
|
|
1053
|
-
"个性开场白": { quality: "t1", type: "“入场特效", cost: 5, quantity: 5 },
|
|
1054
|
-
"史蒂夫": { quality: "t0", type: "皮肤", cost: 6, quantity: 1 },
|
|
1055
|
-
"ep4": { quality: "t0", type: "物品", cost: 6, quantity: 3 },
|
|
1056
|
-
"小狗": { quality: "t3", type: "宠物", cost: 3, quantity: 5 },
|
|
1057
|
-
"小猫": { quality: "t3", type: "宠物", cost: 3, quantity: 5 },
|
|
1058
|
-
"小黄鸭": { quality: "t3", type: "宠物", cost: 3, quantity: 5 },
|
|
1059
|
-
"萌萌熊": { quality: "t2", type: "宠物", cost: 4, quantity: 3 },
|
|
1060
|
-
"荆棘蜥蜴": { quality: "t2", type: "宠物", cost: 4, quantity: 3 },
|
|
1061
|
-
"萌宠小狗": { quality: "t1", type: "宠物", cost: 5, quantity: 2 },
|
|
1062
|
-
"熔岩虫": { quality: "t1", type: "宠物", cost: 5, quantity: 2 },
|
|
1063
|
-
"尸甲虫": { quality: "t1", type: "宠物", cost: 5, quantity: 2 },
|
|
1064
|
-
"绿毛虫": { quality: "t0", type: "宠物", cost: 6, quantity: 1 },
|
|
1065
|
-
"妙蛙种子": { quality: "t0", type: "宠物", cost: 6, quantity: 1 },
|
|
1066
|
-
"皮卡丘": { quality: "t0", type: "宠物", cost: 6, quantity: 1 },
|
|
1067
|
-
"哆啦A梦": { quality: "t0", type: "宠物", cost: 6, quantity: 1 }
|
|
1043
|
+
"拾荒者": { quality: "t3", type: "皮肤", cost: 3, isLimited: false },
|
|
1044
|
+
"劳工": { quality: "t3", type: "皮肤", cost: 3, isLimited: false },
|
|
1045
|
+
"老兵": { quality: "t2", type: "皮肤", cost: 4, isLimited: false },
|
|
1046
|
+
"合成人": { quality: "t2", type: "皮肤", cost: 4, isLimited: false },
|
|
1047
|
+
"阿斯塔特": { quality: "t1", type: "皮肤", cost: 5, isLimited: false },
|
|
1048
|
+
"皇家指挥官": { quality: "t1", type: "皮肤", cost: 5, isLimited: false },
|
|
1049
|
+
"个性开场白": { quality: "t1", type: "“入场特效", cost: 5, quantity: 5, isLimited: false },
|
|
1050
|
+
"史蒂夫": { quality: "t0", type: "皮肤", cost: 6, quantity: 1, isLimited: true },
|
|
1051
|
+
"ep4": { quality: "t0", type: "物品", cost: 6, quantity: 3, isLimited: false },
|
|
1052
|
+
"小狗": { quality: "t3", type: "宠物", cost: 3, quantity: 5, isLimited: false },
|
|
1053
|
+
"小猫": { quality: "t3", type: "宠物", cost: 3, quantity: 5, isLimited: false },
|
|
1054
|
+
"小黄鸭": { quality: "t3", type: "宠物", cost: 3, quantity: 5, isLimited: false },
|
|
1055
|
+
"萌萌熊": { quality: "t2", type: "宠物", cost: 4, quantity: 3, isLimited: false },
|
|
1056
|
+
"荆棘蜥蜴": { quality: "t2", type: "宠物", cost: 4, quantity: 3, isLimited: false },
|
|
1057
|
+
"萌宠小狗": { quality: "t1", type: "宠物", cost: 5, quantity: 2, isLimited: false },
|
|
1058
|
+
"熔岩虫": { quality: "t1", type: "宠物", cost: 5, quantity: 2, isLimited: false },
|
|
1059
|
+
"尸甲虫": { quality: "t1", type: "宠物", cost: 5, quantity: 2, isLimited: false },
|
|
1060
|
+
"绿毛虫": { quality: "t0", type: "宠物", cost: 6, quantity: 1, isLimited: false },
|
|
1061
|
+
"妙蛙种子": { quality: "t0", type: "宠物", cost: 6, quantity: 1, isLimited: false },
|
|
1062
|
+
"皮卡丘": { quality: "t0", type: "宠物", cost: 6, quantity: 1, isLimited: false },
|
|
1063
|
+
"哆啦A梦": { quality: "t0", type: "宠物", cost: 6, quantity: 1, isLimited: false }
|
|
1068
1064
|
};
|
|
1069
1065
|
ctx.command("ggcevo/兑换", "兑换物品").action(async ({ session }) => {
|
|
1070
1066
|
try {
|
|
@@ -1098,9 +1094,12 @@ ${items.join("、")}
|
|
|
1098
1094
|
if (!configname) return "无效的物品名称,请重新输入";
|
|
1099
1095
|
const userRecords = await ctx.database.get("ggcevo_exchange", { handle, item: name2 });
|
|
1100
1096
|
if (userRecords.length > 0) return "您已经兑换过该物品";
|
|
1101
|
-
if (configname.quantity !== void 0 && config.ignoreGlobalLimit === false) {
|
|
1102
|
-
const globalRecords = await ctx.database.get("ggcevo_exchange", {
|
|
1103
|
-
|
|
1097
|
+
if (configname.quantity !== void 0 && (configname.isLimited || config.ignoreGlobalLimit === false)) {
|
|
1098
|
+
const globalRecords = await ctx.database.get("ggcevo_exchange", {
|
|
1099
|
+
item: name2,
|
|
1100
|
+
GlobalLimit: true
|
|
1101
|
+
});
|
|
1102
|
+
if (globalRecords.length >= configname.quantity) return "该物品已被兑换尽";
|
|
1104
1103
|
}
|
|
1105
1104
|
const qualityMap = { "t3": 4, "t2": 5, "t1": 6, "t0": 7 };
|
|
1106
1105
|
const petItems = new Set(
|
|
@@ -1127,7 +1126,7 @@ ${items.join("、")}
|
|
|
1127
1126
|
return `${requireMsg}
|
|
1128
1127
|
当前持有:${coupon?.quantity || 0}个${couponName}`;
|
|
1129
1128
|
}
|
|
1130
|
-
const isGlobal = config.ignoreGlobalLimit === false;
|
|
1129
|
+
const isGlobal = configname.isLimited || config.ignoreGlobalLimit === false;
|
|
1131
1130
|
await ctx.database.withTransaction(async () => {
|
|
1132
1131
|
await ctx.database.set(
|
|
1133
1132
|
"ggcevo_backpack",
|