koishi-plugin-ggcevo-game 1.4.48 → 1.4.50
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/boss/BattleEffectProcessor.d.ts +4 -1
- package/lib/index.js +162 -100
- package/lib/utils.d.ts +6 -0
- package/package.json +1 -1
|
@@ -393,7 +393,10 @@ export declare const BattleEffectProcessor: {
|
|
|
393
393
|
buffMultiplier: number;
|
|
394
394
|
layerAdded: boolean;
|
|
395
395
|
} | null;
|
|
396
|
-
handleWeaponEnergyDrain: (targetBoss: any, weaponName: string
|
|
396
|
+
handleWeaponEnergyDrain: (targetBoss: any, weaponName: string, maxStatsMap: Record<string, {
|
|
397
|
+
maxHP: number;
|
|
398
|
+
maxEnergy: number;
|
|
399
|
+
}>) => {
|
|
397
400
|
messages: string[];
|
|
398
401
|
targetUpdates: {
|
|
399
402
|
name: string;
|
package/lib/index.js
CHANGED
|
@@ -251,7 +251,7 @@ var weaponConfig = {
|
|
|
251
251
|
description: "一件传奇武器",
|
|
252
252
|
specialeffect: "",
|
|
253
253
|
price: 6400,
|
|
254
|
-
redCrystalCost:
|
|
254
|
+
redCrystalCost: 200,
|
|
255
255
|
isantiair: true,
|
|
256
256
|
tagEffects: {
|
|
257
257
|
"生物": 2,
|
|
@@ -267,7 +267,7 @@ var weaponConfig = {
|
|
|
267
267
|
description: "一件传奇武器",
|
|
268
268
|
specialeffect: "攻击暴击率+80%",
|
|
269
269
|
price: 6400,
|
|
270
|
-
redCrystalCost:
|
|
270
|
+
redCrystalCost: 200,
|
|
271
271
|
isantiair: true,
|
|
272
272
|
tagEffects: {
|
|
273
273
|
"重甲": 1.5
|
|
@@ -281,7 +281,7 @@ var weaponConfig = {
|
|
|
281
281
|
description: "这是传说中的武器",
|
|
282
282
|
specialeffect: "",
|
|
283
283
|
price: 6400,
|
|
284
|
-
redCrystalCost:
|
|
284
|
+
redCrystalCost: 200,
|
|
285
285
|
isantiair: false,
|
|
286
286
|
tagEffects: {
|
|
287
287
|
"轻甲": 1.5,
|
|
@@ -296,7 +296,7 @@ var weaponConfig = {
|
|
|
296
296
|
description: "一件传奇武器",
|
|
297
297
|
specialeffect: "",
|
|
298
298
|
price: 6400,
|
|
299
|
-
redCrystalCost:
|
|
299
|
+
redCrystalCost: 200,
|
|
300
300
|
isantiair: true,
|
|
301
301
|
tagEffects: {
|
|
302
302
|
"重甲": 1.2
|
|
@@ -310,7 +310,7 @@ var weaponConfig = {
|
|
|
310
310
|
description: "优雅而独特的武器",
|
|
311
311
|
specialeffect: "无视目标100%的减伤效果",
|
|
312
312
|
price: 6400,
|
|
313
|
-
redCrystalCost:
|
|
313
|
+
redCrystalCost: 200,
|
|
314
314
|
isantiair: false,
|
|
315
315
|
tagEffects: {}
|
|
316
316
|
},
|
|
@@ -322,7 +322,7 @@ var weaponConfig = {
|
|
|
322
322
|
description: "一件传奇武器",
|
|
323
323
|
specialeffect: "攻击消耗目标500点能量",
|
|
324
324
|
price: 6400,
|
|
325
|
-
redCrystalCost:
|
|
325
|
+
redCrystalCost: 200,
|
|
326
326
|
isantiair: true,
|
|
327
327
|
tagEffects: {
|
|
328
328
|
"机械": 1.5
|
|
@@ -336,7 +336,7 @@ var weaponConfig = {
|
|
|
336
336
|
description: "一件传奇武器",
|
|
337
337
|
specialeffect: "攻击无视目标80%的减伤效果",
|
|
338
338
|
price: 6400,
|
|
339
|
-
redCrystalCost:
|
|
339
|
+
redCrystalCost: 200,
|
|
340
340
|
isantiair: true,
|
|
341
341
|
tagEffects: {
|
|
342
342
|
"重甲": 2
|
|
@@ -350,7 +350,7 @@ var weaponConfig = {
|
|
|
350
350
|
description: "一件传奇武器",
|
|
351
351
|
specialeffect: "",
|
|
352
352
|
price: 6400,
|
|
353
|
-
redCrystalCost:
|
|
353
|
+
redCrystalCost: 200,
|
|
354
354
|
isantiair: true,
|
|
355
355
|
tagEffects: {
|
|
356
356
|
"建筑": 2,
|
|
@@ -604,7 +604,7 @@ var spaceStationCrewConfig = [
|
|
|
604
604
|
var syndicatePirateConfig = [
|
|
605
605
|
{
|
|
606
606
|
professionName: "能量武器专家",
|
|
607
|
-
effect: "能量武器攻击伤害+20%;
|
|
607
|
+
effect: "能量武器攻击伤害+20%; 购买MK-4激光步枪(传奇)享有50%的折扣",
|
|
608
608
|
requirements: "至少拥有一把3级及以上等级的能量武器",
|
|
609
609
|
Jobtransfer: true,
|
|
610
610
|
costredcrystal: 30
|
|
@@ -618,21 +618,21 @@ var syndicatePirateConfig = [
|
|
|
618
618
|
},
|
|
619
619
|
{
|
|
620
620
|
professionName: "枪手",
|
|
621
|
-
effect: "武器等级上限为7级; 升级武器享有10%的折扣;
|
|
621
|
+
effect: "武器等级上限为7级; 升级武器享有10%的折扣; 购买M4AE脉冲步枪(传奇)享有50%的折扣",
|
|
622
622
|
requirements: "至少拥有一把6级及以上等级的武器",
|
|
623
623
|
Jobtransfer: true,
|
|
624
624
|
costredcrystal: 35
|
|
625
625
|
},
|
|
626
626
|
{
|
|
627
627
|
professionName: "猩红杀手",
|
|
628
|
-
effect: "“侦察步枪”攻击伤害+15%; 使用“侦察步枪”攻击时无视目标20%的减伤效果;
|
|
628
|
+
effect: "“侦察步枪”攻击伤害+15%; 使用“侦察步枪”攻击时无视目标20%的减伤效果; 购买DSR-55反器材步枪(传奇)享有50%的折扣",
|
|
629
629
|
requirements: "“侦察步枪”武器等级≥3级",
|
|
630
630
|
Jobtransfer: true,
|
|
631
631
|
costredcrystal: 30
|
|
632
632
|
},
|
|
633
633
|
{
|
|
634
634
|
professionName: "纵火狂",
|
|
635
|
-
effect: "热能武器攻击伤害+20%;
|
|
635
|
+
effect: "热能武器攻击伤害+20%; 购买龙息霰弹枪(传奇)享有50%的折扣",
|
|
636
636
|
requirements: "至少拥有一把3级及以上等级的热能武器",
|
|
637
637
|
Jobtransfer: true,
|
|
638
638
|
costredcrystal: 30
|
|
@@ -2781,13 +2781,14 @@ var BattleEffectProcessor = {
|
|
|
2781
2781
|
};
|
|
2782
2782
|
}, "handleColdEffect"),
|
|
2783
2783
|
// 统一的武器能量消耗处理函数
|
|
2784
|
-
handleWeaponEnergyDrain: /* @__PURE__ */ __name(function(targetBoss, weaponName) {
|
|
2784
|
+
handleWeaponEnergyDrain: /* @__PURE__ */ __name(function(targetBoss, weaponName, maxStatsMap) {
|
|
2785
2785
|
const weaponEnergyDrain = {
|
|
2786
2786
|
"弧焊枪": 200,
|
|
2787
2787
|
"DG-3电弧步枪": 500
|
|
2788
2788
|
};
|
|
2789
|
+
const targetmaxEnergy = maxStatsMap[targetBoss.name].maxEnergy;
|
|
2789
2790
|
const drainValue = weaponEnergyDrain[weaponName];
|
|
2790
|
-
if (!drainValue) {
|
|
2791
|
+
if (!drainValue || targetmaxEnergy === 0) {
|
|
2791
2792
|
return null;
|
|
2792
2793
|
}
|
|
2793
2794
|
const messages = [];
|
|
@@ -2983,7 +2984,7 @@ function applyPassiveEffects(targetBoss, activeBosses, weaponName, damage, ignor
|
|
|
2983
2984
|
processEffect(effectItem.effect, ...effectItem.args);
|
|
2984
2985
|
}
|
|
2985
2986
|
const healingEffects = [
|
|
2986
|
-
{ effect: BattleEffectProcessor.handleFrostRegeneration, args: [targetBoss, activeBosses] },
|
|
2987
|
+
{ effect: BattleEffectProcessor.handleFrostRegeneration, args: [targetBoss, activeBosses, maxStatsMap] },
|
|
2987
2988
|
{ effect: BattleEffectProcessor.handleFrostAura, args: [targetBoss, activeBosses] },
|
|
2988
2989
|
{ effect: BattleEffectProcessor.handleSentryGun, args: [targetBoss, activeBosses] },
|
|
2989
2990
|
{ effect: BattleEffectProcessor.handleMoldGrowth, args: [targetBoss, activeBosses] },
|
|
@@ -3056,7 +3057,7 @@ function applyPassiveEffects(targetBoss, activeBosses, weaponName, damage, ignor
|
|
|
3056
3057
|
}
|
|
3057
3058
|
coldLayerAdded = coldResult.layerAdded;
|
|
3058
3059
|
}
|
|
3059
|
-
const energyDrainResult = BattleEffectProcessor.handleWeaponEnergyDrain(targetBoss, weaponName);
|
|
3060
|
+
const energyDrainResult = BattleEffectProcessor.handleWeaponEnergyDrain(targetBoss, weaponName, maxStatsMap);
|
|
3060
3061
|
if (energyDrainResult) {
|
|
3061
3062
|
messages.push(...energyDrainResult.messages);
|
|
3062
3063
|
if (energyDrainResult.targetUpdates) {
|
|
@@ -4077,6 +4078,12 @@ function formatTime(date) {
|
|
|
4077
4078
|
});
|
|
4078
4079
|
}
|
|
4079
4080
|
__name(formatTime, "formatTime");
|
|
4081
|
+
var legendaryDiscounts = {
|
|
4082
|
+
"MK-4激光步枪": ["能量武器专家"],
|
|
4083
|
+
"DSR-55反器材步枪": ["猩红杀手"],
|
|
4084
|
+
"龙息霰弹枪": ["纵火狂"],
|
|
4085
|
+
"M4AE脉冲步枪": ["枪手"]
|
|
4086
|
+
};
|
|
4080
4087
|
|
|
4081
4088
|
// src/boss/damagecalculation.ts
|
|
4082
4089
|
async function calculateTotalDamage(ctx, session, config, equippedWeapon, targetBoss) {
|
|
@@ -7571,8 +7578,8 @@ ${validTypes.join("、")}`;
|
|
|
7571
7578
|
const layerDisplay = layerInfo.length > 0 ? `📊 层数状态: ${layerInfo.join(" | ")}` : "";
|
|
7572
7579
|
return [
|
|
7573
7580
|
`🎯 使用武器 ${weaponName} 攻击 ${dummyBoss.name}`,
|
|
7574
|
-
`❤️ 假人血量:${dummyBoss.HP}`,
|
|
7575
|
-
`⚡ 假人能量:${dummyBoss.energy}`,
|
|
7581
|
+
`❤️ 假人血量:${dummyBoss.HP}/10000`,
|
|
7582
|
+
`⚡ 假人能量:${dummyBoss.energy}/1000`,
|
|
7576
7583
|
options.tags?.length && `🏷️ 模拟标签:${tags.join(", ")}`,
|
|
7577
7584
|
options.passives?.length && `✨ 模拟被动:${passives.join(", ")}`,
|
|
7578
7585
|
layerDisplay,
|
|
@@ -7590,9 +7597,8 @@ ${testResult.ignoreMessage.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
7590
7597
|
${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
7591
7598
|
] : [],
|
|
7592
7599
|
`📊 理论伤害值:${testResult.initialDamage}${testResult.hasCrit ? "(✨ 暴击)" : ""}`,
|
|
7593
|
-
"💡
|
|
7594
|
-
"💡 层数选项:技能层数(-s)、辐射层数(-r)、寒冷层数(-c)、状态层数(-a)"
|
|
7595
|
-
`ℹ️ 测试假人最大血量:10000 | 最大能量:1000 | 最大层数:100`
|
|
7600
|
+
"💡 参数添加:可添加标签(-t)、被动(-p)、血量(-l)、能量(-e)",
|
|
7601
|
+
"💡 层数选项:技能层数(-s)、辐射层数(-r)、寒冷层数(-c)、状态层数(-a)"
|
|
7596
7602
|
].filter((line) => line).join("\n");
|
|
7597
7603
|
} finally {
|
|
7598
7604
|
Object.keys("测试假人").forEach((key) => delete battleStatsMap[key]);
|
|
@@ -7909,7 +7915,7 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
7909
7915
|
return `您输入的是错误的阵营名称,请选择有效阵营:${validFactions.join(" / ")}`;
|
|
7910
7916
|
}
|
|
7911
7917
|
const [existing] = await ctx.database.get("ggcevo_careers", { handle });
|
|
7912
|
-
if (existing) {
|
|
7918
|
+
if (existing.group === "人类联盟" || existing.group === "辛迪加海盗") {
|
|
7913
7919
|
return `你已经加入${existing.group}阵营,当前职业:${existing.career}`;
|
|
7914
7920
|
}
|
|
7915
7921
|
const [signData] = await ctx.database.get("ggcevo_sign", { handle });
|
|
@@ -7926,15 +7932,13 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
7926
7932
|
handle,
|
|
7927
7933
|
totalRewards: signData?.totalRewards - 1e3
|
|
7928
7934
|
}], ["handle"]);
|
|
7929
|
-
await ctx.database.
|
|
7935
|
+
await ctx.database.upsert("ggcevo_careers", [{
|
|
7930
7936
|
handle,
|
|
7931
7937
|
group: "人类联盟",
|
|
7932
7938
|
career: "联盟新兵",
|
|
7933
|
-
redcrystal: 0,
|
|
7934
7939
|
date: /* @__PURE__ */ new Date()
|
|
7935
|
-
});
|
|
7940
|
+
}], ["handle"]);
|
|
7936
7941
|
} else if (faction === "辛迪加海盗") {
|
|
7937
|
-
const [pkData] = await ctx.database.get("ggcevo_pk", { handle });
|
|
7938
7942
|
if (userCoins < 2e3) {
|
|
7939
7943
|
return `加入辛迪加海盗需要缴纳2000金币,您当前拥有${userCoins}金币`;
|
|
7940
7944
|
}
|
|
@@ -7945,13 +7949,13 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
7945
7949
|
handle,
|
|
7946
7950
|
totalRewards: signData?.totalRewards - 2e3
|
|
7947
7951
|
}], ["handle"]);
|
|
7948
|
-
await ctx.database.
|
|
7952
|
+
await ctx.database.upsert("ggcevo_careers", [{
|
|
7949
7953
|
handle,
|
|
7950
7954
|
group: "辛迪加海盗",
|
|
7951
7955
|
career: "辛迪加炮灰新兵",
|
|
7952
|
-
redcrystal: 5,
|
|
7956
|
+
redcrystal: (existing?.redcrystal || 0) + 5,
|
|
7953
7957
|
date: /* @__PURE__ */ new Date()
|
|
7954
|
-
});
|
|
7958
|
+
}], ["handle"]);
|
|
7955
7959
|
}
|
|
7956
7960
|
return `花费了${faction === "人类联盟" ? "1000金币" : "2000金币"}成功加入${faction}!${faction === "人类联盟" ? "" : "获得5枚红晶,"}初始职业:${faction === "人类联盟" ? "联盟新兵" : "辛迪加炮灰新兵"}`;
|
|
7957
7961
|
} catch (err) {
|
|
@@ -8167,8 +8171,22 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
8167
8171
|
if (!careerData || careerData.group !== "辛迪加海盗") {
|
|
8168
8172
|
return "🚫 该功能需要【辛迪加海盗】阵营权限";
|
|
8169
8173
|
}
|
|
8170
|
-
const
|
|
8171
|
-
const
|
|
8174
|
+
const currentCareer = careerData.career;
|
|
8175
|
+
const discountProfessions = {
|
|
8176
|
+
"计算机专家": ["设备工具"],
|
|
8177
|
+
"破坏者": ["爆破物"]
|
|
8178
|
+
};
|
|
8179
|
+
Object.keys(legendaryDiscounts).forEach((item) => {
|
|
8180
|
+
if (legendaryDiscounts[item].includes(currentCareer)) {
|
|
8181
|
+
const category2 = weaponConfig[item]?.category;
|
|
8182
|
+
if (category2 && !discountProfessions[currentCareer]?.includes(category2)) {
|
|
8183
|
+
discountProfessions[currentCareer] = [
|
|
8184
|
+
...discountProfessions[currentCareer] || [],
|
|
8185
|
+
category2
|
|
8186
|
+
];
|
|
8187
|
+
}
|
|
8188
|
+
}
|
|
8189
|
+
});
|
|
8172
8190
|
const categoryStats = {};
|
|
8173
8191
|
Object.values(weaponConfig).filter((config2) => config2.redCrystalCost > 0).forEach((weapon) => {
|
|
8174
8192
|
categoryStats[weapon.category] = (categoryStats[weapon.category] || 0) + 1;
|
|
@@ -8178,17 +8196,16 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
8178
8196
|
});
|
|
8179
8197
|
if (!category) {
|
|
8180
8198
|
const discountLines = [];
|
|
8181
|
-
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
-
|
|
8185
|
-
|
|
8186
|
-
}
|
|
8199
|
+
Object.entries(discountProfessions).forEach(([profession, categories]) => {
|
|
8200
|
+
categories.forEach((cat) => {
|
|
8201
|
+
discountLines.push(`▸ ${profession}:${cat}类50%折扣`);
|
|
8202
|
+
});
|
|
8203
|
+
});
|
|
8187
8204
|
return [
|
|
8188
8205
|
"🏴 辛迪加黑市 🏴",
|
|
8189
8206
|
'使用 "黑市 分类名称" 查看详细信息',
|
|
8190
8207
|
discountLines.length ? [
|
|
8191
|
-
"💰
|
|
8208
|
+
"💰 专属折扣职业:",
|
|
8192
8209
|
...discountLines
|
|
8193
8210
|
].join("\n") : "",
|
|
8194
8211
|
"====================",
|
|
@@ -8198,18 +8215,29 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
8198
8215
|
}
|
|
8199
8216
|
const normalizedCategory = Object.keys(categoryStats).find((c) => c === category);
|
|
8200
8217
|
if (!normalizedCategory) return `无效分类,可用:${Object.keys(categoryStats).join("、")}`;
|
|
8201
|
-
const isLegendaryCategory = normalizedCategory === "传奇武器";
|
|
8202
|
-
const legendaryNotice = isLegendaryCategory ? "⚠️ 注意:购买传奇武器需要对应的辛迪加海盗职业权限" : null;
|
|
8203
8218
|
const items = [
|
|
8204
8219
|
...Object.entries(weaponConfig).filter(
|
|
8205
8220
|
([_, config2]) => config2.category === normalizedCategory && config2.redCrystalCost > 0
|
|
8206
8221
|
).map(([name2, config2]) => {
|
|
8222
|
+
let discountPrice = null;
|
|
8223
|
+
let discountProfession = null;
|
|
8224
|
+
if (legendaryDiscounts[name2]?.includes(currentCareer)) {
|
|
8225
|
+
discountPrice = Math.floor(config2.redCrystalCost * 0.5);
|
|
8226
|
+
discountProfession = currentCareer;
|
|
8227
|
+
}
|
|
8207
8228
|
const infoBlocks = [
|
|
8208
8229
|
`【${name2}】`,
|
|
8209
8230
|
`武器类型:${config2.type}`,
|
|
8210
|
-
`基础伤害:${config2.damage}
|
|
8211
|
-
`订购价:${config2.redCrystalCost}红晶`
|
|
8231
|
+
`基础伤害:${config2.damage}`
|
|
8212
8232
|
];
|
|
8233
|
+
if (discountPrice) {
|
|
8234
|
+
infoBlocks.push(
|
|
8235
|
+
`订购价:${discountPrice}红晶 (原价${config2.redCrystalCost})`,
|
|
8236
|
+
`折扣:${discountProfession}专属50%折扣`
|
|
8237
|
+
);
|
|
8238
|
+
} else {
|
|
8239
|
+
infoBlocks.push(`订购价:${config2.redCrystalCost}红晶`);
|
|
8240
|
+
}
|
|
8213
8241
|
if (config2.specialeffect) {
|
|
8214
8242
|
infoBlocks.push(`特殊效果:${config2.specialeffect}`);
|
|
8215
8243
|
}
|
|
@@ -8227,26 +8255,23 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
8227
8255
|
...Object.entries(SyndicatedItems).filter(
|
|
8228
8256
|
([_, item]) => item.type === normalizedCategory && item.redCrystalCost > 0
|
|
8229
8257
|
).map(([name2, item]) => {
|
|
8230
|
-
let
|
|
8231
|
-
let
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
|
|
8235
|
-
|
|
8236
|
-
|
|
8237
|
-
|
|
8238
|
-
finalPrice = Math.floor(item.redCrystalCost * 0.5);
|
|
8239
|
-
discountApplied = true;
|
|
8240
|
-
discountType = "计算机专家";
|
|
8258
|
+
let discountPrice = null;
|
|
8259
|
+
let discountReason = null;
|
|
8260
|
+
if (currentCareer === "破坏者" && normalizedCategory === "爆破物") {
|
|
8261
|
+
discountPrice = Math.floor(item.redCrystalCost * 0.5);
|
|
8262
|
+
discountReason = "破坏者";
|
|
8263
|
+
} else if (currentCareer === "计算机专家" && normalizedCategory === "设备工具") {
|
|
8264
|
+
discountPrice = Math.floor(item.redCrystalCost * 0.5);
|
|
8265
|
+
discountReason = "计算机专家";
|
|
8241
8266
|
}
|
|
8242
8267
|
const infoBlocks = [
|
|
8243
8268
|
`【${name2}】`,
|
|
8244
8269
|
`物品类型:${item.type}`
|
|
8245
8270
|
];
|
|
8246
|
-
if (
|
|
8271
|
+
if (discountPrice) {
|
|
8247
8272
|
infoBlocks.push(
|
|
8248
|
-
`订购价:${
|
|
8249
|
-
`折扣:${
|
|
8273
|
+
`订购价:${discountPrice}红晶 (原价${item.redCrystalCost})`,
|
|
8274
|
+
`折扣:${discountReason}专属50%折扣`
|
|
8250
8275
|
);
|
|
8251
8276
|
} else {
|
|
8252
8277
|
infoBlocks.push(
|
|
@@ -8255,7 +8280,6 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
8255
8280
|
}
|
|
8256
8281
|
infoBlocks.push(
|
|
8257
8282
|
`条件:${item.condition}`,
|
|
8258
|
-
// 新增的条件字段
|
|
8259
8283
|
`特殊效果:${item.effects}`,
|
|
8260
8284
|
`描述:${item.description}`,
|
|
8261
8285
|
"------------------"
|
|
@@ -8263,23 +8287,29 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
8263
8287
|
return infoBlocks.join("\n");
|
|
8264
8288
|
})
|
|
8265
8289
|
];
|
|
8266
|
-
|
|
8267
|
-
if (
|
|
8268
|
-
|
|
8269
|
-
|
|
8270
|
-
|
|
8271
|
-
|
|
8272
|
-
|
|
8273
|
-
|
|
8290
|
+
const discountInfo = [];
|
|
8291
|
+
if (normalizedCategory === "传奇武器") {
|
|
8292
|
+
const availableDiscounts = [];
|
|
8293
|
+
Object.entries(legendaryDiscounts).forEach(([weapon, professions]) => {
|
|
8294
|
+
if (professions.includes(currentCareer)) {
|
|
8295
|
+
availableDiscounts.push(`${weapon}(${currentCareer}专属50%折扣)`);
|
|
8296
|
+
}
|
|
8297
|
+
});
|
|
8298
|
+
if (availableDiscounts.length) {
|
|
8299
|
+
discountInfo.push(
|
|
8300
|
+
"💰 传奇武器职业折扣:",
|
|
8301
|
+
`▸ ${availableDiscounts.join("\n▸ ")}`
|
|
8302
|
+
);
|
|
8303
|
+
}
|
|
8304
|
+
} else if (currentCareer === "破坏者" && normalizedCategory === "爆破物" || currentCareer === "计算机专家" && normalizedCategory === "设备工具") {
|
|
8305
|
+
discountInfo.push(
|
|
8274
8306
|
"💰 折扣明细:",
|
|
8275
|
-
|
|
8276
|
-
|
|
8307
|
+
`▸ ${currentCareer}职业:${normalizedCategory}类50%折扣`
|
|
8308
|
+
);
|
|
8277
8309
|
}
|
|
8278
8310
|
return [
|
|
8279
8311
|
`🏴 辛迪加黑市 - ${normalizedCategory} 🏴`,
|
|
8280
8312
|
'使用"订购 物品名称"进行购买(仅消耗红晶)',
|
|
8281
|
-
legendaryNotice,
|
|
8282
|
-
// 新增传奇武器权限提示
|
|
8283
8313
|
...discountInfo,
|
|
8284
8314
|
"====================",
|
|
8285
8315
|
...items
|
|
@@ -8302,34 +8332,22 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
8302
8332
|
if (!isWeapon && !isSyndicatedItem) return "❌ 无效物品名称";
|
|
8303
8333
|
const itemConfig2 = isWeapon ? weaponConfig[item] : SyndicatedItems[item];
|
|
8304
8334
|
if (!itemConfig2.redCrystalCost) return "⛔ 该物品不可订购";
|
|
8305
|
-
|
|
8306
|
-
|
|
8307
|
-
if (item === "MK-4激光步枪" && careerData.career !== "能量武器专家") {
|
|
8308
|
-
return "❌ 购买MK-4激光步枪需要【能量武器专家】职业。";
|
|
8309
|
-
} else if (item === "DSR-55反器材步枪" && careerData.career !== "猩红杀手") {
|
|
8310
|
-
return "❌ 购买DSR-55反器材步枪需要【猩红杀手】职业。";
|
|
8311
|
-
} else if (item === "龙息霰弹枪" && careerData.career !== "纵火狂") {
|
|
8312
|
-
return "❌ 购买龙息霰弹枪需要【纵火狂】职业。";
|
|
8313
|
-
} else if (item === "M4AE脉冲步枪" && careerData.career !== "枪手") {
|
|
8314
|
-
return "❌ 购买M4AE脉冲步枪需要【枪手】职业。";
|
|
8315
|
-
} else if (item !== "MK-4激光步枪" && item !== "DSR-55反器材步枪" && item !== "龙息霰弹枪" && item !== "M4AE脉冲步枪") {
|
|
8316
|
-
return "❌ 未知的传奇武器或未开放购买权限";
|
|
8317
|
-
}
|
|
8318
|
-
}
|
|
8319
|
-
let isComputerExpertDiscount = false;
|
|
8320
|
-
let isSaboteurDiscount = false;
|
|
8335
|
+
let discountApplied = false;
|
|
8336
|
+
let discountReason = "";
|
|
8321
8337
|
let originalPrice = itemConfig2.redCrystalCost;
|
|
8322
8338
|
let finalCost = originalPrice;
|
|
8323
|
-
let discountApplied = false;
|
|
8324
8339
|
if (!isWeapon && itemConfig2.type === "爆破物" && careerData.career === "破坏者") {
|
|
8325
8340
|
finalCost = Math.floor(originalPrice * 0.5);
|
|
8326
|
-
isSaboteurDiscount = true;
|
|
8327
8341
|
discountApplied = true;
|
|
8328
|
-
|
|
8329
|
-
if (!isWeapon && itemConfig2.type === "设备工具" && careerData.career === "计算机专家") {
|
|
8342
|
+
discountReason = "破坏者职业:爆破物类物品50%折扣";
|
|
8343
|
+
} else if (!isWeapon && itemConfig2.type === "设备工具" && careerData.career === "计算机专家") {
|
|
8330
8344
|
finalCost = Math.floor(originalPrice * 0.5);
|
|
8331
|
-
isComputerExpertDiscount = true;
|
|
8332
8345
|
discountApplied = true;
|
|
8346
|
+
discountReason = "计算机专家职业:设备工具类物品50%折扣";
|
|
8347
|
+
} else if (isWeapon && itemConfig2.category === "传奇武器" && legendaryDiscounts[item]?.includes(careerData.career)) {
|
|
8348
|
+
finalCost = Math.floor(originalPrice * 0.5);
|
|
8349
|
+
discountApplied = true;
|
|
8350
|
+
discountReason = `${careerData.career}职业:购买${item}享受50%折扣`;
|
|
8333
8351
|
}
|
|
8334
8352
|
if ((careerData.redcrystal || 0) < finalCost) {
|
|
8335
8353
|
const discountMessage = discountApplied ? `(原价${originalPrice})` : "";
|
|
@@ -8379,12 +8397,6 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
8379
8397
|
});
|
|
8380
8398
|
const buildResponse = /* @__PURE__ */ __name(async () => {
|
|
8381
8399
|
const discountLines = [];
|
|
8382
|
-
if (isSaboteurDiscount) {
|
|
8383
|
-
discountLines.push("💣 破坏者职业:爆破物类物品50%折扣");
|
|
8384
|
-
}
|
|
8385
|
-
if (isComputerExpertDiscount) {
|
|
8386
|
-
discountLines.push("💻 计算机专家职业:设备工具类物品50%折扣");
|
|
8387
|
-
}
|
|
8388
8400
|
const priceInfo = [
|
|
8389
8401
|
`消耗红晶:${finalCost}${discountApplied ? ` (原价${originalPrice})` : ""}`
|
|
8390
8402
|
];
|
|
@@ -8393,8 +8405,7 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
8393
8405
|
return [
|
|
8394
8406
|
`✅ 成功订购【${item}】!`,
|
|
8395
8407
|
...priceInfo,
|
|
8396
|
-
|
|
8397
|
-
▸ ${discountLines.join("\n▸ ")}` : "",
|
|
8408
|
+
discountApplied ? `💰 折扣明细:${discountReason}` : "",
|
|
8398
8409
|
`装备状态:${equippedStatus}`,
|
|
8399
8410
|
'输入 "武器仓库" 管理武器'
|
|
8400
8411
|
].filter(Boolean).join("\n");
|
|
@@ -8406,8 +8417,8 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
8406
8417
|
return [
|
|
8407
8418
|
`✅ 成功订购【${item}】x1!`,
|
|
8408
8419
|
...priceInfo,
|
|
8409
|
-
|
|
8410
|
-
|
|
8420
|
+
discountApplied ? `💰 折扣明细:
|
|
8421
|
+
${discountReason}` : "",
|
|
8411
8422
|
`当前库存:${currentStock}件`,
|
|
8412
8423
|
'输入 "仓库" 查看所有物品'
|
|
8413
8424
|
].filter(Boolean).join("\n");
|
|
@@ -8854,6 +8865,57 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
|
|
|
8854
8865
|
return "购买过程中发生错误,请稍后再试";
|
|
8855
8866
|
}
|
|
8856
8867
|
});
|
|
8868
|
+
ctx.command("ggcevo/开启军械库防爆门").alias("打开军械库防爆门").action(async (argv) => {
|
|
8869
|
+
const session = argv.session;
|
|
8870
|
+
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
8871
|
+
if (!profile) return "🔒 请先绑定游戏句柄。";
|
|
8872
|
+
const { regionId, realmId, profileId } = profile;
|
|
8873
|
+
const handle = `${regionId}-S2-${realmId}-${profileId}`;
|
|
8874
|
+
const isBlacklisted = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
8875
|
+
if (isBlacklisted.length > 0) return "⛔ 您已被列入黑名单。";
|
|
8876
|
+
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
8877
|
+
if (!careerData || careerData.group !== "人类联盟") {
|
|
8878
|
+
return "⚠️ 您不属于人类阵营,无法执行此操作";
|
|
8879
|
+
}
|
|
8880
|
+
const validCareers = ["警卫", "警卫长", "情报副官"];
|
|
8881
|
+
if (!careerData.career || !validCareers.includes(careerData.career)) {
|
|
8882
|
+
return `⚠️ 您的职业(${careerData.career || "未设置"})不是警卫、警卫长或情报副官`;
|
|
8883
|
+
}
|
|
8884
|
+
const [permission] = await ctx.database.get("ggcevo_permissions", { handle });
|
|
8885
|
+
if (!permission || !permission.explosiondoorauthority || permission.explosiondoorauthority < 1) {
|
|
8886
|
+
return "⚠️ 您没有操作军械库防爆门的权限";
|
|
8887
|
+
}
|
|
8888
|
+
const userWeapons = await ctx.database.get("ggcevo_weapons", { handle });
|
|
8889
|
+
const ownedLegendaryIds = userWeapons.filter((weapon) => weapon.weaponId >= 101 && weapon.weaponId <= 108).map((weapon) => weapon.weaponId);
|
|
8890
|
+
const allLegendaryWeapons = Object.entries(weaponConfig).filter(([_, config2]) => config2.category === "传奇武器").map(([name2, config2]) => ({ name: name2, ...config2 }));
|
|
8891
|
+
const availableLegendaryWeapons = allLegendaryWeapons.filter((weapon) => !ownedLegendaryIds.includes(weapon.id));
|
|
8892
|
+
if (availableLegendaryWeapons.length === 0) {
|
|
8893
|
+
return "⚠️ 您已经拥有所有传奇武器,无法获得新武器。";
|
|
8894
|
+
}
|
|
8895
|
+
const randomIndex = Math.floor(Math.random() * availableLegendaryWeapons.length);
|
|
8896
|
+
const awardedWeapon = availableLegendaryWeapons[randomIndex];
|
|
8897
|
+
await ctx.database.withTransaction(async () => {
|
|
8898
|
+
await ctx.database.set("ggcevo_permissions", { handle }, {
|
|
8899
|
+
explosiondoorauthority: permission.explosiondoorauthority - 1
|
|
8900
|
+
});
|
|
8901
|
+
await ctx.database.upsert("ggcevo_weapons", [{
|
|
8902
|
+
handle,
|
|
8903
|
+
weaponId: awardedWeapon.id,
|
|
8904
|
+
level: 0,
|
|
8905
|
+
modificationSlots: 1,
|
|
8906
|
+
installedMods: [],
|
|
8907
|
+
equipped: false
|
|
8908
|
+
}]);
|
|
8909
|
+
});
|
|
8910
|
+
return [
|
|
8911
|
+
`🎉 军械库防爆门已开启!`,
|
|
8912
|
+
`✨ 您获得了传奇武器:${awardedWeapon.name}`,
|
|
8913
|
+
`🔧 武器类型:${awardedWeapon.type}`,
|
|
8914
|
+
`⚔️ 基础伤害:${awardedWeapon.damage}`,
|
|
8915
|
+
`🔮 特殊效果:${awardedWeapon.specialeffect || "无"}`,
|
|
8916
|
+
`📖 描述:${awardedWeapon.description}`
|
|
8917
|
+
].join("\n");
|
|
8918
|
+
});
|
|
8857
8919
|
}
|
|
8858
8920
|
__name(apply, "apply");
|
|
8859
8921
|
// Annotate the CommonJS export names for ESM import in node:
|
package/lib/utils.d.ts
CHANGED
|
@@ -23,3 +23,9 @@ export declare function generateUpgradePriceList(ctx: Context, handle: string):
|
|
|
23
23
|
export declare function getRankInfo(ctx: Context, config: Config, handle: string): Promise<string>;
|
|
24
24
|
export declare function isWithinProtection(protections: PKProtection[]): boolean;
|
|
25
25
|
export declare function formatTime(date: Date): string;
|
|
26
|
+
export declare const legendaryDiscounts: {
|
|
27
|
+
'MK-4\u6FC0\u5149\u6B65\u67AA': string[];
|
|
28
|
+
'DSR-55\u53CD\u5668\u6750\u6B65\u67AA': string[];
|
|
29
|
+
龙息霰弹枪: string[];
|
|
30
|
+
M4AE脉冲步枪: string[];
|
|
31
|
+
};
|