koishi-plugin-ggcevo-game 1.2.63 → 1.2.64
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 +15 -2
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -3433,6 +3433,7 @@ ${validTypes.join("、")}`;
|
|
|
3433
3433
|
}).then((records) => records[0]);
|
|
3434
3434
|
let actualPrice = config2.price;
|
|
3435
3435
|
let discountMessage = "";
|
|
3436
|
+
let equippedCount;
|
|
3436
3437
|
if (activeWish) {
|
|
3437
3438
|
actualPrice = Math.floor(config2.price * 0.8);
|
|
3438
3439
|
discountMessage = ` (祈愿优惠价,原价${config2.price})`;
|
|
@@ -3456,11 +3457,23 @@ ${validTypes.join("、")}`;
|
|
|
3456
3457
|
modificationSlots: 1,
|
|
3457
3458
|
equipped: false
|
|
3458
3459
|
}], ["handle", "weaponId"]);
|
|
3460
|
+
equippedCount = await ctx.database.select("ggcevo_equipment").where({ handle, equipped: true }).execute((row) => import_koishi.$.count(row.weaponId));
|
|
3461
|
+
if (equippedCount === 0) {
|
|
3462
|
+
await ctx.database.set(
|
|
3463
|
+
"ggcevo_equipment",
|
|
3464
|
+
{ handle, weaponId: config2.id },
|
|
3465
|
+
{ equipped: true }
|
|
3466
|
+
);
|
|
3467
|
+
}
|
|
3459
3468
|
});
|
|
3460
3469
|
let message = `成功购买 ${weapon}!花费 ${actualPrice}枚金币${discountMessage}。`;
|
|
3461
3470
|
if (activeWish) {
|
|
3462
3471
|
message += `
|
|
3463
3472
|
🦗 蚱蜢优购祈愿已使用,下次购买将恢复原价。`;
|
|
3473
|
+
}
|
|
3474
|
+
if (equippedCount === 0) {
|
|
3475
|
+
message += `
|
|
3476
|
+
已自动为您装备当前武器!`;
|
|
3464
3477
|
}
|
|
3465
3478
|
return message + "\n输入“武器仓库”查看你拥有的武器。";
|
|
3466
3479
|
});
|
|
@@ -3489,9 +3502,9 @@ ${validTypes.join("、")}`;
|
|
|
3489
3502
|
"🛡️ 您当前拥有的武器",
|
|
3490
3503
|
'使用"装备武器 武器名称"来装备武器',
|
|
3491
3504
|
"⚡表示当前装备武器",
|
|
3492
|
-
"
|
|
3505
|
+
"──────────────",
|
|
3493
3506
|
...weaponDetails.length ? weaponDetails : ["空空如也,快去“武器库”看看吧!"],
|
|
3494
|
-
"
|
|
3507
|
+
"──────────────",
|
|
3495
3508
|
"💡 武器效果说明:",
|
|
3496
3509
|
"🔧 改装效果在战斗中生效"
|
|
3497
3510
|
].join("\n");
|