koishi-plugin-ggcevo-game 1.2.38 → 1.2.39
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 +1 -0
- package/lib/index.js +388 -74
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -230,6 +230,8 @@ function apply(ctx, config) {
|
|
|
230
230
|
name: "string",
|
|
231
231
|
type: "string",
|
|
232
232
|
HP: "unsigned",
|
|
233
|
+
skills: { type: "list", initial: [] },
|
|
234
|
+
// 明确数组元素类型
|
|
233
235
|
groupId: "unsigned",
|
|
234
236
|
isActive: "boolean",
|
|
235
237
|
respawnTime: "timestamp"
|
|
@@ -338,6 +340,18 @@ function apply(ctx, config) {
|
|
|
338
340
|
"轻甲": 0.5,
|
|
339
341
|
"重甲": 0.2
|
|
340
342
|
}
|
|
343
|
+
},
|
|
344
|
+
"零度之下": {
|
|
345
|
+
id: 8,
|
|
346
|
+
type: "热能武器",
|
|
347
|
+
damage: 30,
|
|
348
|
+
description: "喷射稳定的液氮恒流,对长时间接触者造成致命的损伤",
|
|
349
|
+
price: 775,
|
|
350
|
+
tagEffects: {
|
|
351
|
+
"惧寒": 2,
|
|
352
|
+
"灵能": 1.5,
|
|
353
|
+
"护盾": 0.8
|
|
354
|
+
}
|
|
341
355
|
}
|
|
342
356
|
};
|
|
343
357
|
const modConfig = {
|
|
@@ -417,6 +431,162 @@ function apply(ctx, config) {
|
|
|
417
431
|
}
|
|
418
432
|
]
|
|
419
433
|
};
|
|
434
|
+
const spaceStationCrewConfig = [
|
|
435
|
+
{
|
|
436
|
+
professionName: "深空矿工",
|
|
437
|
+
effectname: "",
|
|
438
|
+
effect: "每日签到获得的金币收益增加100%",
|
|
439
|
+
requirements: "当月累计签到14天",
|
|
440
|
+
description: "",
|
|
441
|
+
Jobtransfer: true
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
professionName: "安保警卫",
|
|
445
|
+
effectname: "",
|
|
446
|
+
effect: "攻击获得的金币增加100%",
|
|
447
|
+
requirements: "当期伤害榜攻击次数达到5次",
|
|
448
|
+
description: "",
|
|
449
|
+
Jobtransfer: true
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
professionName: "首席武器官",
|
|
453
|
+
effectname: "",
|
|
454
|
+
effect: "攻击伤害+10%",
|
|
455
|
+
requirements: "当期伤害榜造成200点伤害",
|
|
456
|
+
description: "",
|
|
457
|
+
Jobtransfer: true
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
professionName: "医生",
|
|
461
|
+
effectname: "",
|
|
462
|
+
effect: "",
|
|
463
|
+
requirements: "",
|
|
464
|
+
description: "",
|
|
465
|
+
Jobtransfer: false
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
professionName: "首席情报官",
|
|
469
|
+
effectname: "",
|
|
470
|
+
effect: "升级联盟空间站科技享有80%的折扣",
|
|
471
|
+
requirements: "拥有500枚金币",
|
|
472
|
+
description: "",
|
|
473
|
+
Jobtransfer: false
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
professionName: "首席工程师",
|
|
477
|
+
effectname: "",
|
|
478
|
+
effect: "拥有独特的C.O.R.E科技升级权限",
|
|
479
|
+
requirements: "",
|
|
480
|
+
description: "",
|
|
481
|
+
Jobtransfer: false
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
professionName: "舰长",
|
|
485
|
+
effectname: "",
|
|
486
|
+
effect: "pk胜利将获得对面的红晶,可以使用红晶升级联盟空间站科技",
|
|
487
|
+
requirements: "pk总次数达10次",
|
|
488
|
+
description: "",
|
|
489
|
+
Jobtransfer: false
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
professionName: "首席机械师",
|
|
493
|
+
effectname: "",
|
|
494
|
+
effect: "机甲形态攻击伤害+50%",
|
|
495
|
+
requirements: "",
|
|
496
|
+
description: "",
|
|
497
|
+
Jobtransfer: false
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
professionName: "联盟新兵",
|
|
501
|
+
effectname: "无",
|
|
502
|
+
effect: "无",
|
|
503
|
+
requirements: "无",
|
|
504
|
+
description: "",
|
|
505
|
+
Jobtransfer: false
|
|
506
|
+
}
|
|
507
|
+
];
|
|
508
|
+
const syndicatePirateConfig = [
|
|
509
|
+
{
|
|
510
|
+
professionName: "能量武器",
|
|
511
|
+
effectname: "",
|
|
512
|
+
effect: "能量武器攻击伤害+20%",
|
|
513
|
+
requirements: "",
|
|
514
|
+
description: "",
|
|
515
|
+
Jobtransfer: true
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
professionName: "清洁工",
|
|
519
|
+
effectname: "",
|
|
520
|
+
effect: "击败主宰能够根据排名获得红晶",
|
|
521
|
+
requirements: "",
|
|
522
|
+
description: "",
|
|
523
|
+
Jobtransfer: true
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
professionName: "枪手",
|
|
527
|
+
effectname: "",
|
|
528
|
+
effect: "升级武器享有80%的折扣",
|
|
529
|
+
requirements: "",
|
|
530
|
+
description: "",
|
|
531
|
+
Jobtransfer: true
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
professionName: "纵火狂",
|
|
535
|
+
effectname: "",
|
|
536
|
+
effect: "热能武器攻击伤害+15%",
|
|
537
|
+
requirements: "",
|
|
538
|
+
description: "",
|
|
539
|
+
Jobtransfer: true
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
professionName: "财务",
|
|
543
|
+
effectname: "",
|
|
544
|
+
effect: "每日签到能额外获得红晶",
|
|
545
|
+
requirements: "",
|
|
546
|
+
description: "",
|
|
547
|
+
Jobtransfer: true
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
professionName: "计算机专家",
|
|
551
|
+
effectname: "",
|
|
552
|
+
effect: "每日pk次数翻倍,pk的胜率提高10%",
|
|
553
|
+
requirements: "",
|
|
554
|
+
description: "",
|
|
555
|
+
Jobtransfer: false
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
professionName: "指挥官",
|
|
559
|
+
effectname: "",
|
|
560
|
+
effect: "可以使用红晶升级独特的辛迪加空间站科技",
|
|
561
|
+
requirements: "",
|
|
562
|
+
description: "",
|
|
563
|
+
Jobtransfer: false
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
professionName: "装甲兵",
|
|
567
|
+
effectname: "",
|
|
568
|
+
effect: "改装武器享有80%的折扣",
|
|
569
|
+
requirements: "",
|
|
570
|
+
description: "",
|
|
571
|
+
Jobtransfer: true
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
professionName: "破坏狂",
|
|
575
|
+
effectname: "",
|
|
576
|
+
effect: "pk胜利获得额外红晶",
|
|
577
|
+
requirements: "",
|
|
578
|
+
description: "",
|
|
579
|
+
Jobtransfer: false
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
professionName: "辛迪加炮灰新兵",
|
|
583
|
+
effectname: "无",
|
|
584
|
+
effect: "无",
|
|
585
|
+
requirements: "无",
|
|
586
|
+
description: "",
|
|
587
|
+
Jobtransfer: false
|
|
588
|
+
}
|
|
589
|
+
];
|
|
420
590
|
const passiveConfig = {
|
|
421
591
|
"弱化形态": {
|
|
422
592
|
effect: 0.1,
|
|
@@ -429,6 +599,22 @@ function apply(ctx, config) {
|
|
|
429
599
|
"孤立无援": {
|
|
430
600
|
effect: 0.2,
|
|
431
601
|
description: "没有存活的子代,受到的伤害+20%"
|
|
602
|
+
},
|
|
603
|
+
"冰霜回复": {
|
|
604
|
+
effect: 0,
|
|
605
|
+
description: "血量降低到30%以下时触发,回复自身和主宰20%的生命值(触发后移除被动)"
|
|
606
|
+
},
|
|
607
|
+
"冰霜进化": {
|
|
608
|
+
effect: 0,
|
|
609
|
+
description: "免疫冰霜伤害,受到冰霜伤害会回复生命值"
|
|
610
|
+
},
|
|
611
|
+
"冰霜环绕": {
|
|
612
|
+
effect: 0,
|
|
613
|
+
description: "血量降低到30%以下时触发,回复自身45%的生命值(触发后移除被动)"
|
|
614
|
+
},
|
|
615
|
+
"寒霜地狱": {
|
|
616
|
+
effect: -0.3,
|
|
617
|
+
description: "灾难的暴风雪降临,受到的伤害-30%"
|
|
432
618
|
}
|
|
433
619
|
};
|
|
434
620
|
const bossPool = [
|
|
@@ -439,7 +625,7 @@ function apply(ctx, config) {
|
|
|
439
625
|
type: "主宰",
|
|
440
626
|
maxHP: 1e4,
|
|
441
627
|
tags: ["重甲", "生物"],
|
|
442
|
-
passive: ["坚固外壳"
|
|
628
|
+
passive: ["坚固外壳"]
|
|
443
629
|
// 明确类型
|
|
444
630
|
},
|
|
445
631
|
minions: [
|
|
@@ -452,6 +638,27 @@ function apply(ctx, config) {
|
|
|
452
638
|
// 明确类型
|
|
453
639
|
}
|
|
454
640
|
]
|
|
641
|
+
},
|
|
642
|
+
{
|
|
643
|
+
main: {
|
|
644
|
+
id: 2,
|
|
645
|
+
name: "寒冰王蛇",
|
|
646
|
+
type: "主宰",
|
|
647
|
+
maxHP: 7500,
|
|
648
|
+
tags: ["重甲", "惧热", "生物"],
|
|
649
|
+
passive: ["冰霜环绕", "冰霜进化"]
|
|
650
|
+
// 明确类型
|
|
651
|
+
},
|
|
652
|
+
minions: [
|
|
653
|
+
{
|
|
654
|
+
name: "冰蛇",
|
|
655
|
+
type: "子代",
|
|
656
|
+
maxHP: 1500,
|
|
657
|
+
tags: ["惧热", "生物"],
|
|
658
|
+
passive: ["弱化形态", "冰霜回复", "冰霜进化"]
|
|
659
|
+
// 明确类型
|
|
660
|
+
}
|
|
661
|
+
]
|
|
455
662
|
}
|
|
456
663
|
];
|
|
457
664
|
function calculateModifiers(equippedWeapon, weaponName, hasCritRhythm) {
|
|
@@ -505,14 +712,9 @@ function apply(ctx, config) {
|
|
|
505
712
|
return totalTagAdd;
|
|
506
713
|
}
|
|
507
714
|
__name(calculateTagEffects, "calculateTagEffects");
|
|
508
|
-
function calculatePassiveEffects(
|
|
715
|
+
function calculatePassiveEffects(targetBoss) {
|
|
509
716
|
let passiveEffect = 0;
|
|
510
|
-
const effectivePassives = [...
|
|
511
|
-
if (targetBossConfig.type === "主宰" && effectivePassives.includes("孤立无援")) {
|
|
512
|
-
if (activeMinionsCount !== 0) {
|
|
513
|
-
effectivePassives.splice(effectivePassives.indexOf("孤立无援"), 1);
|
|
514
|
-
}
|
|
515
|
-
}
|
|
717
|
+
const effectivePassives = [...targetBoss.skills || []];
|
|
516
718
|
effectivePassives.forEach((passive) => {
|
|
517
719
|
const effect = passiveConfig[passive]?.effect || 0;
|
|
518
720
|
passiveEffect += effect;
|
|
@@ -551,12 +753,7 @@ function apply(ctx, config) {
|
|
|
551
753
|
const targetBossConfig = targetBoss.type === "主宰" ? bossPool.find((g) => g.main.name === targetBoss.name).main : bossPool.find((g) => g.minions.some((m) => m.name === targetBoss.name)).minions[0];
|
|
552
754
|
const tagMultiplier = calculateTagEffects(weaponData, targetBossConfig, equippedWeapon);
|
|
553
755
|
damage *= 1 + tagMultiplier;
|
|
554
|
-
const
|
|
555
|
-
groupId: targetBoss.groupId,
|
|
556
|
-
type: "子代",
|
|
557
|
-
isActive: true
|
|
558
|
-
});
|
|
559
|
-
const passiveMultiplier = calculatePassiveEffects(targetBossConfig, activeMinions.length);
|
|
756
|
+
const passiveMultiplier = calculatePassiveEffects(targetBoss);
|
|
560
757
|
damage *= 1 + passiveMultiplier;
|
|
561
758
|
const [sovereignEffect] = await ctx2.database.get("ggcevo_Wish_Record", {
|
|
562
759
|
handle,
|
|
@@ -577,7 +774,7 @@ function apply(ctx, config) {
|
|
|
577
774
|
if (lamentEffect) {
|
|
578
775
|
const levelBonus = 0.1 * (equippedWeapon.level + 1);
|
|
579
776
|
damage *= 1 + levelBonus;
|
|
580
|
-
effectMessage.push(`🗡️
|
|
777
|
+
effectMessage.push(`🗡️ 悲鸣之锋祈愿生效(+${(levelBonus * 100).toFixed(0)}%等级加成)`);
|
|
581
778
|
}
|
|
582
779
|
const [rankRecord] = await ctx2.database.get("ggcevo_rank", { handle: session.handle, rankseason: config.rankseason });
|
|
583
780
|
const rankBonus = calculateRankBonus(rankRecord);
|
|
@@ -706,13 +903,6 @@ function apply(ctx, config) {
|
|
|
706
903
|
}
|
|
707
904
|
}
|
|
708
905
|
__name(checkSensitiveWord, "checkSensitiveWord");
|
|
709
|
-
async function initializeBoss() {
|
|
710
|
-
const activeBoss = await ctx.database.get("ggcevo_boss", { isActive: true });
|
|
711
|
-
if (!activeBoss.length) {
|
|
712
|
-
await activateNextBossGroup();
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
__name(initializeBoss, "initializeBoss");
|
|
716
906
|
async function activateNextBossGroup(currentBossId = null) {
|
|
717
907
|
let nextIndex = 0;
|
|
718
908
|
if (currentBossId !== null) {
|
|
@@ -726,6 +916,8 @@ function apply(ctx, config) {
|
|
|
726
916
|
name: nextBossGroup.main.name,
|
|
727
917
|
type: nextBossGroup.main.type,
|
|
728
918
|
HP: nextBossGroup.main.maxHP,
|
|
919
|
+
skills: [...nextBossGroup.main.passive],
|
|
920
|
+
// 直接展开被动数组
|
|
729
921
|
groupId: nextBossGroup.main.id,
|
|
730
922
|
isActive: true,
|
|
731
923
|
respawnTime: /* @__PURE__ */ new Date()
|
|
@@ -735,6 +927,8 @@ function apply(ctx, config) {
|
|
|
735
927
|
name: minion.name,
|
|
736
928
|
type: minion.type,
|
|
737
929
|
HP: minion.maxHP,
|
|
930
|
+
skills: [...minion.passive],
|
|
931
|
+
// 直接展开被动数组
|
|
738
932
|
groupId: mainBoss.groupId,
|
|
739
933
|
isActive: true,
|
|
740
934
|
respawnTime: /* @__PURE__ */ new Date()
|
|
@@ -1009,7 +1203,7 @@ ${itemDetails.join("\n")}`;
|
|
|
1009
1203
|
quantity: (backpack?.quantity || 0) + tickets
|
|
1010
1204
|
}]);
|
|
1011
1205
|
return `签到成功!本月累计签到${monthlyDays}天,获得:
|
|
1012
|
-
💰
|
|
1206
|
+
💰 金币 x ${points}
|
|
1013
1207
|
🪙 咕咕币 x ${tickets}` + effectMessage;
|
|
1014
1208
|
} catch (error) {
|
|
1015
1209
|
console.error("签到命令时发生错误:", error);
|
|
@@ -2123,6 +2317,7 @@ ${achievementList.join("\n")}`;
|
|
|
2123
2317
|
const parsedUser = import_koishi.h.parse(user)[0];
|
|
2124
2318
|
if (!parsedUser || parsedUser.type !== "at" || !parsedUser.attrs.id) return "参数格式错误,请输入“pk @指定pk玩家”。";
|
|
2125
2319
|
const targetUserId = parsedUser.attrs.id;
|
|
2320
|
+
const targetUsername = session.bot.getGuildMember(config.ggcqun, targetUserId);
|
|
2126
2321
|
const [targetprofile] = await ctx.database.get("sc2arcade_player", { userId: targetUserId });
|
|
2127
2322
|
if (!targetprofile) return "对方尚未绑定句柄。";
|
|
2128
2323
|
const initiatorHandle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
@@ -2200,7 +2395,7 @@ ${achievementList.join("\n")}`;
|
|
|
2200
2395
|
const initiatorRank = initiatorData[0]?.rank || 0;
|
|
2201
2396
|
const targetRank = targetData[0]?.rank || 0;
|
|
2202
2397
|
const initiatorRankname = initiatorData[0]?.name || session.username;
|
|
2203
|
-
const targetRankname = targetData[0]?.name ||
|
|
2398
|
+
const targetRankname = targetData[0]?.name || (await targetUsername).name;
|
|
2204
2399
|
const [initiatorSign, targetSign] = await Promise.all([
|
|
2205
2400
|
ctx.database.get("ggcevo_sign", initiatorHandle),
|
|
2206
2401
|
ctx.database.get("ggcevo_sign", targetHandle)
|
|
@@ -2481,7 +2676,7 @@ ${validTypes.join("、")}`;
|
|
|
2481
2676
|
});
|
|
2482
2677
|
ctx.command("ggcevo/装备 <weapon>").action(async ({ session }, weapon) => {
|
|
2483
2678
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
2484
|
-
if (!profile) return "
|
|
2679
|
+
if (!profile) return "您暂未绑定句柄。";
|
|
2485
2680
|
if (!weaponConfig[weapon]) return "请输入“装备 武器名称”来装备一把你拥有的武器。";
|
|
2486
2681
|
const config2 = weaponConfig[weapon];
|
|
2487
2682
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
@@ -2489,7 +2684,7 @@ ${validTypes.join("、")}`;
|
|
|
2489
2684
|
handle,
|
|
2490
2685
|
weaponId: config2.id
|
|
2491
2686
|
});
|
|
2492
|
-
if (!owned) return "
|
|
2687
|
+
if (!owned) return "尚未获得该武器。";
|
|
2493
2688
|
await ctx.database.withTransaction(async () => {
|
|
2494
2689
|
await ctx.database.set(
|
|
2495
2690
|
"ggcevo_equipment",
|
|
@@ -2506,7 +2701,7 @@ ${validTypes.join("、")}`;
|
|
|
2506
2701
|
equipped: true
|
|
2507
2702
|
}], ["handle", "weaponId"]);
|
|
2508
2703
|
});
|
|
2509
|
-
return
|
|
2704
|
+
return `您已成功装备 ${weapon}!`;
|
|
2510
2705
|
});
|
|
2511
2706
|
ctx.command("ggcevo/升级 <weapon>", "升级武器伤害").alias("升级武器", "武器升级", "武器强化", "强化武器").action(async ({ session }, weapon) => {
|
|
2512
2707
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
@@ -2675,14 +2870,85 @@ ${validTypes.join("、")}`;
|
|
|
2675
2870
|
if (!activeBosses.length) return "当前没有存活的主宰。";
|
|
2676
2871
|
const targetBoss = normalizedTarget === "主宰" ? activeBosses.find((b) => b.type === "主宰") : activeBosses.find((b) => b.type === "子代");
|
|
2677
2872
|
if (!targetBoss) return `当前没有可攻击的${normalizedTarget === "主宰" ? "主宰" : "子代"}。`;
|
|
2678
|
-
const bossGroup = bossPool.find((group) => group.main.id === targetBoss.groupId);
|
|
2679
|
-
if (!bossGroup) return "无法获取BOSS组信息,请联系管理员。";
|
|
2680
2873
|
const weaponConfigEntry = Object.entries(weaponConfig).find(([_, c]) => c.id === equippedWeapon.weaponId);
|
|
2681
2874
|
const [weaponName, weaponData] = weaponConfigEntry;
|
|
2682
2875
|
const { damage: baseDamage, hasCrit, effectMessage } = await calculateTotalDamage(ctx, session, equippedWeapon, targetBoss);
|
|
2683
|
-
const
|
|
2684
|
-
|
|
2685
|
-
const
|
|
2876
|
+
const bossGroup = bossPool.find((g) => g.main.id === targetBoss.groupId);
|
|
2877
|
+
if (!bossGroup) return "无法获取BOSS组配置";
|
|
2878
|
+
const maxHP = targetBoss.type === "主宰" ? bossGroup.main.maxHP : bossGroup.minions.find((m) => m.name === targetBoss.name)?.maxHP || 0;
|
|
2879
|
+
let initialDamage = Math.min(baseDamage, targetBoss.HP);
|
|
2880
|
+
let currentHP = targetBoss.HP - initialDamage;
|
|
2881
|
+
let healMessages = [];
|
|
2882
|
+
let triggeredSkills = [];
|
|
2883
|
+
let globalSkillUpdates = /* @__PURE__ */ new Map();
|
|
2884
|
+
if (targetBoss.skills.includes("冰霜进化") && weaponName === "零度之下") {
|
|
2885
|
+
const healAmount = baseDamage;
|
|
2886
|
+
currentHP = Math.min(targetBoss.HP + healAmount, maxHP);
|
|
2887
|
+
initialDamage = 0;
|
|
2888
|
+
}
|
|
2889
|
+
const willDieInstantly = currentHP <= 0;
|
|
2890
|
+
if (!willDieInstantly) {
|
|
2891
|
+
const hpPercentage = currentHP / maxHP;
|
|
2892
|
+
if (targetBoss.type === "主宰" && targetBoss.skills.includes("冰霜环绕") && hpPercentage <= 0.3) {
|
|
2893
|
+
const healAmount = Math.floor(maxHP * 0.45);
|
|
2894
|
+
currentHP = Math.min(currentHP + healAmount, maxHP);
|
|
2895
|
+
triggeredSkills.push("冰霜环绕");
|
|
2896
|
+
const activeMinions = await ctx.database.get("ggcevo_boss", {
|
|
2897
|
+
groupId: targetBoss.groupId,
|
|
2898
|
+
type: "子代",
|
|
2899
|
+
isActive: true
|
|
2900
|
+
});
|
|
2901
|
+
const updates = [
|
|
2902
|
+
// 更新主宰
|
|
2903
|
+
{
|
|
2904
|
+
name: targetBoss.name,
|
|
2905
|
+
skills: [
|
|
2906
|
+
...targetBoss.skills.filter((s) => s !== "冰霜环绕"),
|
|
2907
|
+
"寒霜地狱"
|
|
2908
|
+
]
|
|
2909
|
+
// 明确类型
|
|
2910
|
+
},
|
|
2911
|
+
// 更新所有存活子代
|
|
2912
|
+
...activeMinions.map((minion) => ({
|
|
2913
|
+
name: minion.name,
|
|
2914
|
+
skills: [
|
|
2915
|
+
...minion.skills,
|
|
2916
|
+
"寒霜地狱"
|
|
2917
|
+
// 明确字面量类型
|
|
2918
|
+
]
|
|
2919
|
+
}))
|
|
2920
|
+
];
|
|
2921
|
+
updates.forEach((update) => {
|
|
2922
|
+
globalSkillUpdates.set(update.name, update.skills);
|
|
2923
|
+
});
|
|
2924
|
+
await ctx.database.upsert("ggcevo_boss", updates, ["name"]);
|
|
2925
|
+
healMessages.push(
|
|
2926
|
+
`❄️ ${targetBoss.name} 触发【冰霜环绕】,自身恢复45%最大生命值(+${healAmount}HP)`,
|
|
2927
|
+
`🌪️ 寒霜地狱降临!所有存活的异形获得30%减伤效果`
|
|
2928
|
+
);
|
|
2929
|
+
}
|
|
2930
|
+
if (targetBoss.type === "子代" && targetBoss.skills.includes("冰霜回复") && hpPercentage <= 0.3) {
|
|
2931
|
+
let mainHeal;
|
|
2932
|
+
const selfHeal = Math.floor(maxHP * 0.2);
|
|
2933
|
+
currentHP = Math.min(currentHP + selfHeal, maxHP);
|
|
2934
|
+
const mainBoss = activeBosses.find(
|
|
2935
|
+
(b) => b.groupId === targetBoss.groupId && b.type === "主宰"
|
|
2936
|
+
);
|
|
2937
|
+
if (mainBoss) {
|
|
2938
|
+
const mainMaxHP = bossGroup.main.maxHP;
|
|
2939
|
+
mainHeal = Math.floor(mainMaxHP * 0.2);
|
|
2940
|
+
const mainNewHP = Math.min(mainBoss.HP + mainHeal, mainMaxHP);
|
|
2941
|
+
await ctx.database.set(
|
|
2942
|
+
"ggcevo_boss",
|
|
2943
|
+
{ name: mainBoss.name },
|
|
2944
|
+
{ HP: mainNewHP }
|
|
2945
|
+
);
|
|
2946
|
+
}
|
|
2947
|
+
triggeredSkills.push("冰霜回复");
|
|
2948
|
+
healMessages.push(`❄️ ${targetBoss.name} 触发【冰霜回复】,自身恢复20%最大生命值(+${selfHeal}HP),主宰恢复20%最大生命值(+${mainHeal}HP)`);
|
|
2949
|
+
}
|
|
2950
|
+
}
|
|
2951
|
+
const isDefeated = currentHP <= 0;
|
|
2686
2952
|
const [existingRecord] = await ctx.database.get("ggcevo_boss_damage", {
|
|
2687
2953
|
handle,
|
|
2688
2954
|
bossGroupId: targetBoss.groupId
|
|
@@ -2693,7 +2959,7 @@ ${validTypes.join("、")}`;
|
|
|
2693
2959
|
bossGroupId: targetBoss.groupId
|
|
2694
2960
|
}, {
|
|
2695
2961
|
playerName: session.username,
|
|
2696
|
-
totalDamage: existingRecord.totalDamage +
|
|
2962
|
+
totalDamage: existingRecord.totalDamage + initialDamage,
|
|
2697
2963
|
// 改为实际伤害
|
|
2698
2964
|
attackCount: existingRecord.attackCount + 1,
|
|
2699
2965
|
lastattackDate: /* @__PURE__ */ new Date()
|
|
@@ -2703,7 +2969,7 @@ ${validTypes.join("、")}`;
|
|
|
2703
2969
|
handle,
|
|
2704
2970
|
playerName: session.username,
|
|
2705
2971
|
bossGroupId: targetBoss.groupId,
|
|
2706
|
-
totalDamage:
|
|
2972
|
+
totalDamage: initialDamage,
|
|
2707
2973
|
// 改为实际伤害
|
|
2708
2974
|
attackCount: 1,
|
|
2709
2975
|
lastattackDate: /* @__PURE__ */ new Date()
|
|
@@ -2878,40 +3144,71 @@ ${validTypes.join("、")}`;
|
|
|
2878
3144
|
HP: 0
|
|
2879
3145
|
}
|
|
2880
3146
|
);
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
3147
|
+
const groupId = targetBoss.groupId;
|
|
3148
|
+
const remainingMinions = await ctx.database.get("ggcevo_boss", {
|
|
3149
|
+
groupId,
|
|
3150
|
+
type: "子代",
|
|
3151
|
+
isActive: true
|
|
3152
|
+
});
|
|
3153
|
+
const broadcastMessages = [`⚡ ${session.username} 击破了子代 ${targetBoss.name}!`];
|
|
3154
|
+
if (remainingMinions.length === 0) {
|
|
3155
|
+
const [mainBoss] = await ctx.database.get("ggcevo_boss", {
|
|
3156
|
+
groupId,
|
|
3157
|
+
type: "主宰",
|
|
3158
|
+
isActive: true
|
|
3159
|
+
});
|
|
3160
|
+
if (mainBoss && !mainBoss.skills.includes("孤立无援")) {
|
|
3161
|
+
const updatedSkills = [...mainBoss.skills, "孤立无援"];
|
|
3162
|
+
await ctx.database.set(
|
|
3163
|
+
"ggcevo_boss",
|
|
3164
|
+
{ name: mainBoss.name },
|
|
3165
|
+
{ skills: updatedSkills }
|
|
3166
|
+
);
|
|
3167
|
+
broadcastMessages.push("💥 所有子代已阵亡,主宰进入【孤立无援】状态,受到的伤害+20%!");
|
|
3168
|
+
}
|
|
3169
|
+
}
|
|
3170
|
+
broadcastMessage = broadcastMessages;
|
|
2885
3171
|
}
|
|
2886
3172
|
} else {
|
|
3173
|
+
const finalSkills = globalSkillUpdates.get(targetBoss.name) || targetBoss.skills.filter((s) => !triggeredSkills.includes(s));
|
|
2887
3174
|
await ctx.database.set(
|
|
2888
3175
|
"ggcevo_boss",
|
|
2889
3176
|
{ name: targetBoss.name },
|
|
2890
|
-
{
|
|
3177
|
+
{
|
|
3178
|
+
HP: Math.max(currentHP, 0),
|
|
3179
|
+
skills: finalSkills
|
|
3180
|
+
}
|
|
2891
3181
|
);
|
|
2892
3182
|
}
|
|
2893
3183
|
const [existingSign] = await ctx.database.get("ggcevo_sign", { handle });
|
|
2894
3184
|
if (existingSign) {
|
|
2895
3185
|
await ctx.database.set("ggcevo_sign", { handle }, {
|
|
2896
|
-
totalRewards: existingSign.totalRewards +
|
|
3186
|
+
totalRewards: existingSign.totalRewards + initialDamage
|
|
2897
3187
|
// 改为实际伤害
|
|
2898
3188
|
});
|
|
2899
3189
|
} else {
|
|
2900
3190
|
await ctx.database.create("ggcevo_sign", {
|
|
2901
3191
|
handle,
|
|
2902
|
-
totalRewards:
|
|
3192
|
+
totalRewards: initialDamage
|
|
2903
3193
|
// 改为实际伤害
|
|
2904
3194
|
});
|
|
2905
3195
|
}
|
|
2906
3196
|
const resultMessage = [
|
|
2907
3197
|
`🔥 ${session.username} 使用武器 ${weaponName} 对 ${targetBoss.name} 发起攻击!`,
|
|
2908
3198
|
...effectMessage.length > 0 ? [
|
|
2909
|
-
// 新增效果反馈
|
|
2910
3199
|
`💫 祈愿效果:${effectMessage.join(" | ")}`
|
|
2911
3200
|
] : [],
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
3201
|
+
// 冰霜进化特殊处理(新增条件判断)
|
|
3202
|
+
...targetBoss.skills.includes("冰霜进化") && weaponName === "零度之下" ? [
|
|
3203
|
+
`❄️ ${targetBoss.name} 触发【冰霜进化】免疫冰霜伤害!`,
|
|
3204
|
+
`🩹 反而恢复 ${baseDamage} 生命值`
|
|
3205
|
+
] : [
|
|
3206
|
+
`造成伤害:${initialDamage}${hasCrit ? "(✨ 暴击)" : ""}`,
|
|
3207
|
+
...healMessages
|
|
3208
|
+
],
|
|
3209
|
+
// 金币奖励显示逻辑优化
|
|
3210
|
+
`获得金币:${targetBoss.skills.includes("冰霜进化") && weaponName === "零度之下" ? 0 : initialDamage}`,
|
|
3211
|
+
`目标剩余HP:${Math.max(currentHP, 0)}/${maxHP}`,
|
|
2915
3212
|
isDefeated ? `🎉 成功击败 ${targetBoss.name}!` : ""
|
|
2916
3213
|
].filter((line) => line).join("\n");
|
|
2917
3214
|
await session.send(resultMessage);
|
|
@@ -2951,7 +3248,7 @@ ${validTypes.join("、")}`;
|
|
|
2951
3248
|
pageNum < totalPages ? `输入 伤害榜 ${pageNum + 1} 查看下一页` : "已是最后一页"
|
|
2952
3249
|
].join("\n");
|
|
2953
3250
|
});
|
|
2954
|
-
ctx.command("ggcevo/主宰信息", "查看当前主宰信息").alias("zz信息").action(async () => {
|
|
3251
|
+
ctx.command("ggcevo/主宰信息", "查看当前主宰信息").alias("zz信息", "主宰状态", "zz状态").action(async () => {
|
|
2955
3252
|
const activeBosses = await ctx.database.get("ggcevo_boss", { isActive: true });
|
|
2956
3253
|
if (!activeBosses.length) return "当前没有存活的主宰。";
|
|
2957
3254
|
const mainBoss = activeBosses.find((b) => b.type === "主宰");
|
|
@@ -2960,44 +3257,61 @@ ${validTypes.join("、")}`;
|
|
|
2960
3257
|
const bossGroup = bossPool.find((group) => group.main.name === mainBoss.name);
|
|
2961
3258
|
if (!bossGroup) return "BOSS配置数据异常,请联系管理员";
|
|
2962
3259
|
const mainBossHpBar = createHpBar(mainBoss.HP, bossGroup.main.maxHP);
|
|
2963
|
-
|
|
2964
|
-
if (bossGroup.main.passive) {
|
|
2965
|
-
const activeMinions = await ctx.database.get("ggcevo_boss", {
|
|
2966
|
-
groupId: mainBoss.groupId,
|
|
2967
|
-
type: "子代",
|
|
2968
|
-
isActive: true
|
|
2969
|
-
});
|
|
2970
|
-
passiveDisplay = bossGroup.main.passive.filter((p) => {
|
|
2971
|
-
if (p === "孤立无援") return activeMinions.length === 0;
|
|
2972
|
-
return true;
|
|
2973
|
-
}).map((p) => {
|
|
2974
|
-
return `${p}:${passiveConfig[p].description}`;
|
|
2975
|
-
});
|
|
2976
|
-
}
|
|
3260
|
+
const mainPassives = mainBoss.skills.map((p) => `${p}:${passiveConfig[p].description}`);
|
|
2977
3261
|
const result = [
|
|
2978
3262
|
`🔴 主宰:${mainBoss.name}`,
|
|
2979
3263
|
`${mainBossHpBar} (${mainBoss.HP}/${bossGroup.main.maxHP})`,
|
|
2980
3264
|
`标签:${bossGroup.main.tags.join("、")}`,
|
|
2981
|
-
|
|
3265
|
+
"被动:",
|
|
3266
|
+
...mainPassives.length ? mainPassives : ["无"]
|
|
2982
3267
|
];
|
|
2983
3268
|
if (minions.length > 0) {
|
|
2984
|
-
result.push("
|
|
2985
|
-
|
|
3269
|
+
result.push("\n🟠 子代:");
|
|
3270
|
+
for (const minion of minions) {
|
|
2986
3271
|
const minionConfig = bossGroup.minions.find((m) => m.name === minion.name);
|
|
2987
|
-
if (minionConfig)
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
}
|
|
3272
|
+
if (!minionConfig) continue;
|
|
3273
|
+
const minionHpBar = createHpBar(minion.HP, minionConfig.maxHP);
|
|
3274
|
+
const minionPassives = minion.skills.map((p) => `${p}:${passiveConfig[p].description}`);
|
|
3275
|
+
result.push(
|
|
3276
|
+
`${minion.name}`,
|
|
3277
|
+
`${minionHpBar} (${minion.HP}/${minionConfig.maxHP})`,
|
|
3278
|
+
`标签:${minionConfig.tags.join("、")}`,
|
|
3279
|
+
"被动:",
|
|
3280
|
+
...minionPassives.length ? minionPassives : ["无"]
|
|
3281
|
+
);
|
|
3282
|
+
}
|
|
2998
3283
|
}
|
|
2999
3284
|
return result.join("\n");
|
|
3000
3285
|
});
|
|
3286
|
+
ctx.command("ggcevo/初始化主宰 <groupid:number>", "初始化指定主宰组", { authority: 3 }).alias("初始化zz").action(async ({ session }, groupid) => {
|
|
3287
|
+
if (!groupid) groupid = 1;
|
|
3288
|
+
const bossConfig = bossPool.find((g) => g.main.id === groupid);
|
|
3289
|
+
if (!bossConfig) {
|
|
3290
|
+
return `未找到groupid为${groupid}的主宰配置`;
|
|
3291
|
+
}
|
|
3292
|
+
await ctx.database.remove("ggcevo_boss", {});
|
|
3293
|
+
const mainBoss = await ctx.database.create("ggcevo_boss", {
|
|
3294
|
+
name: bossConfig.main.name,
|
|
3295
|
+
type: "主宰",
|
|
3296
|
+
HP: bossConfig.main.maxHP,
|
|
3297
|
+
skills: [...bossConfig.main.passive],
|
|
3298
|
+
groupId: groupid,
|
|
3299
|
+
isActive: true,
|
|
3300
|
+
respawnTime: /* @__PURE__ */ new Date()
|
|
3301
|
+
});
|
|
3302
|
+
for (const minion of bossConfig.minions) {
|
|
3303
|
+
await ctx.database.create("ggcevo_boss", {
|
|
3304
|
+
name: minion.name,
|
|
3305
|
+
type: "子代",
|
|
3306
|
+
HP: minion.maxHP,
|
|
3307
|
+
skills: [...minion.passive],
|
|
3308
|
+
groupId: groupid,
|
|
3309
|
+
isActive: true,
|
|
3310
|
+
respawnTime: /* @__PURE__ */ new Date()
|
|
3311
|
+
});
|
|
3312
|
+
}
|
|
3313
|
+
return `✅ 主宰初始化成功!当前主宰:${bossConfig.main.name}(HP:${bossConfig.main.maxHP})`;
|
|
3314
|
+
});
|
|
3001
3315
|
ctx.command("ggcevo/祈愿").alias("祈福", "祈祷").action(async (argv) => {
|
|
3002
3316
|
const session = argv.session;
|
|
3003
3317
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|