koishi-plugin-ggcevo-game 1.2.55 → 1.2.57
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 +8 -0
- package/lib/index.js +847 -270
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -262,6 +262,15 @@ function apply(ctx, config) {
|
|
|
262
262
|
primary: "id",
|
|
263
263
|
autoInc: true
|
|
264
264
|
});
|
|
265
|
+
ctx.model.extend("ggcevo_careers", {
|
|
266
|
+
handle: "string",
|
|
267
|
+
group: "string",
|
|
268
|
+
career: "string",
|
|
269
|
+
redcrystal: "unsigned",
|
|
270
|
+
date: "timestamp"
|
|
271
|
+
}, {
|
|
272
|
+
primary: "handle"
|
|
273
|
+
});
|
|
265
274
|
const weaponConfig = {
|
|
266
275
|
// 武器配置
|
|
267
276
|
"高斯步枪": {
|
|
@@ -319,6 +328,7 @@ function apply(ctx, config) {
|
|
|
319
328
|
price: 150,
|
|
320
329
|
tagEffects: {
|
|
321
330
|
"重甲": 1.5,
|
|
331
|
+
"建筑": 1.5,
|
|
322
332
|
"机械": 1.2
|
|
323
333
|
}
|
|
324
334
|
},
|
|
@@ -451,186 +461,6 @@ function apply(ctx, config) {
|
|
|
451
461
|
}
|
|
452
462
|
]
|
|
453
463
|
};
|
|
454
|
-
const spaceStationCrewConfig = [
|
|
455
|
-
{
|
|
456
|
-
professionName: "深空矿工",
|
|
457
|
-
effectname: "",
|
|
458
|
-
effect: "每日签到获得的金币收益增加100%",
|
|
459
|
-
requirements: "当月累计签到14天",
|
|
460
|
-
description: "",
|
|
461
|
-
Jobtransfer: true
|
|
462
|
-
},
|
|
463
|
-
{
|
|
464
|
-
professionName: "警卫员下士",
|
|
465
|
-
effectname: "",
|
|
466
|
-
effect: "攻击获得的金币增加100%",
|
|
467
|
-
requirements: "当期伤害榜攻击次数达到5次",
|
|
468
|
-
description: "",
|
|
469
|
-
Jobtransfer: true
|
|
470
|
-
},
|
|
471
|
-
{
|
|
472
|
-
professionName: "警卫长",
|
|
473
|
-
effectname: "",
|
|
474
|
-
effect: "攻击获得的金币增加100%",
|
|
475
|
-
requirements: "当期伤害榜攻击次数达到5次",
|
|
476
|
-
description: "",
|
|
477
|
-
Jobtransfer: true
|
|
478
|
-
},
|
|
479
|
-
{
|
|
480
|
-
professionName: "武器中士",
|
|
481
|
-
effectname: "",
|
|
482
|
-
effect: "攻击伤害+10%",
|
|
483
|
-
requirements: "当期伤害榜造成200点伤害",
|
|
484
|
-
description: "",
|
|
485
|
-
Jobtransfer: true
|
|
486
|
-
},
|
|
487
|
-
{
|
|
488
|
-
professionName: "医疗专家",
|
|
489
|
-
effectname: "",
|
|
490
|
-
effect: "",
|
|
491
|
-
requirements: "",
|
|
492
|
-
description: "",
|
|
493
|
-
Jobtransfer: false
|
|
494
|
-
},
|
|
495
|
-
{
|
|
496
|
-
professionName: "情报副官",
|
|
497
|
-
effectname: "",
|
|
498
|
-
effect: "升级联盟空间站科技享有80%的折扣",
|
|
499
|
-
requirements: "拥有500枚金币",
|
|
500
|
-
description: "",
|
|
501
|
-
Jobtransfer: false
|
|
502
|
-
},
|
|
503
|
-
{
|
|
504
|
-
professionName: "总工程师",
|
|
505
|
-
effectname: "",
|
|
506
|
-
effect: "拥有独特的C.O.R.E科技升级权限",
|
|
507
|
-
requirements: "",
|
|
508
|
-
description: "",
|
|
509
|
-
Jobtransfer: false
|
|
510
|
-
},
|
|
511
|
-
{
|
|
512
|
-
professionName: "舰长",
|
|
513
|
-
effectname: "",
|
|
514
|
-
effect: "pk胜利将获得对面的红晶,可以使用红晶升级联盟空间站科技",
|
|
515
|
-
requirements: "pk总次数达10次",
|
|
516
|
-
description: "",
|
|
517
|
-
Jobtransfer: false
|
|
518
|
-
},
|
|
519
|
-
{
|
|
520
|
-
professionName: "机械化专家",
|
|
521
|
-
effectname: "",
|
|
522
|
-
effect: "机甲形态攻击伤害+50%",
|
|
523
|
-
requirements: "",
|
|
524
|
-
description: "",
|
|
525
|
-
Jobtransfer: false
|
|
526
|
-
},
|
|
527
|
-
{
|
|
528
|
-
professionName: "联盟新兵",
|
|
529
|
-
effectname: "无",
|
|
530
|
-
effect: "无",
|
|
531
|
-
requirements: "无",
|
|
532
|
-
description: "",
|
|
533
|
-
Jobtransfer: false
|
|
534
|
-
}
|
|
535
|
-
];
|
|
536
|
-
const syndicatePirateConfig = [
|
|
537
|
-
{
|
|
538
|
-
professionName: "能量武器专家",
|
|
539
|
-
effectname: "",
|
|
540
|
-
effect: "能量武器攻击伤害+15%",
|
|
541
|
-
requirements: "",
|
|
542
|
-
description: "",
|
|
543
|
-
Jobtransfer: true
|
|
544
|
-
},
|
|
545
|
-
{
|
|
546
|
-
professionName: "清洁工",
|
|
547
|
-
effectname: "",
|
|
548
|
-
effect: "击败主宰能够根据排名获得红晶",
|
|
549
|
-
requirements: "",
|
|
550
|
-
description: "",
|
|
551
|
-
Jobtransfer: true
|
|
552
|
-
},
|
|
553
|
-
{
|
|
554
|
-
professionName: "枪手",
|
|
555
|
-
effectname: "",
|
|
556
|
-
effect: "升级武器享有80%的折扣",
|
|
557
|
-
requirements: "",
|
|
558
|
-
description: "",
|
|
559
|
-
Jobtransfer: true
|
|
560
|
-
},
|
|
561
|
-
{
|
|
562
|
-
professionName: "猩红杀手",
|
|
563
|
-
effectname: "",
|
|
564
|
-
effect: "升级武器享有80%的折扣",
|
|
565
|
-
requirements: "",
|
|
566
|
-
description: "",
|
|
567
|
-
Jobtransfer: true
|
|
568
|
-
},
|
|
569
|
-
{
|
|
570
|
-
professionName: "纵火狂",
|
|
571
|
-
effectname: "",
|
|
572
|
-
effect: "热能武器攻击伤害+15%",
|
|
573
|
-
requirements: "",
|
|
574
|
-
description: "",
|
|
575
|
-
Jobtransfer: true
|
|
576
|
-
},
|
|
577
|
-
{
|
|
578
|
-
professionName: "辛迪加财务经理",
|
|
579
|
-
effectname: "",
|
|
580
|
-
effect: "每日签到能额外获得红晶",
|
|
581
|
-
requirements: "",
|
|
582
|
-
description: "",
|
|
583
|
-
Jobtransfer: true
|
|
584
|
-
},
|
|
585
|
-
{
|
|
586
|
-
professionName: "计算机专家",
|
|
587
|
-
effectname: "",
|
|
588
|
-
effect: "每日pk次数翻倍,pk的胜率提高10%",
|
|
589
|
-
requirements: "",
|
|
590
|
-
description: "",
|
|
591
|
-
Jobtransfer: false
|
|
592
|
-
},
|
|
593
|
-
{
|
|
594
|
-
professionName: "指挥官",
|
|
595
|
-
effectname: "",
|
|
596
|
-
effect: "可以使用红晶升级独特的辛迪加空间站科技",
|
|
597
|
-
requirements: "",
|
|
598
|
-
description: "",
|
|
599
|
-
Jobtransfer: false
|
|
600
|
-
},
|
|
601
|
-
{
|
|
602
|
-
professionName: "装甲兵",
|
|
603
|
-
effectname: "",
|
|
604
|
-
effect: "改装武器享有80%的折扣",
|
|
605
|
-
requirements: "",
|
|
606
|
-
description: "",
|
|
607
|
-
Jobtransfer: true
|
|
608
|
-
},
|
|
609
|
-
{
|
|
610
|
-
professionName: "破坏者",
|
|
611
|
-
effectname: "",
|
|
612
|
-
effect: "pk胜利获得额外红晶",
|
|
613
|
-
requirements: "",
|
|
614
|
-
description: "",
|
|
615
|
-
Jobtransfer: false
|
|
616
|
-
},
|
|
617
|
-
{
|
|
618
|
-
professionName: "征募官",
|
|
619
|
-
effectname: "",
|
|
620
|
-
effect: "pk胜利获得额外红晶",
|
|
621
|
-
requirements: "",
|
|
622
|
-
description: "",
|
|
623
|
-
Jobtransfer: false
|
|
624
|
-
},
|
|
625
|
-
{
|
|
626
|
-
professionName: "辛迪加炮灰新兵",
|
|
627
|
-
effectname: "无",
|
|
628
|
-
effect: "无",
|
|
629
|
-
requirements: "无",
|
|
630
|
-
description: "",
|
|
631
|
-
Jobtransfer: false
|
|
632
|
-
}
|
|
633
|
-
];
|
|
634
464
|
const passiveConfig = {
|
|
635
465
|
"弱化形态": {
|
|
636
466
|
effect: 0.1,
|
|
@@ -679,6 +509,26 @@ function apply(ctx, config) {
|
|
|
679
509
|
"冷适应": {
|
|
680
510
|
effect: 0,
|
|
681
511
|
description: "受到10次寒冷伤害后,永久获得“惧热”标签,同时免疫寒冷伤害"
|
|
512
|
+
},
|
|
513
|
+
"感染空间站": {
|
|
514
|
+
effect: 0,
|
|
515
|
+
description: "若“空间站哨枪塔”存活,则自身受到的伤害-50%(空间站哨枪塔不属于子代)"
|
|
516
|
+
},
|
|
517
|
+
"病毒云": {
|
|
518
|
+
effect: -0.1,
|
|
519
|
+
description: "释放病毒云雾保护自身,受到的伤害-10%"
|
|
520
|
+
},
|
|
521
|
+
"霉菌滋生": {
|
|
522
|
+
effect: 0,
|
|
523
|
+
description: "自身每受到1次攻击,若“空间站哨枪塔”存活,则为其回复1%的最大生命值"
|
|
524
|
+
},
|
|
525
|
+
"岗哨机枪": {
|
|
526
|
+
effect: 0,
|
|
527
|
+
description: "自己的职责为“保护感染虫”,受到10次攻击后,为存活的机械感染虫和空间站感染虫回复10%的最大生命值(可重复触发)"
|
|
528
|
+
},
|
|
529
|
+
"结构装甲": {
|
|
530
|
+
effect: 0,
|
|
531
|
+
description: "拥有结构装甲,受到的伤害-20%;若伤害来源于能量武器,则受到的伤害-40%"
|
|
682
532
|
}
|
|
683
533
|
};
|
|
684
534
|
const bossPool = [
|
|
@@ -708,7 +558,7 @@ function apply(ctx, config) {
|
|
|
708
558
|
id: 2,
|
|
709
559
|
name: "寒冰王蛇",
|
|
710
560
|
type: "主宰",
|
|
711
|
-
maxHP:
|
|
561
|
+
maxHP: 1e4,
|
|
712
562
|
tags: ["重甲", "惧热", "生物", "异形"],
|
|
713
563
|
passive: ["冰霜环绕", "冰霜进化"]
|
|
714
564
|
// 明确类型
|
|
@@ -717,7 +567,7 @@ function apply(ctx, config) {
|
|
|
717
567
|
{
|
|
718
568
|
name: "冰蛇",
|
|
719
569
|
type: "子代",
|
|
720
|
-
maxHP:
|
|
570
|
+
maxHP: 3e3,
|
|
721
571
|
tags: ["惧热", "生物", "异形"],
|
|
722
572
|
passive: ["弱化形态", "冰霜回复", "冰霜进化"]
|
|
723
573
|
// 明确类型
|
|
@@ -738,7 +588,7 @@ function apply(ctx, config) {
|
|
|
738
588
|
{
|
|
739
589
|
name: "狂暴畸变体",
|
|
740
590
|
type: "子代",
|
|
741
|
-
maxHP:
|
|
591
|
+
maxHP: 3e3,
|
|
742
592
|
tags: ["重甲", "生物", "异形"],
|
|
743
593
|
passive: ["弱化形态", "应激甲壳I", "求生本能I", "冷适应"]
|
|
744
594
|
// 明确类型
|
|
@@ -746,12 +596,211 @@ function apply(ctx, config) {
|
|
|
746
596
|
{
|
|
747
597
|
name: "剧毒畸变体",
|
|
748
598
|
type: "子代",
|
|
749
|
-
maxHP:
|
|
599
|
+
maxHP: 3e3,
|
|
750
600
|
tags: ["重甲", "生物", "异形"],
|
|
751
601
|
passive: ["弱化形态", "应激甲壳I", "求生本能I", "冷适应"]
|
|
752
602
|
// 明确类型
|
|
753
603
|
}
|
|
754
604
|
]
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
main: {
|
|
608
|
+
id: 4,
|
|
609
|
+
name: "空间站感染虫",
|
|
610
|
+
type: "主宰",
|
|
611
|
+
maxHP: 1e4,
|
|
612
|
+
tags: ["重甲", "生物", "机械", "异形"],
|
|
613
|
+
passive: ["感染空间站", "病毒云", "霉菌滋生"]
|
|
614
|
+
// 明确类型
|
|
615
|
+
},
|
|
616
|
+
minions: [
|
|
617
|
+
{
|
|
618
|
+
name: "机械感染虫",
|
|
619
|
+
type: "子代",
|
|
620
|
+
maxHP: 3e3,
|
|
621
|
+
tags: ["重甲", "生物", "机械", "异形"],
|
|
622
|
+
passive: ["弱化形态", "病毒云", "霉菌滋生"]
|
|
623
|
+
// 明确类型
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
name: "空间站哨枪塔",
|
|
627
|
+
type: "子代",
|
|
628
|
+
maxHP: 5e3,
|
|
629
|
+
tags: ["重甲", "机械", "建筑"],
|
|
630
|
+
passive: ["岗哨机枪", "结构装甲"]
|
|
631
|
+
// 明确类型
|
|
632
|
+
}
|
|
633
|
+
]
|
|
634
|
+
}
|
|
635
|
+
];
|
|
636
|
+
const spaceStationCrewConfig = [
|
|
637
|
+
{
|
|
638
|
+
professionName: "深空矿工",
|
|
639
|
+
effect: "每日签到获得的金币收益增加50%",
|
|
640
|
+
requirements: "当月累计签到14天",
|
|
641
|
+
Jobtransfer: true,
|
|
642
|
+
costcoins: 2e3
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
professionName: "警卫员下士",
|
|
646
|
+
effect: "攻击获得的金币增加50%",
|
|
647
|
+
requirements: "当期伤害榜攻击次数达到6次",
|
|
648
|
+
Jobtransfer: true,
|
|
649
|
+
costcoins: 2e3
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
professionName: "警卫长",
|
|
653
|
+
effect: "攻击伤害+5%,攻击获得的金币增加100%",
|
|
654
|
+
requirements: "职业为警卫员下士并且当前伤害榜前3",
|
|
655
|
+
Jobtransfer: true,
|
|
656
|
+
costcoins: 3e3
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
professionName: "武器中士",
|
|
660
|
+
effect: "攻击伤害+10%",
|
|
661
|
+
requirements: "当期伤害榜造成300点伤害",
|
|
662
|
+
Jobtransfer: true,
|
|
663
|
+
costcoins: 2e3
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
professionName: "医疗专家",
|
|
667
|
+
effect: "",
|
|
668
|
+
requirements: "",
|
|
669
|
+
Jobtransfer: false,
|
|
670
|
+
costcoins: 3e3
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
professionName: "情报副官",
|
|
674
|
+
effect: "升级联盟空间站科技享有80%的折扣",
|
|
675
|
+
requirements: "拥有500枚金币",
|
|
676
|
+
Jobtransfer: false,
|
|
677
|
+
costcoins: 3e3
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
professionName: "总工程师",
|
|
681
|
+
effect: "拥有独特的C.O.R.E科技升级权限",
|
|
682
|
+
requirements: "",
|
|
683
|
+
Jobtransfer: false,
|
|
684
|
+
costcoins: 3e3
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
professionName: "舰长",
|
|
688
|
+
effect: "pk胜利将获得对面的红晶,可以使用红晶升级联盟空间站科技",
|
|
689
|
+
requirements: "pk总次数达10次",
|
|
690
|
+
Jobtransfer: false,
|
|
691
|
+
costcoins: 3e3
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
professionName: "机械化专家",
|
|
695
|
+
effect: "机甲形态攻击伤害+50%",
|
|
696
|
+
requirements: "",
|
|
697
|
+
Jobtransfer: false,
|
|
698
|
+
costcoins: 3e3
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
professionName: "联盟新兵",
|
|
702
|
+
effect: "你只是一个普通人",
|
|
703
|
+
requirements: "无",
|
|
704
|
+
Jobtransfer: false,
|
|
705
|
+
costcoins: 0
|
|
706
|
+
}
|
|
707
|
+
];
|
|
708
|
+
const syndicatePirateConfig = [
|
|
709
|
+
{
|
|
710
|
+
professionName: "能量武器专家",
|
|
711
|
+
effect: "能量武器攻击伤害+15%",
|
|
712
|
+
requirements: "拥有一把武器等级为6的能量武器",
|
|
713
|
+
Jobtransfer: true,
|
|
714
|
+
costcoins: 2e3,
|
|
715
|
+
costredcrystal: 20
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
professionName: "清洁工",
|
|
719
|
+
effect: "击败主宰能够根据排名获得红晶",
|
|
720
|
+
requirements: "当期伤害榜排名前3",
|
|
721
|
+
Jobtransfer: true,
|
|
722
|
+
costcoins: 2e3,
|
|
723
|
+
costredcrystal: 20
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
professionName: "枪手",
|
|
727
|
+
effect: "武器等级上限为7级,升级武器享有80%的折扣(可与祈愿叠加)",
|
|
728
|
+
requirements: "拥有2把武器等级为6的武器",
|
|
729
|
+
Jobtransfer: false,
|
|
730
|
+
costcoins: 3e3,
|
|
731
|
+
costredcrystal: 30
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
professionName: "猩红杀手",
|
|
735
|
+
effect: "使用“侦查步枪”造成的伤害增加15%",
|
|
736
|
+
requirements: "“侦查步枪”武器等级为6",
|
|
737
|
+
Jobtransfer: false,
|
|
738
|
+
costcoins: 2e3,
|
|
739
|
+
costredcrystal: 20
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
professionName: "纵火狂",
|
|
743
|
+
effect: "热能武器攻击伤害+15%",
|
|
744
|
+
requirements: "",
|
|
745
|
+
Jobtransfer: false,
|
|
746
|
+
costcoins: 2e3,
|
|
747
|
+
costredcrystal: 20
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
professionName: "辛迪加财务经理",
|
|
751
|
+
effect: "每日签到能额外获得红晶",
|
|
752
|
+
requirements: "当月累计签到28天",
|
|
753
|
+
Jobtransfer: true,
|
|
754
|
+
costcoins: 3e3,
|
|
755
|
+
costredcrystal: 30
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
professionName: "计算机专家",
|
|
759
|
+
effect: "每日pk次数翻倍,pk的胜率提高10%",
|
|
760
|
+
requirements: "",
|
|
761
|
+
Jobtransfer: false,
|
|
762
|
+
costcoins: 2e3,
|
|
763
|
+
costredcrystal: 10
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
professionName: "指挥官",
|
|
767
|
+
effect: "可以使用红晶升级独特的辛迪加空间站科技",
|
|
768
|
+
requirements: "",
|
|
769
|
+
Jobtransfer: false,
|
|
770
|
+
costcoins: 2e3,
|
|
771
|
+
costredcrystal: 10
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
professionName: "装甲兵",
|
|
775
|
+
effect: "",
|
|
776
|
+
requirements: "",
|
|
777
|
+
Jobtransfer: false,
|
|
778
|
+
costcoins: 2e3,
|
|
779
|
+
costredcrystal: 10
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
professionName: "破坏者",
|
|
783
|
+
effect: "",
|
|
784
|
+
requirements: "",
|
|
785
|
+
Jobtransfer: false,
|
|
786
|
+
costcoins: 2e3,
|
|
787
|
+
costredcrystal: 10
|
|
788
|
+
},
|
|
789
|
+
{
|
|
790
|
+
professionName: "征募官",
|
|
791
|
+
effect: "",
|
|
792
|
+
requirements: "",
|
|
793
|
+
Jobtransfer: false,
|
|
794
|
+
costcoins: 2e3,
|
|
795
|
+
costredcrystal: 10
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
professionName: "辛迪加炮灰新兵",
|
|
799
|
+
effect: "你只是一个炮灰",
|
|
800
|
+
requirements: "无",
|
|
801
|
+
Jobtransfer: false,
|
|
802
|
+
costcoins: 0,
|
|
803
|
+
costredcrystal: 0
|
|
755
804
|
}
|
|
756
805
|
];
|
|
757
806
|
function calculateModifiers(equippedWeapon, weaponName, hasCritRhythm) {
|
|
@@ -813,6 +862,33 @@ function apply(ctx, config) {
|
|
|
813
862
|
return passiveEffect;
|
|
814
863
|
}
|
|
815
864
|
__name(calculatePassiveEffects, "calculatePassiveEffects");
|
|
865
|
+
async function calculateCareerBonus(ctx2, handle, currentDamage, weaponType) {
|
|
866
|
+
const [careerData] = await ctx2.database.get("ggcevo_careers", { handle });
|
|
867
|
+
const career = careerData?.career;
|
|
868
|
+
const faction = careerData?.group;
|
|
869
|
+
let message = "";
|
|
870
|
+
let multiplier = 1;
|
|
871
|
+
if (career === "警卫长") {
|
|
872
|
+
multiplier = 1.05;
|
|
873
|
+
message = "⚔️ 职业加成:警卫长(攻击伤害+5%)";
|
|
874
|
+
} else if (career === "武器中士") {
|
|
875
|
+
multiplier = 1.1;
|
|
876
|
+
message = "⚔️ 职业加成:武器中士(攻击伤害+10%)";
|
|
877
|
+
}
|
|
878
|
+
if (faction === "辛迪加海盗" && career === "能量武器专家") {
|
|
879
|
+
if (weaponType === "能量") {
|
|
880
|
+
multiplier *= 1.15;
|
|
881
|
+
message = "⚡ 职业加成:能量武器专家(能量武器伤害+15%)";
|
|
882
|
+
} else {
|
|
883
|
+
message = "⚠️ 能量武器专家:未装备能量武器,加成未生效";
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
return {
|
|
887
|
+
damage: currentDamage * multiplier,
|
|
888
|
+
message: message || void 0
|
|
889
|
+
};
|
|
890
|
+
}
|
|
891
|
+
__name(calculateCareerBonus, "calculateCareerBonus");
|
|
816
892
|
function calculateRankBonus(rankRecord) {
|
|
817
893
|
if (!rankRecord || rankRecord.rank <= 0) return 0;
|
|
818
894
|
return Math.floor(rankRecord.rank / 400) * 0.01;
|
|
@@ -825,6 +901,7 @@ function apply(ctx, config) {
|
|
|
825
901
|
const handle = `${regionId}-S2-${realmId}-${profileId}`;
|
|
826
902
|
const weaponConfigEntry = Object.entries(weaponConfig).find(([_, c]) => c.id === equippedWeapon.weaponId);
|
|
827
903
|
const [weaponName, weaponData] = weaponConfigEntry;
|
|
904
|
+
const weaponType = weaponData.type;
|
|
828
905
|
let damage = weaponData.damage * (1 + 0.1 * equippedWeapon.level);
|
|
829
906
|
const [critRhythmEffect] = await ctx2.database.get("ggcevo_Wish_Record", {
|
|
830
907
|
handle,
|
|
@@ -846,6 +923,15 @@ function apply(ctx, config) {
|
|
|
846
923
|
damage *= 1 + tagMultiplier;
|
|
847
924
|
const passiveMultiplier = calculatePassiveEffects(targetBoss);
|
|
848
925
|
damage *= 1 + passiveMultiplier;
|
|
926
|
+
const { damage: careerDamage, message: careerMessage } = await calculateCareerBonus(
|
|
927
|
+
ctx2,
|
|
928
|
+
handle,
|
|
929
|
+
damage,
|
|
930
|
+
weaponType
|
|
931
|
+
// 新增参数
|
|
932
|
+
);
|
|
933
|
+
damage = careerDamage;
|
|
934
|
+
if (careerMessage) effectMessage.push(careerMessage);
|
|
849
935
|
const [sovereignEffect] = await ctx2.database.get("ggcevo_Wish_Record", {
|
|
850
936
|
handle,
|
|
851
937
|
wishname: "王权增幅",
|
|
@@ -1032,9 +1118,10 @@ function apply(ctx, config) {
|
|
|
1032
1118
|
__name(activateNextBossGroup, "activateNextBossGroup");
|
|
1033
1119
|
ctx.setInterval(async () => {
|
|
1034
1120
|
const totalBosses = await ctx.database.select("ggcevo_boss").execute((row) => import_koishi.$.count(row.name));
|
|
1121
|
+
const [groupId] = config.groupId;
|
|
1035
1122
|
if (totalBosses === 0) {
|
|
1036
1123
|
await activateNextBossGroup();
|
|
1037
|
-
await ctx.broadcast(
|
|
1124
|
+
await ctx.broadcast([groupId], `🔄 咕咕PVE系统已初始化,首个主宰已登场!`);
|
|
1038
1125
|
return;
|
|
1039
1126
|
}
|
|
1040
1127
|
const now = /* @__PURE__ */ new Date();
|
|
@@ -1048,7 +1135,8 @@ function apply(ctx, config) {
|
|
|
1048
1135
|
groupId: group.groupId
|
|
1049
1136
|
});
|
|
1050
1137
|
await activateNextBossGroup(group.groupId);
|
|
1051
|
-
|
|
1138
|
+
const [groupId2] = config.groupId;
|
|
1139
|
+
await ctx.broadcast([groupId2], `🔄 新的主宰已刷新,快去挑战吧!`);
|
|
1052
1140
|
}
|
|
1053
1141
|
}, 60 * 1e3);
|
|
1054
1142
|
const PassiveHandler = {
|
|
@@ -1178,8 +1266,135 @@ function apply(ctx, config) {
|
|
|
1178
1266
|
}]
|
|
1179
1267
|
};
|
|
1180
1268
|
}, "handleSurvivalInstinct"),
|
|
1269
|
+
// 感染空间站处理
|
|
1270
|
+
handleInfectedStation: /* @__PURE__ */ __name(async (ctx2, targetBoss, initialDamage, bossGroup) => {
|
|
1271
|
+
if (targetBoss.name !== "空间站感染虫" || !targetBoss.skills.includes("感染空间站")) {
|
|
1272
|
+
return null;
|
|
1273
|
+
}
|
|
1274
|
+
const sentryConfig = bossGroup.minions.find((m) => m.name === "空间站哨枪塔");
|
|
1275
|
+
if (!sentryConfig) return null;
|
|
1276
|
+
const [sentryGun] = await ctx2.database.get("ggcevo_boss", {
|
|
1277
|
+
name: "空间站哨枪塔",
|
|
1278
|
+
isActive: true
|
|
1279
|
+
});
|
|
1280
|
+
if (sentryGun) {
|
|
1281
|
+
const newDamage = Math.floor(initialDamage * 0.5);
|
|
1282
|
+
return {
|
|
1283
|
+
initialDamage: newDamage,
|
|
1284
|
+
messages: ["🛡️ 【感染空间站】生效:空间站哨枪塔存活,伤害减少50%"]
|
|
1285
|
+
};
|
|
1286
|
+
}
|
|
1287
|
+
return null;
|
|
1288
|
+
}, "handleInfectedStation"),
|
|
1289
|
+
// 霉菌滋生处理
|
|
1290
|
+
handleMoldGrowth: /* @__PURE__ */ __name(async (ctx2, targetBoss, bossGroup) => {
|
|
1291
|
+
if (!targetBoss.skills.includes("霉菌滋生")) {
|
|
1292
|
+
return null;
|
|
1293
|
+
}
|
|
1294
|
+
const sentryConfig = bossGroup.minions.find((m) => m.name === "空间站哨枪塔");
|
|
1295
|
+
if (!sentryConfig) return null;
|
|
1296
|
+
const [sentryGun] = await ctx2.database.get("ggcevo_boss", {
|
|
1297
|
+
name: "空间站哨枪塔",
|
|
1298
|
+
isActive: true
|
|
1299
|
+
});
|
|
1300
|
+
if (sentryGun) {
|
|
1301
|
+
const healAmount = Math.floor(sentryConfig.maxHP * 0.01);
|
|
1302
|
+
const newHP = Math.min(sentryGun.HP + healAmount, sentryConfig.maxHP);
|
|
1303
|
+
await ctx2.database.set(
|
|
1304
|
+
"ggcevo_boss",
|
|
1305
|
+
{ name: "空间站哨枪塔" },
|
|
1306
|
+
{ HP: newHP }
|
|
1307
|
+
);
|
|
1308
|
+
return {
|
|
1309
|
+
messages: [`🦠 【霉菌滋生】生效:空间站哨枪塔回复1%最大生命值(+${healAmount}HP)`]
|
|
1310
|
+
};
|
|
1311
|
+
}
|
|
1312
|
+
return null;
|
|
1313
|
+
}, "handleMoldGrowth"),
|
|
1314
|
+
// 岗哨机枪处理
|
|
1315
|
+
handleSentryGun: /* @__PURE__ */ __name(async (ctx2, targetBoss, bossGroup) => {
|
|
1316
|
+
if (targetBoss.name !== "空间站哨枪塔" || !targetBoss.skills.includes("岗哨机枪")) {
|
|
1317
|
+
return null;
|
|
1318
|
+
}
|
|
1319
|
+
const newCount = (targetBoss.Skillcountpoints || 0) + 1;
|
|
1320
|
+
await ctx2.database.set(
|
|
1321
|
+
"ggcevo_boss",
|
|
1322
|
+
{ name: targetBoss.name },
|
|
1323
|
+
{ Skillcountpoints: newCount }
|
|
1324
|
+
);
|
|
1325
|
+
if (newCount >= 10) {
|
|
1326
|
+
const getMaxHP = /* @__PURE__ */ __name((name2) => {
|
|
1327
|
+
if (name2 === "空间站感染虫") return bossGroup.main.maxHP;
|
|
1328
|
+
const minion = bossGroup.minions.find((m) => m.name === name2);
|
|
1329
|
+
return minion?.maxHP || 0;
|
|
1330
|
+
}, "getMaxHP");
|
|
1331
|
+
const updates = [];
|
|
1332
|
+
const messages = [];
|
|
1333
|
+
const [infectionBug] = await ctx2.database.get("ggcevo_boss", {
|
|
1334
|
+
name: "空间站感染虫",
|
|
1335
|
+
isActive: true
|
|
1336
|
+
});
|
|
1337
|
+
if (infectionBug) {
|
|
1338
|
+
const maxHP = getMaxHP("空间站感染虫");
|
|
1339
|
+
const heal = Math.floor(maxHP * 0.1);
|
|
1340
|
+
updates.push(
|
|
1341
|
+
ctx2.database.set(
|
|
1342
|
+
"ggcevo_boss",
|
|
1343
|
+
{ name: infectionBug.name },
|
|
1344
|
+
{ HP: Math.min(infectionBug.HP + heal, maxHP) }
|
|
1345
|
+
)
|
|
1346
|
+
);
|
|
1347
|
+
messages.push(`主宰回复${heal}HP`);
|
|
1348
|
+
}
|
|
1349
|
+
const [mechaBug] = await ctx2.database.get("ggcevo_boss", {
|
|
1350
|
+
name: "机械感染虫",
|
|
1351
|
+
isActive: true
|
|
1352
|
+
});
|
|
1353
|
+
if (mechaBug) {
|
|
1354
|
+
const maxHP = getMaxHP("机械感染虫");
|
|
1355
|
+
const heal = Math.floor(maxHP * 0.1);
|
|
1356
|
+
updates.push(
|
|
1357
|
+
ctx2.database.set(
|
|
1358
|
+
"ggcevo_boss",
|
|
1359
|
+
{ name: mechaBug.name },
|
|
1360
|
+
{ HP: Math.min(mechaBug.HP + heal, maxHP) }
|
|
1361
|
+
)
|
|
1362
|
+
);
|
|
1363
|
+
messages.push(`机械感染虫回复${heal}HP`);
|
|
1364
|
+
}
|
|
1365
|
+
updates.push(
|
|
1366
|
+
ctx2.database.set(
|
|
1367
|
+
"ggcevo_boss",
|
|
1368
|
+
{ name: targetBoss.name },
|
|
1369
|
+
{ Skillcountpoints: 0 }
|
|
1370
|
+
)
|
|
1371
|
+
);
|
|
1372
|
+
await Promise.all(updates);
|
|
1373
|
+
return {
|
|
1374
|
+
messages: ["🔫 【岗哨机枪】触发:" + messages.join(",")]
|
|
1375
|
+
};
|
|
1376
|
+
}
|
|
1377
|
+
return null;
|
|
1378
|
+
}, "handleSentryGun"),
|
|
1379
|
+
// 结构装甲处理
|
|
1380
|
+
handleStructuralArmor: /* @__PURE__ */ __name((targetBoss, initialDamage, weaponData) => {
|
|
1381
|
+
if (targetBoss.name !== "空间站哨枪塔" || !targetBoss.skills.includes("结构装甲")) {
|
|
1382
|
+
return null;
|
|
1383
|
+
}
|
|
1384
|
+
let reduction = 0.2;
|
|
1385
|
+
let msg = "常规减伤20%";
|
|
1386
|
+
if (weaponData.type === "能量武器") {
|
|
1387
|
+
reduction = 0.4;
|
|
1388
|
+
msg = "能量武器减伤40%";
|
|
1389
|
+
}
|
|
1390
|
+
const newDamage = Math.floor(initialDamage * (1 - reduction));
|
|
1391
|
+
return {
|
|
1392
|
+
initialDamage: newDamage,
|
|
1393
|
+
messages: [`🛡️ 【结构装甲】生效:${msg}`]
|
|
1394
|
+
};
|
|
1395
|
+
}, "handleStructuralArmor"),
|
|
1181
1396
|
// 统一处理被动技能(关键修复部分)
|
|
1182
|
-
handlePassives: /* @__PURE__ */ __name(async function(ctx2, targetBoss, initialDamage, currentHP, maxHP, weaponName, baseDamage, activeBosses, bossGroup) {
|
|
1397
|
+
handlePassives: /* @__PURE__ */ __name(async function(ctx2, targetBoss, initialDamage, currentHP, maxHP, weaponName, weaponData, baseDamage, activeBosses, bossGroup) {
|
|
1183
1398
|
let messages = [];
|
|
1184
1399
|
let skillUpdates = [];
|
|
1185
1400
|
if (currentHP <= 0 && !targetBoss.skills.includes("求生本能I") && !targetBoss.skills.includes("求生本能II")) {
|
|
@@ -1221,6 +1436,24 @@ function apply(ctx, config) {
|
|
|
1221
1436
|
messages.push(...survivalResult.messages);
|
|
1222
1437
|
skillUpdates.push(...survivalResult.skillUpdates);
|
|
1223
1438
|
}
|
|
1439
|
+
const infectionResult = await this.handleInfectedStation(ctx2, targetBoss, initialDamage, bossGroup);
|
|
1440
|
+
if (infectionResult) {
|
|
1441
|
+
initialDamage = infectionResult.initialDamage;
|
|
1442
|
+
messages.push(...infectionResult.messages);
|
|
1443
|
+
}
|
|
1444
|
+
const armorResult = this.handleStructuralArmor(targetBoss, initialDamage, weaponData);
|
|
1445
|
+
if (armorResult) {
|
|
1446
|
+
initialDamage = armorResult.initialDamage;
|
|
1447
|
+
messages.push(...armorResult.messages);
|
|
1448
|
+
}
|
|
1449
|
+
const sentryResult = await this.handleSentryGun(ctx2, targetBoss, bossGroup);
|
|
1450
|
+
if (sentryResult) {
|
|
1451
|
+
messages.push(...sentryResult.messages);
|
|
1452
|
+
}
|
|
1453
|
+
const moldResult = await this.handleMoldGrowth(ctx2, targetBoss, bossGroup);
|
|
1454
|
+
if (moldResult) {
|
|
1455
|
+
messages.push(...moldResult.messages);
|
|
1456
|
+
}
|
|
1224
1457
|
return { currentHP, messages, skillUpdates, initialDamage };
|
|
1225
1458
|
}, "handlePassives"),
|
|
1226
1459
|
// 应用技能更新到数据库
|
|
@@ -1248,14 +1481,20 @@ function apply(ctx, config) {
|
|
|
1248
1481
|
totalDamage: { $gt: 0 }
|
|
1249
1482
|
}).orderBy("totalDamage", "desc").execute();
|
|
1250
1483
|
const rewardMessages = [];
|
|
1251
|
-
const broadcastMessages = [];
|
|
1252
1484
|
const rewardMap = /* @__PURE__ */ new Map();
|
|
1253
1485
|
const updatePromises = [];
|
|
1486
|
+
const handles = damageRecords.map((r) => r.handle);
|
|
1487
|
+
const pirateCleaners = await ctx2.database.get("ggcevo_careers", {
|
|
1488
|
+
handle: { $in: handles },
|
|
1489
|
+
group: "辛迪加海盗",
|
|
1490
|
+
career: "清洁工"
|
|
1491
|
+
});
|
|
1492
|
+
const cleanerHandles = new Set(pirateCleaners.map((c) => c.handle));
|
|
1254
1493
|
if (damageRecords.length > 0) {
|
|
1255
1494
|
const top20 = damageRecords.slice(0, 20);
|
|
1256
1495
|
top20.forEach((record, index) => {
|
|
1257
1496
|
const rank = index + 1;
|
|
1258
|
-
let guguCoins, gold;
|
|
1497
|
+
let guguCoins = 5, gold = 500;
|
|
1259
1498
|
switch (true) {
|
|
1260
1499
|
case rank === 1:
|
|
1261
1500
|
guguCoins = 10;
|
|
@@ -1273,44 +1512,80 @@ function apply(ctx, config) {
|
|
|
1273
1512
|
guguCoins = 5;
|
|
1274
1513
|
gold = 1e3;
|
|
1275
1514
|
break;
|
|
1276
|
-
default:
|
|
1277
|
-
guguCoins = 5;
|
|
1278
|
-
gold = 500;
|
|
1279
1515
|
}
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1516
|
+
let redCrystal = 0;
|
|
1517
|
+
if (cleanerHandles.has(record.handle)) {
|
|
1518
|
+
switch (true) {
|
|
1519
|
+
case rank === 1:
|
|
1520
|
+
redCrystal = 25;
|
|
1521
|
+
break;
|
|
1522
|
+
case rank === 2:
|
|
1523
|
+
redCrystal = 20;
|
|
1524
|
+
break;
|
|
1525
|
+
case rank === 3:
|
|
1526
|
+
redCrystal = 15;
|
|
1527
|
+
break;
|
|
1528
|
+
case rank <= 10:
|
|
1529
|
+
redCrystal = 10;
|
|
1530
|
+
break;
|
|
1531
|
+
case rank <= 20:
|
|
1532
|
+
redCrystal = 5;
|
|
1533
|
+
break;
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
const reward = {
|
|
1537
|
+
guguCoins,
|
|
1538
|
+
gold,
|
|
1539
|
+
redCrystal,
|
|
1284
1540
|
playerName: record.playerName
|
|
1285
|
-
}
|
|
1541
|
+
};
|
|
1542
|
+
rewardMap.set(record.handle, reward);
|
|
1286
1543
|
rewardMessages.push(
|
|
1287
1544
|
`${rank}. ${record.playerName}`,
|
|
1288
|
-
` 获得奖励: ${guguCoins} 咕咕币 + ${gold} 金币`
|
|
1545
|
+
` 获得奖励: ${guguCoins} 咕咕币 + ${gold} 金币` + (redCrystal > 0 ? ` + ${redCrystal} 红晶` : "")
|
|
1289
1546
|
);
|
|
1290
1547
|
});
|
|
1291
1548
|
const others = damageRecords.slice(20);
|
|
1292
1549
|
if (others.length > 0) {
|
|
1293
1550
|
others.forEach((record) => {
|
|
1294
|
-
const
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1551
|
+
const baseReward = {
|
|
1552
|
+
guguCoins: 3,
|
|
1553
|
+
gold: 200,
|
|
1554
|
+
redCrystal: cleanerHandles.has(record.handle) ? 3 : 0,
|
|
1298
1555
|
playerName: record.playerName
|
|
1299
|
-
}
|
|
1556
|
+
};
|
|
1557
|
+
rewardMap.set(record.handle, baseReward);
|
|
1300
1558
|
});
|
|
1301
|
-
rewardMessages.push(`其他参与者各获得: 3 咕咕币 +
|
|
1559
|
+
rewardMessages.push(`其他参与者各获得: 3 咕咕币 + 200 金币` + (cleanerHandles.size > 0 ? " (清洁工额外+3红晶)" : ""));
|
|
1302
1560
|
}
|
|
1303
1561
|
const doubleRewardPlayers = await handleDoubleRewards(ctx2, damageRecords, rewardMap);
|
|
1304
1562
|
await applyDoubleRewards(ctx2, doubleRewardPlayers, rewardMap, rewardMessages);
|
|
1305
|
-
await
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1563
|
+
await ctx2.database.withTransaction(async () => {
|
|
1564
|
+
for (const [handle, reward] of rewardMap) {
|
|
1565
|
+
const [signData] = await ctx2.database.get("ggcevo_sign", { handle });
|
|
1566
|
+
await ctx2.database.upsert("ggcevo_sign", [{
|
|
1567
|
+
handle,
|
|
1568
|
+
totalRewards: (signData?.totalRewards || 0) + reward.gold
|
|
1569
|
+
}], ["handle"]);
|
|
1570
|
+
const [backpackData] = await ctx2.database.get("ggcevo_backpack", {
|
|
1571
|
+
handle,
|
|
1572
|
+
itemId: 1
|
|
1573
|
+
});
|
|
1574
|
+
await ctx2.database.upsert("ggcevo_backpack", [{
|
|
1575
|
+
handle,
|
|
1576
|
+
itemId: 1,
|
|
1577
|
+
quantity: (backpackData?.quantity || 0) + reward.guguCoins
|
|
1578
|
+
}], ["handle", "itemId"]);
|
|
1579
|
+
if (reward.redCrystal > 0) {
|
|
1580
|
+
const [careerData] = await ctx2.database.get("ggcevo_careers", { handle });
|
|
1581
|
+
await ctx2.database.upsert("ggcevo_careers", [{
|
|
1582
|
+
handle,
|
|
1583
|
+
redcrystal: (careerData?.redcrystal || 0) + reward.redCrystal
|
|
1584
|
+
}], ["handle"]);
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
});
|
|
1588
|
+
}
|
|
1314
1589
|
return { rewardMessages };
|
|
1315
1590
|
}
|
|
1316
1591
|
__name(handleBossDefeatRewards, "handleBossDefeatRewards");
|
|
@@ -1366,32 +1641,82 @@ function apply(ctx, config) {
|
|
|
1366
1641
|
}
|
|
1367
1642
|
}
|
|
1368
1643
|
__name(applyDoubleRewards, "applyDoubleRewards");
|
|
1369
|
-
async function
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1644
|
+
async function checkTransferRequirements(ctx2, handle, profession) {
|
|
1645
|
+
const [mainBoss] = await ctx2.database.get("ggcevo_boss", {
|
|
1646
|
+
type: "主宰",
|
|
1647
|
+
isActive: true
|
|
1648
|
+
});
|
|
1649
|
+
const [signData] = await ctx2.database.get("ggcevo_sign", { handle });
|
|
1650
|
+
const [careerData] = await ctx2.database.get("ggcevo_careers", { handle });
|
|
1651
|
+
const damageRecords = await ctx2.database.get("ggcevo_boss_damage", { handle });
|
|
1652
|
+
const totalAttack = damageRecords.reduce((sum, r) => sum + r.attackCount, 0);
|
|
1653
|
+
const totalDamage = damageRecords.reduce((sum, r) => sum + r.totalDamage, 0);
|
|
1654
|
+
switch (profession) {
|
|
1655
|
+
case "深空矿工":
|
|
1656
|
+
return {
|
|
1657
|
+
success: signData?.monthlyDays >= 14,
|
|
1658
|
+
message: `需要当月签到14天(当前${signData?.monthlyDays || 0}天)`
|
|
1659
|
+
};
|
|
1660
|
+
case "警卫员下士":
|
|
1661
|
+
if (!mainBoss) return { success: false, message: "当前暂无伤害榜。" };
|
|
1662
|
+
return {
|
|
1663
|
+
success: totalAttack >= 6,
|
|
1664
|
+
message: `需要累计攻击6次(当前${totalAttack}次)`
|
|
1665
|
+
};
|
|
1666
|
+
case "警卫长": {
|
|
1667
|
+
if (careerData?.career !== "警卫员下士") {
|
|
1668
|
+
return { success: false, message: "需要当前职业为警卫员下士" };
|
|
1669
|
+
}
|
|
1670
|
+
if (!mainBoss) return { success: false, message: "当前暂无伤害榜。" };
|
|
1671
|
+
const top3 = await ctx2.database.select("ggcevo_boss_damage").where({
|
|
1672
|
+
bossGroupId: mainBoss?.groupId,
|
|
1673
|
+
handle
|
|
1674
|
+
}).orderBy("totalDamage", "desc").limit(3).execute();
|
|
1675
|
+
const isInTop3 = top3.some((r) => r.handle === handle);
|
|
1676
|
+
return {
|
|
1677
|
+
success: isInTop3,
|
|
1678
|
+
message: "需要当前伤害榜前三名"
|
|
1679
|
+
};
|
|
1680
|
+
}
|
|
1681
|
+
case "武器中士":
|
|
1682
|
+
if (!mainBoss) return { success: false, message: "当前暂无伤害榜。" };
|
|
1683
|
+
return {
|
|
1684
|
+
success: totalDamage >= 300,
|
|
1685
|
+
message: `需要累计造成300伤害(当前${totalDamage})`
|
|
1686
|
+
};
|
|
1687
|
+
case "能量武器专家":
|
|
1688
|
+
const weapons = await ctx2.database.get("ggcevo_equipment", {
|
|
1381
1689
|
handle,
|
|
1382
|
-
|
|
1690
|
+
level: { $gte: 6 }
|
|
1383
1691
|
});
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1692
|
+
const hasEnergyWeapon = weapons.some((weapon) => {
|
|
1693
|
+
const weaponConfigEntry = Object.values(weaponConfig).find((c) => c.id === weapon.weaponId);
|
|
1694
|
+
return weaponConfigEntry?.type === "能量";
|
|
1695
|
+
});
|
|
1696
|
+
return {
|
|
1697
|
+
success: hasEnergyWeapon,
|
|
1698
|
+
message: `需要拥有一把等级6以上的能量武器`
|
|
1699
|
+
};
|
|
1700
|
+
case "清洁工":
|
|
1701
|
+
if (!mainBoss) return { success: false, message: "当前暂无伤害榜。" };
|
|
1702
|
+
const cleanTop3 = await ctx2.database.select("ggcevo_boss_damage").where({
|
|
1703
|
+
bossGroupId: mainBoss.groupId
|
|
1704
|
+
}).orderBy("totalDamage", "desc").limit(3).execute();
|
|
1705
|
+
const isCleanTop3 = cleanTop3.some((r) => r.handle === handle);
|
|
1706
|
+
return {
|
|
1707
|
+
success: isCleanTop3,
|
|
1708
|
+
message: "需要当前主宰伤害榜前三名"
|
|
1709
|
+
};
|
|
1710
|
+
case "辛迪加财务经理":
|
|
1711
|
+
return {
|
|
1712
|
+
success: signData?.monthlyDays >= 28,
|
|
1713
|
+
message: `需要当月累计签到28天(当前${signData?.monthlyDays || 0}天)`
|
|
1714
|
+
};
|
|
1715
|
+
default:
|
|
1716
|
+
return { success: false, message: "未知职业要求" };
|
|
1391
1717
|
}
|
|
1392
|
-
await Promise.all(updatePromises);
|
|
1393
1718
|
}
|
|
1394
|
-
__name(
|
|
1719
|
+
__name(checkTransferRequirements, "checkTransferRequirements");
|
|
1395
1720
|
ctx.command("ggcevo/抽奖").action(async (argv) => {
|
|
1396
1721
|
const session = argv.session;
|
|
1397
1722
|
let winCount = 0;
|
|
@@ -1617,25 +1942,51 @@ ${itemDetails.join("\n")}`;
|
|
|
1617
1942
|
} else if (monthlyDays >= 28) {
|
|
1618
1943
|
points = getRandomInt(100, 200);
|
|
1619
1944
|
}
|
|
1945
|
+
let redCrystal = 0;
|
|
1946
|
+
let careerCrystalMessage = "";
|
|
1620
1947
|
if (meowEffect) {
|
|
1621
1948
|
tickets *= 2;
|
|
1622
1949
|
points *= 2;
|
|
1623
1950
|
effectMessage = "\n🐾 喵喵财源祈愿生效,获得双倍奖励!";
|
|
1624
1951
|
}
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
}
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1952
|
+
let careerMessage = "";
|
|
1953
|
+
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
1954
|
+
if (careerData?.career === "深空矿工") {
|
|
1955
|
+
points = Math.round(points * 1.5);
|
|
1956
|
+
careerMessage = "\n⛏️ 深空矿工职业加成:额外获得50%金币!";
|
|
1957
|
+
}
|
|
1958
|
+
if (careerData?.group === "辛迪加海盗" && careerData.career === "辛迪加财务经理") {
|
|
1959
|
+
if (monthlyDays < 7) {
|
|
1960
|
+
redCrystal = 1;
|
|
1961
|
+
} else if (monthlyDays < 14) {
|
|
1962
|
+
redCrystal = 2;
|
|
1963
|
+
} else if (monthlyDays < 21) {
|
|
1964
|
+
redCrystal = 3;
|
|
1965
|
+
} else if (monthlyDays < 28) {
|
|
1966
|
+
redCrystal = 4;
|
|
1967
|
+
} else {
|
|
1968
|
+
redCrystal = 5;
|
|
1969
|
+
}
|
|
1970
|
+
careerCrystalMessage = `
|
|
1971
|
+
⚓ 辛迪加财务经理职业加成:获得 ${redCrystal} 红晶`;
|
|
1972
|
+
}
|
|
1973
|
+
await ctx.database.withTransaction(async () => {
|
|
1974
|
+
await ctx.database.upsert("ggcevo_sign", [{
|
|
1975
|
+
handle,
|
|
1976
|
+
lastSign: now,
|
|
1977
|
+
monthlyDays,
|
|
1978
|
+
totalRewards: (record?.totalRewards || 0) + points
|
|
1979
|
+
}]);
|
|
1980
|
+
if (redCrystal > 0) {
|
|
1981
|
+
await ctx.database.upsert("ggcevo_careers", [{
|
|
1982
|
+
handle,
|
|
1983
|
+
redcrystal: (careerData.redcrystal || 0) + redCrystal
|
|
1984
|
+
}], ["handle"]);
|
|
1985
|
+
}
|
|
1986
|
+
});
|
|
1636
1987
|
return `签到成功!本月累计签到${monthlyDays}天,获得:
|
|
1637
1988
|
💰 金币 x ${points}
|
|
1638
|
-
🪙 咕咕币 x ${tickets}` + effectMessage;
|
|
1989
|
+
🪙 咕咕币 x ${tickets}` + effectMessage + careerMessage + careerCrystalMessage;
|
|
1639
1990
|
} catch (error) {
|
|
1640
1991
|
console.error("签到命令时发生错误:", error);
|
|
1641
1992
|
return "服务器繁忙,请稍后尝试。";
|
|
@@ -2736,7 +3087,8 @@ ${achievementList.join("\n")}`;
|
|
|
2736
3087
|
`玩家数: ${lobby.slotsHumansTaken}/${lobby.slotsHumansTotal}`,
|
|
2737
3088
|
`🏆 安全玩家:${atElements || "无"}`
|
|
2738
3089
|
].join("\n");
|
|
2739
|
-
|
|
3090
|
+
const [groupId] = config.groupId;
|
|
3091
|
+
await ctx.broadcast([groupId], message);
|
|
2740
3092
|
processedLobbies.add(lobby.id);
|
|
2741
3093
|
}
|
|
2742
3094
|
}
|
|
@@ -2902,6 +3254,18 @@ ${achievementList.join("\n")}`;
|
|
|
2902
3254
|
await ctx.database.set("ggcevo_sign", initiatorHandle, { totalRewards: initiatorGold - goldTransfer });
|
|
2903
3255
|
await ctx.database.set("ggcevo_sign", targetHandle, { totalRewards: targetGold + goldTransfer });
|
|
2904
3256
|
}
|
|
3257
|
+
if (isWin) {
|
|
3258
|
+
const [initiatorCareer] = await ctx.database.get("ggcevo_careers", {
|
|
3259
|
+
handle: initiatorHandle
|
|
3260
|
+
});
|
|
3261
|
+
if (initiatorCareer?.group === "辛迪加海盗") {
|
|
3262
|
+
await ctx.database.upsert("ggcevo_careers", [{
|
|
3263
|
+
handle: initiatorHandle,
|
|
3264
|
+
redcrystal: (initiatorCareer.redcrystal || 0) + 1
|
|
3265
|
+
}], ["handle"]);
|
|
3266
|
+
result.push(`🔴 海盗阵营奖励:获得1红晶`);
|
|
3267
|
+
}
|
|
3268
|
+
}
|
|
2905
3269
|
});
|
|
2906
3270
|
const result = [
|
|
2907
3271
|
`⚔️【对战结果】${isWin ? "胜利" : "失败"}`,
|
|
@@ -2975,6 +3339,8 @@ ${achievementList.join("\n")}`;
|
|
|
2975
3339
|
const remaining = 3 - diffDays;
|
|
2976
3340
|
return `状态切换冷却中,${remaining}天后再试(下次可切换时间:${new Date(lastToggle.getTime() + 3 * 864e5).toLocaleDateString("zh-CN")})。`;
|
|
2977
3341
|
}
|
|
3342
|
+
const [careers] = await ctx.database.get("ggcevo_careers", { handle });
|
|
3343
|
+
if (careers?.group === "辛迪加海盗") return "您已经加入了辛迪加海盗,无法切换PK状态!";
|
|
2978
3344
|
const action = currentState ? "关闭" : "开启";
|
|
2979
3345
|
await session.send(`您当前的PK状态为【${currentState ? "开启" : "关闭"}】,确认要${action}吗?(请在30秒内回复“是”确认)`);
|
|
2980
3346
|
const confirm = await session.prompt(3e4);
|
|
@@ -3115,7 +3481,7 @@ ${validTypes.join("、")}`;
|
|
|
3115
3481
|
}));
|
|
3116
3482
|
return [
|
|
3117
3483
|
"🛡️ 您当前拥有的武器",
|
|
3118
|
-
'使用"
|
|
3484
|
+
'使用"装备武器 武器名称"来装备武器',
|
|
3119
3485
|
"⚡表示当前装备武器",
|
|
3120
3486
|
"────────────────",
|
|
3121
3487
|
...weaponDetails.length ? weaponDetails : ["空空如也,快去“武器库”看看吧!"],
|
|
@@ -3355,6 +3721,7 @@ ${validTypes.join("、")}`;
|
|
|
3355
3721
|
currentHP,
|
|
3356
3722
|
maxHP,
|
|
3357
3723
|
weaponName,
|
|
3724
|
+
weaponData,
|
|
3358
3725
|
baseDamage,
|
|
3359
3726
|
activeBosses,
|
|
3360
3727
|
bossGroup
|
|
@@ -3417,15 +3784,9 @@ ${validTypes.join("、")}`;
|
|
|
3417
3784
|
}
|
|
3418
3785
|
);
|
|
3419
3786
|
const groupId = targetBoss.groupId;
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
isActive: true
|
|
3424
|
-
});
|
|
3425
|
-
const broadcastMessages = [
|
|
3426
|
-
`⚡ ${session.username} 击败了子代 ${targetBoss.name}!`
|
|
3427
|
-
];
|
|
3428
|
-
if (remainingMinions.length === 0) {
|
|
3787
|
+
let remainingMinions = [];
|
|
3788
|
+
let broadcastMessages = [];
|
|
3789
|
+
if (targetBoss.name === "机械感染虫") {
|
|
3429
3790
|
const [mainBoss] = await ctx.database.get("ggcevo_boss", {
|
|
3430
3791
|
groupId,
|
|
3431
3792
|
type: "主宰",
|
|
@@ -3435,7 +3796,26 @@ ${validTypes.join("、")}`;
|
|
|
3435
3796
|
await ctx.database.set("ggcevo_boss", { name: mainBoss.name }, {
|
|
3436
3797
|
skills: [...mainBoss.skills, "孤立无援"]
|
|
3437
3798
|
});
|
|
3438
|
-
broadcastMessages.push("💥
|
|
3799
|
+
broadcastMessages.push("💥 机械感染虫被消灭,空间站感染虫进入【孤立无援】状态,受到的伤害+20%!");
|
|
3800
|
+
}
|
|
3801
|
+
} else {
|
|
3802
|
+
remainingMinions = await ctx.database.get("ggcevo_boss", {
|
|
3803
|
+
groupId,
|
|
3804
|
+
type: "子代",
|
|
3805
|
+
isActive: true
|
|
3806
|
+
});
|
|
3807
|
+
if (remainingMinions.length === 0) {
|
|
3808
|
+
const [mainBoss] = await ctx.database.get("ggcevo_boss", {
|
|
3809
|
+
groupId,
|
|
3810
|
+
type: "主宰",
|
|
3811
|
+
isActive: true
|
|
3812
|
+
});
|
|
3813
|
+
if (mainBoss && !mainBoss.skills.includes("孤立无援")) {
|
|
3814
|
+
await ctx.database.set("ggcevo_boss", { name: mainBoss.name }, {
|
|
3815
|
+
skills: [...mainBoss.skills, "孤立无援"]
|
|
3816
|
+
});
|
|
3817
|
+
broadcastMessages.push("💥 所有子代已阵亡,主宰进入【孤立无援】状态,受到的伤害+20%!");
|
|
3818
|
+
}
|
|
3439
3819
|
}
|
|
3440
3820
|
}
|
|
3441
3821
|
broadcastMessage = broadcastMessages;
|
|
@@ -3449,31 +3829,42 @@ ${validTypes.join("、")}`;
|
|
|
3449
3829
|
}
|
|
3450
3830
|
);
|
|
3451
3831
|
}
|
|
3832
|
+
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
3833
|
+
const career = careerData?.career;
|
|
3834
|
+
let careerMultiplier = 1;
|
|
3835
|
+
let careerMessage = "";
|
|
3836
|
+
if (career === "警卫员下士") {
|
|
3837
|
+
careerMultiplier = 1.5;
|
|
3838
|
+
careerMessage = "(+50% 警卫员下士职业加成)";
|
|
3839
|
+
} else if (career === "警卫长") {
|
|
3840
|
+
careerMultiplier = 2;
|
|
3841
|
+
careerMessage = "(+100% 警卫长职业加成)";
|
|
3842
|
+
}
|
|
3843
|
+
const finalReward = Math.round(initialDamage * careerMultiplier);
|
|
3452
3844
|
const [existingSign] = await ctx.database.get("ggcevo_sign", { handle });
|
|
3453
3845
|
await ctx.database.upsert("ggcevo_sign", [{
|
|
3454
3846
|
handle,
|
|
3455
|
-
totalRewards: (existingSign?.totalRewards || 0) +
|
|
3456
|
-
//
|
|
3847
|
+
totalRewards: (existingSign?.totalRewards || 0) + finalReward
|
|
3848
|
+
// 改用finalReward
|
|
3457
3849
|
}], ["handle"]);
|
|
3458
3850
|
const resultMessage = [
|
|
3459
3851
|
`🔥 ${session.username} 使用武器 ${weaponName} 对 ${targetBoss.name} 发起攻击!`,
|
|
3460
3852
|
...effectMessage.length > 0 ? [
|
|
3461
3853
|
`💫 祈愿效果:${effectMessage.join(" | ")}`
|
|
3462
3854
|
] : [],
|
|
3463
|
-
// 直接显示伤害数值和附加效果
|
|
3464
3855
|
`造成伤害:${initialDamage}${hasCrit ? "(✨ 暴击)" : ""}`,
|
|
3465
3856
|
...healMessages,
|
|
3466
|
-
//
|
|
3467
|
-
`获得金币:${
|
|
3857
|
+
// 修改金币显示行
|
|
3858
|
+
`获得金币:${finalReward}${careerMessage}`,
|
|
3468
3859
|
`目标剩余HP:${Math.max(currentHP, 0)}/${maxHP}`,
|
|
3469
3860
|
isDefeated ? `🎉 恭喜,您成功击败 ${targetBoss.name}!` : ""
|
|
3470
3861
|
].filter((line) => line).join("\n");
|
|
3471
3862
|
await session.send(resultMessage);
|
|
3472
3863
|
if (broadcastMessage) {
|
|
3473
3864
|
const finalBroadcast = Array.isArray(broadcastMessage) ? broadcastMessage.join("\n") : broadcastMessage;
|
|
3474
|
-
|
|
3865
|
+
const [groupId] = config2.groupId;
|
|
3866
|
+
await ctx.broadcast([groupId], finalBroadcast);
|
|
3475
3867
|
}
|
|
3476
|
-
return;
|
|
3477
3868
|
});
|
|
3478
3869
|
ctx.command("ggcevo/伤害榜 [page]", "查看当前主宰伤害排名").usage("输入 伤害榜 [页码] 查看对应页的排行榜,每页10条").action(async (_, page) => {
|
|
3479
3870
|
const pageNum = parseInt(page) || 1;
|
|
@@ -3504,7 +3895,7 @@ ${validTypes.join("、")}`;
|
|
|
3504
3895
|
pageNum < totalPages ? `输入 伤害榜 ${pageNum + 1} 查看下一页` : "已是最后一页"
|
|
3505
3896
|
].join("\n");
|
|
3506
3897
|
});
|
|
3507
|
-
ctx.command("ggcevo/异形信息", "查看当前主宰信息").alias("yx信息"
|
|
3898
|
+
ctx.command("ggcevo/异形信息", "查看当前主宰信息").alias("yx信息").action(async () => {
|
|
3508
3899
|
const activeBosses = await ctx.database.get("ggcevo_boss", { isActive: true });
|
|
3509
3900
|
if (!activeBosses.length) return "当前没有存活的异形,请等待1小时后刷新。";
|
|
3510
3901
|
const mainBoss = activeBosses.find((b) => b.type === "主宰");
|
|
@@ -3569,7 +3960,7 @@ ${validTypes.join("、")}`;
|
|
|
3569
3960
|
}
|
|
3570
3961
|
return `✅ 异形初始化成功!当前主宰:${bossConfig.main.name}(HP:${bossConfig.main.maxHP})`;
|
|
3571
3962
|
});
|
|
3572
|
-
ctx.command("ggcevo/祈愿").
|
|
3963
|
+
ctx.command("ggcevo/祈愿").action(async (argv) => {
|
|
3573
3964
|
const session = argv.session;
|
|
3574
3965
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
3575
3966
|
if (!profile) return "您暂未绑定句柄。";
|
|
@@ -3612,6 +4003,9 @@ ${validTypes.join("、")}`;
|
|
|
3612
4003
|
break;
|
|
3613
4004
|
case "酥手空空":
|
|
3614
4005
|
newGold = Math.max(0, newGold - 50);
|
|
4006
|
+
const kfcMsg = '🍗【疯狂星期四警报】有人抽中了"酥手空空"!钱包空空如也,现在急需好心人V他50金币!慈悲为怀的指挥官,速带黄金救场,解救同袍于水火!🆘';
|
|
4007
|
+
const [groupId] = config.groupId;
|
|
4008
|
+
await ctx.broadcast([groupId], kfcMsg);
|
|
3615
4009
|
break;
|
|
3616
4010
|
case "夜市赠礼":
|
|
3617
4011
|
const [backpack] = await ctx.database.get("ggcevo_backpack", { handle, itemId: 1 });
|
|
@@ -3650,7 +4044,7 @@ ${validTypes.join("、")}`;
|
|
|
3650
4044
|
const { regionId, realmId, profileId } = profile;
|
|
3651
4045
|
const handle = `${regionId}-S2-${realmId}-${profileId}`;
|
|
3652
4046
|
await session.send(`请输入你要使用多少张兑换券来兑换金币?(请在30秒内回复数字,回复“0”为取消兑换)
|
|
3653
|
-
注意:1张兑换券=
|
|
4047
|
+
注意:1张兑换券=2000金币`);
|
|
3654
4048
|
const exchangeInput = await session.prompt(3e4);
|
|
3655
4049
|
if (!exchangeInput) return "输入超时,请重新输入。";
|
|
3656
4050
|
const exchangeCount = parseInt(exchangeInput, 10);
|
|
@@ -3667,7 +4061,7 @@ ${validTypes.join("、")}`;
|
|
|
3667
4061
|
if (!item || item.quantity < exchangeCount) {
|
|
3668
4062
|
return "您的兑换券不足,无法兑换!";
|
|
3669
4063
|
}
|
|
3670
|
-
const goldAmount = exchangeCount *
|
|
4064
|
+
const goldAmount = exchangeCount * 2e3;
|
|
3671
4065
|
await ctx.database.set("ggcevo_backpack", {
|
|
3672
4066
|
handle,
|
|
3673
4067
|
itemId: 2
|
|
@@ -3679,6 +4073,189 @@ ${validTypes.join("、")}`;
|
|
|
3679
4073
|
});
|
|
3680
4074
|
return `成功使用${exchangeCount}张兑换券,获得${goldAmount}枚金币!`;
|
|
3681
4075
|
});
|
|
4076
|
+
ctx.command("ggcevo/加入 <faction>", "加入阵营").action(async ({ session }, faction) => {
|
|
4077
|
+
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
4078
|
+
if (!profile) return "您暂未绑定句柄。";
|
|
4079
|
+
const { regionId, realmId, profileId } = profile;
|
|
4080
|
+
const handle = `${regionId}-S2-${realmId}-${profileId}`;
|
|
4081
|
+
const validFactions = ["人类联盟", "辛迪加海盗"];
|
|
4082
|
+
if (!faction) return `请选择有效阵营:${validFactions.join(" / ")}`;
|
|
4083
|
+
if (!validFactions.includes(faction)) {
|
|
4084
|
+
return `请选择有效阵营:${validFactions.join(" / ")}`;
|
|
4085
|
+
}
|
|
4086
|
+
const [existing] = await ctx.database.get("ggcevo_careers", { handle });
|
|
4087
|
+
if (existing) {
|
|
4088
|
+
return `你已经加入${existing.group}阵营,当前职业:${existing.career}`;
|
|
4089
|
+
}
|
|
4090
|
+
const [signData] = await ctx.database.get("ggcevo_sign", { handle });
|
|
4091
|
+
const userCoins = signData?.totalRewards || 0;
|
|
4092
|
+
try {
|
|
4093
|
+
if (faction === "人类联盟") {
|
|
4094
|
+
if (userCoins < 1e3) {
|
|
4095
|
+
return `加入人类联盟需要1000金币,你当前拥有${userCoins}金币`;
|
|
4096
|
+
}
|
|
4097
|
+
await session.send(`请问你确定要缴纳1000金币加入人类联盟吗?(请在30秒内输入“是”确定加入)`);
|
|
4098
|
+
const cost = await session.prompt(3e4);
|
|
4099
|
+
if (!cost) return "已取消加入。";
|
|
4100
|
+
await ctx.database.upsert("ggcevo_sign", [{
|
|
4101
|
+
handle,
|
|
4102
|
+
totalRewards: signData?.totalRewards - 1e3
|
|
4103
|
+
}], ["handle"]);
|
|
4104
|
+
await ctx.database.create("ggcevo_careers", {
|
|
4105
|
+
handle,
|
|
4106
|
+
group: "人类联盟",
|
|
4107
|
+
career: "联盟新兵",
|
|
4108
|
+
redcrystal: 0,
|
|
4109
|
+
date: /* @__PURE__ */ new Date()
|
|
4110
|
+
});
|
|
4111
|
+
} else if (faction === "辛迪加海盗") {
|
|
4112
|
+
const [pkData] = await ctx.database.get("ggcevo_pk", { handle });
|
|
4113
|
+
if (userCoins < 2e3) {
|
|
4114
|
+
return `加入辛迪加海盗需要2000金币,你当前拥有${userCoins}金币`;
|
|
4115
|
+
}
|
|
4116
|
+
if (!pkData?.enable) {
|
|
4117
|
+
return "当前PK功能未开启,无法加入辛迪加海盗。";
|
|
4118
|
+
}
|
|
4119
|
+
await session.send(`请问你确定要缴纳2000金币并且永久开启PK功能加入辛迪加海盗吗?(请在30秒内输入“是”确定加入)`);
|
|
4120
|
+
const cost = await session.prompt(3e4);
|
|
4121
|
+
if (!cost) return "已取消加入。";
|
|
4122
|
+
await ctx.database.upsert("ggcevo_sign", [{
|
|
4123
|
+
handle,
|
|
4124
|
+
totalRewards: signData?.totalRewards - 2e3
|
|
4125
|
+
}], ["handle"]);
|
|
4126
|
+
await ctx.database.create("ggcevo_careers", {
|
|
4127
|
+
handle,
|
|
4128
|
+
group: "辛迪加海盗",
|
|
4129
|
+
career: "辛迪加炮灰新兵",
|
|
4130
|
+
redcrystal: 5,
|
|
4131
|
+
date: /* @__PURE__ */ new Date()
|
|
4132
|
+
});
|
|
4133
|
+
}
|
|
4134
|
+
return `花费了${faction === "人类联盟" ? "1000金币" : "2000金币"}成功加入${faction}!${faction === "人类联盟" ? "" : "获得5枚红晶,"}初始职业:${faction === "人类联盟" ? "联盟新兵" : "辛迪加炮灰新兵"}`;
|
|
4135
|
+
} catch (err) {
|
|
4136
|
+
ctx.logger.error("加入阵营失败:", err);
|
|
4137
|
+
return "加入阵营时发生错误,请稍后再试";
|
|
4138
|
+
}
|
|
4139
|
+
});
|
|
4140
|
+
ctx.command("ggcevo/转职 [profession]", "转职系统").action(async ({ session }, profession) => {
|
|
4141
|
+
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
4142
|
+
if (!profile) return "您暂未绑定句柄。";
|
|
4143
|
+
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
4144
|
+
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
4145
|
+
if (!careerData) return "请先加入阵营后使用转职功能。";
|
|
4146
|
+
let config2, factionTips;
|
|
4147
|
+
if (careerData.group === "人类联盟") {
|
|
4148
|
+
config2 = spaceStationCrewConfig;
|
|
4149
|
+
factionTips = "💰 转职消耗金币";
|
|
4150
|
+
} else if (careerData.group === "辛迪加海盗") {
|
|
4151
|
+
config2 = syndicatePirateConfig;
|
|
4152
|
+
factionTips = "💰 消耗金币 + 🔴 消耗红晶";
|
|
4153
|
+
} else {
|
|
4154
|
+
return "未知阵营无法显示职业信息。";
|
|
4155
|
+
}
|
|
4156
|
+
if (!profession) {
|
|
4157
|
+
const availableCareers = config2.filter(
|
|
4158
|
+
(p) => p.Jobtransfer && p.professionName !== careerData.career
|
|
4159
|
+
);
|
|
4160
|
+
const careerList = availableCareers.map((p) => {
|
|
4161
|
+
const info = [
|
|
4162
|
+
`🛠️ ${p.professionName}`,
|
|
4163
|
+
`▸ 效果:${p.effect || "暂无效果描述"}`,
|
|
4164
|
+
`▸ 需求:${p.requirements || "无特殊要求"}`,
|
|
4165
|
+
`▸ 消耗:${p.costcoins}金币` + (careerData.group === "辛迪加海盗" ? ` + ${p.costredcrystal}红晶` : "")
|
|
4166
|
+
];
|
|
4167
|
+
return info.join("\n");
|
|
4168
|
+
});
|
|
4169
|
+
return [
|
|
4170
|
+
`🎖️ ${careerData.group} 可转职列表(当前职业:${careerData.career})`,
|
|
4171
|
+
'使用"转职 职业名称"进行转职',
|
|
4172
|
+
"───────────────",
|
|
4173
|
+
...careerList.length ? careerList : ["暂无更多可转职职业"],
|
|
4174
|
+
"───────────────",
|
|
4175
|
+
"💡 转职后原有职业效果将被替换"
|
|
4176
|
+
].join("\n");
|
|
4177
|
+
}
|
|
4178
|
+
const targetProfession = config2.find((p) => p.professionName === profession);
|
|
4179
|
+
if (!targetProfession) return "该职业不存在。";
|
|
4180
|
+
if (!targetProfession.Jobtransfer) return "该职业无法直接转职。";
|
|
4181
|
+
if (careerData.career === profession) return "您已经是该职业了。";
|
|
4182
|
+
const requirementCheck = await checkTransferRequirements(ctx, handle, profession);
|
|
4183
|
+
if (!requirementCheck.success) {
|
|
4184
|
+
return `转职条件不满足:${requirementCheck.message}`;
|
|
4185
|
+
}
|
|
4186
|
+
const [signData] = await ctx.database.get("ggcevo_sign", { handle });
|
|
4187
|
+
const userCoins = signData?.totalRewards || 0;
|
|
4188
|
+
const userRedCrystal = careerData.redcrystal || 0;
|
|
4189
|
+
try {
|
|
4190
|
+
if (careerData.group === "人类联盟") {
|
|
4191
|
+
if (userCoins < targetProfession.costcoins) {
|
|
4192
|
+
return `转职需要 ${targetProfession.costcoins} 金币,当前拥有 ${userCoins} 金币`;
|
|
4193
|
+
}
|
|
4194
|
+
await ctx.database.upsert("ggcevo_sign", [{
|
|
4195
|
+
handle,
|
|
4196
|
+
totalRewards: userCoins - targetProfession.costcoins
|
|
4197
|
+
}], ["handle"]);
|
|
4198
|
+
} else if (careerData.group === "辛迪加海盗") {
|
|
4199
|
+
if (userCoins < targetProfession.costcoins) {
|
|
4200
|
+
return `需要金币 ${targetProfession.costcoins},当前 ${userCoins}`;
|
|
4201
|
+
}
|
|
4202
|
+
if (userRedCrystal < (targetProfession.costredcrystal || 0)) {
|
|
4203
|
+
return `需要红晶 ${targetProfession.costredcrystal},当前 ${userRedCrystal}`;
|
|
4204
|
+
}
|
|
4205
|
+
await Promise.all([
|
|
4206
|
+
ctx.database.upsert("ggcevo_sign", [{
|
|
4207
|
+
handle,
|
|
4208
|
+
totalRewards: userCoins - targetProfession.costcoins
|
|
4209
|
+
}], ["handle"]),
|
|
4210
|
+
ctx.database.upsert("ggcevo_careers", [{
|
|
4211
|
+
handle,
|
|
4212
|
+
redcrystal: userRedCrystal - (targetProfession.costredcrystal || 0)
|
|
4213
|
+
}], ["handle"])
|
|
4214
|
+
]);
|
|
4215
|
+
}
|
|
4216
|
+
await ctx.database.upsert("ggcevo_careers", [{
|
|
4217
|
+
handle,
|
|
4218
|
+
career: profession,
|
|
4219
|
+
date: /* @__PURE__ */ new Date()
|
|
4220
|
+
}], ["handle"]);
|
|
4221
|
+
return `${careerData.group === "辛迪加海盗" ? `花费${targetProfession.costcoins}金币和${targetProfession.costredcrystal}红晶` : `花费${targetProfession.costcoins}金币`}转职成功!当前职业:${profession}`;
|
|
4222
|
+
} catch (err) {
|
|
4223
|
+
ctx.logger.error("转职失败:", err);
|
|
4224
|
+
return "转职过程中发生错误,请稍后再试";
|
|
4225
|
+
}
|
|
4226
|
+
});
|
|
4227
|
+
ctx.command("ggcevo/职业信息", "查看当前阵营与职业状态").action(async ({ session }) => {
|
|
4228
|
+
try {
|
|
4229
|
+
const [profile] = await ctx.database.get("sc2arcade_player", {
|
|
4230
|
+
userId: session.userId
|
|
4231
|
+
});
|
|
4232
|
+
if (!profile) return "您暂未绑定游戏句柄。";
|
|
4233
|
+
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
4234
|
+
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
4235
|
+
if (!careerData) return "您尚未加入任何阵营。";
|
|
4236
|
+
const joinDate = new Date(careerData.date);
|
|
4237
|
+
const formattedDate = `${joinDate.getFullYear()}年${joinDate.getMonth() + 1}月${joinDate.getDate()}日`;
|
|
4238
|
+
const infoCard = [
|
|
4239
|
+
`🎖️ 当前阵营:${careerData.group}`,
|
|
4240
|
+
`🛠️ 当前职业:${careerData.career}`,
|
|
4241
|
+
`📅 就职时间:${formattedDate}`
|
|
4242
|
+
];
|
|
4243
|
+
if (careerData.group === "辛迪加海盗") {
|
|
4244
|
+
infoCard.push(`🔴 持有红晶:${careerData.redcrystal || 0} 个`);
|
|
4245
|
+
infoCard.push("💡 提示:红晶可通过主动PK胜利获得");
|
|
4246
|
+
} else {
|
|
4247
|
+
infoCard.push("💡 提示:使用「转职」命令可变更职业");
|
|
4248
|
+
}
|
|
4249
|
+
return [
|
|
4250
|
+
"=== 职业档案 ===",
|
|
4251
|
+
...infoCard,
|
|
4252
|
+
"================"
|
|
4253
|
+
].join("\n");
|
|
4254
|
+
} catch (error) {
|
|
4255
|
+
ctx.logger.error("查询职业信息失败:", error);
|
|
4256
|
+
return "获取职业信息失败,请稍后重试";
|
|
4257
|
+
}
|
|
4258
|
+
});
|
|
3682
4259
|
}
|
|
3683
4260
|
__name(apply, "apply");
|
|
3684
4261
|
function simpleDraw() {
|