koishi-plugin-ggcevo-game 1.4.1 → 1.4.3
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/attackhandling.d.ts +2 -2
- package/lib/boss/boss.d.ts +20 -9
- package/lib/boss/passive.d.ts +17 -1
- package/lib/boss/passivehandler.d.ts +29 -6
- package/lib/database.d.ts +7 -0
- package/lib/index.js +623 -224
- package/lib/utils.d.ts +1 -0
- package/lib/weapons.d.ts +160 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -35,6 +35,7 @@ var weaponConfig = {
|
|
|
35
35
|
"高斯步枪": {
|
|
36
36
|
id: 1,
|
|
37
37
|
type: "实弹武器",
|
|
38
|
+
category: "实弹武器",
|
|
38
39
|
damage: 10,
|
|
39
40
|
description: "标准配置武器,中距离作战利器",
|
|
40
41
|
specialeffect: "",
|
|
@@ -49,6 +50,7 @@ var weaponConfig = {
|
|
|
49
50
|
"激光步枪": {
|
|
50
51
|
id: 2,
|
|
51
52
|
type: "能量武器",
|
|
53
|
+
category: "能量武器",
|
|
52
54
|
damage: 23,
|
|
53
55
|
description: "先进激光武器,远距离精准打击",
|
|
54
56
|
specialeffect: "",
|
|
@@ -64,6 +66,7 @@ var weaponConfig = {
|
|
|
64
66
|
"焚烧枪": {
|
|
65
67
|
id: 3,
|
|
66
68
|
type: "热能武器",
|
|
69
|
+
category: "热能武器",
|
|
67
70
|
damage: 20,
|
|
68
71
|
description: "基于热能的强大武器,烧烬一切",
|
|
69
72
|
specialeffect: "",
|
|
@@ -79,6 +82,7 @@ var weaponConfig = {
|
|
|
79
82
|
"碎骨步枪": {
|
|
80
83
|
id: 4,
|
|
81
84
|
type: "能量武器",
|
|
85
|
+
category: "能量武器",
|
|
82
86
|
damage: 28,
|
|
83
87
|
description: "由激光步枪改良而来,高效的对重甲武器",
|
|
84
88
|
specialeffect: "",
|
|
@@ -94,6 +98,7 @@ var weaponConfig = {
|
|
|
94
98
|
"等离子切割机": {
|
|
95
99
|
id: 5,
|
|
96
100
|
type: "实弹武器",
|
|
101
|
+
category: "实弹武器",
|
|
97
102
|
damage: 12,
|
|
98
103
|
description: "一种改造后的采矿切割机,有效对抗重甲目标",
|
|
99
104
|
specialeffect: "",
|
|
@@ -109,6 +114,7 @@ var weaponConfig = {
|
|
|
109
114
|
"突击霰弹枪": {
|
|
110
115
|
id: 6,
|
|
111
116
|
type: "实弹武器",
|
|
117
|
+
category: "实弹武器",
|
|
112
118
|
damage: 28,
|
|
113
119
|
description: "近距离攻击武器,专为遭遇战设计使用",
|
|
114
120
|
specialeffect: "",
|
|
@@ -123,6 +129,7 @@ var weaponConfig = {
|
|
|
123
129
|
"侦察步枪": {
|
|
124
130
|
id: 7,
|
|
125
131
|
type: "实弹武器",
|
|
132
|
+
category: "实弹武器",
|
|
126
133
|
damage: 50,
|
|
127
134
|
description: "用于隐秘射击的最佳武器,但是无法穿透护甲",
|
|
128
135
|
specialeffect: "",
|
|
@@ -137,6 +144,7 @@ var weaponConfig = {
|
|
|
137
144
|
"零度之下": {
|
|
138
145
|
id: 8,
|
|
139
146
|
type: "热能武器",
|
|
147
|
+
category: "热能武器",
|
|
140
148
|
damage: 20,
|
|
141
149
|
description: "喷射稳定的液氮恒流,对长时间接触者造成致命的损伤",
|
|
142
150
|
specialeffect: "攻击使目标叠加“寒冷”层数,每层使其受到的伤害+5%(至多叠加10层)",
|
|
@@ -151,9 +159,10 @@ var weaponConfig = {
|
|
|
151
159
|
"弧焊枪": {
|
|
152
160
|
id: 9,
|
|
153
161
|
type: "能量武器",
|
|
162
|
+
category: "能量武器",
|
|
154
163
|
damage: 25,
|
|
155
164
|
description: "一种经过改造的电动工具,可对近距离的目标放出高压电",
|
|
156
|
-
specialeffect: "
|
|
165
|
+
specialeffect: "攻击消耗目标200点能量",
|
|
157
166
|
price: 750,
|
|
158
167
|
redCrystalCost: 10,
|
|
159
168
|
isantiair: true,
|
|
@@ -165,6 +174,7 @@ var weaponConfig = {
|
|
|
165
174
|
"伽马枪": {
|
|
166
175
|
id: 10,
|
|
167
176
|
type: "热能武器",
|
|
177
|
+
category: "热能武器",
|
|
168
178
|
damage: 25,
|
|
169
179
|
description: "一种高度危险性的武器,设计用辐射照射并伤害敌人",
|
|
170
180
|
specialeffect: "攻击使生物目标(无机械标签)叠加“辐射”层数,每层使其受到的伤害+5%(至多叠加10层)",
|
|
@@ -179,9 +189,10 @@ var weaponConfig = {
|
|
|
179
189
|
"中子步枪": {
|
|
180
190
|
id: 11,
|
|
181
191
|
type: "能量武器",
|
|
192
|
+
category: "能量武器",
|
|
182
193
|
damage: 30,
|
|
183
194
|
description: "激光步枪的变种,采用折射技术升级",
|
|
184
|
-
specialeffect: "拥有“散射”效果,对其他目标造成80
|
|
195
|
+
specialeffect: "拥有“散射”效果,对其他目标造成80%的伤害",
|
|
185
196
|
price: 1450,
|
|
186
197
|
redCrystalCost: 15,
|
|
187
198
|
isantiair: true,
|
|
@@ -192,9 +203,10 @@ var weaponConfig = {
|
|
|
192
203
|
"粒子相位枪": {
|
|
193
204
|
id: 12,
|
|
194
205
|
type: "能量武器",
|
|
206
|
+
category: "能量武器",
|
|
195
207
|
damage: 30,
|
|
196
208
|
description: "面对护盾目标而开发的武器",
|
|
197
|
-
specialeffect: "
|
|
209
|
+
specialeffect: "攻击无视护盾目标50%的减伤效果",
|
|
198
210
|
price: 1050,
|
|
199
211
|
redCrystalCost: 15,
|
|
200
212
|
isantiair: true,
|
|
@@ -203,6 +215,148 @@ var weaponConfig = {
|
|
|
203
215
|
"轻甲": 0.5,
|
|
204
216
|
"重甲": 0.2
|
|
205
217
|
}
|
|
218
|
+
},
|
|
219
|
+
"动力钻头": {
|
|
220
|
+
id: 13,
|
|
221
|
+
type: "实弹武器",
|
|
222
|
+
category: "实弹武器",
|
|
223
|
+
damage: 25,
|
|
224
|
+
description: "这种强大的钻头是由那些想把矿工SCV上的大螺丝用作武器的人创造的",
|
|
225
|
+
specialeffect: "",
|
|
226
|
+
price: 1e3,
|
|
227
|
+
redCrystalCost: 15,
|
|
228
|
+
isantiair: true,
|
|
229
|
+
tagEffects: {
|
|
230
|
+
"建筑": 2,
|
|
231
|
+
"重甲": 1.5,
|
|
232
|
+
"机械": 1.5
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"脉冲扰乱枪": {
|
|
236
|
+
id: 14,
|
|
237
|
+
type: "能量武器",
|
|
238
|
+
category: "能量武器",
|
|
239
|
+
damage: 30,
|
|
240
|
+
description: "一种原型能量武器,能够发射强大的脉冲",
|
|
241
|
+
specialeffect: "攻击不会触发目标的叠层技能",
|
|
242
|
+
price: 1500,
|
|
243
|
+
redCrystalCost: 15,
|
|
244
|
+
isantiair: true,
|
|
245
|
+
tagEffects: {}
|
|
246
|
+
},
|
|
247
|
+
"外星电浆": {
|
|
248
|
+
id: 101,
|
|
249
|
+
type: "能量武器",
|
|
250
|
+
category: "传奇武器",
|
|
251
|
+
damage: 88,
|
|
252
|
+
description: "一件传奇武器",
|
|
253
|
+
specialeffect: "",
|
|
254
|
+
price: 7500,
|
|
255
|
+
redCrystalCost: 150,
|
|
256
|
+
isantiair: true,
|
|
257
|
+
tagEffects: {
|
|
258
|
+
"护盾": 0.5,
|
|
259
|
+
"重甲": 0.5
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
"MK-4激光步枪": {
|
|
263
|
+
id: 102,
|
|
264
|
+
type: "能量武器",
|
|
265
|
+
category: "传奇武器",
|
|
266
|
+
damage: 50,
|
|
267
|
+
description: "一件传奇武器",
|
|
268
|
+
specialeffect: "攻击暴击率80%",
|
|
269
|
+
price: 7500,
|
|
270
|
+
redCrystalCost: 150,
|
|
271
|
+
isantiair: true,
|
|
272
|
+
tagEffects: {
|
|
273
|
+
"重甲": 2
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
"龙息霰弹枪": {
|
|
277
|
+
id: 103,
|
|
278
|
+
type: "实弹武器",
|
|
279
|
+
category: "传奇武器",
|
|
280
|
+
damage: 80,
|
|
281
|
+
description: "这是传说中的武器",
|
|
282
|
+
specialeffect: "",
|
|
283
|
+
price: 7500,
|
|
284
|
+
redCrystalCost: 150,
|
|
285
|
+
isantiair: false,
|
|
286
|
+
tagEffects: {
|
|
287
|
+
"轻甲": 1.5,
|
|
288
|
+
"惧热": 1.5
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
"DSR-55反器材步枪": {
|
|
292
|
+
id: 104,
|
|
293
|
+
type: "实弹武器",
|
|
294
|
+
category: "传奇武器",
|
|
295
|
+
damage: 145,
|
|
296
|
+
description: "一件传奇武器",
|
|
297
|
+
specialeffect: "",
|
|
298
|
+
price: 7500,
|
|
299
|
+
redCrystalCost: 150,
|
|
300
|
+
isantiair: true,
|
|
301
|
+
tagEffects: {
|
|
302
|
+
"重甲": 1.2
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
"光剑": {
|
|
306
|
+
id: 105,
|
|
307
|
+
type: "能量武器",
|
|
308
|
+
category: "传奇武器",
|
|
309
|
+
damage: 100,
|
|
310
|
+
description: "优雅而独特的武器",
|
|
311
|
+
specialeffect: "",
|
|
312
|
+
price: 7500,
|
|
313
|
+
redCrystalCost: 150,
|
|
314
|
+
isantiair: false,
|
|
315
|
+
tagEffects: {}
|
|
316
|
+
},
|
|
317
|
+
"DG-3电弧步枪": {
|
|
318
|
+
id: 106,
|
|
319
|
+
type: "能量武器",
|
|
320
|
+
category: "传奇武器",
|
|
321
|
+
damage: 100,
|
|
322
|
+
description: "一件传奇武器",
|
|
323
|
+
specialeffect: "攻击消耗目标500点能量",
|
|
324
|
+
price: 7500,
|
|
325
|
+
redCrystalCost: 150,
|
|
326
|
+
isantiair: true,
|
|
327
|
+
tagEffects: {
|
|
328
|
+
"机械": 1.5
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
"M4AE脉冲步枪": {
|
|
332
|
+
id: 107,
|
|
333
|
+
type: "能量武器",
|
|
334
|
+
category: "传奇武器",
|
|
335
|
+
damage: 50,
|
|
336
|
+
description: "一件传奇武器",
|
|
337
|
+
specialeffect: "攻击无视目标80%的减伤效果",
|
|
338
|
+
price: 7500,
|
|
339
|
+
redCrystalCost: 150,
|
|
340
|
+
isantiair: true,
|
|
341
|
+
tagEffects: {
|
|
342
|
+
"重甲": 2
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
"核聚变重炮": {
|
|
346
|
+
id: 108,
|
|
347
|
+
type: "能量武器",
|
|
348
|
+
category: "传奇武器",
|
|
349
|
+
damage: 110,
|
|
350
|
+
description: "一件传奇武器",
|
|
351
|
+
specialeffect: "",
|
|
352
|
+
price: 7500,
|
|
353
|
+
redCrystalCost: 150,
|
|
354
|
+
isantiair: true,
|
|
355
|
+
tagEffects: {
|
|
356
|
+
"建筑": 2,
|
|
357
|
+
"重型": 1.5,
|
|
358
|
+
"重甲": 1.2
|
|
359
|
+
}
|
|
206
360
|
}
|
|
207
361
|
};
|
|
208
362
|
var modConfig = {
|
|
@@ -218,6 +372,12 @@ var modConfig = {
|
|
|
218
372
|
exclusiveTo: "",
|
|
219
373
|
isExclusive: false
|
|
220
374
|
},
|
|
375
|
+
"破甲模块": {
|
|
376
|
+
cost: 2750,
|
|
377
|
+
effect: "攻击无视目标20%的减伤效果",
|
|
378
|
+
exclusiveTo: "",
|
|
379
|
+
isExclusive: false
|
|
380
|
+
},
|
|
221
381
|
// 新增专属模块
|
|
222
382
|
"裂甲核心": {
|
|
223
383
|
cost: 750,
|
|
@@ -241,7 +401,7 @@ var modConfig = {
|
|
|
241
401
|
},
|
|
242
402
|
"光束曲射晶片": {
|
|
243
403
|
cost: 2750,
|
|
244
|
-
effect: "拥有“散射”效果,对其他目标造成80
|
|
404
|
+
effect: "拥有“散射”效果,对其他目标造成80%的伤害",
|
|
245
405
|
exclusiveTo: "碎骨步枪",
|
|
246
406
|
isExclusive: true
|
|
247
407
|
},
|
|
@@ -453,7 +613,7 @@ var syndicatePirateConfig = [
|
|
|
453
613
|
},
|
|
454
614
|
{
|
|
455
615
|
professionName: "纵火狂",
|
|
456
|
-
effect: "热能武器攻击伤害+20%;
|
|
616
|
+
effect: "热能武器攻击伤害+20%; 解锁龙息霰弹枪(传奇)购买权限",
|
|
457
617
|
requirements: "至少拥有一把3级及以上等级的热能武器",
|
|
458
618
|
Jobtransfer: true,
|
|
459
619
|
costcoins: 0,
|
|
@@ -688,19 +848,19 @@ var Spacestationtechnology = [
|
|
|
688
848
|
level: 3,
|
|
689
849
|
cost: 2550,
|
|
690
850
|
description: "提升空间站武器等级,升级武器享有15%的折扣",
|
|
691
|
-
careerBonus: "武器中士/情报副官: 升级武器享有30
|
|
851
|
+
careerBonus: "武器中士/情报副官: 升级武器享有30%的折扣"
|
|
692
852
|
},
|
|
693
853
|
{
|
|
694
854
|
level: 4,
|
|
695
855
|
cost: 3950,
|
|
696
856
|
description: "提升空间站武器等级,升级武器享有20%的折扣",
|
|
697
|
-
careerBonus: "武器中士/情报副官: 在升级武器享有40
|
|
857
|
+
careerBonus: "武器中士/情报副官: 在升级武器享有40%的折扣"
|
|
698
858
|
},
|
|
699
859
|
{
|
|
700
860
|
level: 5,
|
|
701
861
|
cost: 4650,
|
|
702
|
-
description: "提升空间站武器等级,升级武器享有25
|
|
703
|
-
careerBonus: "武器中士/情报副官: 升级武器享有50%的折扣;
|
|
862
|
+
description: "提升空间站武器等级,升级武器享有25%的折扣",
|
|
863
|
+
careerBonus: "武器中士/情报副官: 升级武器享有50%的折扣; 解锁传奇武器购买权限1次"
|
|
704
864
|
}
|
|
705
865
|
]
|
|
706
866
|
},
|
|
@@ -759,7 +919,7 @@ var Spacestationtechnology = [
|
|
|
759
919
|
level: 5,
|
|
760
920
|
cost: 5350,
|
|
761
921
|
description: "完全恢复空间站安防系统,攻击获得的金币+25%",
|
|
762
|
-
careerBonus: "警卫员下士/警卫长/情报副官: 攻击获得的金币+50%;
|
|
922
|
+
careerBonus: "警卫员下士/警卫长/情报副官: 攻击获得的金币+50%; 获得一次打开安全军械库防爆门的权限,可以随机获得一把传奇武器"
|
|
763
923
|
}
|
|
764
924
|
]
|
|
765
925
|
}
|
|
@@ -940,14 +1100,6 @@ var bossPool = [
|
|
|
940
1100
|
energy: 0,
|
|
941
1101
|
tags: asBossTags(["护盾", "灵能", "异形"]),
|
|
942
1102
|
passive: asPassives(["弱化形态", "超导体", "能量虹吸", "能量黑洞"])
|
|
943
|
-
},
|
|
944
|
-
{
|
|
945
|
-
name: "电能者",
|
|
946
|
-
type: "子代",
|
|
947
|
-
maxHP: 3e3,
|
|
948
|
-
energy: 0,
|
|
949
|
-
tags: asBossTags(["护盾", "灵能", "异形"]),
|
|
950
|
-
passive: asPassives(["弱化形态", "电能导体", "能量虹吸", "能量黑洞"])
|
|
951
1103
|
}
|
|
952
1104
|
]
|
|
953
1105
|
}),
|
|
@@ -971,6 +1123,35 @@ var bossPool = [
|
|
|
971
1123
|
passive: asPassives(["弱化形态", "火焰异形", "灼烧粘液", "腐蚀胆汁", "燃烧潜地"])
|
|
972
1124
|
}
|
|
973
1125
|
]
|
|
1126
|
+
}),
|
|
1127
|
+
defineBoss({
|
|
1128
|
+
main: {
|
|
1129
|
+
id: 8,
|
|
1130
|
+
name: "狂猎猛禽首领",
|
|
1131
|
+
type: "主宰",
|
|
1132
|
+
maxHP: 2e4,
|
|
1133
|
+
energy: 0,
|
|
1134
|
+
tags: asBossTags(["生物", "异形"]),
|
|
1135
|
+
passive: asPassives(["猎手异形", "致命一击", "狂暴", "伪装"])
|
|
1136
|
+
},
|
|
1137
|
+
minions: [
|
|
1138
|
+
{
|
|
1139
|
+
name: "狂猎猛禽1",
|
|
1140
|
+
type: "子代",
|
|
1141
|
+
maxHP: 5e3,
|
|
1142
|
+
energy: 0,
|
|
1143
|
+
tags: asBossTags(["生物", "异形"]),
|
|
1144
|
+
passive: asPassives(["弱化形态", "猎手异形", "狂暴", "伪装"])
|
|
1145
|
+
},
|
|
1146
|
+
{
|
|
1147
|
+
name: "狂猎猛禽2",
|
|
1148
|
+
type: "子代",
|
|
1149
|
+
maxHP: 5e3,
|
|
1150
|
+
energy: 0,
|
|
1151
|
+
tags: asBossTags(["生物", "异形"]),
|
|
1152
|
+
passive: asPassives(["弱化形态", "猎手异形", "狂暴", "伪装"])
|
|
1153
|
+
}
|
|
1154
|
+
]
|
|
974
1155
|
})
|
|
975
1156
|
];
|
|
976
1157
|
|
|
@@ -1102,7 +1283,7 @@ var passiveConfig = {
|
|
|
1102
1283
|
},
|
|
1103
1284
|
"灼烧粘液": {
|
|
1104
1285
|
effect: 0,
|
|
1105
|
-
description: "
|
|
1286
|
+
description: "受到伤害时,会获得一层“胆汁”; 若存在“胆汁”层数时受到火焰攻击,将立刻清空层数并回复X点生命值(X为“胆汁”层数 x 10)"
|
|
1106
1287
|
},
|
|
1107
1288
|
"腐蚀胆汁": {
|
|
1108
1289
|
effect: 0,
|
|
@@ -1123,6 +1304,22 @@ var passiveConfig = {
|
|
|
1123
1304
|
"炼狱爆弹": {
|
|
1124
1305
|
effect: 0,
|
|
1125
1306
|
description: "每拥有一层“胆汁”,受到的伤害-5%; 若有存活的子代,则每层“胆汁”使受到的伤害额外-5%"
|
|
1307
|
+
},
|
|
1308
|
+
"猎手异形": {
|
|
1309
|
+
effect: 0,
|
|
1310
|
+
description: "若有存活的其他异形,则受到的伤害-20%; 若没有存活的其他异形,则受到的伤害+20%; 免疫火焰伤害; 免疫寒冷伤害"
|
|
1311
|
+
},
|
|
1312
|
+
"狂暴": {
|
|
1313
|
+
effect: 0,
|
|
1314
|
+
description: "血量低于50%时,进入狂暴状态,受到的伤害-50%"
|
|
1315
|
+
},
|
|
1316
|
+
"伪装": {
|
|
1317
|
+
effect: 0,
|
|
1318
|
+
description: "受到伤害时,记录伤害来源的武器名称(最多一种,新记录会替换旧记录),下次受到相同武器伤害时伤害减少80%"
|
|
1319
|
+
},
|
|
1320
|
+
"致命一击": {
|
|
1321
|
+
effect: 0,
|
|
1322
|
+
description: "受到伤害时,有5%的概率免疫此次伤害"
|
|
1126
1323
|
}
|
|
1127
1324
|
};
|
|
1128
1325
|
|
|
@@ -1723,6 +1920,23 @@ async function handleTechUpgrade(ctx, handle, target) {
|
|
|
1723
1920
|
const priceHint = discountApplied ? ` (原价${originalCost}金币)` : "";
|
|
1724
1921
|
return `❌ 金币不足!需要${actualCost}金币${priceHint},您当前拥有:${signInfo?.totalRewards || 0}金币`;
|
|
1725
1922
|
}
|
|
1923
|
+
let permissionGrantInfo = null;
|
|
1924
|
+
if (tech.techname === "武器系统" && currentLevel === 4 && nextLevel === 5) {
|
|
1925
|
+
permissionGrantInfo = {
|
|
1926
|
+
type: "武器系统",
|
|
1927
|
+
field: "legendarypermissions",
|
|
1928
|
+
amount: 1,
|
|
1929
|
+
message: "🎉 解锁传奇武器购买权限1次!"
|
|
1930
|
+
};
|
|
1931
|
+
}
|
|
1932
|
+
if (tech.techname === "安防系统" && currentLevel === 4 && nextLevel === 5) {
|
|
1933
|
+
permissionGrantInfo = {
|
|
1934
|
+
type: "安防系统",
|
|
1935
|
+
field: "explosiondoorauthority",
|
|
1936
|
+
amount: 1,
|
|
1937
|
+
message: "🔓 解锁安全军械库防爆门权限1次!"
|
|
1938
|
+
};
|
|
1939
|
+
}
|
|
1726
1940
|
await ctx.database.withTransaction(async () => {
|
|
1727
1941
|
await ctx.database.set("ggcevo_sign", { handle }, {
|
|
1728
1942
|
totalRewards: signInfo.totalRewards - actualCost
|
|
@@ -1732,6 +1946,14 @@ async function handleTechUpgrade(ctx, handle, target) {
|
|
|
1732
1946
|
techId: tech.techId,
|
|
1733
1947
|
level: nextLevel
|
|
1734
1948
|
}], ["handle", "techId"]);
|
|
1949
|
+
if (permissionGrantInfo) {
|
|
1950
|
+
const [permissionRecord] = await ctx.database.get("ggcevo_purchasepermissions", { handle });
|
|
1951
|
+
const currentValue = permissionRecord?.[permissionGrantInfo.field] || 0;
|
|
1952
|
+
await ctx.database.upsert("ggcevo_purchasepermissions", [{
|
|
1953
|
+
handle,
|
|
1954
|
+
[permissionGrantInfo.field]: currentValue + permissionGrantInfo.amount
|
|
1955
|
+
}], ["handle"]);
|
|
1956
|
+
}
|
|
1735
1957
|
});
|
|
1736
1958
|
let discountInfo = [];
|
|
1737
1959
|
if (discountApplied) {
|
|
@@ -1741,13 +1963,23 @@ async function handleTechUpgrade(ctx, handle, target) {
|
|
|
1741
1963
|
];
|
|
1742
1964
|
}
|
|
1743
1965
|
const costInfo = discountApplied ? `💰 花费金币:${actualCost} (原价${originalCost})` : `💰 花费金币:${actualCost}`;
|
|
1966
|
+
let permissionMessage = [];
|
|
1967
|
+
if (permissionGrantInfo) {
|
|
1968
|
+
const [permissionRecord] = await ctx.database.get("ggcevo_purchasepermissions", { handle });
|
|
1969
|
+
const newValue = permissionRecord?.[permissionGrantInfo.field] || permissionGrantInfo.amount;
|
|
1970
|
+
permissionMessage.push(
|
|
1971
|
+
permissionGrantInfo.message
|
|
1972
|
+
);
|
|
1973
|
+
}
|
|
1744
1974
|
return [
|
|
1745
1975
|
`✅ ${tech.techname} 升级至 Lv.${nextLevel}`,
|
|
1746
1976
|
costInfo,
|
|
1747
1977
|
...discountInfo,
|
|
1748
|
-
//
|
|
1978
|
+
// 折扣信息
|
|
1749
1979
|
`📝 ${levelData.description}`,
|
|
1750
|
-
`💼 ${levelData.careerBonus}
|
|
1980
|
+
`💼 ${levelData.careerBonus}`,
|
|
1981
|
+
...permissionMessage
|
|
1982
|
+
// 权限解锁信息
|
|
1751
1983
|
].filter(Boolean).join("\n");
|
|
1752
1984
|
}
|
|
1753
1985
|
__name(handleTechUpgrade, "handleTechUpgrade");
|
|
@@ -1900,6 +2132,28 @@ async function generateUpgradePriceList(ctx, handle) {
|
|
|
1900
2132
|
].join("\n");
|
|
1901
2133
|
}
|
|
1902
2134
|
__name(generateUpgradePriceList, "generateUpgradePriceList");
|
|
2135
|
+
async function getRankInfo(ctx, config, handle) {
|
|
2136
|
+
const [user] = await ctx.database.get("ggcevo_rank", {
|
|
2137
|
+
handle,
|
|
2138
|
+
rankseason: config.rankseason
|
|
2139
|
+
});
|
|
2140
|
+
if (!user) return "暂未找到排名信息。";
|
|
2141
|
+
if (user.Blacklist) return "❌ 该用户已被禁止参加本赛季胜点榜。";
|
|
2142
|
+
const allRanks = await ctx.database.select("ggcevo_rank").where({ Blacklist: false, rankseason: config.rankseason }).orderBy("rank", "desc").execute();
|
|
2143
|
+
const userRank = allRanks.findIndex((u) => u.handle === handle) + 1;
|
|
2144
|
+
const isSafe = await checkSensitiveWord(ctx, user.name);
|
|
2145
|
+
const displayName = isSafe ? user.name : (user.name[0] || "") + "***";
|
|
2146
|
+
return `🎮 咕咕排名信息 🎮
|
|
2147
|
+
------------------------------
|
|
2148
|
+
昵称:${displayName}
|
|
2149
|
+
句柄:${user.handle}
|
|
2150
|
+
当前积分:${user.rank}
|
|
2151
|
+
参赛次数:${user.matches} 次
|
|
2152
|
+
胜率:${user.matches === 0 ? "0.00%" : (user.wins / user.matches * 100).toFixed(2) + "%"}
|
|
2153
|
+
全服排名:第 ${userRank} 名
|
|
2154
|
+
------------------------------`;
|
|
2155
|
+
}
|
|
2156
|
+
__name(getRankInfo, "getRankInfo");
|
|
1903
2157
|
|
|
1904
2158
|
// src/boss/passivehandler.ts
|
|
1905
2159
|
var PassiveHandler = {
|
|
@@ -2472,27 +2726,6 @@ var PassiveHandler = {
|
|
|
2472
2726
|
}
|
|
2473
2727
|
return { messages };
|
|
2474
2728
|
}, "handleArcWelderEffect"),
|
|
2475
|
-
// 处理粒子相位枪的无视减伤效果
|
|
2476
|
-
handleParticlePhaseEffect: /* @__PURE__ */ __name((targetBoss, weaponName, totalMultiplier) => {
|
|
2477
|
-
if (weaponName !== "粒子相位枪" || totalMultiplier >= 0) return null;
|
|
2478
|
-
const messages = [];
|
|
2479
|
-
const hasShieldTag = targetBoss.tags.includes("护盾");
|
|
2480
|
-
if (hasShieldTag) {
|
|
2481
|
-
const originalReduction = Math.abs(totalMultiplier);
|
|
2482
|
-
const effectiveReduction = originalReduction * 0.5;
|
|
2483
|
-
const reducedMultiplier = -effectiveReduction;
|
|
2484
|
-
messages.push(
|
|
2485
|
-
`⚡ 【粒子相位枪】触发特效:护盾目标减伤效果减半`,
|
|
2486
|
-
`原减伤:${Math.round(originalReduction * 100)}% → 实际减伤:${Math.round(effectiveReduction * 100)}%`
|
|
2487
|
-
);
|
|
2488
|
-
return {
|
|
2489
|
-
damageMultiplier: reducedMultiplier,
|
|
2490
|
-
messages
|
|
2491
|
-
};
|
|
2492
|
-
} else {
|
|
2493
|
-
return null;
|
|
2494
|
-
}
|
|
2495
|
-
}, "handleParticlePhaseEffect"),
|
|
2496
2729
|
// 庞兽狂暴处理(血量低于50%时减伤)
|
|
2497
2730
|
handleGiantRage: /* @__PURE__ */ __name(function(targetBoss, currentHP, maxHP) {
|
|
2498
2731
|
if (!targetBoss.skills.includes("庞兽狂暴")) return null;
|
|
@@ -2749,8 +2982,139 @@ var PassiveHandler = {
|
|
|
2749
2982
|
messages: messageParts
|
|
2750
2983
|
};
|
|
2751
2984
|
}, "handleHellfireBomb"),
|
|
2985
|
+
// 猎手异形处理(Hunter Alien)
|
|
2986
|
+
handleHunterAlien: /* @__PURE__ */ __name(async function(ctx, targetBoss, weaponName, activeBosses) {
|
|
2987
|
+
if (!targetBoss.skills.includes("猎手异形")) return null;
|
|
2988
|
+
if (weaponName === "焚烧枪" || weaponName === "零度之下") {
|
|
2989
|
+
return {
|
|
2990
|
+
immune: true,
|
|
2991
|
+
messages: [`🛡️ 【猎手异形】生效:免疫${weaponName === "焚烧枪" ? "火焰" : "寒冷"}伤害`]
|
|
2992
|
+
};
|
|
2993
|
+
}
|
|
2994
|
+
const otherAlive = activeBosses.some(
|
|
2995
|
+
(boss) => boss.groupId === targetBoss.groupId && boss.name !== targetBoss.name && boss.HP > 0
|
|
2996
|
+
);
|
|
2997
|
+
const multiplier = otherAlive ? -0.2 : 0.2;
|
|
2998
|
+
return {
|
|
2999
|
+
damageMultiplier: multiplier,
|
|
3000
|
+
messages: [
|
|
3001
|
+
`🕵️ 【猎手异形】生效:${otherAlive ? "有其他存活异形,受到的伤害-20%" : "无其他存活异形,受到的伤害+20%"}`
|
|
3002
|
+
]
|
|
3003
|
+
};
|
|
3004
|
+
}, "handleHunterAlien"),
|
|
3005
|
+
// 狂暴处理(Rage)
|
|
3006
|
+
handleRage: /* @__PURE__ */ __name(function(targetBoss, currentHP, maxHP) {
|
|
3007
|
+
if (!targetBoss.skills.includes("狂暴")) return null;
|
|
3008
|
+
if (currentHP / maxHP < 0.5) {
|
|
3009
|
+
return {
|
|
3010
|
+
damageMultiplier: -0.5,
|
|
3011
|
+
messages: [`😠 【狂暴】生效:血量低于50%,受到的伤害-50%`]
|
|
3012
|
+
};
|
|
3013
|
+
}
|
|
3014
|
+
return null;
|
|
3015
|
+
}, "handleRage"),
|
|
3016
|
+
// 伪装处理(Disguise)
|
|
3017
|
+
handleDisguise: /* @__PURE__ */ __name(async function(ctx, targetBoss, weaponName, initialDamage) {
|
|
3018
|
+
if (!targetBoss.skills.includes("伪装")) return null;
|
|
3019
|
+
const messages = [];
|
|
3020
|
+
let damageMultiplier = 0;
|
|
3021
|
+
let recordWeapon = initialDamage > 0;
|
|
3022
|
+
if (targetBoss.lastWeaponName === weaponName) {
|
|
3023
|
+
damageMultiplier = -0.8;
|
|
3024
|
+
messages.push(`🎭 【伪装】生效:已适应武器【${weaponName}】,本次受到的伤害-80%`);
|
|
3025
|
+
}
|
|
3026
|
+
if (recordWeapon) {
|
|
3027
|
+
await ctx.database.set(
|
|
3028
|
+
"ggcevo_boss",
|
|
3029
|
+
{ name: targetBoss.name },
|
|
3030
|
+
{ lastWeaponName: weaponName }
|
|
3031
|
+
);
|
|
3032
|
+
messages.push(`🎭 【伪装】生效:记录新武器【${weaponName}】`);
|
|
3033
|
+
}
|
|
3034
|
+
return {
|
|
3035
|
+
damageMultiplier,
|
|
3036
|
+
messages
|
|
3037
|
+
};
|
|
3038
|
+
}, "handleDisguise"),
|
|
3039
|
+
// 致命一击处理(Critical Hit)
|
|
3040
|
+
handleCriticalHit: /* @__PURE__ */ __name(function(targetBoss, initialDamage) {
|
|
3041
|
+
if (!targetBoss.skills.includes("致命一击") || initialDamage === 0) return null;
|
|
3042
|
+
if (Math.random() * 100 < 5) {
|
|
3043
|
+
return {
|
|
3044
|
+
immune: true,
|
|
3045
|
+
messages: ["💥 【致命一击】生效:免疫本次伤害"]
|
|
3046
|
+
};
|
|
3047
|
+
}
|
|
3048
|
+
return null;
|
|
3049
|
+
}, "handleCriticalHit"),
|
|
3050
|
+
// 破甲模块效果处理
|
|
3051
|
+
handleCorrosionModule: /* @__PURE__ */ __name((installedMods) => {
|
|
3052
|
+
if (!installedMods) return 0;
|
|
3053
|
+
return installedMods.includes("破甲模块") ? 0.2 : 0;
|
|
3054
|
+
}, "handleCorrosionModule"),
|
|
3055
|
+
// 粒子相位枪效果处理
|
|
3056
|
+
handleParticlePhaseEffect: /* @__PURE__ */ __name((targetBoss, weaponName) => {
|
|
3057
|
+
if (!targetBoss || weaponName !== "粒子相位枪") return 0;
|
|
3058
|
+
return targetBoss.tags.includes("护盾") ? 0.5 : 0;
|
|
3059
|
+
}, "handleParticlePhaseEffect"),
|
|
3060
|
+
// 修复handleIgnoreReductionEffects函数,确保始终返回有效对象
|
|
3061
|
+
handleIgnoreReductionEffects: /* @__PURE__ */ __name(async (ctx, userId, weaponName, targetBoss, totalMultiplier) => {
|
|
3062
|
+
const fallbackResult = {
|
|
3063
|
+
damageMultiplier: totalMultiplier,
|
|
3064
|
+
messages: []
|
|
3065
|
+
};
|
|
3066
|
+
try {
|
|
3067
|
+
if (totalMultiplier >= 0) {
|
|
3068
|
+
return fallbackResult;
|
|
3069
|
+
}
|
|
3070
|
+
const weaponConfigData = weaponConfig[weaponName];
|
|
3071
|
+
if (!weaponConfigData) {
|
|
3072
|
+
return fallbackResult;
|
|
3073
|
+
}
|
|
3074
|
+
const [equippedWeapon] = await ctx.database.get("ggcevo_equipment", {
|
|
3075
|
+
weaponId: weaponConfigData.id,
|
|
3076
|
+
handle: userId,
|
|
3077
|
+
equipped: true
|
|
3078
|
+
});
|
|
3079
|
+
if (!equippedWeapon || !equippedWeapon.installedMods) {
|
|
3080
|
+
return fallbackResult;
|
|
3081
|
+
}
|
|
3082
|
+
const ignoreEffects = [];
|
|
3083
|
+
const particleEffect = PassiveHandler.handleParticlePhaseEffect(targetBoss, weaponName);
|
|
3084
|
+
if (particleEffect > 0) {
|
|
3085
|
+
ignoreEffects.push(particleEffect);
|
|
3086
|
+
}
|
|
3087
|
+
const corrosionEffect = PassiveHandler.handleCorrosionModule(equippedWeapon.installedMods);
|
|
3088
|
+
if (corrosionEffect > 0) {
|
|
3089
|
+
ignoreEffects.push(corrosionEffect);
|
|
3090
|
+
}
|
|
3091
|
+
if (ignoreEffects.length === 0) {
|
|
3092
|
+
return fallbackResult;
|
|
3093
|
+
}
|
|
3094
|
+
const totalIgnoreRate = ignoreEffects.reduce((sum, rate) => sum + rate, 0);
|
|
3095
|
+
const originalMultiplier = totalMultiplier;
|
|
3096
|
+
const effectiveMultiplier = totalMultiplier * (1 - totalIgnoreRate);
|
|
3097
|
+
const messages = [];
|
|
3098
|
+
if (particleEffect > 0) {
|
|
3099
|
+
messages.push(`⚡ 【粒子相位枪】特效:无视护盾目标${particleEffect * 100}%减伤效果`);
|
|
3100
|
+
}
|
|
3101
|
+
if (corrosionEffect > 0) {
|
|
3102
|
+
messages.push(`⚡ 【破甲模块】生效:无视目标${corrosionEffect * 100}%减伤效果`);
|
|
3103
|
+
}
|
|
3104
|
+
messages.push(
|
|
3105
|
+
`⚡ 减伤系数由${(originalMultiplier * 100).toFixed(0)}% → ${(effectiveMultiplier * 100).toFixed(0)}%`
|
|
3106
|
+
);
|
|
3107
|
+
return {
|
|
3108
|
+
damageMultiplier: effectiveMultiplier,
|
|
3109
|
+
messages
|
|
3110
|
+
};
|
|
3111
|
+
} catch (error) {
|
|
3112
|
+
ctx.logger("PassiveHandler").warn("处理无视减伤效果失败", error);
|
|
3113
|
+
return fallbackResult;
|
|
3114
|
+
}
|
|
3115
|
+
}, "handleIgnoreReductionEffects"),
|
|
2752
3116
|
// 统一处理被动技能
|
|
2753
|
-
handlePassives: /* @__PURE__ */ __name(async function(ctx, targetBoss, initialDamage, currentHP, maxHP, weaponName, weaponData, activeBosses, bossGroup) {
|
|
3117
|
+
handlePassives: /* @__PURE__ */ __name(async function(ctx, handle, targetBoss, initialDamage, currentHP, maxHP, weaponName, weaponData, activeBosses, bossGroup) {
|
|
2754
3118
|
let messages = [];
|
|
2755
3119
|
let skillUpdates = [];
|
|
2756
3120
|
let totalMultiplier = 0;
|
|
@@ -2812,6 +3176,24 @@ var PassiveHandler = {
|
|
|
2812
3176
|
bileStacks: fireEvoResult.bileStacks
|
|
2813
3177
|
};
|
|
2814
3178
|
}
|
|
3179
|
+
const criticalResult = this.handleCriticalHit(targetBoss, initialDamage);
|
|
3180
|
+
if (criticalResult?.immune) {
|
|
3181
|
+
return {
|
|
3182
|
+
currentHP: targetBoss.HP,
|
|
3183
|
+
messages: criticalResult.messages,
|
|
3184
|
+
skillUpdates: [],
|
|
3185
|
+
initialDamage: 0
|
|
3186
|
+
};
|
|
3187
|
+
}
|
|
3188
|
+
const hunterImmune = await this.handleHunterAlien(ctx, targetBoss, weaponName, activeBosses);
|
|
3189
|
+
if (hunterImmune?.immune) {
|
|
3190
|
+
return {
|
|
3191
|
+
currentHP: targetBoss.HP,
|
|
3192
|
+
messages: hunterImmune.messages,
|
|
3193
|
+
skillUpdates: [],
|
|
3194
|
+
initialDamage: 0
|
|
3195
|
+
};
|
|
3196
|
+
}
|
|
2815
3197
|
targetBoss.skills.forEach((skill) => {
|
|
2816
3198
|
const config = passiveConfig[skill];
|
|
2817
3199
|
if (config && config.effect !== void 0 && config.effect !== 0) {
|
|
@@ -2855,6 +3237,20 @@ var PassiveHandler = {
|
|
|
2855
3237
|
totalMultiplier += hellfireBombResult.damageMultiplier;
|
|
2856
3238
|
messages.push(...hellfireBombResult.messages);
|
|
2857
3239
|
}
|
|
3240
|
+
const disguiseResult = await this.handleDisguise(ctx, targetBoss, weaponName, initialDamage);
|
|
3241
|
+
if (disguiseResult) {
|
|
3242
|
+
totalMultiplier += disguiseResult.damageMultiplier;
|
|
3243
|
+
messages.push(...disguiseResult.messages);
|
|
3244
|
+
}
|
|
3245
|
+
if (hunterImmune && !hunterImmune.immune) {
|
|
3246
|
+
totalMultiplier += hunterImmune.damageMultiplier;
|
|
3247
|
+
messages.push(...hunterImmune.messages);
|
|
3248
|
+
}
|
|
3249
|
+
const rageResult = this.handleRage(targetBoss, currentHP, maxHP);
|
|
3250
|
+
if (rageResult) {
|
|
3251
|
+
totalMultiplier += rageResult.damageMultiplier;
|
|
3252
|
+
messages.push(...rageResult.messages);
|
|
3253
|
+
}
|
|
2858
3254
|
const radiationCalc = this.calculateRadiationDamage(targetBoss);
|
|
2859
3255
|
if (radiationCalc) {
|
|
2860
3256
|
totalMultiplier += radiationCalc.damageMultiplier;
|
|
@@ -2865,14 +3261,16 @@ var PassiveHandler = {
|
|
|
2865
3261
|
totalMultiplier += coldDamageResult.damageMultiplier;
|
|
2866
3262
|
messages.push(...coldDamageResult.messages);
|
|
2867
3263
|
}
|
|
2868
|
-
const
|
|
2869
|
-
|
|
3264
|
+
const ignoreReductionResult = await this.handleIgnoreReductionEffects(
|
|
3265
|
+
ctx,
|
|
3266
|
+
handle,
|
|
2870
3267
|
weaponName,
|
|
3268
|
+
targetBoss,
|
|
2871
3269
|
totalMultiplier
|
|
2872
3270
|
);
|
|
2873
|
-
if (
|
|
2874
|
-
totalMultiplier =
|
|
2875
|
-
messages.push(...
|
|
3271
|
+
if (ignoreReductionResult && ignoreReductionResult.messages && ignoreReductionResult.messages.length > 0) {
|
|
3272
|
+
totalMultiplier = ignoreReductionResult.damageMultiplier;
|
|
3273
|
+
messages.push(...ignoreReductionResult.messages);
|
|
2876
3274
|
}
|
|
2877
3275
|
if (solarFlareResult.messages.length > 0) {
|
|
2878
3276
|
messages.push(...solarFlareResult.messages);
|
|
@@ -3212,10 +3610,11 @@ async function handleBossDefeatRewards(ctx, targetBoss) {
|
|
|
3212
3610
|
return { rewardMessages };
|
|
3213
3611
|
}
|
|
3214
3612
|
__name(handleBossDefeatRewards, "handleBossDefeatRewards");
|
|
3215
|
-
async function handlePrimaryAttack(ctx, session, config, equippedWeapon, targetBoss, activeBosses, bossGroup, weaponName, weaponData, maxHP) {
|
|
3613
|
+
async function handlePrimaryAttack(ctx, session, config, handle, equippedWeapon, targetBoss, activeBosses, bossGroup, weaponName, weaponData, maxHP) {
|
|
3216
3614
|
const damageResult = await calculateTotalDamage(ctx, session, config, equippedWeapon, targetBoss);
|
|
3217
3615
|
const passiveResult = await PassiveHandler.handlePassives(
|
|
3218
3616
|
ctx,
|
|
3617
|
+
handle,
|
|
3219
3618
|
targetBoss,
|
|
3220
3619
|
damageResult.damage,
|
|
3221
3620
|
targetBoss.HP,
|
|
@@ -3245,7 +3644,7 @@ async function handlePrimaryAttack(ctx, session, config, equippedWeapon, targetB
|
|
|
3245
3644
|
};
|
|
3246
3645
|
}
|
|
3247
3646
|
__name(handlePrimaryAttack, "handlePrimaryAttack");
|
|
3248
|
-
async function handleScatterAttack(ctx, session, config, equippedWeapon, targetBoss, weaponName, weaponData, activeBosses, bossGroup) {
|
|
3647
|
+
async function handleScatterAttack(ctx, session, config, handle, equippedWeapon, targetBoss, weaponName, weaponData, activeBosses, bossGroup) {
|
|
3249
3648
|
const secondaryTargets = activeBosses.filter((boss) => boss.name !== targetBoss.name);
|
|
3250
3649
|
const scatterEffectMessages = [];
|
|
3251
3650
|
const extraDamages = [];
|
|
@@ -3271,6 +3670,7 @@ async function handleScatterAttack(ctx, session, config, equippedWeapon, targetB
|
|
|
3271
3670
|
);
|
|
3272
3671
|
const passiveResult = await PassiveHandler.handlePassives(
|
|
3273
3672
|
ctx,
|
|
3673
|
+
handle,
|
|
3274
3674
|
secondaryTarget,
|
|
3275
3675
|
damageResult.damage,
|
|
3276
3676
|
secondaryTarget.HP,
|
|
@@ -3424,10 +3824,10 @@ async function calculateRewards(ctx, handle, username, totalDamage) {
|
|
|
3424
3824
|
let careerMessage = "";
|
|
3425
3825
|
if (career === "警卫员下士") {
|
|
3426
3826
|
careerMultiplier = 50;
|
|
3427
|
-
careerMessage = "(
|
|
3827
|
+
careerMessage = "(警卫员下士:金币+50%)";
|
|
3428
3828
|
} else if (career === "警卫长") {
|
|
3429
3829
|
careerMultiplier = 100;
|
|
3430
|
-
careerMessage = "(
|
|
3830
|
+
careerMessage = "(警卫长:金币+100%)";
|
|
3431
3831
|
}
|
|
3432
3832
|
const totalBonusPercent = careerMultiplier + techBonusPercent;
|
|
3433
3833
|
const totalBonusFactor = 1 + totalBonusPercent / 100;
|
|
@@ -3438,7 +3838,7 @@ async function calculateRewards(ctx, handle, username, totalDamage) {
|
|
|
3438
3838
|
handle,
|
|
3439
3839
|
redcrystal: (careerData?.redcrystal || 0) + 1
|
|
3440
3840
|
}], ["handle"]);
|
|
3441
|
-
redcrystalMessage = "
|
|
3841
|
+
redcrystalMessage = "🎖️ 清洁工:+1枚红晶";
|
|
3442
3842
|
}
|
|
3443
3843
|
return {
|
|
3444
3844
|
finalReward,
|
|
@@ -3733,6 +4133,8 @@ function apply(ctx, config) {
|
|
|
3733
4133
|
Vulnerability: "unsigned",
|
|
3734
4134
|
freezing: "unsigned",
|
|
3735
4135
|
energy: "unsigned",
|
|
4136
|
+
lastWeaponName: "string",
|
|
4137
|
+
// 新增字段,记录伪装技能的信息
|
|
3736
4138
|
groupId: "unsigned",
|
|
3737
4139
|
isActive: "boolean",
|
|
3738
4140
|
respawnTime: "timestamp"
|
|
@@ -3798,6 +4200,13 @@ function apply(ctx, config) {
|
|
|
3798
4200
|
}, {
|
|
3799
4201
|
primary: ["handle", "taskId"]
|
|
3800
4202
|
});
|
|
4203
|
+
ctx.model.extend("ggcevo_purchasepermissions", {
|
|
4204
|
+
handle: "string",
|
|
4205
|
+
legendarypermissions: "unsigned",
|
|
4206
|
+
explosiondoorauthority: "unsigned"
|
|
4207
|
+
}, {
|
|
4208
|
+
primary: "handle"
|
|
4209
|
+
});
|
|
3801
4210
|
ctx.setInterval(async () => {
|
|
3802
4211
|
const totalBosses = await ctx.database.select("ggcevo_boss").execute((row) => import_koishi.$.count(row.name));
|
|
3803
4212
|
const groupId = [...config.groupId];
|
|
@@ -4667,69 +5076,23 @@ ${itemDetails.join("\n")}`;
|
|
|
4667
5076
|
});
|
|
4668
5077
|
ctx.command("ggcevo/排名 [player]", "查询个人排名").alias("rank").usage("输入“排名”查看自己的排名信息").action(async (argv, player) => {
|
|
4669
5078
|
const session = argv.session;
|
|
5079
|
+
const ctx2 = session.bot.ctx;
|
|
5080
|
+
let handle;
|
|
4670
5081
|
if (!player) {
|
|
4671
|
-
const [profile] = await
|
|
4672
|
-
if (!profile)
|
|
4673
|
-
|
|
4674
|
-
}
|
|
4675
|
-
const { regionId, realmId, profileId } = profile;
|
|
4676
|
-
const handle = `${regionId}-S2-${realmId}-${profileId}`;
|
|
4677
|
-
const [user] = await ctx.database.get("ggcevo_rank", {
|
|
4678
|
-
handle,
|
|
4679
|
-
rankseason: config.rankseason
|
|
4680
|
-
});
|
|
4681
|
-
if (!user) return "暂未找到您的排名信息。";
|
|
4682
|
-
if (user.Blacklist) return "❌ 您已经被禁止参加本赛季胜点榜。";
|
|
4683
|
-
const allRanks = await ctx.database.select("ggcevo_rank").where({ Blacklist: false, rankseason: config.rankseason }).orderBy("rank", "desc").execute();
|
|
4684
|
-
const userRank = allRanks.findIndex(
|
|
4685
|
-
(u) => u.handle === handle
|
|
4686
|
-
) + 1;
|
|
4687
|
-
const isSafe = await checkSensitiveWord(ctx, user.name);
|
|
4688
|
-
const displayName = isSafe ? user.name : (user.name[0] || "") + "***";
|
|
4689
|
-
return `🎮 咕咕排名信息 🎮
|
|
4690
|
-
------------------------------
|
|
4691
|
-
昵称:${displayName}
|
|
4692
|
-
句柄:${user.handle}
|
|
4693
|
-
当前积分:${user.rank}
|
|
4694
|
-
参赛次数:${user.matches} 次
|
|
4695
|
-
胜率: ${user.matches === 0 ? "0.00%" : (user.wins / user.matches * 100).toFixed(2) + "%"}
|
|
4696
|
-
全服排名:第 ${userRank} 名
|
|
4697
|
-
------------------------------`;
|
|
5082
|
+
const [profile] = await ctx2.database.get("sc2arcade_player", { userId: session.userId });
|
|
5083
|
+
if (!profile) return "🔒 需要先绑定游戏句柄。";
|
|
5084
|
+
handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
4698
5085
|
} else {
|
|
4699
5086
|
const parsedUser = import_koishi.h.parse(player)[0];
|
|
4700
5087
|
if (!parsedUser || parsedUser.type !== "at" || !parsedUser.attrs.id) {
|
|
4701
5088
|
return "参数错误,请输入“排名 @玩家”";
|
|
4702
5089
|
}
|
|
4703
5090
|
const targetUserId = parsedUser.attrs.id;
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
return "对方暂未绑定句柄。";
|
|
4708
|
-
}
|
|
4709
|
-
const { regionId, realmId, profileId } = profile;
|
|
4710
|
-
const handle = `${regionId}-S2-${realmId}-${profileId}`;
|
|
4711
|
-
const [user] = await ctx.database.get("ggcevo_rank", {
|
|
4712
|
-
handle,
|
|
4713
|
-
rankseason: config.rankseason
|
|
4714
|
-
});
|
|
4715
|
-
if (!user) return "暂未找到对方的排名信息。";
|
|
4716
|
-
if (user.Blacklist) return "❌ 对方已经被禁止参加本赛季胜点榜。";
|
|
4717
|
-
const allRanks = await ctx.database.select("ggcevo_rank").where({ Blacklist: false, rankseason: config.rankseason }).orderBy("rank", "desc").execute();
|
|
4718
|
-
const userRank = allRanks.findIndex(
|
|
4719
|
-
(u) => u.handle === handle
|
|
4720
|
-
) + 1;
|
|
4721
|
-
const isSafe = await checkSensitiveWord(ctx, user.name);
|
|
4722
|
-
const displayName = isSafe ? user.name : (user.name[0] || "") + "***";
|
|
4723
|
-
return `🎮 咕咕排名信息 🎮
|
|
4724
|
-
------------------------------
|
|
4725
|
-
昵称:${displayName}
|
|
4726
|
-
句柄:${user.handle}
|
|
4727
|
-
当前积分:${user.rank}
|
|
4728
|
-
参赛次数:${user.matches} 次
|
|
4729
|
-
胜率: ${user.matches === 0 ? "0.00%" : (user.wins / user.matches * 100).toFixed(2) + "%"}
|
|
4730
|
-
全服排名:第 ${userRank} 名
|
|
4731
|
-
------------------------------`;
|
|
5091
|
+
const [profile] = await ctx2.database.get("sc2arcade_player", { userId: targetUserId });
|
|
5092
|
+
if (!profile) return "对方暂未绑定句柄。";
|
|
5093
|
+
handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
4732
5094
|
}
|
|
5095
|
+
return getRankInfo(ctx2, config, handle);
|
|
4733
5096
|
});
|
|
4734
5097
|
ctx.command("ggcevo/给予 <handle> <itemName:string> <amount:number>", "增加用户物品/金币", { authority: 3 }).action(async (_, handle, itemName, amount) => {
|
|
4735
5098
|
try {
|
|
@@ -5015,11 +5378,8 @@ ${items.join("、")}
|
|
|
5015
5378
|
}]);
|
|
5016
5379
|
return `🎉 恭喜!您获得了${itemName}`;
|
|
5017
5380
|
});
|
|
5018
|
-
ctx.command("ggcevo/拉黑 [handle]", "添加用户到黑名单").action(async (argv, handle) => {
|
|
5381
|
+
ctx.command("ggcevo/拉黑 [handle]", "添加用户到黑名单", { authority: 3 }).action(async (argv, handle) => {
|
|
5019
5382
|
const session = argv.session;
|
|
5020
|
-
if (!ctx.config.admins.includes(session.userId)) {
|
|
5021
|
-
return "⚠️ 没有操作权限。";
|
|
5022
|
-
}
|
|
5023
5383
|
if (!handle) {
|
|
5024
5384
|
await session.send("请在30秒内输入需要拉黑的句柄:\n(句柄格式为: [区域ID]-S2-[服务器ID]-[档案ID])");
|
|
5025
5385
|
handle = await session.prompt(3e4);
|
|
@@ -5044,11 +5404,8 @@ ${items.join("、")}
|
|
|
5044
5404
|
return "操作失败,请稍后重试。错误详情已记录";
|
|
5045
5405
|
}
|
|
5046
5406
|
});
|
|
5047
|
-
ctx.command("ggcevo/标记 [handle]", "标记用户到胜点榜黑名单").action(async (argv, handle) => {
|
|
5407
|
+
ctx.command("ggcevo/标记 [handle]", "标记用户到胜点榜黑名单", { authority: 3 }).action(async (argv, handle) => {
|
|
5048
5408
|
const session = argv.session;
|
|
5049
|
-
if (!ctx.config.admins.includes(session.userId)) {
|
|
5050
|
-
return "⚠️ 没有操作权限。";
|
|
5051
|
-
}
|
|
5052
5409
|
if (!handle) {
|
|
5053
5410
|
await session.send("请在30秒内输入需要标记的句柄:\n(句柄格式为: [区域ID]-S2-[服务器ID]-[档案ID])");
|
|
5054
5411
|
handle = await session.prompt(3e4);
|
|
@@ -5409,7 +5766,7 @@ ${items.join("、")}
|
|
|
5409
5766
|
result.push(`🔴 辛迪加海盗:+1枚红晶`);
|
|
5410
5767
|
}
|
|
5411
5768
|
if (isWin && initiatorCareer?.career === "辛迪加财务经理") {
|
|
5412
|
-
result.push(
|
|
5769
|
+
result.push(`🎖️ 辛迪加财务经理:+1枚红晶`);
|
|
5413
5770
|
}
|
|
5414
5771
|
result.push(`📅 剩余挑战次数:${config.dailyPKLimit - (initiatorPK.todayCount + 1)}`);
|
|
5415
5772
|
return result.join("\n");
|
|
@@ -5451,33 +5808,17 @@ ${items.join("、")}
|
|
|
5451
5808
|
pageNum < totalPages ? `输入 pk榜 ${pageNum + 1} 查看下一页` : "已是最后一页"
|
|
5452
5809
|
].join("\n");
|
|
5453
5810
|
});
|
|
5454
|
-
ctx.command("ggcevo/武器库 [
|
|
5811
|
+
ctx.command("ggcevo/武器库 [category]").usage('输入"武器库"查看类型,或"武器库 类型"查看详细武器信息').action(async ({ session }, category) => {
|
|
5455
5812
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
5456
5813
|
if (!profile) return "⚠️ 需要先绑定游戏句柄";
|
|
5457
5814
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
5458
|
-
const [techData] = await ctx.database.get("ggcevo_tech", { handle, techId: 2 }).catch(() => [{ level: 0 }]);
|
|
5459
5815
|
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
5460
|
-
const group = careerData?.group || "";
|
|
5461
5816
|
const discountDetails = [];
|
|
5462
|
-
let
|
|
5463
|
-
if (group === "人类联盟") {
|
|
5464
|
-
const techLevel = techData?.level || 0;
|
|
5465
|
-
if (techLevel > 0) {
|
|
5466
|
-
const isCareerMatch = Spacestationtechnology.find((t) => t.techId === 2).careerNames.includes(careerData?.career);
|
|
5467
|
-
const BASE_DISCOUNTS = [0, 0, 0, 0, 0];
|
|
5468
|
-
const CAREER_DISCOUNTS = [0, 0, 10, 15, 20];
|
|
5469
|
-
const baseDiscount = techLevel > 0 ? BASE_DISCOUNTS[techLevel - 1] : 0;
|
|
5470
|
-
const careerDiscount = isCareerMatch ? CAREER_DISCOUNTS[techLevel - 1] : 0;
|
|
5471
|
-
techDiscount = Math.max(baseDiscount, careerDiscount);
|
|
5472
|
-
if (techDiscount > 0) {
|
|
5473
|
-
discountDetails.push(`⚙️ 武器系统 Lv${techLevel}:${techDiscount}%折扣`);
|
|
5474
|
-
}
|
|
5475
|
-
}
|
|
5476
|
-
}
|
|
5477
|
-
let weaponSpecialistDiscount = 0;
|
|
5817
|
+
let totalDiscount = 0;
|
|
5478
5818
|
if (careerData?.career === "武器中士") {
|
|
5479
|
-
weaponSpecialistDiscount = 20;
|
|
5480
|
-
|
|
5819
|
+
const weaponSpecialistDiscount = 20;
|
|
5820
|
+
totalDiscount += weaponSpecialistDiscount;
|
|
5821
|
+
discountDetails.push(`🎖️ 武器中士:${weaponSpecialistDiscount}%折扣`);
|
|
5481
5822
|
}
|
|
5482
5823
|
const activeWish = await ctx.database.get("ggcevo_Wish_Record", {
|
|
5483
5824
|
handle,
|
|
@@ -5486,40 +5827,47 @@ ${items.join("、")}
|
|
|
5486
5827
|
endTime: { $gte: /* @__PURE__ */ new Date() },
|
|
5487
5828
|
isused: false
|
|
5488
5829
|
}).then((records) => records[0]);
|
|
5489
|
-
|
|
5490
|
-
|
|
5830
|
+
if (activeWish) {
|
|
5831
|
+
const grasshopperDiscount = 20;
|
|
5832
|
+
totalDiscount += grasshopperDiscount;
|
|
5491
5833
|
discountDetails.push(`🦗 蚱蜢优购:${grasshopperDiscount}%折扣`);
|
|
5492
5834
|
}
|
|
5493
|
-
let totalDiscount = techDiscount + weaponSpecialistDiscount + grasshopperDiscount;
|
|
5494
5835
|
totalDiscount = Math.min(totalDiscount, 100);
|
|
5495
|
-
const
|
|
5496
|
-
stats[weapon.
|
|
5836
|
+
const categoryStats = Object.values(weaponConfig).filter((weapon) => weapon.price !== 0).reduce((stats, weapon) => {
|
|
5837
|
+
stats[weapon.category] = (stats[weapon.category] || 0) + 1;
|
|
5497
5838
|
return stats;
|
|
5498
5839
|
}, {});
|
|
5499
|
-
if (!
|
|
5840
|
+
if (!category) {
|
|
5500
5841
|
return [
|
|
5501
5842
|
"🏪 咕咕武器库分类 🏪",
|
|
5502
|
-
'使用 "武器库
|
|
5843
|
+
'使用 "武器库 分类名称" 查看详细列表',
|
|
5503
5844
|
totalDiscount > 0 && `💰 当前折扣:
|
|
5504
5845
|
${discountDetails.length ? `${discountDetails.join("\n")}` : ""}`,
|
|
5505
5846
|
"====================",
|
|
5506
|
-
...Object.entries(
|
|
5847
|
+
...Object.entries(categoryStats).map(([catName, count]) => `▸ ${catName} (${count}种)`),
|
|
5507
5848
|
"===================="
|
|
5508
5849
|
].filter(Boolean).join("\n");
|
|
5509
5850
|
}
|
|
5510
|
-
if (!Object.keys(
|
|
5511
|
-
return
|
|
5512
|
-
${Object.keys(
|
|
5513
|
-
}
|
|
5514
|
-
const
|
|
5515
|
-
|
|
5516
|
-
const
|
|
5851
|
+
if (!Object.keys(categoryStats).includes(category)) {
|
|
5852
|
+
return `无效武器分类,可用分类:
|
|
5853
|
+
${Object.keys(categoryStats).join("、")}`;
|
|
5854
|
+
}
|
|
5855
|
+
const isLegendaryCategory = category === "传奇武器";
|
|
5856
|
+
const items = Object.entries(weaponConfig).filter(([_, config2]) => config2.category === category && config2.price !== 0).map(([name2, config2]) => {
|
|
5857
|
+
const shouldApplyDiscount = !isLegendaryCategory && config2.category !== "传奇武器";
|
|
5858
|
+
const displayPrice = shouldApplyDiscount ? Math.floor(config2.price * (100 - totalDiscount) / 100) : config2.price;
|
|
5859
|
+
const showOriginalPrice = shouldApplyDiscount && totalDiscount > 0;
|
|
5860
|
+
const priceDisplay = showOriginalPrice ? `${displayPrice}金币 (原价${config2.price})` : `${displayPrice}金币`;
|
|
5861
|
+
let tagEffectsDesc = "▸ 无特殊加成效果";
|
|
5862
|
+
if (config2.tagEffects && Object.keys(config2.tagEffects).length > 0) {
|
|
5863
|
+
tagEffectsDesc = Object.entries(config2.tagEffects).map(([tag, multiplier]) => `▸ 对${tag}目标造成${(multiplier * 100).toFixed(0)}%伤害`).join("\n");
|
|
5864
|
+
}
|
|
5517
5865
|
const specialEffect = config2.specialeffect ? `特殊效果:${config2.specialeffect}` : "";
|
|
5518
5866
|
return [
|
|
5519
5867
|
`【${name2}】`,
|
|
5520
|
-
|
|
5868
|
+
`武器类型:${config2.type}`,
|
|
5521
5869
|
`基础伤害:${config2.damage}`,
|
|
5522
|
-
`价格:${
|
|
5870
|
+
`价格:${priceDisplay}`,
|
|
5523
5871
|
specialEffect,
|
|
5524
5872
|
"特性:",
|
|
5525
5873
|
tagEffectsDesc,
|
|
@@ -5527,11 +5875,14 @@ ${Object.keys(typeStats).join("、")}`;
|
|
|
5527
5875
|
"------------------"
|
|
5528
5876
|
].filter(Boolean).join("\n");
|
|
5529
5877
|
});
|
|
5878
|
+
const shouldShowDiscountInfo = totalDiscount > 0 && !isLegendaryCategory;
|
|
5879
|
+
const discountInfo = shouldShowDiscountInfo ? `💰 当前折扣:
|
|
5880
|
+
${discountDetails.length ? `${discountDetails.join("\n")}` : ""}` : null;
|
|
5530
5881
|
return [
|
|
5531
|
-
`🏪 咕咕武器库 - ${
|
|
5882
|
+
`🏪 咕咕武器库 - ${category} 🏪`,
|
|
5532
5883
|
'使用"购买 武器名称"指令进行购买',
|
|
5533
|
-
|
|
5534
|
-
|
|
5884
|
+
discountInfo,
|
|
5885
|
+
// 传奇武器分类时不显示此信息
|
|
5535
5886
|
"====================",
|
|
5536
5887
|
...items,
|
|
5537
5888
|
items.length === 0 ? "⚠️ 该分类下暂无可用武器" : ""
|
|
@@ -5585,11 +5936,12 @@ ${validTypes.join("、")}`;
|
|
|
5585
5936
|
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
5586
5937
|
if (existingEntries.length > 0) return "⛔ 您已被列入黑名单。";
|
|
5587
5938
|
const allItems = { ...weaponConfig, ...SyndicatedItems };
|
|
5588
|
-
if (!item) return "
|
|
5939
|
+
if (!item) return '请输入"购买 物品名称"来购买所需物品。';
|
|
5589
5940
|
const config2 = allItems[item];
|
|
5590
5941
|
if (!config2) return "无效的物品名称,请重新输入。";
|
|
5591
5942
|
if (config2.price <= 0) return "❌ 该物品不可直接购买";
|
|
5592
|
-
const isWeapon = ["能量武器", "热能武器", "实弹武器"].includes(config2.
|
|
5943
|
+
const isWeapon = ["能量武器", "热能武器", "实弹武器", "传奇武器"].includes(config2.category);
|
|
5944
|
+
const isLegendaryWeapon = config2.category === "传奇武器";
|
|
5593
5945
|
if (isWeapon) {
|
|
5594
5946
|
const existingWeapon = await ctx.database.get("ggcevo_equipment", {
|
|
5595
5947
|
handle,
|
|
@@ -5597,45 +5949,53 @@ ${validTypes.join("、")}`;
|
|
|
5597
5949
|
});
|
|
5598
5950
|
if (existingWeapon.length > 0) return `❌ 您已经拥有${item},无法重复购买`;
|
|
5599
5951
|
}
|
|
5952
|
+
if (isLegendaryWeapon) {
|
|
5953
|
+
const [permissions] = await ctx.database.get("ggcevo_purchasepermissions", { handle });
|
|
5954
|
+
if (!permissions || permissions.legendarypermissions <= 0) {
|
|
5955
|
+
return '❌ 购买传奇武器需要"传奇武器购买权限",您当前没有购买权限。';
|
|
5956
|
+
}
|
|
5957
|
+
const [careerData2] = await ctx.database.get("ggcevo_careers", { handle });
|
|
5958
|
+
const [weaponTech] = await ctx.database.get("ggcevo_tech", { handle, techId: 2 });
|
|
5959
|
+
if (!careerData2 || careerData2.group !== "人类联盟") {
|
|
5960
|
+
return '❌ 购买传奇武器需要在"人类联盟"阵营。';
|
|
5961
|
+
}
|
|
5962
|
+
const weaponSystemLevel = weaponTech?.level || 0;
|
|
5963
|
+
if (weaponSystemLevel < 5) {
|
|
5964
|
+
return `❌ 购买传奇武器需要将武器系统升级到5级(当前等级:${weaponSystemLevel})。`;
|
|
5965
|
+
}
|
|
5966
|
+
if (!careerData2.career || !["情报副官", "武器中士"].includes(careerData2.career)) {
|
|
5967
|
+
return `❌ 购买传奇武器需要成为"情报副官"或"武器中士"(当前职业:${careerData2.career || "无"})。`;
|
|
5968
|
+
}
|
|
5969
|
+
}
|
|
5600
5970
|
const [signInfo] = await ctx.database.get("ggcevo_sign", { handle });
|
|
5601
5971
|
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
5602
|
-
const [weaponTech] = await ctx.database.get("ggcevo_tech", { handle, techId: 2 });
|
|
5603
5972
|
let totalDiscount = 0;
|
|
5604
5973
|
let discountDetails = [];
|
|
5605
|
-
|
|
5606
|
-
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
totalDiscount +=
|
|
5618
|
-
discountDetails.push(
|
|
5619
|
-
`武器系统 Lv${techLevel}${isQualifiedCareer ? "(职业加成)" : ""}:${techDiscount}%折扣`
|
|
5620
|
-
);
|
|
5974
|
+
let activeWish = null;
|
|
5975
|
+
if (!isLegendaryWeapon) {
|
|
5976
|
+
if (isWeapon) {
|
|
5977
|
+
activeWish = await ctx.database.get("ggcevo_Wish_Record", {
|
|
5978
|
+
handle,
|
|
5979
|
+
wishname: "蚱蜢优购",
|
|
5980
|
+
startTime: { $lte: /* @__PURE__ */ new Date() },
|
|
5981
|
+
endTime: { $gte: /* @__PURE__ */ new Date() },
|
|
5982
|
+
isused: false
|
|
5983
|
+
}).then((records) => records[0] || null);
|
|
5984
|
+
if (activeWish) {
|
|
5985
|
+
const wishDiscount = 20;
|
|
5986
|
+
totalDiscount += wishDiscount;
|
|
5987
|
+
discountDetails.push(`🦗 蚱蜢优购:${wishDiscount}%折扣`);
|
|
5621
5988
|
}
|
|
5622
5989
|
}
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
endTime: { $gte: /* @__PURE__ */ new Date() },
|
|
5629
|
-
isused: false
|
|
5630
|
-
}).then((records) => records[0]) : null;
|
|
5631
|
-
if (activeWish) {
|
|
5632
|
-
const wishDiscount = 20;
|
|
5633
|
-
totalDiscount += wishDiscount;
|
|
5634
|
-
discountDetails.push(`蚱蜢优购祈愿生效:${wishDiscount}%折扣`);
|
|
5990
|
+
if (isWeapon && careerData?.career === "武器中士") {
|
|
5991
|
+
const specialistDiscount = 20;
|
|
5992
|
+
totalDiscount += specialistDiscount;
|
|
5993
|
+
discountDetails.push(`🎖️ 武器中士:${specialistDiscount}%折扣`);
|
|
5994
|
+
}
|
|
5635
5995
|
totalDiscount = Math.min(totalDiscount, 100);
|
|
5636
5996
|
}
|
|
5637
5997
|
let actualPrice = config2.price;
|
|
5638
|
-
if (totalDiscount > 0) {
|
|
5998
|
+
if (!isLegendaryWeapon && totalDiscount > 0) {
|
|
5639
5999
|
actualPrice = Math.floor(config2.price * (100 - totalDiscount) / 100);
|
|
5640
6000
|
actualPrice = Math.max(actualPrice, 1);
|
|
5641
6001
|
}
|
|
@@ -5643,6 +6003,8 @@ ${validTypes.join("、")}`;
|
|
|
5643
6003
|
let priceInfo = `需要 ${actualPrice} 金币`;
|
|
5644
6004
|
if (discountDetails.length > 0) {
|
|
5645
6005
|
priceInfo += `(原价${config2.price})`;
|
|
6006
|
+
} else if (isLegendaryWeapon) {
|
|
6007
|
+
priceInfo = `需要 ${actualPrice} 金币 (传奇武器无折扣)`;
|
|
5646
6008
|
}
|
|
5647
6009
|
return `❌ 金币不足,${priceInfo}`;
|
|
5648
6010
|
}
|
|
@@ -5656,6 +6018,16 @@ ${validTypes.join("、")}`;
|
|
|
5656
6018
|
isused: true
|
|
5657
6019
|
});
|
|
5658
6020
|
}
|
|
6021
|
+
if (isLegendaryWeapon) {
|
|
6022
|
+
const [permissionRecord] = await ctx.database.get("ggcevo_purchasepermissions", { handle });
|
|
6023
|
+
if (!permissionRecord || permissionRecord.legendarypermissions <= 0) {
|
|
6024
|
+
throw new Error("传奇武器购买权限不足");
|
|
6025
|
+
}
|
|
6026
|
+
const remaining = permissionRecord.legendarypermissions - 1;
|
|
6027
|
+
await ctx.database.set("ggcevo_purchasepermissions", { handle }, {
|
|
6028
|
+
legendarypermissions: remaining
|
|
6029
|
+
});
|
|
6030
|
+
}
|
|
5659
6031
|
if (isWeapon) {
|
|
5660
6032
|
await ctx.database.upsert("ggcevo_equipment", [{
|
|
5661
6033
|
handle,
|
|
@@ -5688,10 +6060,16 @@ ${validTypes.join("、")}`;
|
|
|
5688
6060
|
let message = `✅ 成功购买${isWeapon ? "武器" : "物品"}「${item}」
|
|
5689
6061
|
`;
|
|
5690
6062
|
message += `花费 ${actualPrice} 金币`;
|
|
5691
|
-
if (
|
|
6063
|
+
if (isLegendaryWeapon) {
|
|
6064
|
+
const [permissions] = await ctx.database.get("ggcevo_purchasepermissions", { handle });
|
|
6065
|
+
message += `
|
|
6066
|
+
扣除 1 次传奇武器购买权限,剩余次数:${permissions?.legendarypermissions || 0}`;
|
|
6067
|
+
} else if (discountDetails.length > 0) {
|
|
5692
6068
|
message += `(原价${config2.price} 金币)
|
|
5693
6069
|
折扣明细:
|
|
5694
6070
|
▸ ${discountDetails.join("\n▸ ")}`;
|
|
6071
|
+
} else {
|
|
6072
|
+
message += ` (原价${config2.price} 金币)`;
|
|
5695
6073
|
}
|
|
5696
6074
|
if (isWeapon) {
|
|
5697
6075
|
if (isAutoEquipped) {
|
|
@@ -6009,6 +6387,7 @@ ${validTypes.join("、")}`;
|
|
|
6009
6387
|
ctx,
|
|
6010
6388
|
session,
|
|
6011
6389
|
config2,
|
|
6390
|
+
handle,
|
|
6012
6391
|
equippedWeapon,
|
|
6013
6392
|
targetBoss,
|
|
6014
6393
|
activeBosses,
|
|
@@ -6029,6 +6408,7 @@ ${validTypes.join("、")}`;
|
|
|
6029
6408
|
ctx,
|
|
6030
6409
|
session,
|
|
6031
6410
|
config2,
|
|
6411
|
+
handle,
|
|
6032
6412
|
equippedWeapon,
|
|
6033
6413
|
targetBoss,
|
|
6034
6414
|
weaponName,
|
|
@@ -6213,6 +6593,9 @@ ${validTypes.join("、")}`;
|
|
|
6213
6593
|
if (countingSkill) {
|
|
6214
6594
|
result.push(`📈 ${countingSkill}:${mainBoss.Skillcountpoints}层`);
|
|
6215
6595
|
}
|
|
6596
|
+
if (mainBoss.lastWeaponName) {
|
|
6597
|
+
result.push(`🎭 记录武器:${mainBoss.lastWeaponName}`);
|
|
6598
|
+
}
|
|
6216
6599
|
if (minions.length > 0) {
|
|
6217
6600
|
result.push("\n🟠 子代:");
|
|
6218
6601
|
for (let i = 0; i < minions.length; i++) {
|
|
@@ -6243,6 +6626,9 @@ ${validTypes.join("、")}`;
|
|
|
6243
6626
|
if (minionCountingSkill) {
|
|
6244
6627
|
minionInfo.push(`📈 ${minionCountingSkill}:${minion.Skillcountpoints}层`);
|
|
6245
6628
|
}
|
|
6629
|
+
if (minion.lastWeaponName) {
|
|
6630
|
+
minionInfo.push(`🎭 记录武器:${minion.lastWeaponName}`);
|
|
6631
|
+
}
|
|
6246
6632
|
result.push(...minionInfo);
|
|
6247
6633
|
if (i < minions.length - 1) result.push("");
|
|
6248
6634
|
}
|
|
@@ -6633,7 +7019,7 @@ ${validTypes.join("、")}`;
|
|
|
6633
7019
|
return "获取职业信息失败,请稍后重试";
|
|
6634
7020
|
}
|
|
6635
7021
|
});
|
|
6636
|
-
ctx.command("ggcevo/黑市 [
|
|
7022
|
+
ctx.command("ggcevo/黑市 [category]", "辛迪加海盗专属黑市").usage('输入"黑市"查看分类,或"黑市 分类名称"查看详细').action(async ({ session }, category) => {
|
|
6637
7023
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
6638
7024
|
if (!profile) return "🔒 需要先绑定游戏句柄。";
|
|
6639
7025
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
@@ -6642,45 +7028,49 @@ ${validTypes.join("、")}`;
|
|
|
6642
7028
|
return "🚫 该功能需要【辛迪加海盗】阵营权限";
|
|
6643
7029
|
}
|
|
6644
7030
|
const isComputerExpert = careerData.career === "计算机专家";
|
|
6645
|
-
const
|
|
7031
|
+
const categoryStats = {};
|
|
6646
7032
|
Object.values(weaponConfig).filter((config2) => config2.redCrystalCost > 0).forEach((weapon) => {
|
|
6647
|
-
|
|
7033
|
+
categoryStats[weapon.category] = (categoryStats[weapon.category] || 0) + 1;
|
|
6648
7034
|
});
|
|
6649
7035
|
Object.values(SyndicatedItems).filter((item) => item.redCrystalCost > 0).forEach((item) => {
|
|
6650
|
-
|
|
7036
|
+
categoryStats[item.type] = (categoryStats[item.type] || 0) + 1;
|
|
6651
7037
|
});
|
|
6652
|
-
if (!
|
|
7038
|
+
if (!category) {
|
|
6653
7039
|
return [
|
|
6654
7040
|
"🏴 辛迪加黑市 🏴",
|
|
6655
|
-
'使用 "黑市
|
|
6656
|
-
// 添加计算机专家提示 - 优化为带emoji的分行显示
|
|
7041
|
+
'使用 "黑市 分类名称" 查看详细信息',
|
|
6657
7042
|
isComputerExpert ? [
|
|
6658
7043
|
"💰 当前折扣:",
|
|
6659
7044
|
"💻 计算机专家:设备工具类物品50%折扣"
|
|
6660
7045
|
].join("\n") : "",
|
|
6661
7046
|
"====================",
|
|
6662
|
-
...Object.entries(
|
|
7047
|
+
...Object.entries(categoryStats).map(([catName, count]) => `▸ ${catName} (${count}种)`),
|
|
6663
7048
|
"===================="
|
|
6664
7049
|
].join("\n");
|
|
6665
7050
|
}
|
|
6666
|
-
const
|
|
6667
|
-
if (!
|
|
7051
|
+
const normalizedCategory = Object.keys(categoryStats).find((c) => c === category);
|
|
7052
|
+
if (!normalizedCategory) return `无效分类,可用:${Object.keys(categoryStats).join("、")}`;
|
|
6668
7053
|
const items = [
|
|
6669
7054
|
...Object.entries(weaponConfig).filter(
|
|
6670
|
-
([_, config2]) => config2.
|
|
7055
|
+
([_, config2]) => config2.category === normalizedCategory && // 使用 category 代替 type
|
|
7056
|
+
config2.redCrystalCost > 0
|
|
6671
7057
|
).map(([name2, config2]) => {
|
|
6672
7058
|
const infoBlocks = [
|
|
6673
7059
|
`【${name2}】`,
|
|
6674
|
-
|
|
7060
|
+
`武器类型:${config2.type}`,
|
|
7061
|
+
// 保留攻击类型显示
|
|
7062
|
+
// +++ 为武器类物品添加基础伤害显示 +++
|
|
7063
|
+
`基础伤害:${config2.damage}`,
|
|
6675
7064
|
`订购价:${config2.redCrystalCost}红晶`
|
|
6676
7065
|
];
|
|
6677
7066
|
if (config2.specialeffect) {
|
|
6678
7067
|
infoBlocks.push(`特殊效果:${config2.specialeffect}`);
|
|
6679
7068
|
}
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
7069
|
+
let tagEffectsDesc = "▸ 无特殊加成效果";
|
|
7070
|
+
if (config2.tagEffects && Object.keys(config2.tagEffects).length > 0) {
|
|
7071
|
+
tagEffectsDesc = Object.entries(config2.tagEffects).map(([tag, mul]) => `▸ 对${tag}目标造成${(mul * 100).toFixed(0)}%伤害`).join("\n");
|
|
6683
7072
|
}
|
|
7073
|
+
infoBlocks.push("特性:", tagEffectsDesc);
|
|
6684
7074
|
infoBlocks.push(
|
|
6685
7075
|
`描述:${config2.description}`,
|
|
6686
7076
|
"------------------"
|
|
@@ -6688,14 +7078,15 @@ ${validTypes.join("、")}`;
|
|
|
6688
7078
|
return infoBlocks.join("\n");
|
|
6689
7079
|
}),
|
|
6690
7080
|
...Object.entries(SyndicatedItems).filter(
|
|
6691
|
-
([_, item]) => item.type ===
|
|
7081
|
+
([_, item]) => item.type === normalizedCategory && // 爆破物仍然使用 type
|
|
7082
|
+
item.redCrystalCost > 0
|
|
6692
7083
|
).map(([name2, item]) => {
|
|
6693
|
-
const finalPrice = isComputerExpert &&
|
|
7084
|
+
const finalPrice = isComputerExpert && normalizedCategory === "设备工具" ? Math.floor(item.redCrystalCost * 0.5) : item.redCrystalCost;
|
|
6694
7085
|
const infoBlocks = [
|
|
6695
7086
|
`【${name2}】`,
|
|
6696
|
-
|
|
7087
|
+
`物品类型:${item.type}`
|
|
6697
7088
|
];
|
|
6698
|
-
if (isComputerExpert &&
|
|
7089
|
+
if (isComputerExpert && normalizedCategory === "设备工具") {
|
|
6699
7090
|
infoBlocks.push(
|
|
6700
7091
|
`订购价:${finalPrice}红晶 (原价${item.redCrystalCost})`
|
|
6701
7092
|
);
|
|
@@ -6713,16 +7104,15 @@ ${validTypes.join("、")}`;
|
|
|
6713
7104
|
})
|
|
6714
7105
|
];
|
|
6715
7106
|
let discountInfo = [];
|
|
6716
|
-
if (isComputerExpert &&
|
|
7107
|
+
if (isComputerExpert && normalizedCategory === "设备工具") {
|
|
6717
7108
|
discountInfo = [
|
|
6718
7109
|
"💰 当前折扣:",
|
|
6719
7110
|
"💻 计算机专家:设备工具类物品50%折扣"
|
|
6720
7111
|
];
|
|
6721
7112
|
}
|
|
6722
7113
|
return [
|
|
6723
|
-
`🏴☠️ 辛迪加黑市 - ${
|
|
7114
|
+
`🏴☠️ 辛迪加黑市 - ${normalizedCategory} 🏴☠️`,
|
|
6724
7115
|
'使用"订购 物品名称"进行购买(仅消耗红晶)',
|
|
6725
|
-
// 显示折扣信息(如果有)
|
|
6726
7116
|
...discountInfo,
|
|
6727
7117
|
"====================",
|
|
6728
7118
|
...items
|
|
@@ -6739,12 +7129,24 @@ ${validTypes.join("、")}`;
|
|
|
6739
7129
|
if (!careerData || careerData.group !== "辛迪加海盗") {
|
|
6740
7130
|
return "🚫 该功能需要【辛迪加海盗】阵营权限";
|
|
6741
7131
|
}
|
|
6742
|
-
if (!item) return "
|
|
7132
|
+
if (!item) return '请输入"订购 物品名称"向辛迪加总部订购物品。';
|
|
6743
7133
|
const isWeapon = Object.prototype.hasOwnProperty.call(weaponConfig, item);
|
|
6744
7134
|
const isSyndicatedItem = Object.prototype.hasOwnProperty.call(SyndicatedItems, item);
|
|
6745
7135
|
if (!isWeapon && !isSyndicatedItem) return "❌ 无效物品名称";
|
|
6746
7136
|
const itemConfig2 = isWeapon ? weaponConfig[item] : SyndicatedItems[item];
|
|
6747
7137
|
if (!itemConfig2.redCrystalCost) return "⛔ 该物品不可订购";
|
|
7138
|
+
const isLegendaryWeapon = isWeapon && itemConfig2.category === "传奇武器";
|
|
7139
|
+
if (isLegendaryWeapon) {
|
|
7140
|
+
if (item === "MK-4激光步枪" && careerData.career !== "能量武器专家") {
|
|
7141
|
+
return "❌ 购买MK-4激光步枪需要【能量武器专家】职业。";
|
|
7142
|
+
} else if (item === "DSR-55反器材步枪" && careerData.career !== "猩红杀手") {
|
|
7143
|
+
return "❌ 购买DSR-55反器材步枪需要【猩红杀手】职业。";
|
|
7144
|
+
} else if (item === "龙息霰弹枪" && careerData.career !== "纵火狂") {
|
|
7145
|
+
return "❌ 购买龙息霰弹枪需要【纵火狂】职业。";
|
|
7146
|
+
} else if (item !== "MK-4激光步枪" && item !== "DSR-55反器材步枪" && item !== "龙息霰弹枪") {
|
|
7147
|
+
return "❌ 未知的传奇武器或未开放购买权限";
|
|
7148
|
+
}
|
|
7149
|
+
}
|
|
6748
7150
|
let isComputerExpertDiscount = false;
|
|
6749
7151
|
let originalPrice = itemConfig2.redCrystalCost;
|
|
6750
7152
|
let finalCost = originalPrice;
|
|
@@ -6765,6 +7167,7 @@ ${validTypes.join("、")}`;
|
|
|
6765
7167
|
});
|
|
6766
7168
|
if (existing.length) return "您已经拥有该武器。";
|
|
6767
7169
|
}
|
|
7170
|
+
let isAutoEquipped = false;
|
|
6768
7171
|
await ctx.database.withTransaction(async () => {
|
|
6769
7172
|
await ctx.database.set("ggcevo_careers", { handle }, {
|
|
6770
7173
|
redcrystal: careerData.redcrystal - finalCost
|
|
@@ -6785,6 +7188,7 @@ ${validTypes.join("、")}`;
|
|
|
6785
7188
|
{ handle, weaponId: itemConfig2.id },
|
|
6786
7189
|
{ equipped: true }
|
|
6787
7190
|
);
|
|
7191
|
+
isAutoEquipped = true;
|
|
6788
7192
|
}
|
|
6789
7193
|
} else {
|
|
6790
7194
|
const [existing] = await ctx.database.get("ggcevo_warehouse", {
|
|
@@ -6806,19 +7210,13 @@ ${validTypes.join("、")}`;
|
|
|
6806
7210
|
const priceInfo = [
|
|
6807
7211
|
`消耗红晶:${finalCost}${discountApplied ? ` (原价${originalPrice})` : ""}`
|
|
6808
7212
|
];
|
|
6809
|
-
if (discountApplied) {
|
|
6810
|
-
priceInfo.push("折扣明细:");
|
|
6811
|
-
priceInfo.push(...discountLines);
|
|
6812
|
-
}
|
|
6813
7213
|
if (isWeapon) {
|
|
6814
|
-
const equippedStatus =
|
|
6815
|
-
handle,
|
|
6816
|
-
weaponId: itemConfig2.id
|
|
6817
|
-
}).then((r) => r[0]?.equipped ? "已自动装备武器" : "需手动装备武器");
|
|
7214
|
+
const equippedStatus = isAutoEquipped ? "已自动装备武器" : "需手动装备武器";
|
|
6818
7215
|
return [
|
|
6819
7216
|
`✅ 成功订购【${item}】!`,
|
|
6820
7217
|
...priceInfo,
|
|
6821
|
-
|
|
7218
|
+
discountApplied ? `折扣明细:
|
|
7219
|
+
▸ ${discountLines.join("\n▸ ")}` : "",
|
|
6822
7220
|
`装备状态:${equippedStatus}`,
|
|
6823
7221
|
'输入 "武器仓库" 管理武器'
|
|
6824
7222
|
].filter(Boolean).join("\n");
|
|
@@ -6830,7 +7228,8 @@ ${validTypes.join("、")}`;
|
|
|
6830
7228
|
return [
|
|
6831
7229
|
`✅ 成功订购【${item}】x1!`,
|
|
6832
7230
|
...priceInfo,
|
|
6833
|
-
|
|
7231
|
+
discountApplied ? `折扣明细:
|
|
7232
|
+
▸ ${discountLines.join("\n▸ ")}` : "",
|
|
6834
7233
|
`当前库存:${currentStock}件`,
|
|
6835
7234
|
'输入 "仓库" 查看所有物品'
|
|
6836
7235
|
].filter(Boolean).join("\n");
|