koishi-plugin-ggcevo-game 1.2.47 → 1.2.49

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.
Files changed (2) hide show
  1. package/lib/index.js +180 -102
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -307,8 +307,8 @@ function apply(ctx, config) {
307
307
  price: 850,
308
308
  tagEffects: {
309
309
  "重甲": 2,
310
- "机械": 0.8,
311
- "护盾": 0.5
310
+ "机械": 0.5,
311
+ "护盾": 0.2
312
312
  }
313
313
  },
314
314
  "等离子切割机": {
@@ -322,7 +322,7 @@ function apply(ctx, config) {
322
322
  "机械": 1.2
323
323
  }
324
324
  },
325
- "霰弹枪": {
325
+ "突击霰弹枪": {
326
326
  id: 6,
327
327
  type: "实弹武器",
328
328
  damage: 28,
@@ -330,17 +330,17 @@ function apply(ctx, config) {
330
330
  price: 325,
331
331
  tagEffects: {
332
332
  "轻甲": 1.5,
333
- "重甲": 0.5
333
+ "重甲": 0.8
334
334
  }
335
335
  },
336
- "狙击步枪": {
336
+ "侦查步枪": {
337
337
  id: 7,
338
338
  type: "实弹武器",
339
339
  damage: 60,
340
340
  description: "用于隐秘射击的最佳武器,但是无法穿透护甲",
341
341
  price: 550,
342
342
  tagEffects: {
343
- "护盾": 0.8,
343
+ "护盾": 0.5,
344
344
  "轻甲": 0.5,
345
345
  "重甲": 0.2
346
346
  }
@@ -355,17 +355,28 @@ function apply(ctx, config) {
355
355
  "惧寒": 2,
356
356
  "灵能": 1.5
357
357
  }
358
+ },
359
+ "弧焊枪": {
360
+ id: 9,
361
+ type: "实弹武器",
362
+ damage: 30,
363
+ description: "一种经过改造的电动工具,可对近距离的目标放出高压电",
364
+ price: 750,
365
+ tagEffects: {
366
+ "机械": 1.5,
367
+ "建筑": 2
368
+ }
358
369
  }
359
370
  };
360
371
  const modConfig = {
361
372
  "动能增幅": {
362
- cost: 1250,
373
+ cost: 1750,
363
374
  effect: "伤害+20%",
364
375
  exclusiveTo: "",
365
376
  isExclusive: false
366
377
  },
367
378
  "棱镜水晶": {
368
- cost: 1750,
379
+ cost: 2250,
369
380
  effect: "暴击率+20%",
370
381
  exclusiveTo: "",
371
382
  isExclusive: false
@@ -380,10 +391,16 @@ function apply(ctx, config) {
380
391
  // 标记为专属模块
381
392
  },
382
393
  "棱镜超载核心": {
383
- cost: 2500,
394
+ cost: 2750,
384
395
  effect: "暴击率+80%",
385
396
  exclusiveTo: "激光步枪",
386
397
  isExclusive: true
398
+ },
399
+ "助燃核心": {
400
+ cost: 2550,
401
+ effect: "对惧热目标改为造成300%伤害",
402
+ exclusiveTo: "焚烧枪",
403
+ isExclusive: true
387
404
  }
388
405
  };
389
406
  const wishConfig = {
@@ -444,7 +461,15 @@ function apply(ctx, config) {
444
461
  Jobtransfer: true
445
462
  },
446
463
  {
447
- professionName: "安保警卫",
464
+ professionName: "警卫员下士",
465
+ effectname: "",
466
+ effect: "攻击获得的金币增加100%",
467
+ requirements: "当期伤害榜攻击次数达到5次",
468
+ description: "",
469
+ Jobtransfer: true
470
+ },
471
+ {
472
+ professionName: "警卫长",
448
473
  effectname: "",
449
474
  effect: "攻击获得的金币增加100%",
450
475
  requirements: "当期伤害榜攻击次数达到5次",
@@ -452,7 +477,7 @@ function apply(ctx, config) {
452
477
  Jobtransfer: true
453
478
  },
454
479
  {
455
- professionName: "首席武器官",
480
+ professionName: "武器中士",
456
481
  effectname: "",
457
482
  effect: "攻击伤害+10%",
458
483
  requirements: "当期伤害榜造成200点伤害",
@@ -460,7 +485,7 @@ function apply(ctx, config) {
460
485
  Jobtransfer: true
461
486
  },
462
487
  {
463
- professionName: "医生",
488
+ professionName: "医疗专家",
464
489
  effectname: "",
465
490
  effect: "",
466
491
  requirements: "",
@@ -468,7 +493,7 @@ function apply(ctx, config) {
468
493
  Jobtransfer: false
469
494
  },
470
495
  {
471
- professionName: "首席情报官",
496
+ professionName: "情报副官",
472
497
  effectname: "",
473
498
  effect: "升级联盟空间站科技享有80%的折扣",
474
499
  requirements: "拥有500枚金币",
@@ -476,7 +501,7 @@ function apply(ctx, config) {
476
501
  Jobtransfer: false
477
502
  },
478
503
  {
479
- professionName: "首席工程师",
504
+ professionName: "总工程师",
480
505
  effectname: "",
481
506
  effect: "拥有独特的C.O.R.E科技升级权限",
482
507
  requirements: "",
@@ -492,7 +517,7 @@ function apply(ctx, config) {
492
517
  Jobtransfer: false
493
518
  },
494
519
  {
495
- professionName: "首席机械师",
520
+ professionName: "机械化专家",
496
521
  effectname: "",
497
522
  effect: "机甲形态攻击伤害+50%",
498
523
  requirements: "",
@@ -510,7 +535,7 @@ function apply(ctx, config) {
510
535
  ];
511
536
  const syndicatePirateConfig = [
512
537
  {
513
- professionName: "能量武器",
538
+ professionName: "能量武器专家",
514
539
  effectname: "",
515
540
  effect: "能量武器攻击伤害+15%",
516
541
  requirements: "",
@@ -533,6 +558,14 @@ function apply(ctx, config) {
533
558
  description: "",
534
559
  Jobtransfer: true
535
560
  },
561
+ {
562
+ professionName: "猩红杀手",
563
+ effectname: "",
564
+ effect: "升级武器享有80%的折扣",
565
+ requirements: "",
566
+ description: "",
567
+ Jobtransfer: true
568
+ },
536
569
  {
537
570
  professionName: "纵火狂",
538
571
  effectname: "",
@@ -542,7 +575,7 @@ function apply(ctx, config) {
542
575
  Jobtransfer: true
543
576
  },
544
577
  {
545
- professionName: "财务",
578
+ professionName: "辛迪加财务经理",
546
579
  effectname: "",
547
580
  effect: "每日签到能额外获得红晶",
548
581
  requirements: "",
@@ -574,7 +607,15 @@ function apply(ctx, config) {
574
607
  Jobtransfer: true
575
608
  },
576
609
  {
577
- professionName: "破坏狂",
610
+ professionName: "破坏者",
611
+ effectname: "",
612
+ effect: "pk胜利获得额外红晶",
613
+ requirements: "",
614
+ description: "",
615
+ Jobtransfer: false
616
+ },
617
+ {
618
+ professionName: "征募官",
578
619
  effectname: "",
579
620
  effect: "pk胜利获得额外红晶",
580
621
  requirements: "",
@@ -647,7 +688,7 @@ function apply(ctx, config) {
647
688
  name: "异齿猛兽-首领",
648
689
  type: "主宰",
649
690
  maxHP: 12e3,
650
- tags: ["重甲", "生物"],
691
+ tags: ["重甲", "生物", "异形"],
651
692
  passive: ["异形甲壳"]
652
693
  // 明确类型
653
694
  },
@@ -656,7 +697,7 @@ function apply(ctx, config) {
656
697
  name: "异齿猛兽",
657
698
  type: "子代",
658
699
  maxHP: 4e3,
659
- tags: ["重甲", "生物"],
700
+ tags: ["重甲", "生物", "异形"],
660
701
  passive: ["弱化形态", "异形甲壳"]
661
702
  // 明确类型
662
703
  }
@@ -668,7 +709,7 @@ function apply(ctx, config) {
668
709
  name: "寒冰王蛇",
669
710
  type: "主宰",
670
711
  maxHP: 8500,
671
- tags: ["重甲", "惧热", "生物"],
712
+ tags: ["重甲", "惧热", "生物", "异形"],
672
713
  passive: ["冰霜环绕", "冰霜进化"]
673
714
  // 明确类型
674
715
  },
@@ -677,7 +718,7 @@ function apply(ctx, config) {
677
718
  name: "冰蛇",
678
719
  type: "子代",
679
720
  maxHP: 2500,
680
- tags: ["惧热", "生物"],
721
+ tags: ["惧热", "生物", "异形"],
681
722
  passive: ["弱化形态", "冰霜回复", "冰霜进化"]
682
723
  // 明确类型
683
724
  }
@@ -688,8 +729,8 @@ function apply(ctx, config) {
688
729
  id: 3,
689
730
  name: "莽兽",
690
731
  type: "主宰",
691
- maxHP: 8e3,
692
- tags: ["重甲", "生物"],
732
+ maxHP: 1e4,
733
+ tags: ["重甲", "生物", "异形"],
693
734
  passive: ["应激甲壳II", "求生本能II", "冷适应"]
694
735
  // 明确类型
695
736
  },
@@ -698,7 +739,7 @@ function apply(ctx, config) {
698
739
  name: "狂暴畸变体",
699
740
  type: "子代",
700
741
  maxHP: 2e3,
701
- tags: ["重甲", "生物"],
742
+ tags: ["重甲", "生物", "异形"],
702
743
  passive: ["弱化形态", "应激甲壳I", "求生本能I", "冷适应"]
703
744
  // 明确类型
704
745
  },
@@ -706,7 +747,7 @@ function apply(ctx, config) {
706
747
  name: "剧毒畸变体",
707
748
  type: "子代",
708
749
  maxHP: 2e3,
709
- tags: ["重甲", "生物"],
750
+ tags: ["重甲", "生物", "异形"],
710
751
  passive: ["弱化形态", "应激甲壳I", "求生本能I", "冷适应"]
711
752
  // 明确类型
712
753
  }
@@ -752,6 +793,8 @@ function apply(ctx, config) {
752
793
  let effectValue;
753
794
  if (tag === "重甲" && equippedWeapon.installedMods.includes("裂甲核心")) {
754
795
  effectValue = 1.2;
796
+ } else if (tag === "惧热" && equippedWeapon.installedMods.includes("助燃核心")) {
797
+ effectValue = 3;
755
798
  } else {
756
799
  effectValue = weaponData.tagEffects?.[tag] ?? 1;
757
800
  }
@@ -943,8 +986,8 @@ function apply(ctx, config) {
943
986
  __name(updatePityCounter, "updatePityCounter");
944
987
  async function checkSensitiveWord(content) {
945
988
  try {
946
- const response = await ctx.http("get", `https://api.iminbk.com/v1/wordscan/?word=${encodeURIComponent(content)}`);
947
- return response.data.verdict === "security";
989
+ const response = await ctx.http("get", `https://v.api.aa1.cn/api/api-mgc/index.php?msg=${encodeURIComponent(content)}`);
990
+ return response.data.num !== "1";
948
991
  } catch (error) {
949
992
  console.error("敏感词查询失败:", error);
950
993
  return false;
@@ -1088,17 +1131,17 @@ function apply(ctx, config) {
1088
1131
  }, "handleFrostRecovery"),
1089
1132
  // 冷适应计数处理
1090
1133
  handleColdAdaptation: /* @__PURE__ */ __name(async function(ctx2, targetBoss, weaponName) {
1091
- if (weaponName !== "零度之下" || !targetBoss.skills.includes("冷适应") || targetBoss.label.includes("惧热")) {
1134
+ if (weaponName !== "零度之下" || !targetBoss.skills.includes("冷适应") || targetBoss.tags.includes("惧热")) {
1092
1135
  return null;
1093
1136
  }
1094
1137
  const newCount = (targetBoss.Skillcountpoints || 0) + 1;
1095
1138
  await ctx2.database.set("ggcevo_boss", { name: targetBoss.name }, {
1096
1139
  Skillcountpoints: newCount
1097
1140
  });
1098
- if (newCount >= 5 && !targetBoss.label.includes("惧热")) {
1099
- const newLabels = [.../* @__PURE__ */ new Set([...targetBoss.label, "惧热"])];
1141
+ if (newCount >= 5 && !targetBoss.tags.includes("惧热")) {
1142
+ const newtags = [.../* @__PURE__ */ new Set([...targetBoss.tags, "惧热"])];
1100
1143
  await ctx2.database.set("ggcevo_boss", { name: targetBoss.name }, {
1101
- tags: newLabels
1144
+ tags: newtags
1102
1145
  });
1103
1146
  return {
1104
1147
  messages: [`❄️ ${targetBoss.name} 触发【冷适应】,永久获得「惧热」标签并免疫寒冷伤害!`]
@@ -1215,23 +1258,23 @@ function apply(ctx, config) {
1215
1258
  let guguCoins, gold;
1216
1259
  switch (true) {
1217
1260
  case rank === 1:
1218
- guguCoins = 30;
1261
+ guguCoins = 10;
1219
1262
  gold = 2e3;
1220
1263
  break;
1221
1264
  case rank === 2:
1222
- guguCoins = 25;
1265
+ guguCoins = 10;
1223
1266
  gold = 1750;
1224
1267
  break;
1225
1268
  case rank === 3:
1226
- guguCoins = 20;
1269
+ guguCoins = 10;
1227
1270
  gold = 1500;
1228
1271
  break;
1229
1272
  case rank <= 10:
1230
- guguCoins = 15;
1273
+ guguCoins = 5;
1231
1274
  gold = 1e3;
1232
1275
  break;
1233
1276
  default:
1234
- guguCoins = 10;
1277
+ guguCoins = 5;
1235
1278
  gold = 500;
1236
1279
  }
1237
1280
  const key = record.handle;
@@ -1255,7 +1298,7 @@ function apply(ctx, config) {
1255
1298
  playerName: record.playerName
1256
1299
  });
1257
1300
  });
1258
- rewardMessages.push(`其他参与者各获得: 3 咕咕币 + 200 金币`);
1301
+ rewardMessages.push(`其他参与者各获得: 3 咕咕币 + 250 金币`);
1259
1302
  }
1260
1303
  const doubleRewardPlayers = await handleDoubleRewards(ctx2, damageRecords, rewardMap);
1261
1304
  await applyDoubleRewards(ctx2, doubleRewardPlayers, rewardMap, rewardMessages);
@@ -1329,7 +1372,7 @@ function apply(ctx, config) {
1329
1372
  const [existingSign] = await ctx2.database.get("ggcevo_sign", { handle });
1330
1373
  await ctx2.database.upsert("ggcevo_sign", [{
1331
1374
  handle,
1332
- totalRewards: existingSign?.totalRewards + reward.gold
1375
+ totalRewards: (existingSign?.totalRewards || 0) + reward.gold
1333
1376
  }], ["handle"]);
1334
1377
  })();
1335
1378
  updatePromises.push(signPromise);
@@ -1341,7 +1384,7 @@ function apply(ctx, config) {
1341
1384
  await ctx2.database.upsert("ggcevo_backpack", [{
1342
1385
  handle,
1343
1386
  itemId: 1,
1344
- quantity: existingItem?.quantity + reward.guguCoins
1387
+ quantity: (existingItem?.quantity || 0) + reward.guguCoins
1345
1388
  }], ["handle", "itemId"]);
1346
1389
  })();
1347
1390
  updatePromises.push(backpackPromise);
@@ -2153,7 +2196,7 @@ ${itemDetails.join("\n")}`;
2153
2196
  ) + 1;
2154
2197
  const isSafe = await checkSensitiveWord(user.name);
2155
2198
  const displayName = isSafe ? user.name : (user.name[0] || "") + "***";
2156
- return `🎮 您的咕咕胜点榜排名信息
2199
+ return `🎮 咕咕胜点榜排名信息 🎮
2157
2200
  ------------------------------
2158
2201
  昵称:${displayName}
2159
2202
  句柄:${user.handle}
@@ -2187,7 +2230,7 @@ ${itemDetails.join("\n")}`;
2187
2230
  ) + 1;
2188
2231
  const isSafe = await checkSensitiveWord(user.name);
2189
2232
  const displayName = isSafe ? user.name : (user.name[0] || "") + "***";
2190
- return `🎮 对方的咕咕胜点榜排名信息
2233
+ return `🎮 咕咕胜点榜排名信息 🎮
2191
2234
  ------------------------------
2192
2235
  昵称:${displayName}
2193
2236
  句柄:${user.handle}
@@ -2682,12 +2725,12 @@ ${achievementList.join("\n")}`;
2682
2725
  const safePlayers = await ctx.database.select("sc2arcade_player").where({ $or: queryConditions }).execute().then((res) => res.map((r) => r.userId));
2683
2726
  const atElements = safePlayers.map((userId) => `<at id="${userId}"/>`).join(" ");
2684
2727
  const message = [
2685
- `📺 监测到违规大厅 ID: ${lobby.id}`,
2728
+ `📺 监测到违规玩家正在房间中!`,
2686
2729
  `创建时间: ${new Date(lobby.createdAt).toLocaleString("zh-CN")}`,
2687
- `🚨 违规玩家(${violators.length} 人):`,
2730
+ `🚨 违规玩家(${violators.length} 人):`,
2688
2731
  ...violators.map((v) => {
2689
2732
  const record = punishmentRecords.find((r) => r.handle === v.handle);
2690
- return `· ${v.name}(${record?.level}级处罚)`;
2733
+ return `· ${v.name}(${record?.level}级处罚)`;
2691
2734
  }),
2692
2735
  `房主: ${lobby.hostName}`,
2693
2736
  `玩家数: ${lobby.slotsHumansTaken}/${lobby.slotsHumansTotal}`,
@@ -2899,9 +2942,9 @@ ${achievementList.join("\n")}`;
2899
2942
  }).join("\n");
2900
2943
  return [
2901
2944
  "🏆 PK排行榜(已启用PK功能的玩家)",
2902
- "────────────────",
2945
+ "──────────────",
2903
2946
  rankingText,
2904
- "────────────────",
2947
+ "──────────────",
2905
2948
  `第 ${pageNum} 页 / 共 ${totalPages} 页`,
2906
2949
  pageNum < totalPages ? `输入 pk榜 ${pageNum + 1} 查看下一页` : "已是最后一页"
2907
2950
  ].join("\n");
@@ -2952,14 +2995,14 @@ ${achievementList.join("\n")}`;
2952
2995
  day: "2-digit"
2953
2996
  })}`;
2954
2997
  });
2955
- ctx.command("ggcevo/武器库 [type]").alias("武器商店", "武器商城", "武器商场").usage("输入“武器库”查看类型,或“武器库 类型”查看详细武器信息").action(async (_, type) => {
2998
+ ctx.command("ggcevo/武器库 [type]").usage("输入“武器库”查看类型,或“武器库 类型”查看详细武器信息").action(async (_, type) => {
2956
2999
  const typeStats = Object.values(weaponConfig).reduce((stats, weapon) => {
2957
3000
  stats[weapon.type] = (stats[weapon.type] || 0) + 1;
2958
3001
  return stats;
2959
3002
  }, {});
2960
3003
  if (!type) {
2961
3004
  return [
2962
- "🏪 咕咕军火武器库分类 🏪",
3005
+ "🏪 咕咕武器库分类 🏪",
2963
3006
  '使用 "武器库 类型名称" 查看详细列表',
2964
3007
  "====================",
2965
3008
  ...Object.entries(typeStats).map(([typeName, count]) => `▸ ${typeName} (${count}种)`)
@@ -2984,7 +3027,7 @@ ${validTypes.join("、")}`;
2984
3027
  ].join("\n");
2985
3028
  });
2986
3029
  return [
2987
- `🏪 咕咕军火武器库 - ${normalizedType} 🏪`,
3030
+ `🏪 咕咕武器库 - ${normalizedType} 🏪`,
2988
3031
  "使用“购买 武器名称”命令进行购买",
2989
3032
  "====================",
2990
3033
  ...items
@@ -2992,7 +3035,7 @@ ${validTypes.join("、")}`;
2992
3035
  });
2993
3036
  ctx.command("ggcevo/购买 <weapon>").action(async ({ session }, weapon) => {
2994
3037
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
2995
- if (!profile) return "您暂未绑定句柄";
3038
+ if (!profile) return "您暂未绑定句柄。";
2996
3039
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
2997
3040
  const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
2998
3041
  if (existingEntries.length > 0) {
@@ -3023,7 +3066,7 @@ ${validTypes.join("、")}`;
3023
3066
  discountMessage = ` (祈愿优惠价,原价${config2.price})`;
3024
3067
  }
3025
3068
  if ((signInfo?.totalRewards || 0) < actualPrice) {
3026
- return `金币不足,需要${actualPrice}枚金币${discountMessage}。`;
3069
+ return `金币不足,需要${actualPrice}枚金币${discountMessage}`;
3027
3070
  }
3028
3071
  await ctx.database.withTransaction(async () => {
3029
3072
  await ctx.database.set("ggcevo_sign", { handle }, {
@@ -3047,9 +3090,9 @@ ${validTypes.join("、")}`;
3047
3090
  message += `
3048
3091
  🦗 蚱蜢优购祈愿已使用,下次购买将恢复原价。`;
3049
3092
  }
3050
- return message + "\n输入“武器列表”查看你的武器库。";
3093
+ return message + "\n输入“武器仓库”查看你拥有的武器。";
3051
3094
  });
3052
- ctx.command("ggcevo/武器列表").action(async ({ session }) => {
3095
+ ctx.command("ggcevo/武器仓库").action(async ({ session }) => {
3053
3096
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
3054
3097
  if (!profile) return "您暂未绑定句柄";
3055
3098
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -3071,19 +3114,20 @@ ${validTypes.join("、")}`;
3071
3114
  ].join("\n");
3072
3115
  }));
3073
3116
  return [
3074
- "🛡️ 当前拥有的武器列表",
3117
+ "🛡️ 您当前拥有的武器",
3075
3118
  '使用"装备 武器名称"切换武器',
3076
3119
  "⚡表示当前装备武器",
3077
3120
  "────────────────",
3078
- ...weaponDetails.length ? weaponDetails : ["空空如也,快去武器库看看吧!"],
3121
+ ...weaponDetails.length ? weaponDetails : ["空空如也,快去“武器库”看看吧!"],
3079
3122
  "────────────────",
3080
3123
  "💡 武器效果说明:",
3081
- "🔧 改装效果会在战斗中生效"
3124
+ "🔧 改装效果在战斗中生效"
3082
3125
  ].join("\n");
3083
3126
  });
3084
3127
  ctx.command("ggcevo/装备 <weapon>").action(async ({ session }, weapon) => {
3085
3128
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
3086
3129
  if (!profile) return "您暂未绑定句柄。";
3130
+ if (!weapon) return "缺少参数,请输入“装备 武器名称”。";
3087
3131
  if (!weaponConfig[weapon]) return "请输入“装备 武器名称”来装备一把你拥有的武器。";
3088
3132
  const config2 = weaponConfig[weapon];
3089
3133
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -3114,7 +3158,7 @@ ${validTypes.join("、")}`;
3114
3158
  });
3115
3159
  return `您已成功装备 ${weapon}!`;
3116
3160
  });
3117
- ctx.command("ggcevo/升级 <weapon>", "升级武器伤害").alias("升级武器", "武器升级", "武器强化", "强化武器").action(async ({ session }, weapon) => {
3161
+ ctx.command("ggcevo/升级武器 <weapon>", "升级武器伤害").action(async ({ session }, weapon) => {
3118
3162
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
3119
3163
  if (!profile) return "您暂未绑定句柄。";
3120
3164
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -3127,7 +3171,7 @@ ${validTypes.join("、")}`;
3127
3171
  handle,
3128
3172
  weaponId: weaponConfig[weapon]?.id
3129
3173
  });
3130
- if (!weapon) return "请输入“升级 武器名称”来升级你想要的武器。";
3174
+ if (!weapon) return "请输入“升级武器 武器名称”来升级你想要的武器。";
3131
3175
  if (!equipment) return "尚未获得该武器。";
3132
3176
  if (equipment.level >= 6) return "该武器已达最大升级等级。";
3133
3177
  const activeWish = await ctx.database.get("ggcevo_Wish_Record", {
@@ -3172,9 +3216,9 @@ ${validTypes.join("、")}`;
3172
3216
  🦊 灵狐升运祈愿已使用,下次升级将恢复原价。`;
3173
3217
  }
3174
3218
  return `${message}
3175
- 当前等级:${newLevel},伤害:${baseDamage},可用改装槽:${slots}个。`;
3219
+ 当前等级:${newLevel},伤害:${baseDamage},拥有改装槽:${slots}个。`;
3176
3220
  });
3177
- ctx.command("ggcevo/改装 <weapon> [mod]", "安装武器模块").alias("改装武器", "改造", "改造武器", "武器改装", "武器改造").action(async ({ session }, weapon, mod) => {
3221
+ ctx.command("ggcevo/改装武器 <weapon> [mod]", "安装武器模块").action(async ({ session }, weapon, mod) => {
3178
3222
  const isValidWeapon = weapon && weaponConfig[weapon]?.id !== void 0;
3179
3223
  const generateModList = /* @__PURE__ */ __name(() => {
3180
3224
  if (!isValidWeapon) {
@@ -3192,7 +3236,7 @@ ${validTypes.join("、")}`;
3192
3236
  if (!mod || !modConfig[mod]) {
3193
3237
  return [
3194
3238
  isValidWeapon ? `🛠️ ${weapon} 专属模块 🛠️` : "🛠️ 通用武器模块 🛠️",
3195
- isValidWeapon ? `使用「改装 ${weapon} 模块名称」安装专属模块` : weapon ? "※ 无效武器名称,请使用「改装 武器名称 模块名称」安装模块" : "※ 输入「改装 武器名称」查询专属模块\n※ 安装模块:「改装 武器名称 模块名称」",
3239
+ isValidWeapon ? `使用「改装武器 ${weapon} 模块名称」安装专属模块` : weapon ? "※ 无效武器名称,请使用「改装武器 武器名称 模块名称」安装模块" : "※ 输入「改装武器 武器名称」查询专属模块\n※ 安装模块:「改装武器 武器名称 模块名称」",
3196
3240
  "====================",
3197
3241
  generateModList()
3198
3242
  ].join("\n\n");
@@ -3219,9 +3263,9 @@ ${validTypes.join("、")}`;
3219
3263
  if (hasExclusive) return "❌ 每个武器只能安装一个专属模块。";
3220
3264
  }
3221
3265
  if (equipment.installedMods.length >= equipment.modificationSlots)
3222
- return "改装槽已满,升级武器等级至3/6级的时候会额外获得一个改装槽。";
3266
+ return "当前武器改装槽已满(升级武器等级至3/6级的时候会额外获得一个改装槽)。";
3223
3267
  if (equipment.installedMods.includes(mod))
3224
- return "已安装相同模块。";
3268
+ return "当前武器已安装相同模块。";
3225
3269
  if ((signInfo?.totalRewards || 0) < modInfo.cost)
3226
3270
  return `需要${modInfo.cost}枚金币,当前持有:${signInfo?.totalRewards || 0}`;
3227
3271
  await ctx.database.set("ggcevo_equipment", {
@@ -3248,15 +3292,25 @@ ${validTypes.join("、")}`;
3248
3292
  `剩余金币:${signInfo.totalRewards - modInfo.cost}`
3249
3293
  ].join("\n\n");
3250
3294
  });
3251
- ctx.command("ggcevo/攻击 <bossName>").usage("请输入要攻击的BOSS名称(例如:攻击 异齿猛兽 或 攻击 寒冰王蛇)").action(async (argv, bossName) => {
3295
+ ctx.command("ggcevo/攻击 <bossName>").usage("请输入要攻击的异形名称(例如:攻击 异齿猛兽 或 攻击 寒冰王蛇)").action(async (argv, bossName) => {
3252
3296
  const session = argv.session;
3253
3297
  let broadcastMessage = null;
3298
+ const getActiveBossNames = /* @__PURE__ */ __name(async () => {
3299
+ const activeBosses2 = await ctx.database.get("ggcevo_boss", { isActive: true });
3300
+ return activeBosses2.map((b) => b.name).join(",");
3301
+ }, "getActiveBossNames");
3302
+ if (!bossName) {
3303
+ const activeNames = await getActiveBossNames();
3304
+ return `请输入正确的攻击目标,当前存活的异形:${activeNames || "无"}。请使用"攻击 异形名称"进行攻击。`;
3305
+ }
3254
3306
  const [targetBoss] = await ctx.database.get("ggcevo_boss", {
3255
3307
  name: bossName,
3256
3308
  isActive: true
3257
3309
  });
3258
- if (!bossName) return `请选择你要攻击的目标,请使用"主宰信息"查看`;
3259
- if (!targetBoss) return `当前没有找到名为 ${bossName} 的可攻击目标,请使用"主宰信息"查看`;
3310
+ if (!targetBoss) {
3311
+ const activeNames = await getActiveBossNames();
3312
+ return `当前没有找到名为 ${bossName} 的可攻击目标,当前存活的异形:${activeNames || "无"}。请使用"攻击 异形名称"进行攻击。`;
3313
+ }
3260
3314
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
3261
3315
  if (!profile) return "您暂未绑定句柄。";
3262
3316
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -3278,16 +3332,16 @@ ${validTypes.join("、")}`;
3278
3332
  handle,
3279
3333
  equipped: true
3280
3334
  });
3281
- if (!equippedWeapon) return "请先装备武器再攻击。";
3335
+ if (!equippedWeapon) return "请先输入“装备武器 武器名称”后再攻击。";
3282
3336
  const weaponConfigEntry = Object.entries(weaponConfig).find(([_, c]) => c.id === equippedWeapon.weaponId);
3283
3337
  const [weaponName, weaponData] = weaponConfigEntry;
3284
3338
  const { damage: baseDamage, hasCrit, effectMessage } = await calculateTotalDamage(ctx, session, equippedWeapon, targetBoss);
3285
3339
  const activeBosses = await ctx.database.get("ggcevo_boss", { isActive: true });
3286
- if (!activeBosses.length) return "当前没有存活的主宰。";
3340
+ if (!activeBosses.length) return "当前没有存活的异形,请等待1小时后刷新。";
3287
3341
  const bossGroup = bossPool.find(
3288
3342
  (g) => g.main.name === targetBoss.name || g.minions.some((m) => m.name === targetBoss.name)
3289
3343
  );
3290
- if (!bossGroup) return "无法获取BOSS组配置。";
3344
+ if (!bossGroup) return "无法获取异形组配置。";
3291
3345
  const maxHP = targetBoss.type === "主宰" ? bossGroup.main.maxHP : bossGroup.minions.find((m) => m.name === targetBoss.name)?.maxHP || 0;
3292
3346
  let initialDamage = Math.min(baseDamage, targetBoss.HP);
3293
3347
  let currentHP = targetBoss.HP - initialDamage;
@@ -3394,18 +3448,11 @@ ${validTypes.join("、")}`;
3394
3448
  );
3395
3449
  }
3396
3450
  const [existingSign] = await ctx.database.get("ggcevo_sign", { handle });
3397
- if (existingSign) {
3398
- await ctx.database.set("ggcevo_sign", { handle }, {
3399
- totalRewards: existingSign.totalRewards + initialDamage
3400
- // 改为实际伤害
3401
- });
3402
- } else {
3403
- await ctx.database.create("ggcevo_sign", {
3404
- handle,
3405
- totalRewards: initialDamage
3406
- // 改为实际伤害
3407
- });
3408
- }
3451
+ await ctx.database.upsert("ggcevo_sign", [{
3452
+ handle,
3453
+ totalRewards: (existingSign?.totalRewards || 0) + initialDamage
3454
+ // 改为实际伤害
3455
+ }], ["handle"]);
3409
3456
  const resultMessage = [
3410
3457
  `🔥 ${session.username} 使用武器 ${weaponName} 对 ${targetBoss.name} 发起攻击!`,
3411
3458
  ...effectMessage.length > 0 ? [
@@ -3431,9 +3478,9 @@ ${validTypes.join("、")}`;
3431
3478
  const pageNum = parseInt(page) || 1;
3432
3479
  if (pageNum < 1) return "请输入有效的页码。";
3433
3480
  const activeBosses = await ctx.database.get("ggcevo_boss", { isActive: true });
3434
- if (!activeBosses.length) return "当前没有激活的BOSS";
3481
+ if (!activeBosses.length) return "当前没有存活的异形,请等待1小时后刷新。";
3435
3482
  const mainBoss = activeBosses.find((b) => b.type === "主宰");
3436
- if (!mainBoss) return "当前BOSS数据异常";
3483
+ if (!mainBoss) return "当前数据异常,请联系管理员";
3437
3484
  const offset = (pageNum - 1) * 10;
3438
3485
  const [records, total] = await Promise.all([
3439
3486
  // 获取当前页记录
@@ -3448,57 +3495,53 @@ ${validTypes.join("、")}`;
3448
3495
  (record, index) => `${offset + index + 1}. ${record.playerName || "未知玩家"} | 总伤害: ${record.totalDamage} | 攻击次数: ${record.attackCount}`
3449
3496
  ).join("\n");
3450
3497
  return [
3451
- `🏆 当前主宰伤害榜 (${mainBoss.name})`,
3452
- "────────────────",
3498
+ `🏆 咕咕之战伤害榜 (${mainBoss.name})`,
3499
+ "──────────────",
3453
3500
  rankingText,
3454
- "────────────────",
3501
+ "──────────────",
3455
3502
  `第 ${pageNum} 页 / 共 ${totalPages} 页`,
3456
3503
  pageNum < totalPages ? `输入 伤害榜 ${pageNum + 1} 查看下一页` : "已是最后一页"
3457
3504
  ].join("\n");
3458
3505
  });
3459
- ctx.command("ggcevo/主宰信息", "查看当前主宰信息").alias("zz信息", "主宰状态", "zz状态").action(async () => {
3506
+ ctx.command("ggcevo/异形信息", "查看当前主宰信息").alias("yx信息", "异形状态", "yx状态").action(async () => {
3460
3507
  const activeBosses = await ctx.database.get("ggcevo_boss", { isActive: true });
3461
- if (!activeBosses.length) return "当前没有存活的主宰。";
3508
+ if (!activeBosses.length) return "当前没有存活的异形,请等待1小时后刷新。";
3462
3509
  const mainBoss = activeBosses.find((b) => b.type === "主宰");
3463
3510
  const minions = activeBosses.filter((b) => b.type === "子代");
3464
- if (!mainBoss) return "当前BOSS数据异常,请联系管理员";
3511
+ if (!mainBoss) return "当前数据异常,请联系管理员";
3465
3512
  const bossGroup = bossPool.find((group) => group.main.name === mainBoss.name);
3466
- if (!bossGroup) return "BOSS配置数据异常,请联系管理员";
3513
+ if (!bossGroup) return "配置数据异常,请联系管理员";
3467
3514
  const mainBossHpBar = createHpBar(mainBoss.HP, bossGroup.main.maxHP);
3468
3515
  const result = [
3469
3516
  `🔴 主宰:${mainBoss.name}`,
3470
3517
  `${mainBossHpBar} (${mainBoss.HP}/${bossGroup.main.maxHP})`,
3471
3518
  `标签:${mainBoss.tags?.join("、") || "无"}`,
3472
- // 从数据库label字段获取
3473
3519
  "被动:",
3474
3520
  ...mainBoss.skills.map((p) => `${p}:${passiveConfig[p]?.description}`) || ["无"]
3475
3521
  ];
3476
3522
  if (minions.length > 0) {
3477
3523
  result.push("\n🟠 子代:");
3478
- for (const minion of minions) {
3524
+ for (let i = 0; i < minions.length; i++) {
3525
+ const minion = minions[i];
3479
3526
  const minionConfig = bossGroup.minions.find((m) => m.name === minion.name);
3480
- const minionHpBar = createHpBar(
3481
- minion.HP,
3482
- minionConfig?.maxHP || 1e3
3483
- // 后备值防止报错
3484
- );
3527
+ const minionHpBar = createHpBar(minion.HP, minionConfig?.maxHP || 1e3);
3485
3528
  result.push(
3486
3529
  `${minion.name}`,
3487
3530
  `${minionHpBar} (${minion.HP}/${minionConfig?.maxHP || "未知"})`,
3488
3531
  `标签:${minion.tags?.join("、") || "无"}`,
3489
- // 从数据库获取
3490
3532
  "被动:",
3491
3533
  ...minion.skills.map((p) => `${p}:${passiveConfig[p]?.description}`) || ["无"]
3492
3534
  );
3535
+ if (i < minions.length - 1) result.push("");
3493
3536
  }
3494
3537
  }
3495
3538
  return result.join("\n");
3496
3539
  });
3497
- ctx.command("ggcevo/初始化主宰 <groupid:number>", "初始化指定主宰组", { authority: 3 }).alias("初始化zz").action(async (_, groupid) => {
3540
+ ctx.command("ggcevo/初始化异形 <groupid:number>", "初始化指定主宰组", { authority: 3 }).action(async (_, groupid) => {
3498
3541
  if (!groupid) groupid = 1;
3499
3542
  const bossConfig = bossPool.find((g) => g.main.id === groupid);
3500
3543
  if (!bossConfig) {
3501
- return `未找到groupid为${groupid}的主宰配置`;
3544
+ return `未找到groupid为${groupid}的异形配置`;
3502
3545
  }
3503
3546
  await ctx.database.remove("ggcevo_boss", {});
3504
3547
  const mainBoss = await ctx.database.create("ggcevo_boss", {
@@ -3523,7 +3566,7 @@ ${validTypes.join("、")}`;
3523
3566
  respawnTime: /* @__PURE__ */ new Date()
3524
3567
  });
3525
3568
  }
3526
- return `✅ 主宰初始化成功!当前主宰:${bossConfig.main.name}(HP:${bossConfig.main.maxHP})`;
3569
+ return `✅ 异形初始化成功!当前主宰:${bossConfig.main.name}(HP:${bossConfig.main.maxHP})`;
3527
3570
  });
3528
3571
  ctx.command("ggcevo/祈愿").alias("祈福", "祈祷").action(async (argv) => {
3529
3572
  const session = argv.session;
@@ -3600,6 +3643,41 @@ ${validTypes.join("、")}`;
3600
3643
  return `✨ 祈愿成功!花费50枚金币获得【${effect.name}】效果:${effect.effect}
3601
3644
  ⏳ 效果持续至 ${formattedEndTime}`;
3602
3645
  });
3646
+ ctx.command("兑换金币", "使用兑换券兑换金币").action(async ({ session }) => {
3647
+ const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
3648
+ if (!profile) return "您暂未绑定句柄。";
3649
+ const { regionId, realmId, profileId } = profile;
3650
+ const handle = `${regionId}-S2-${realmId}-${profileId}`;
3651
+ await session.send(`请输入你要使用多少张兑换券来兑换金币?(请在30秒内回复数字,回复“0”为取消兑换)
3652
+ 注意:1张兑换券=1500金币`);
3653
+ const exchangeInput = await session.prompt(3e4);
3654
+ if (!exchangeInput) return "输入超时,请重新输入。";
3655
+ const exchangeCount = parseInt(exchangeInput, 10);
3656
+ if (isNaN(exchangeCount)) return "请输入有效的数字!";
3657
+ if (exchangeCount < 0) return "兑换数量不能为负数!";
3658
+ if (exchangeCount === 0) return "已取消兑换。";
3659
+ const [item] = await ctx.database.get("ggcevo_backpack", {
3660
+ handle,
3661
+ itemId: 2
3662
+ });
3663
+ const [coin] = await ctx.database.get("ggcevo_sign", {
3664
+ handle
3665
+ });
3666
+ if (!item || item.quantity < exchangeCount) {
3667
+ return "您的兑换券不足,无法兑换!";
3668
+ }
3669
+ const goldAmount = exchangeCount * 1500;
3670
+ await ctx.database.set("ggcevo_backpack", {
3671
+ handle,
3672
+ itemId: 2
3673
+ }, {
3674
+ quantity: item.quantity - exchangeCount
3675
+ });
3676
+ await ctx.database.set("ggcevo_sign", { handle }, {
3677
+ totalRewards: (coin?.totalRewards || 0) + goldAmount
3678
+ });
3679
+ return `成功使用${exchangeCount}张兑换券,获得${goldAmount}枚金币!`;
3680
+ });
3603
3681
  }
3604
3682
  __name(apply, "apply");
3605
3683
  function simpleDraw() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-ggcevo-game",
3
3
  "description": "《星际争霸2》咕咕虫-evolved地图的专属游戏助手插件,集成天梯排行、抽奖系统、签到福利、兑换商城等丰富功能。",
4
- "version": "1.2.47",
4
+ "version": "1.2.49",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -19,7 +19,7 @@
19
19
  "peerDependencies": {
20
20
  "@koishijs/plugin-proxy-agent": "^0.3.3",
21
21
  "koishi": "^4.18.7",
22
- "koishi-plugin-sc2arcade-search": "^1.1.11"
22
+ "koishi-plugin-sc2arcade-search": "^1.1.14"
23
23
  },
24
24
  "koishi": {
25
25
  "service": {