koishi-plugin-ggcevo-game 1.3.37 → 1.3.38
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 +74 -3
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -492,6 +492,14 @@ function apply(ctx, config) {
|
|
|
492
492
|
price: 0,
|
|
493
493
|
redCrystalCost: 60,
|
|
494
494
|
effects: "此物品存放于仓库,仅在处于辛迪加海盗阵营时生效。每日签到金币奖励+50%,每拥有100金币,增加1%(至多增加100%)"
|
|
495
|
+
},
|
|
496
|
+
"脉冲手雷": {
|
|
497
|
+
id: 4,
|
|
498
|
+
type: "手榴弹",
|
|
499
|
+
description: "电磁脉冲干扰机械目标和灵能目标",
|
|
500
|
+
price: 75,
|
|
501
|
+
redCrystalCost: 0,
|
|
502
|
+
effects: "对目标使用后,消耗其100点能量"
|
|
495
503
|
}
|
|
496
504
|
};
|
|
497
505
|
const modConfig = {
|
|
@@ -2705,7 +2713,7 @@ function apply(ctx, config) {
|
|
|
2705
2713
|
});
|
|
2706
2714
|
if (!targetboss.length || targetboss[0].Skillcountpoints === 0 || targetboss[0].tags.includes("建筑") || targetboss[0].tags.includes("重型")) return {
|
|
2707
2715
|
success: false,
|
|
2708
|
-
message: "
|
|
2716
|
+
message: "您无法对目标使用。(目标已死亡/目标的技能计数为0/目标拥有“建筑”或“重型”标签)"
|
|
2709
2717
|
};
|
|
2710
2718
|
await ctx.database.set(
|
|
2711
2719
|
"ggcevo_boss",
|
|
@@ -2723,9 +2731,32 @@ function apply(ctx, config) {
|
|
|
2723
2731
|
message: `此物品无需使用,存放于仓库即刻生效。`
|
|
2724
2732
|
};
|
|
2725
2733
|
}
|
|
2734
|
+
if (itemConfig2.id === 4) {
|
|
2735
|
+
if (!target) return {
|
|
2736
|
+
success: false,
|
|
2737
|
+
message: "您未选择合适的目标。"
|
|
2738
|
+
};
|
|
2739
|
+
const targetboss = await ctx.database.get("ggcevo_boss", {
|
|
2740
|
+
name: target,
|
|
2741
|
+
isActive: true
|
|
2742
|
+
});
|
|
2743
|
+
if (!targetboss.length || targetboss[0].energy === 0) return {
|
|
2744
|
+
success: false,
|
|
2745
|
+
message: "您无法对目标使用。(目标的能量为0)"
|
|
2746
|
+
};
|
|
2747
|
+
await ctx.database.set(
|
|
2748
|
+
"ggcevo_boss",
|
|
2749
|
+
{ name: target },
|
|
2750
|
+
{ energy: targetboss[0].energy - 100 }
|
|
2751
|
+
);
|
|
2752
|
+
return {
|
|
2753
|
+
success: true,
|
|
2754
|
+
message: `成功使用 ${itemName},消耗 ${target} 100点能量`
|
|
2755
|
+
};
|
|
2756
|
+
}
|
|
2726
2757
|
return {
|
|
2727
|
-
success:
|
|
2728
|
-
message: `${itemName}
|
|
2758
|
+
success: false,
|
|
2759
|
+
message: `${itemName} 效果开发中,无法使用`
|
|
2729
2760
|
};
|
|
2730
2761
|
} catch (error) {
|
|
2731
2762
|
console.error("物品效果处理失败:", error);
|
|
@@ -5002,6 +5033,46 @@ ${validTypes.join("、")}`;
|
|
|
5002
5033
|
return showModList();
|
|
5003
5034
|
}
|
|
5004
5035
|
});
|
|
5036
|
+
ctx.command("ggcevo/拆卸 <weapon> <mod>", "卸载武器模块,专属模块返还50%金币,通用模块返还80%金币").action(async ({ session }, weapon, mod) => {
|
|
5037
|
+
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
5038
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
5039
|
+
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
5040
|
+
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
5041
|
+
if (existingEntries.length > 0) return "⛔ 您已被列入黑名单";
|
|
5042
|
+
const weaponId = weaponConfig[weapon]?.id;
|
|
5043
|
+
if (!weaponId) return "❌ 无效的武器名称";
|
|
5044
|
+
const modInfo = modConfig[mod];
|
|
5045
|
+
if (!modInfo) return "❌ 无效的模块名称";
|
|
5046
|
+
const refundRate = modInfo.isExclusive ? 0.5 : 0.8;
|
|
5047
|
+
const refundType = modInfo.isExclusive ? "专属模块返还50%" : "通用模块返还80%";
|
|
5048
|
+
const [equipment] = await ctx.database.get("ggcevo_equipment", {
|
|
5049
|
+
handle,
|
|
5050
|
+
weaponId
|
|
5051
|
+
});
|
|
5052
|
+
if (!equipment) return "❌ 您尚未获得该武器";
|
|
5053
|
+
if (!equipment.installedMods.includes(mod)) {
|
|
5054
|
+
return `❌ 该武器未安装${mod}模块`;
|
|
5055
|
+
}
|
|
5056
|
+
const refund = Math.floor(modInfo.cost * refundRate);
|
|
5057
|
+
const newMods = equipment.installedMods.filter((m) => m !== mod);
|
|
5058
|
+
await ctx.database.set(
|
|
5059
|
+
"ggcevo_equipment",
|
|
5060
|
+
{ handle, weaponId },
|
|
5061
|
+
{ installedMods: newMods }
|
|
5062
|
+
);
|
|
5063
|
+
const [signInfo] = await ctx.database.get("ggcevo_sign", { handle });
|
|
5064
|
+
const newBalance = (signInfo?.totalRewards || 0) + refund;
|
|
5065
|
+
await ctx.database.set("ggcevo_sign", { handle }, {
|
|
5066
|
+
totalRewards: newBalance
|
|
5067
|
+
});
|
|
5068
|
+
return [
|
|
5069
|
+
`✅ 已从 ${weapon} 拆卸 ${mod} 模块`,
|
|
5070
|
+
`返还金币:${refund} (原价${modInfo.cost},${refundType})`,
|
|
5071
|
+
`当前金币总额:${newBalance}`,
|
|
5072
|
+
`剩余模块:${newMods.join(", ") || "无"}`,
|
|
5073
|
+
modInfo.isExclusive ? "ℹ️ 专属模块拆卸只返还50%" : ""
|
|
5074
|
+
].filter(Boolean).join("\n");
|
|
5075
|
+
});
|
|
5005
5076
|
ctx.command("ggcevo/攻击 <bossName>").usage("请输入要攻击的异形名称(例如:攻击 异齿猛兽 或 攻击 寒冰王蛇)").action(async (argv, bossName) => {
|
|
5006
5077
|
const session = argv.session;
|
|
5007
5078
|
let broadcastMessage = null;
|