koishi-plugin-ggcevo-game 1.2.71 → 1.2.72
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.d.ts +6 -1
- package/lib/index.js +357 -233
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import 'koishi-plugin-sc2arcade-search';
|
|
|
3
3
|
export declare const name = "ggcevo-game";
|
|
4
4
|
export interface Config {
|
|
5
5
|
proxyAgent: string;
|
|
6
|
-
ggcqun: string;
|
|
7
6
|
rankseason: string;
|
|
8
7
|
signrequire: boolean;
|
|
9
8
|
autorank: boolean;
|
|
@@ -41,6 +40,7 @@ declare module 'koishi' {
|
|
|
41
40
|
ggcevo_Wish_Record: WishRecord;
|
|
42
41
|
ggcevo_careers: careers;
|
|
43
42
|
ggcevo_warehouse: warehouse;
|
|
43
|
+
ggcevo_tech: tech;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
export interface backpack {
|
|
@@ -184,4 +184,9 @@ export interface warehouse {
|
|
|
184
184
|
itemId: number;
|
|
185
185
|
quantity: number;
|
|
186
186
|
}
|
|
187
|
+
export interface tech {
|
|
188
|
+
handle: string;
|
|
189
|
+
techId: number;
|
|
190
|
+
level: number;
|
|
191
|
+
}
|
|
187
192
|
export declare function apply(ctx: Context, config: Config): void;
|
package/lib/index.js
CHANGED
|
@@ -32,8 +32,7 @@ var name = "ggcevo-game";
|
|
|
32
32
|
var Config = import_koishi.Schema.intersect([
|
|
33
33
|
// 基础配置组
|
|
34
34
|
import_koishi.Schema.object({
|
|
35
|
-
proxyAgent: import_koishi.Schema.string().description("代理服务器地址")
|
|
36
|
-
ggcqun: import_koishi.Schema.string().description("绑定咕咕虫evo的群组ID").required()
|
|
35
|
+
proxyAgent: import_koishi.Schema.string().description("代理服务器地址")
|
|
37
36
|
}).description("基础设置"),
|
|
38
37
|
// 赛季与兑换配置组
|
|
39
38
|
import_koishi.Schema.object({
|
|
@@ -54,7 +53,7 @@ var Config = import_koishi.Schema.intersect([
|
|
|
54
53
|
}).description("对战限制"),
|
|
55
54
|
// 通知系统配置组
|
|
56
55
|
import_koishi.Schema.object({
|
|
57
|
-
groupId: import_koishi.Schema.array(import_koishi.Schema.string()).description("
|
|
56
|
+
groupId: import_koishi.Schema.array(import_koishi.Schema.string()).description("广播通知群组").default([]),
|
|
58
57
|
checkInterval: import_koishi.Schema.number().description("大厅监控检查间隔(秒)").default(60)
|
|
59
58
|
}).description("通知设置").collapse(),
|
|
60
59
|
// 权限管理组
|
|
@@ -278,21 +277,13 @@ function apply(ctx, config) {
|
|
|
278
277
|
}, {
|
|
279
278
|
primary: ["handle", "itemId"]
|
|
280
279
|
});
|
|
281
|
-
|
|
282
|
-
"
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
// 确保结构兼容性
|
|
289
|
-
price: 0,
|
|
290
|
-
damage: 0,
|
|
291
|
-
// 若需要可补充伤害值
|
|
292
|
-
tagEffects: {}
|
|
293
|
-
// 若无属性加成则留空
|
|
294
|
-
}
|
|
295
|
-
};
|
|
280
|
+
ctx.model.extend("ggcevo_tech", {
|
|
281
|
+
handle: "string",
|
|
282
|
+
techId: "unsigned",
|
|
283
|
+
level: "unsigned"
|
|
284
|
+
}, {
|
|
285
|
+
primary: ["handle", "techId"]
|
|
286
|
+
});
|
|
296
287
|
const weaponConfig = {
|
|
297
288
|
// 武器配置
|
|
298
289
|
"高斯步枪": {
|
|
@@ -305,8 +296,7 @@ function apply(ctx, config) {
|
|
|
305
296
|
tagEffects: {
|
|
306
297
|
"轻甲": 1.5
|
|
307
298
|
// 对轻甲目标造成150%伤害
|
|
308
|
-
}
|
|
309
|
-
effects: ""
|
|
299
|
+
}
|
|
310
300
|
},
|
|
311
301
|
"激光步枪": {
|
|
312
302
|
id: 2,
|
|
@@ -319,8 +309,7 @@ function apply(ctx, config) {
|
|
|
319
309
|
"重甲": 1.5,
|
|
320
310
|
// 对重甲目标造成150%伤害
|
|
321
311
|
"护盾": 0.5
|
|
322
|
-
}
|
|
323
|
-
effects: ""
|
|
312
|
+
}
|
|
324
313
|
},
|
|
325
314
|
"焚烧枪": {
|
|
326
315
|
id: 3,
|
|
@@ -333,8 +322,7 @@ function apply(ctx, config) {
|
|
|
333
322
|
"惧热": 2,
|
|
334
323
|
"生物": 1.5,
|
|
335
324
|
"护盾": 0.5
|
|
336
|
-
}
|
|
337
|
-
effects: ""
|
|
325
|
+
}
|
|
338
326
|
},
|
|
339
327
|
"碎骨步枪": {
|
|
340
328
|
id: 4,
|
|
@@ -347,8 +335,7 @@ function apply(ctx, config) {
|
|
|
347
335
|
"重甲": 2,
|
|
348
336
|
"机械": 0.5,
|
|
349
337
|
"护盾": 0.2
|
|
350
|
-
}
|
|
351
|
-
effects: ""
|
|
338
|
+
}
|
|
352
339
|
},
|
|
353
340
|
"等离子切割机": {
|
|
354
341
|
id: 5,
|
|
@@ -361,8 +348,7 @@ function apply(ctx, config) {
|
|
|
361
348
|
"重甲": 1.5,
|
|
362
349
|
"建筑": 1.5,
|
|
363
350
|
"机械": 1.2
|
|
364
|
-
}
|
|
365
|
-
effects: ""
|
|
351
|
+
}
|
|
366
352
|
},
|
|
367
353
|
"突击霰弹枪": {
|
|
368
354
|
id: 6,
|
|
@@ -374,8 +360,7 @@ function apply(ctx, config) {
|
|
|
374
360
|
tagEffects: {
|
|
375
361
|
"轻甲": 1.5,
|
|
376
362
|
"重甲": 0.8
|
|
377
|
-
}
|
|
378
|
-
effects: ""
|
|
363
|
+
}
|
|
379
364
|
},
|
|
380
365
|
"侦查步枪": {
|
|
381
366
|
id: 7,
|
|
@@ -388,8 +373,7 @@ function apply(ctx, config) {
|
|
|
388
373
|
"护盾": 0.5,
|
|
389
374
|
"轻甲": 0.5,
|
|
390
375
|
"重甲": 0.2
|
|
391
|
-
}
|
|
392
|
-
effects: ""
|
|
376
|
+
}
|
|
393
377
|
},
|
|
394
378
|
"零度之下": {
|
|
395
379
|
id: 8,
|
|
@@ -401,8 +385,7 @@ function apply(ctx, config) {
|
|
|
401
385
|
tagEffects: {
|
|
402
386
|
"惧寒": 2,
|
|
403
387
|
"灵能": 1.5
|
|
404
|
-
}
|
|
405
|
-
effects: ""
|
|
388
|
+
}
|
|
406
389
|
},
|
|
407
390
|
"弧焊枪": {
|
|
408
391
|
id: 9,
|
|
@@ -414,10 +397,18 @@ function apply(ctx, config) {
|
|
|
414
397
|
tagEffects: {
|
|
415
398
|
"建筑": 2,
|
|
416
399
|
"机械": 1.5
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
};
|
|
403
|
+
const SyndicatedItems = {
|
|
404
|
+
"E-2能量炸弹": {
|
|
405
|
+
id: 1,
|
|
406
|
+
type: "爆破物",
|
|
407
|
+
description: "一种小型的机械装置,用于吸收空间站能量并进行爆破",
|
|
408
|
+
price: 0,
|
|
409
|
+
redCrystalCost: 30,
|
|
410
|
+
effects: "当主宰为“空间站感染虫”时才能使用,对“空间站哨枪塔”造成其当前血量值的伤害(获得等同于伤害值的金币)"
|
|
411
|
+
}
|
|
421
412
|
};
|
|
422
413
|
const modConfig = {
|
|
423
414
|
"动能增幅": {
|
|
@@ -502,6 +493,8 @@ function apply(ctx, config) {
|
|
|
502
493
|
}
|
|
503
494
|
]
|
|
504
495
|
};
|
|
496
|
+
const asBossTags = /* @__PURE__ */ __name((arr) => arr, "asBossTags");
|
|
497
|
+
const asPassives = /* @__PURE__ */ __name((arr) => arr, "asPassives");
|
|
505
498
|
const passiveConfig = {
|
|
506
499
|
"弱化形态": {
|
|
507
500
|
effect: 0.1,
|
|
@@ -572,107 +565,98 @@ function apply(ctx, config) {
|
|
|
572
565
|
description: "拥有结构装甲,受到的伤害-20%; 若伤害来源于热能武器,则受到的伤害-40%"
|
|
573
566
|
}
|
|
574
567
|
};
|
|
568
|
+
const defineBoss = /* @__PURE__ */ __name((config2) => config2, "defineBoss");
|
|
575
569
|
const bossPool = [
|
|
576
|
-
{
|
|
570
|
+
defineBoss({
|
|
577
571
|
main: {
|
|
578
572
|
id: 1,
|
|
579
573
|
name: "异齿猛兽-首领",
|
|
580
574
|
type: "主宰",
|
|
581
|
-
maxHP:
|
|
582
|
-
tags: ["重甲", "生物", "异形"],
|
|
583
|
-
passive: ["异形甲壳"]
|
|
584
|
-
// 明确类型
|
|
575
|
+
maxHP: 15e3,
|
|
576
|
+
tags: asBossTags(["重甲", "生物", "异形"]),
|
|
577
|
+
passive: asPassives(["异形甲壳"])
|
|
585
578
|
},
|
|
586
579
|
minions: [
|
|
587
580
|
{
|
|
588
581
|
name: "异齿猛兽",
|
|
589
582
|
type: "子代",
|
|
590
|
-
maxHP:
|
|
591
|
-
tags: ["重甲", "生物", "异形"],
|
|
592
|
-
passive: ["弱化形态", "异形甲壳"]
|
|
593
|
-
// 明确类型
|
|
583
|
+
maxHP: 7500,
|
|
584
|
+
tags: asBossTags(["重甲", "生物", "异形"]),
|
|
585
|
+
passive: asPassives(["弱化形态", "异形甲壳"])
|
|
594
586
|
}
|
|
595
587
|
]
|
|
596
|
-
},
|
|
597
|
-
{
|
|
588
|
+
}),
|
|
589
|
+
defineBoss({
|
|
598
590
|
main: {
|
|
599
591
|
id: 2,
|
|
600
592
|
name: "寒冰王蛇",
|
|
601
593
|
type: "主宰",
|
|
602
594
|
maxHP: 1e4,
|
|
603
|
-
tags: ["重甲", "惧热", "生物", "异形"],
|
|
604
|
-
passive: ["冰霜环绕", "冰霜进化"]
|
|
605
|
-
// 明确类型
|
|
595
|
+
tags: asBossTags(["重甲", "惧热", "生物", "异形"]),
|
|
596
|
+
passive: asPassives(["冰霜环绕", "冰霜进化"])
|
|
606
597
|
},
|
|
607
598
|
minions: [
|
|
608
599
|
{
|
|
609
600
|
name: "冰蛇",
|
|
610
601
|
type: "子代",
|
|
611
602
|
maxHP: 3e3,
|
|
612
|
-
tags: ["惧热", "生物", "异形"],
|
|
613
|
-
passive: ["弱化形态", "冰霜回复", "冰霜进化"]
|
|
614
|
-
// 明确类型
|
|
603
|
+
tags: asBossTags(["惧热", "生物", "异形"]),
|
|
604
|
+
passive: asPassives(["弱化形态", "冰霜回复", "冰霜进化"])
|
|
615
605
|
}
|
|
616
606
|
]
|
|
617
|
-
},
|
|
618
|
-
{
|
|
607
|
+
}),
|
|
608
|
+
defineBoss({
|
|
619
609
|
main: {
|
|
620
610
|
id: 3,
|
|
621
611
|
name: "莽兽",
|
|
622
612
|
type: "主宰",
|
|
623
613
|
maxHP: 1e4,
|
|
624
|
-
tags: ["重甲", "生物", "异形"],
|
|
625
|
-
passive: ["应激甲壳II", "求生本能II", "冷适应"]
|
|
626
|
-
// 明确类型
|
|
614
|
+
tags: asBossTags(["重甲", "生物", "异形"]),
|
|
615
|
+
passive: asPassives(["应激甲壳II", "求生本能II", "冷适应"])
|
|
627
616
|
},
|
|
628
617
|
minions: [
|
|
629
618
|
{
|
|
630
619
|
name: "狂暴畸变体",
|
|
631
620
|
type: "子代",
|
|
632
621
|
maxHP: 3e3,
|
|
633
|
-
tags: ["重甲", "生物", "异形"],
|
|
634
|
-
passive: ["弱化形态", "应激甲壳I", "求生本能I", "冷适应"]
|
|
635
|
-
// 明确类型
|
|
622
|
+
tags: asBossTags(["重甲", "生物", "异形"]),
|
|
623
|
+
passive: asPassives(["弱化形态", "应激甲壳I", "求生本能I", "冷适应"])
|
|
636
624
|
},
|
|
637
625
|
{
|
|
638
626
|
name: "剧毒畸变体",
|
|
639
627
|
type: "子代",
|
|
640
628
|
maxHP: 3e3,
|
|
641
|
-
tags: ["重甲", "生物", "异形"],
|
|
642
|
-
passive: ["弱化形态", "应激甲壳I", "求生本能I", "冷适应"]
|
|
643
|
-
// 明确类型
|
|
629
|
+
tags: asBossTags(["重甲", "生物", "异形"]),
|
|
630
|
+
passive: asPassives(["弱化形态", "应激甲壳I", "求生本能I", "冷适应"])
|
|
644
631
|
}
|
|
645
632
|
]
|
|
646
|
-
},
|
|
647
|
-
{
|
|
633
|
+
}),
|
|
634
|
+
defineBoss({
|
|
648
635
|
main: {
|
|
649
636
|
id: 4,
|
|
650
637
|
name: "空间站感染虫",
|
|
651
638
|
type: "主宰",
|
|
652
639
|
maxHP: 1e4,
|
|
653
|
-
tags: ["重甲", "生物", "机械", "异形"],
|
|
654
|
-
passive: ["感染空间站", "病毒云", "霉菌滋生"]
|
|
655
|
-
// 明确类型
|
|
640
|
+
tags: asBossTags(["重甲", "生物", "机械", "异形"]),
|
|
641
|
+
passive: asPassives(["感染空间站", "病毒云", "霉菌滋生"])
|
|
656
642
|
},
|
|
657
643
|
minions: [
|
|
658
644
|
{
|
|
659
645
|
name: "机械感染虫",
|
|
660
646
|
type: "子代",
|
|
661
647
|
maxHP: 3e3,
|
|
662
|
-
tags: ["重甲", "生物", "机械", "异形"],
|
|
663
|
-
passive: ["弱化形态", "病毒云", "霉菌滋生"]
|
|
664
|
-
// 明确类型
|
|
648
|
+
tags: asBossTags(["重甲", "生物", "机械", "异形"]),
|
|
649
|
+
passive: asPassives(["弱化形态", "病毒云", "霉菌滋生"])
|
|
665
650
|
},
|
|
666
651
|
{
|
|
667
652
|
name: "空间站哨枪塔",
|
|
668
653
|
type: "子代",
|
|
669
654
|
maxHP: 5e3,
|
|
670
|
-
tags: ["重甲", "机械", "建筑"],
|
|
671
|
-
passive: ["岗哨机枪", "结构装甲"]
|
|
672
|
-
// 明确类型
|
|
655
|
+
tags: asBossTags(["重甲", "机械", "建筑"]),
|
|
656
|
+
passive: asPassives(["岗哨机枪", "结构装甲"])
|
|
673
657
|
}
|
|
674
658
|
]
|
|
675
|
-
}
|
|
659
|
+
})
|
|
676
660
|
];
|
|
677
661
|
const spaceStationCrewConfig = [
|
|
678
662
|
{
|
|
@@ -750,7 +734,7 @@ function apply(ctx, config) {
|
|
|
750
734
|
{
|
|
751
735
|
professionName: "能量武器专家",
|
|
752
736
|
effect: "能量武器攻击伤害+20%,解锁MK-4激光步枪(传奇)购买权限",
|
|
753
|
-
requirements: "
|
|
737
|
+
requirements: "拥有一把3级及以上等级的能量武器",
|
|
754
738
|
Jobtransfer: true,
|
|
755
739
|
costcoins: 0,
|
|
756
740
|
costredcrystal: 20
|
|
@@ -781,9 +765,9 @@ function apply(ctx, config) {
|
|
|
781
765
|
},
|
|
782
766
|
{
|
|
783
767
|
professionName: "纵火狂",
|
|
784
|
-
effect: "热能武器攻击伤害+
|
|
785
|
-
requirements: "",
|
|
786
|
-
Jobtransfer:
|
|
768
|
+
effect: "热能武器攻击伤害+20%,解锁龙息散弹枪(传奇)购买权限",
|
|
769
|
+
requirements: "拥有一把3级及以上等级的热能武器",
|
|
770
|
+
Jobtransfer: true,
|
|
787
771
|
costcoins: 0,
|
|
788
772
|
costredcrystal: 20
|
|
789
773
|
},
|
|
@@ -844,6 +828,82 @@ function apply(ctx, config) {
|
|
|
844
828
|
costredcrystal: 0
|
|
845
829
|
}
|
|
846
830
|
];
|
|
831
|
+
const Spacestationtechnology = [
|
|
832
|
+
{
|
|
833
|
+
techId: 1,
|
|
834
|
+
techname: "采掘系统",
|
|
835
|
+
maxLevel: 5,
|
|
836
|
+
levels: [
|
|
837
|
+
{
|
|
838
|
+
level: 1,
|
|
839
|
+
cost: 500,
|
|
840
|
+
description: "提高挖矿效率,每日签到奖励+5%",
|
|
841
|
+
careerBonus: "深空矿工/情报副官: 每日签到奖励+10%"
|
|
842
|
+
},
|
|
843
|
+
{
|
|
844
|
+
level: 2,
|
|
845
|
+
cost: 1750,
|
|
846
|
+
description: "提高挖矿效率,每日签到奖励+10%",
|
|
847
|
+
careerBonus: "深空矿工/情报副官: 每日签到奖励+20%,解锁专属“挖矿”指令"
|
|
848
|
+
},
|
|
849
|
+
{
|
|
850
|
+
level: 3,
|
|
851
|
+
cost: 2950,
|
|
852
|
+
description: "提高挖矿效率,每日签到奖励+15%",
|
|
853
|
+
careerBonus: "深空矿工/情报副官: 每日签到奖励+30%,解锁专属“挖矿”指令"
|
|
854
|
+
},
|
|
855
|
+
{
|
|
856
|
+
level: 4,
|
|
857
|
+
cost: 4250,
|
|
858
|
+
description: "提高挖矿效率,每日签到奖励+20%",
|
|
859
|
+
careerBonus: "深空矿工/情报副官: 每日签到奖励+40%,解锁专属“挖矿”指令,并且挖矿效率提高25%"
|
|
860
|
+
},
|
|
861
|
+
{
|
|
862
|
+
level: 5,
|
|
863
|
+
cost: 5375,
|
|
864
|
+
description: "提高挖矿效率,每日签到奖励+25%",
|
|
865
|
+
careerBonus: "深空矿工/情报副官: 每日签到奖励+50%,解锁专属“挖矿”指令,并且挖矿效率提高50%"
|
|
866
|
+
}
|
|
867
|
+
]
|
|
868
|
+
},
|
|
869
|
+
{
|
|
870
|
+
techId: 2,
|
|
871
|
+
techname: "武器系统",
|
|
872
|
+
maxLevel: 5,
|
|
873
|
+
levels: [
|
|
874
|
+
{
|
|
875
|
+
level: 1,
|
|
876
|
+
cost: 500,
|
|
877
|
+
description: "提升空间站武器等级,升级/改装武器享有5%的折扣",
|
|
878
|
+
careerBonus: "武器中士/情报副官: 升级/改装武器享有10%的折扣"
|
|
879
|
+
},
|
|
880
|
+
{
|
|
881
|
+
level: 2,
|
|
882
|
+
cost: 1500,
|
|
883
|
+
description: "提升空间站武器等级,升级/改装武器享有10%的折扣",
|
|
884
|
+
careerBonus: "武器中士/情报副官: 升级/改装武器享有20%的折扣,购买武器享有10%的折扣(非传奇)"
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
level: 3,
|
|
888
|
+
cost: 2550,
|
|
889
|
+
description: "提升空间站武器等级,升级/改装武器享有15%的折扣",
|
|
890
|
+
careerBonus: "武器中士/情报副官: 升级/改装武器享有30%的折扣,购买武器享有15%的折扣(非传奇)"
|
|
891
|
+
},
|
|
892
|
+
{
|
|
893
|
+
level: 4,
|
|
894
|
+
cost: 3950,
|
|
895
|
+
description: "提升空间站武器等级,升级/改装武器享有20%的折扣",
|
|
896
|
+
careerBonus: "武器中士/情报副官: 在升级/改装武器享有40%的折扣,购买武器享有20%的折扣(非传奇)"
|
|
897
|
+
},
|
|
898
|
+
{
|
|
899
|
+
level: 5,
|
|
900
|
+
cost: 4650,
|
|
901
|
+
description: "提升空间站武器等级,升级/改装武器享有25%的折扣,可以以原价购买传奇武器(仅限一把)",
|
|
902
|
+
careerBonus: "武器中士/情报副官: 升级/改装武器享有50%的折扣,购买武器享有25%的折扣(非传奇),可以以80%的价格购买传奇武器(仅限一把)"
|
|
903
|
+
}
|
|
904
|
+
]
|
|
905
|
+
}
|
|
906
|
+
];
|
|
847
907
|
function calculateModifiers(equippedWeapon, weaponName, hasCritRhythm) {
|
|
848
908
|
let totalModAdd = 0;
|
|
849
909
|
let hasCrit = false;
|
|
@@ -924,6 +984,14 @@ function apply(ctx, config) {
|
|
|
924
984
|
message = "⚠️ 能量武器专家:未装备能量武器,加成未生效";
|
|
925
985
|
}
|
|
926
986
|
}
|
|
987
|
+
if (faction === "辛迪加海盗" && career === "纵火狂") {
|
|
988
|
+
if (weaponType === "热能武器") {
|
|
989
|
+
multiplier *= 1.2;
|
|
990
|
+
message = "⚡ 职业加成:纵火狂(热能武器伤害+20%)";
|
|
991
|
+
} else {
|
|
992
|
+
message = "⚠️ 纵火狂:未装备热能武器,加成未生效";
|
|
993
|
+
}
|
|
994
|
+
}
|
|
927
995
|
return {
|
|
928
996
|
damage: currentDamage * multiplier,
|
|
929
997
|
message: message || void 0
|
|
@@ -1692,6 +1760,10 @@ function apply(ctx, config) {
|
|
|
1692
1760
|
const damageRecords = await ctx2.database.get("ggcevo_boss_damage", { handle });
|
|
1693
1761
|
const totalAttack = damageRecords.reduce((sum, r) => sum + r.attackCount, 0);
|
|
1694
1762
|
const totalDamage = damageRecords.reduce((sum, r) => sum + r.totalDamage, 0);
|
|
1763
|
+
const weapons = await ctx2.database.get("ggcevo_equipment", {
|
|
1764
|
+
handle,
|
|
1765
|
+
level: { $gte: 3 }
|
|
1766
|
+
});
|
|
1695
1767
|
switch (profession) {
|
|
1696
1768
|
case "深空矿工":
|
|
1697
1769
|
return {
|
|
@@ -1726,17 +1798,22 @@ function apply(ctx, config) {
|
|
|
1726
1798
|
message: `需要累计造成300伤害(当前${totalDamage})`
|
|
1727
1799
|
};
|
|
1728
1800
|
case "能量武器专家":
|
|
1729
|
-
const weapons = await ctx2.database.get("ggcevo_equipment", {
|
|
1730
|
-
handle,
|
|
1731
|
-
level: { $gte: 3 }
|
|
1732
|
-
});
|
|
1733
1801
|
const hasEnergyWeapon = weapons.some((weapon) => {
|
|
1734
1802
|
const weaponConfigEntry = Object.values(weaponConfig).find((c) => c.id === weapon.weaponId);
|
|
1735
1803
|
return weaponConfigEntry?.type === "能量武器";
|
|
1736
1804
|
});
|
|
1737
1805
|
return {
|
|
1738
1806
|
success: hasEnergyWeapon,
|
|
1739
|
-
message:
|
|
1807
|
+
message: `需要拥有一把3级及以上等级的能量武器`
|
|
1808
|
+
};
|
|
1809
|
+
case "纵火狂":
|
|
1810
|
+
const hasthermalWeapon = weapons.some((weapon) => {
|
|
1811
|
+
const weaponConfigEntry = Object.values(weaponConfig).find((c) => c.id === weapon.weaponId);
|
|
1812
|
+
return weaponConfigEntry?.type === "热能武器";
|
|
1813
|
+
});
|
|
1814
|
+
return {
|
|
1815
|
+
success: hasthermalWeapon,
|
|
1816
|
+
message: `需要拥有一把3级及以上等级的热能武器`
|
|
1740
1817
|
};
|
|
1741
1818
|
case "清洁工":
|
|
1742
1819
|
if (!mainBoss) return { success: false, message: "当前暂无伤害榜。" };
|
|
@@ -1758,33 +1835,50 @@ function apply(ctx, config) {
|
|
|
1758
1835
|
}
|
|
1759
1836
|
}
|
|
1760
1837
|
__name(checkTransferRequirements, "checkTransferRequirements");
|
|
1761
|
-
async function applyItemEffect(session, handle,
|
|
1762
|
-
const
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1838
|
+
async function applyItemEffect(session, handle, itemConfig2) {
|
|
1839
|
+
const itemName = Object.entries(SyndicatedItems).find(
|
|
1840
|
+
([_, item]) => item.id === itemConfig2.id
|
|
1841
|
+
)?.[0] || "未知物品";
|
|
1842
|
+
try {
|
|
1843
|
+
if (itemConfig2.id === 1) {
|
|
1844
|
+
const [SentryTower] = await ctx.database.get("ggcevo_boss", {
|
|
1845
|
+
name: "空间站哨枪塔",
|
|
1846
|
+
isActive: true
|
|
1847
|
+
});
|
|
1848
|
+
const damageValue = SentryTower.HP;
|
|
1849
|
+
await ctx.database.set(
|
|
1850
|
+
"ggcevo_boss",
|
|
1851
|
+
{ name: "空间站哨枪塔" },
|
|
1852
|
+
{
|
|
1853
|
+
isActive: false,
|
|
1854
|
+
HP: 0
|
|
1855
|
+
}
|
|
1856
|
+
);
|
|
1857
|
+
await ctx.database.withTransaction(async () => {
|
|
1858
|
+
const signRecords = await ctx.database.get("ggcevo_sign", { handle });
|
|
1859
|
+
const currentRewards = signRecords[0]?.totalRewards || 0;
|
|
1860
|
+
await ctx.database.upsert("ggcevo_sign", [{
|
|
1861
|
+
handle,
|
|
1862
|
+
totalRewards: currentRewards + damageValue
|
|
1863
|
+
}], ["handle"]);
|
|
1864
|
+
const damageRecords = await ctx.database.get("ggcevo_boss_damage", { handle });
|
|
1865
|
+
const currentDamage = damageRecords[0]?.totalDamage || 0;
|
|
1866
|
+
const currentCount = damageRecords[0]?.attackCount || 0;
|
|
1867
|
+
await ctx.database.upsert("ggcevo_boss_damage", [{
|
|
1868
|
+
handle,
|
|
1869
|
+
playerName: session.username,
|
|
1870
|
+
totalDamage: currentDamage + damageValue,
|
|
1871
|
+
attackCount: currentCount,
|
|
1872
|
+
// 保持原攻击次数
|
|
1873
|
+
bossGroupId: 4
|
|
1874
|
+
}], ["handle"]);
|
|
1875
|
+
});
|
|
1876
|
+
return `成功引爆${itemName},造成 ${damageValue} 点伤害,获得等额金币`;
|
|
1877
|
+
}
|
|
1878
|
+
return `${itemName} 效果已生效(开发中)`;
|
|
1879
|
+
} catch (error) {
|
|
1880
|
+
console.error("物品效果处理失败:", error);
|
|
1881
|
+
return "⚠️ 物品效果处理异常,已回滚操作";
|
|
1788
1882
|
}
|
|
1789
1883
|
}
|
|
1790
1884
|
__name(applyItemEffect, "applyItemEffect");
|
|
@@ -2322,7 +2416,7 @@ ${itemDetails.join("\n")}`;
|
|
|
2322
2416
|
ctx.setInterval(async () => {
|
|
2323
2417
|
if (config.autorank) {
|
|
2324
2418
|
try {
|
|
2325
|
-
const ggcmap = await ctx.database.get("sc2arcade_map", {
|
|
2419
|
+
const ggcmap = await ctx.database.get("sc2arcade_map", { regionId: 3, mapId: 165561 });
|
|
2326
2420
|
const lastdate = ggcmap[0].lastdate;
|
|
2327
2421
|
let currentMaxDate = new Date(lastdate);
|
|
2328
2422
|
let nextCursor = null;
|
|
@@ -2372,7 +2466,7 @@ ${itemDetails.join("\n")}`;
|
|
|
2372
2466
|
} while (nextCursor && shouldContinue);
|
|
2373
2467
|
if (pageMaxDate > currentMaxDate) {
|
|
2374
2468
|
currentMaxDate = pageMaxDate;
|
|
2375
|
-
await ctx.database.set("sc2arcade_map", {
|
|
2469
|
+
await ctx.database.set("sc2arcade_map", { regionId: 3, mapId: 165561 }, {
|
|
2376
2470
|
lastdate: new Date(currentMaxDate.toISOString())
|
|
2377
2471
|
});
|
|
2378
2472
|
}
|
|
@@ -2383,7 +2477,7 @@ ${itemDetails.join("\n")}`;
|
|
|
2383
2477
|
}, 60 * 60 * 1e3);
|
|
2384
2478
|
ctx.command("ggcevo/胜点榜数据同步", { authority: 3 }).action(async () => {
|
|
2385
2479
|
try {
|
|
2386
|
-
const ggcmap = await ctx.database.get("sc2arcade_map", {
|
|
2480
|
+
const ggcmap = await ctx.database.get("sc2arcade_map", { regionId: 3, mapId: 165561 });
|
|
2387
2481
|
const lastdate = ggcmap[0].lastdate;
|
|
2388
2482
|
let currentMaxDate = new Date(lastdate);
|
|
2389
2483
|
let nextCursor = null;
|
|
@@ -2433,7 +2527,7 @@ ${itemDetails.join("\n")}`;
|
|
|
2433
2527
|
} while (nextCursor && shouldContinue);
|
|
2434
2528
|
if (pageMaxDate > currentMaxDate) {
|
|
2435
2529
|
currentMaxDate = pageMaxDate;
|
|
2436
|
-
await ctx.database.set("sc2arcade_map", {
|
|
2530
|
+
await ctx.database.set("sc2arcade_map", { regionId: 3, mapId: 165561 }, {
|
|
2437
2531
|
lastdate: new Date(currentMaxDate.toISOString())
|
|
2438
2532
|
});
|
|
2439
2533
|
}
|
|
@@ -2459,7 +2553,7 @@ ${itemDetails.join("\n")}`;
|
|
|
2459
2553
|
displayName: await checkSensitiveWord(item.name) ? item.name : (item.name[0] || "") + "***"
|
|
2460
2554
|
}))
|
|
2461
2555
|
);
|
|
2462
|
-
const ggcmap = await ctx.database.get("sc2arcade_map", {
|
|
2556
|
+
const ggcmap = await ctx.database.get("sc2arcade_map", { regionId: 3, mapId: 165561 });
|
|
2463
2557
|
const lastdate = ggcmap[0].lastdate;
|
|
2464
2558
|
const rankingText = processedRecords.map(
|
|
2465
2559
|
(item, index) => `${offset + index + 1}. ${item.displayName} | 积分: ${item.rank} | 胜率: ${item.matches === 0 ? "0.00%" : (item.wins / item.matches * 100).toFixed(2) + "%"}`
|
|
@@ -3196,7 +3290,7 @@ ${achievementList.join("\n")}`;
|
|
|
3196
3290
|
const parsedUser = import_koishi.h.parse(user)[0];
|
|
3197
3291
|
if (!parsedUser || parsedUser.type !== "at" || !parsedUser.attrs.id) return "参数格式错误,请输入“pk @指定pk玩家”。";
|
|
3198
3292
|
const targetUserId = parsedUser.attrs.id;
|
|
3199
|
-
const targetUsername = await session.bot.getGuildMember(
|
|
3293
|
+
const targetUsername = await session.bot.getGuildMember(session.guildId, targetUserId);
|
|
3200
3294
|
const [targetprofile] = await ctx.database.get("sc2arcade_player", { userId: targetUserId });
|
|
3201
3295
|
if (!targetprofile) return "对方尚未绑定句柄。";
|
|
3202
3296
|
const initiatorHandle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
@@ -3476,18 +3570,18 @@ ${validTypes.join("、")}`;
|
|
|
3476
3570
|
`价格:${config2.price}金币`,
|
|
3477
3571
|
"特性:",
|
|
3478
3572
|
tagEffectsDesc,
|
|
3479
|
-
config2.description
|
|
3573
|
+
`描述:${config2.description}`
|
|
3480
3574
|
].join("\n");
|
|
3481
3575
|
});
|
|
3482
3576
|
return [
|
|
3483
3577
|
`🏪 咕咕武器库 - ${type} 🏪`,
|
|
3484
|
-
"
|
|
3578
|
+
"使用“购买 武器名称”命令进行购买",
|
|
3485
3579
|
"====================",
|
|
3486
3580
|
...items,
|
|
3487
3581
|
items.length === 0 ? "⚠️ 该分类下暂无可用武器" : ""
|
|
3488
3582
|
].join("\n\n");
|
|
3489
3583
|
});
|
|
3490
|
-
ctx.command("ggcevo
|
|
3584
|
+
ctx.command("ggcevo/购买 <weapon>").action(async ({ session }, weapon) => {
|
|
3491
3585
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
3492
3586
|
if (!profile) return "您暂未绑定句柄。";
|
|
3493
3587
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
@@ -3496,7 +3590,7 @@ ${validTypes.join("、")}`;
|
|
|
3496
3590
|
return `❌ 拒绝访问,您已被列入黑名单。`;
|
|
3497
3591
|
}
|
|
3498
3592
|
const [signInfo] = await ctx.database.get("ggcevo_sign", { handle });
|
|
3499
|
-
if (!weapon) return "
|
|
3593
|
+
if (!weapon) return "请输入“购买 物品名称”来购买所需物品。";
|
|
3500
3594
|
if (!weaponConfig[weapon]) return "无效的武器名称,请重新输入。";
|
|
3501
3595
|
const config2 = weaponConfig[weapon];
|
|
3502
3596
|
const allowedTypes = ["能量武器", "热能武器", "实弹武器"];
|
|
@@ -3586,7 +3680,7 @@ ${validTypes.join("、")}`;
|
|
|
3586
3680
|
}));
|
|
3587
3681
|
return [
|
|
3588
3682
|
"🛡️ 您当前拥有的武器",
|
|
3589
|
-
'使用"
|
|
3683
|
+
'使用"装备 武器名称"来装备武器',
|
|
3590
3684
|
"⚡表示当前装备武器",
|
|
3591
3685
|
"──────────────",
|
|
3592
3686
|
...weaponDetails.length ? weaponDetails : ["空空如也,快去“武器库”看看吧!"],
|
|
@@ -3595,11 +3689,11 @@ ${validTypes.join("、")}`;
|
|
|
3595
3689
|
"🔧 改装效果在战斗中生效"
|
|
3596
3690
|
].join("\n");
|
|
3597
3691
|
});
|
|
3598
|
-
ctx.command("ggcevo
|
|
3692
|
+
ctx.command("ggcevo/装备 <weapon>").action(async ({ session }, weapon) => {
|
|
3599
3693
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
3600
3694
|
if (!profile) return "您暂未绑定句柄。";
|
|
3601
|
-
if (!weapon) return "
|
|
3602
|
-
if (!weaponConfig[weapon]) return "
|
|
3695
|
+
if (!weapon) return "请输入“装备 武器名称”来装备一把你拥有的武器。";
|
|
3696
|
+
if (!weaponConfig[weapon]) return "请输入“装备 武器名称”来装备一把你拥有的武器。";
|
|
3603
3697
|
const config2 = weaponConfig[weapon];
|
|
3604
3698
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
3605
3699
|
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
@@ -3629,7 +3723,7 @@ ${validTypes.join("、")}`;
|
|
|
3629
3723
|
});
|
|
3630
3724
|
return `您已成功装备武器 ${weapon}!`;
|
|
3631
3725
|
});
|
|
3632
|
-
ctx.command("ggcevo
|
|
3726
|
+
ctx.command("ggcevo/升级 <weapon>", "升级武器伤害").action(async ({ session }, weapon) => {
|
|
3633
3727
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
3634
3728
|
if (!profile) return "您暂未绑定句柄。";
|
|
3635
3729
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
@@ -3642,7 +3736,7 @@ ${validTypes.join("、")}`;
|
|
|
3642
3736
|
handle,
|
|
3643
3737
|
weaponId: weaponConfig[weapon]?.id
|
|
3644
3738
|
});
|
|
3645
|
-
if (!weapon) return "
|
|
3739
|
+
if (!weapon) return "请输入“升级 武器名称”来升级你想要的武器。";
|
|
3646
3740
|
if (!equipment) return "尚未获得该武器。";
|
|
3647
3741
|
if (equipment.level >= 6) return "该武器已达最大升级等级。";
|
|
3648
3742
|
const activeWish = await ctx.database.get("ggcevo_Wish_Record", {
|
|
@@ -3689,7 +3783,7 @@ ${validTypes.join("、")}`;
|
|
|
3689
3783
|
return `${message}
|
|
3690
3784
|
当前等级:${newLevel},伤害:${baseDamage},拥有改装槽:${slots}个。`;
|
|
3691
3785
|
});
|
|
3692
|
-
ctx.command("ggcevo
|
|
3786
|
+
ctx.command("ggcevo/改装 <weapon> [mod]", "安装武器模块").action(async ({ session }, weapon, mod) => {
|
|
3693
3787
|
const isValidWeapon = weapon && weaponConfig[weapon]?.id !== void 0;
|
|
3694
3788
|
const generateModList = /* @__PURE__ */ __name(() => {
|
|
3695
3789
|
if (!isValidWeapon) {
|
|
@@ -3707,7 +3801,7 @@ ${validTypes.join("、")}`;
|
|
|
3707
3801
|
if (!mod || !modConfig[mod]) {
|
|
3708
3802
|
return [
|
|
3709
3803
|
isValidWeapon ? `🛠️ ${weapon} 专属模块 🛠️` : "🛠️ 通用武器模块 🛠️",
|
|
3710
|
-
isValidWeapon ?
|
|
3804
|
+
isValidWeapon ? `使用「改装 ${weapon} 模块名称」安装专属模块` : weapon ? "※ 无效武器名称,请使用「改装 武器名称 模块名称」安装模块" : "※ 输入「改装 武器名称」查询专属模块\n※ 安装模块:「改装 武器名称 模块名称」",
|
|
3711
3805
|
"====================",
|
|
3712
3806
|
generateModList()
|
|
3713
3807
|
].join("\n\n");
|
|
@@ -3782,7 +3876,7 @@ ${validTypes.join("、")}`;
|
|
|
3782
3876
|
if (!targetBoss) {
|
|
3783
3877
|
const activeNames = await getActiveBossNames();
|
|
3784
3878
|
return `当前没有找到名为 ${bossName} 的可攻击目标。
|
|
3785
|
-
|
|
3879
|
+
请攻击当前存活的异形:${activeNames || "无"}。`;
|
|
3786
3880
|
}
|
|
3787
3881
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
3788
3882
|
if (!profile) return "您暂未绑定句柄。";
|
|
@@ -3805,7 +3899,7 @@ ${validTypes.join("、")}`;
|
|
|
3805
3899
|
handle,
|
|
3806
3900
|
equipped: true
|
|
3807
3901
|
});
|
|
3808
|
-
if (!equippedWeapon) return "
|
|
3902
|
+
if (!equippedWeapon) return "请先输入“装备 武器名称”后再攻击。";
|
|
3809
3903
|
const weaponConfigEntry = Object.entries(weaponConfig).find(([_, c]) => c.id === equippedWeapon.weaponId);
|
|
3810
3904
|
const [weaponName, weaponData] = weaponConfigEntry;
|
|
3811
3905
|
const { damage: baseDamage, hasCrit, effectMessage } = await calculateTotalDamage(ctx, session, equippedWeapon, targetBoss);
|
|
@@ -3955,7 +4049,8 @@ ${validTypes.join("、")}`;
|
|
|
3955
4049
|
const resultMessage = [
|
|
3956
4050
|
`🔥 ${session.username} 使用武器 ${weaponName} 对 ${targetBoss.name} 发起攻击!`,
|
|
3957
4051
|
...effectMessage.length > 0 ? [
|
|
3958
|
-
|
|
4052
|
+
`触发效果:
|
|
4053
|
+
${effectMessage.join("\n")}`
|
|
3959
4054
|
] : [],
|
|
3960
4055
|
`造成伤害:${initialDamage}${hasCrit ? "(✨ 暴击)" : ""}`,
|
|
3961
4056
|
...healMessages,
|
|
@@ -4301,13 +4396,11 @@ ${validTypes.join("、")}`;
|
|
|
4301
4396
|
}
|
|
4302
4397
|
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
4303
4398
|
if (!careerData) return "请先加入阵营后使用转职功能。";
|
|
4304
|
-
let config2
|
|
4399
|
+
let config2;
|
|
4305
4400
|
if (careerData.group === "人类联盟") {
|
|
4306
4401
|
config2 = spaceStationCrewConfig;
|
|
4307
|
-
factionTips = "💰 转职消耗金币";
|
|
4308
4402
|
} else if (careerData.group === "辛迪加海盗") {
|
|
4309
4403
|
config2 = syndicatePirateConfig;
|
|
4310
|
-
factionTips = "💰 消耗金币 + 🔴 消耗红晶";
|
|
4311
4404
|
} else {
|
|
4312
4405
|
return "未知阵营无法显示职业信息。";
|
|
4313
4406
|
}
|
|
@@ -4412,17 +4505,13 @@ ${validTypes.join("、")}`;
|
|
|
4412
4505
|
}
|
|
4413
4506
|
});
|
|
4414
4507
|
ctx.command("ggcevo/黑市 [type]", "辛迪加海盗专属黑市").usage("输入“黑市”查看类型,或“黑市 类型”查看详细").action(async ({ session }, type) => {
|
|
4415
|
-
const
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
}
|
|
4422
|
-
const typeStats = Object.values(weaponConfig).reduce((stats, weapon) => {
|
|
4423
|
-
stats[weapon.type] = (stats[weapon.type] || 0) + 1;
|
|
4424
|
-
return stats;
|
|
4425
|
-
}, {});
|
|
4508
|
+
const typeStats = {};
|
|
4509
|
+
Object.values(weaponConfig).forEach((weapon) => {
|
|
4510
|
+
typeStats[weapon.type] = (typeStats[weapon.type] || 0) + 1;
|
|
4511
|
+
});
|
|
4512
|
+
Object.values(SyndicatedItems).forEach((item) => {
|
|
4513
|
+
typeStats[item.type] = (typeStats[item.type] || 0) + 1;
|
|
4514
|
+
});
|
|
4426
4515
|
if (!type) {
|
|
4427
4516
|
return [
|
|
4428
4517
|
"🏴☠️ 辛迪加黑市 🏴☠️",
|
|
@@ -4434,30 +4523,39 @@ ${validTypes.join("、")}`;
|
|
|
4434
4523
|
}
|
|
4435
4524
|
const normalizedType = Object.keys(typeStats).find((t) => t === type);
|
|
4436
4525
|
if (!normalizedType) return `无效类型,可用:${Object.keys(typeStats).join("、")}`;
|
|
4437
|
-
const items =
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
)
|
|
4456
|
-
|
|
4457
|
-
|
|
4526
|
+
const items = [
|
|
4527
|
+
...Object.entries(weaponConfig).filter(([_, config2]) => config2.type === normalizedType).map(([name2, config2]) => {
|
|
4528
|
+
const infoBlocks = [
|
|
4529
|
+
`【${name2}】`,
|
|
4530
|
+
`类型:${config2.type}`,
|
|
4531
|
+
...config2.damage ? [`基础伤害:${config2.damage}`] : [],
|
|
4532
|
+
`订购价:${config2.redCrystalCost}红晶`
|
|
4533
|
+
];
|
|
4534
|
+
if (Object.keys(config2.tagEffects).length > 0) {
|
|
4535
|
+
const tagEffectsDesc = Object.entries(config2.tagEffects).map(([tag, mul]) => `▸ 对${tag}目标造成${(mul * 100).toFixed(0)}%伤害`).join("\n");
|
|
4536
|
+
infoBlocks.push("特性:", tagEffectsDesc);
|
|
4537
|
+
}
|
|
4538
|
+
infoBlocks.push(
|
|
4539
|
+
`描述:${config2.description}`,
|
|
4540
|
+
"──────────────"
|
|
4541
|
+
);
|
|
4542
|
+
return infoBlocks.join("\n");
|
|
4543
|
+
}),
|
|
4544
|
+
...Object.entries(SyndicatedItems).filter(([_, item]) => item.type === normalizedType).map(([name2, item]) => {
|
|
4545
|
+
const infoBlocks = [
|
|
4546
|
+
`【${name2}】`,
|
|
4547
|
+
`类型:${item.type}`,
|
|
4548
|
+
`订购价:${item.redCrystalCost}红晶`,
|
|
4549
|
+
`效果:${item.effects}`,
|
|
4550
|
+
item.description,
|
|
4551
|
+
"──────────────"
|
|
4552
|
+
];
|
|
4553
|
+
return infoBlocks.join("\n");
|
|
4554
|
+
})
|
|
4555
|
+
];
|
|
4458
4556
|
return [
|
|
4459
4557
|
`🏴☠️ 辛迪加黑市 - ${normalizedType} 🏴☠️`,
|
|
4460
|
-
"使用“订购
|
|
4558
|
+
"使用“订购 物品名称”进行购买(仅消耗红晶)",
|
|
4461
4559
|
"====================",
|
|
4462
4560
|
...items
|
|
4463
4561
|
].join("\n\n");
|
|
@@ -4466,27 +4564,27 @@ ${validTypes.join("、")}`;
|
|
|
4466
4564
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
4467
4565
|
if (!profile) return "⚠️ 需要先绑定游戏句柄";
|
|
4468
4566
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
4469
|
-
|
|
4470
|
-
if (existingEntries.length > 0) {
|
|
4567
|
+
if (await ctx.database.get("ggcevo_blacklist", { handle }).then((r) => r.length)) {
|
|
4471
4568
|
return "❌ 拒绝访问,您已被列入黑名单";
|
|
4472
4569
|
}
|
|
4473
4570
|
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
4474
4571
|
if (!careerData || careerData.group !== "辛迪加海盗") {
|
|
4475
4572
|
return "🚫 该功能需要【辛迪加海盗】阵营权限";
|
|
4476
4573
|
}
|
|
4477
|
-
if (!item) return "
|
|
4478
|
-
const
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
const
|
|
4574
|
+
if (!item) return "请输入“订购 物品名称”来向辛迪加订购物品。";
|
|
4575
|
+
const isWeapon = Object.prototype.hasOwnProperty.call(weaponConfig, item);
|
|
4576
|
+
const isSyndicatedItem = Object.prototype.hasOwnProperty.call(SyndicatedItems, item);
|
|
4577
|
+
if (!isWeapon && !isSyndicatedItem) return "❌ 无效物品名称";
|
|
4578
|
+
const itemConfig2 = isWeapon ? weaponConfig[item] : SyndicatedItems[item];
|
|
4579
|
+
if (!itemConfig2.redCrystalCost) return "⛔ 该物品不可订购";
|
|
4482
4580
|
if (isWeapon) {
|
|
4483
4581
|
const existing = await ctx.database.get("ggcevo_equipment", {
|
|
4484
4582
|
handle,
|
|
4485
|
-
weaponId:
|
|
4583
|
+
weaponId: itemConfig2.id
|
|
4486
4584
|
});
|
|
4487
|
-
if (existing.length) return "
|
|
4585
|
+
if (existing.length) return "您已经拥有该武器。";
|
|
4488
4586
|
}
|
|
4489
|
-
const requiredRed =
|
|
4587
|
+
const requiredRed = itemConfig2.redCrystalCost;
|
|
4490
4588
|
if ((careerData.redcrystal || 0) < requiredRed) {
|
|
4491
4589
|
return `❌ 红晶不足!需要:${requiredRed} 当前:${careerData.redcrystal}`;
|
|
4492
4590
|
}
|
|
@@ -4495,48 +4593,56 @@ ${validTypes.join("、")}`;
|
|
|
4495
4593
|
redcrystal: careerData.redcrystal - requiredRed
|
|
4496
4594
|
});
|
|
4497
4595
|
if (isWeapon) {
|
|
4498
|
-
await ctx.database.
|
|
4596
|
+
await ctx.database.create("ggcevo_equipment", {
|
|
4499
4597
|
handle,
|
|
4500
|
-
weaponId:
|
|
4598
|
+
weaponId: itemConfig2.id,
|
|
4501
4599
|
level: 0,
|
|
4502
4600
|
modificationSlots: 1,
|
|
4601
|
+
installedMods: [],
|
|
4503
4602
|
equipped: false
|
|
4504
|
-
}
|
|
4603
|
+
});
|
|
4505
4604
|
const equippedCount = await ctx.database.select("ggcevo_equipment").where({ handle, equipped: true }).execute((row) => import_koishi.$.count(row.weaponId));
|
|
4506
4605
|
if (equippedCount === 0) {
|
|
4507
4606
|
await ctx.database.set(
|
|
4508
4607
|
"ggcevo_equipment",
|
|
4509
|
-
{ handle, weaponId:
|
|
4608
|
+
{ handle, weaponId: itemConfig2.id },
|
|
4510
4609
|
{ equipped: true }
|
|
4511
4610
|
);
|
|
4512
4611
|
}
|
|
4513
4612
|
} else {
|
|
4514
|
-
const
|
|
4613
|
+
const [existing] = await ctx.database.get("ggcevo_warehouse", {
|
|
4515
4614
|
handle,
|
|
4516
|
-
itemId:
|
|
4615
|
+
itemId: itemConfig2.id
|
|
4517
4616
|
});
|
|
4518
4617
|
await ctx.database.upsert("ggcevo_warehouse", [{
|
|
4519
4618
|
handle,
|
|
4520
|
-
itemId:
|
|
4521
|
-
quantity: (
|
|
4619
|
+
itemId: itemConfig2.id,
|
|
4620
|
+
quantity: (existing?.quantity || 0) + 1
|
|
4522
4621
|
}], ["handle", "itemId"]);
|
|
4523
4622
|
}
|
|
4524
4623
|
});
|
|
4525
4624
|
if (isWeapon) {
|
|
4526
|
-
const
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4625
|
+
const equippedStatus = await ctx.database.get("ggcevo_equipment", {
|
|
4626
|
+
handle,
|
|
4627
|
+
weaponId: itemConfig2.id
|
|
4628
|
+
}).then((r) => r[0]?.equipped ? "已自动装备武器" : "需手动装备武器");
|
|
4629
|
+
return [
|
|
4630
|
+
`✅ 成功订购【${item}】!`,
|
|
4631
|
+
`消耗红晶:${requiredRed}`,
|
|
4632
|
+
`装备状态:${equippedStatus}`,
|
|
4633
|
+
'输入 "武器仓库" 管理武器'
|
|
4634
|
+
].join("\n");
|
|
4532
4635
|
} else {
|
|
4533
|
-
const
|
|
4636
|
+
const currentStock = await ctx.database.get("ggcevo_warehouse", {
|
|
4534
4637
|
handle,
|
|
4535
|
-
itemId:
|
|
4536
|
-
});
|
|
4537
|
-
return
|
|
4538
|
-
|
|
4539
|
-
|
|
4638
|
+
itemId: itemConfig2.id
|
|
4639
|
+
}).then((r) => r[0]?.quantity || 1);
|
|
4640
|
+
return [
|
|
4641
|
+
`✅ 成功订购【${item}】x1!`,
|
|
4642
|
+
`消耗红晶:${requiredRed}`,
|
|
4643
|
+
`当前库存:${currentStock}件`,
|
|
4644
|
+
'输入 "仓库" 查看所有物品'
|
|
4645
|
+
].join("\n");
|
|
4540
4646
|
}
|
|
4541
4647
|
});
|
|
4542
4648
|
ctx.command("ggcevo/仓库").action(async (argv) => {
|
|
@@ -4554,21 +4660,29 @@ ${validTypes.join("、")}`;
|
|
|
4554
4660
|
const message = [`【${handle}的仓库】`];
|
|
4555
4661
|
message.push(`💰 金币:${totalRewards}`);
|
|
4556
4662
|
if (redcrystal > 0) message.push(`🔴 红晶:${redcrystal}`);
|
|
4557
|
-
const validItems = items.filter(
|
|
4663
|
+
const validItems = items.filter(
|
|
4664
|
+
(item) => Object.values(SyndicatedItems).some(
|
|
4665
|
+
(specialItem) => specialItem.id === item.itemId
|
|
4666
|
+
) && item.quantity > 0
|
|
4667
|
+
);
|
|
4558
4668
|
if (!validItems.length) {
|
|
4559
|
-
message.push("
|
|
4669
|
+
message.push("你的特殊物品仓库空空如也。");
|
|
4560
4670
|
} else {
|
|
4561
4671
|
message.push(
|
|
4562
4672
|
validItems.map((warehouseItem) => {
|
|
4563
|
-
const entry = Object.entries(
|
|
4673
|
+
const entry = Object.entries(SyndicatedItems).find(
|
|
4564
4674
|
([, item]) => item.id === warehouseItem.itemId
|
|
4565
4675
|
);
|
|
4566
|
-
if (!entry) return `未知物品 x ${warehouseItem.quantity}:数据异常,请联系管理员`;
|
|
4567
4676
|
const [itemName, itemData] = entry;
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4677
|
+
return [
|
|
4678
|
+
`${itemName}`,
|
|
4679
|
+
// 移除数量显示在标题
|
|
4680
|
+
`类型:${itemData.type} | 持有数量:${warehouseItem.quantity}`,
|
|
4681
|
+
// 从warehouse表读取实际数量
|
|
4682
|
+
`特效:${itemData.effects}`,
|
|
4683
|
+
`描述:${itemData.description}`,
|
|
4684
|
+
"―――――――――――――――"
|
|
4685
|
+
].join("\n");
|
|
4572
4686
|
}).join("\n\n")
|
|
4573
4687
|
);
|
|
4574
4688
|
}
|
|
@@ -4577,38 +4691,48 @@ ${validTypes.join("、")}`;
|
|
|
4577
4691
|
ctx.command("ggcevo/使用 [itemName]").action(async (argv, itemName) => {
|
|
4578
4692
|
const session = argv.session;
|
|
4579
4693
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
4580
|
-
if (!profile) return "
|
|
4694
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
4581
4695
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
return "❌ 拒绝访问,您已被列入黑名单";
|
|
4696
|
+
if (await ctx.database.get("ggcevo_blacklist", { handle }).then((r) => r.length)) {
|
|
4697
|
+
return "⛔ 您已被列入黑名单";
|
|
4585
4698
|
}
|
|
4586
4699
|
try {
|
|
4587
|
-
const
|
|
4588
|
-
const targetItem =
|
|
4589
|
-
const entry = Object.entries(
|
|
4590
|
-
([,
|
|
4700
|
+
const warehouseItems = await ctx.database.get("ggcevo_warehouse", { handle });
|
|
4701
|
+
const targetItem = warehouseItems.find((item) => {
|
|
4702
|
+
const entry = Object.entries(SyndicatedItems).find(
|
|
4703
|
+
([_, cfg]) => cfg.id === item.itemId
|
|
4591
4704
|
);
|
|
4592
|
-
|
|
4593
|
-
const [itemKey] = entry;
|
|
4594
|
-
return itemKey.toLowerCase() === itemName?.toLowerCase();
|
|
4705
|
+
return entry?.[0] === itemName;
|
|
4595
4706
|
});
|
|
4596
|
-
if (!targetItem) return
|
|
4597
|
-
if (targetItem.quantity < 1) return
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4707
|
+
if (!targetItem) return `❌ 未找到 ${itemName} 或物品不可用`;
|
|
4708
|
+
if (targetItem.quantity < 1) return `⚠️ ${itemName} 库存不足`;
|
|
4709
|
+
const itemEntry = Object.entries(SyndicatedItems).find(
|
|
4710
|
+
([_, item]) => item.id === targetItem.itemId
|
|
4711
|
+
);
|
|
4712
|
+
const [itemNameConfirmed, itemConfig2] = itemEntry;
|
|
4713
|
+
if (itemConfig2.id === 1) {
|
|
4714
|
+
const activeSentry = await ctx.database.get("ggcevo_boss", {
|
|
4715
|
+
name: "空间站哨枪塔",
|
|
4716
|
+
isActive: true
|
|
4717
|
+
});
|
|
4718
|
+
if (!activeSentry.length) return "⚠️ 目标「空间站哨枪塔」未激活";
|
|
4601
4719
|
}
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4720
|
+
const newQuantity = targetItem.quantity - 1;
|
|
4721
|
+
await ctx.database.set(
|
|
4722
|
+
"ggcevo_warehouse",
|
|
4723
|
+
{ handle, itemId: targetItem.itemId },
|
|
4724
|
+
{ quantity: newQuantity }
|
|
4725
|
+
);
|
|
4726
|
+
const effectResult = await applyItemEffect(session, handle, itemConfig2);
|
|
4727
|
+
return [
|
|
4728
|
+
`✅ 成功使用 ${itemNameConfirmed}`,
|
|
4729
|
+
`├ 剩余数量:${newQuantity}`,
|
|
4730
|
+
`└ 效果触发:${effectResult}`,
|
|
4731
|
+
"─".repeat(25)
|
|
4732
|
+
].join("\n");
|
|
4609
4733
|
} catch (error) {
|
|
4610
4734
|
ctx.logger("GGCEVO").error(error);
|
|
4611
|
-
return "
|
|
4735
|
+
return "⚠️ 物品使用失败,请联系管理员";
|
|
4612
4736
|
}
|
|
4613
4737
|
});
|
|
4614
4738
|
}
|