koishi-plugin-ggcevo-game 1.2.66 → 1.2.68
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 +19 -7
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -284,7 +284,7 @@ function apply(ctx, config) {
|
|
|
284
284
|
type: "爆破物",
|
|
285
285
|
description: "一种小型的机械装置,用于吸收空间站能量并进行爆破",
|
|
286
286
|
redCrystalCost: 30,
|
|
287
|
-
effects: "
|
|
287
|
+
effects: "当主宰为“空间站感染虫”时才能使用,对“空间站哨枪塔”造成其当前血量值的伤害(获得等同于伤害值的金币)",
|
|
288
288
|
// 确保结构兼容性
|
|
289
289
|
price: 0,
|
|
290
290
|
damage: 0,
|
|
@@ -569,7 +569,7 @@ function apply(ctx, config) {
|
|
|
569
569
|
},
|
|
570
570
|
"结构装甲": {
|
|
571
571
|
effect: 0,
|
|
572
|
-
description: "拥有结构装甲,受到的伤害-20
|
|
572
|
+
description: "拥有结构装甲,受到的伤害-20%; 若伤害来源于热能武器,则受到的伤害-40%"
|
|
573
573
|
}
|
|
574
574
|
};
|
|
575
575
|
const bossPool = [
|
|
@@ -1423,7 +1423,7 @@ function apply(ctx, config) {
|
|
|
1423
1423
|
return null;
|
|
1424
1424
|
}
|
|
1425
1425
|
let reduction = 0.2;
|
|
1426
|
-
let msg = "
|
|
1426
|
+
let msg = "常规武器减伤20%";
|
|
1427
1427
|
if (weaponData.type === "热能武器") {
|
|
1428
1428
|
reduction = 0.4;
|
|
1429
1429
|
msg = "热能武器减伤40%";
|
|
@@ -1758,12 +1758,13 @@ function apply(ctx, config) {
|
|
|
1758
1758
|
}
|
|
1759
1759
|
}
|
|
1760
1760
|
__name(checkTransferRequirements, "checkTransferRequirements");
|
|
1761
|
-
async function applyItemEffect(handle, itemId) {
|
|
1761
|
+
async function applyItemEffect(session, handle, itemId) {
|
|
1762
1762
|
const itemConfig2 = Object.values(weaponConfig).find((v) => v.id === itemId);
|
|
1763
1763
|
if (!itemConfig2) return "该物品未配置效果";
|
|
1764
1764
|
if (itemId === 1e3) {
|
|
1765
1765
|
const [SentryTower] = await ctx.database.get("ggcevo_boss", { name: "空间站哨枪塔", isActive: true });
|
|
1766
1766
|
const [record] = await ctx.database.get("ggcevo_sign", { handle });
|
|
1767
|
+
const [existingRecord] = await ctx.database.get("ggcevo_boss_damage", { handle });
|
|
1767
1768
|
await ctx.database.set(
|
|
1768
1769
|
"ggcevo_boss",
|
|
1769
1770
|
{ name: "空间站哨枪塔" },
|
|
@@ -1772,11 +1773,18 @@ function apply(ctx, config) {
|
|
|
1772
1773
|
HP: 0
|
|
1773
1774
|
}
|
|
1774
1775
|
);
|
|
1776
|
+
await ctx.database.upsert("ggcevo_boss_damage", [{
|
|
1777
|
+
handle,
|
|
1778
|
+
playerName: session.username,
|
|
1779
|
+
totalDamage: (existingRecord?.totalDamage || 0) + SentryTower.HP,
|
|
1780
|
+
// 改为实际伤害
|
|
1781
|
+
attackCount: existingRecord?.attackCount || 0
|
|
1782
|
+
}], ["handle"]);
|
|
1775
1783
|
await ctx.database.upsert("ggcevo_sign", [{
|
|
1776
1784
|
handle,
|
|
1777
1785
|
totalRewards: (record?.totalRewards || 0) + SentryTower.HP
|
|
1778
1786
|
}], ["handle"]);
|
|
1779
|
-
return `您使用了E-2
|
|
1787
|
+
return `您使用了E-2能量炸弹,直接摧毁了“空间站哨枪塔”并且获得了${SentryTower.HP}金币。`;
|
|
1780
1788
|
}
|
|
1781
1789
|
}
|
|
1782
1790
|
__name(applyItemEffect, "applyItemEffect");
|
|
@@ -3491,6 +3499,10 @@ ${validTypes.join("、")}`;
|
|
|
3491
3499
|
if (!weapon) return "如果您想购买武器,请输入“购买武器 武器名称”。";
|
|
3492
3500
|
if (!weaponConfig[weapon]) return "无效的武器名称,请重新输入。";
|
|
3493
3501
|
const config2 = weaponConfig[weapon];
|
|
3502
|
+
const allowedTypes = ["能量武器", "热能武器", "实弹武器"];
|
|
3503
|
+
if (!allowedTypes.includes(config2.type)) {
|
|
3504
|
+
return `❌ 无法购买该类型武器,仅支持:${allowedTypes.join("、")}`;
|
|
3505
|
+
}
|
|
3494
3506
|
const existingWeapons = await ctx.database.get("ggcevo_equipment", {
|
|
3495
3507
|
handle,
|
|
3496
3508
|
weaponId: config2.id
|
|
@@ -4420,7 +4432,7 @@ ${validTypes.join("、")}`;
|
|
|
4420
4432
|
}
|
|
4421
4433
|
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
4422
4434
|
if (!careerData || careerData.group !== "辛迪加海盗") {
|
|
4423
|
-
return "🚫
|
|
4435
|
+
return "🚫 该功能需要【辛迪加海盗】阵营权限";
|
|
4424
4436
|
}
|
|
4425
4437
|
if (!item) return "请输入要订购的物品名称";
|
|
4426
4438
|
const config2 = weaponConfig[item];
|
|
@@ -4546,7 +4558,7 @@ ${validTypes.join("、")}`;
|
|
|
4546
4558
|
await ctx.database.set("ggcevo_warehouse", { handle, itemId: targetItem.itemId }, {
|
|
4547
4559
|
quantity: Math.max(targetItem.quantity - 1, 0)
|
|
4548
4560
|
});
|
|
4549
|
-
const effectResult = await applyItemEffect(handle, targetItem.itemId);
|
|
4561
|
+
const effectResult = await applyItemEffect(session, handle, targetItem.itemId);
|
|
4550
4562
|
return `使用成功!消耗 ${itemName} ×1
|
|
4551
4563
|
剩余数量:${targetItem.quantity - 1}
|
|
4552
4564
|
${effectResult}`;
|