koishi-plugin-ggcevo-game 1.2.63 → 1.2.65

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 +63 -39
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -369,7 +369,7 @@ function apply(ctx, config) {
369
369
  "弧焊枪": {
370
370
  id: 9,
371
371
  type: "能量武器",
372
- damage: 30,
372
+ damage: 25,
373
373
  description: "一种经过改造的电动工具,可对近距离的目标放出高压电",
374
374
  price: 750,
375
375
  tagEffects: {
@@ -528,7 +528,7 @@ function apply(ctx, config) {
528
528
  },
529
529
  "结构装甲": {
530
530
  effect: 0,
531
- description: "拥有结构装甲,受到的伤害-20%;若伤害来源于能量武器,则受到的伤害-40%"
531
+ description: "拥有结构装甲,受到的伤害-20%;若伤害来源于热能武器,则受到的伤害-40%"
532
532
  }
533
533
  };
534
534
  const bossPool = [
@@ -708,8 +708,8 @@ function apply(ctx, config) {
708
708
  const syndicatePirateConfig = [
709
709
  {
710
710
  professionName: "能量武器专家",
711
- effect: "能量武器攻击伤害+15%",
712
- requirements: "拥有一把武器等级为6的能量武器",
711
+ effect: "能量武器攻击伤害+15%,解锁传奇激光购买权限",
712
+ requirements: "拥有一把武器等级为3的能量武器",
713
713
  Jobtransfer: true,
714
714
  costcoins: 0,
715
715
  costredcrystal: 20
@@ -1118,10 +1118,10 @@ function apply(ctx, config) {
1118
1118
  __name(activateNextBossGroup, "activateNextBossGroup");
1119
1119
  ctx.setInterval(async () => {
1120
1120
  const totalBosses = await ctx.database.select("ggcevo_boss").execute((row) => import_koishi.$.count(row.name));
1121
- const [groupId] = config.groupId;
1121
+ const groupId = [...config.groupId];
1122
1122
  if (totalBosses === 0) {
1123
1123
  await activateNextBossGroup();
1124
- await ctx.broadcast([groupId], `🔄 咕咕PVE系统已初始化,首个主宰已登场!`);
1124
+ await ctx.broadcast(groupId, `🔄 咕咕PVE系统已初始化,首个主宰已登场!`);
1125
1125
  return;
1126
1126
  }
1127
1127
  const now = /* @__PURE__ */ new Date();
@@ -1135,8 +1135,8 @@ function apply(ctx, config) {
1135
1135
  groupId: group.groupId
1136
1136
  });
1137
1137
  await activateNextBossGroup(group.groupId);
1138
- const [groupId2] = config.groupId;
1139
- await ctx.broadcast([groupId2], `🔄 新的主宰已刷新,快去挑战吧!`);
1138
+ const groupId2 = [...config.groupId];
1139
+ await ctx.broadcast(groupId2, `🔄 新的主宰已刷新,快去挑战吧!`);
1140
1140
  }
1141
1141
  }, 60 * 1e3);
1142
1142
  const PassiveHandler = {
@@ -1383,9 +1383,9 @@ function apply(ctx, config) {
1383
1383
  }
1384
1384
  let reduction = 0.2;
1385
1385
  let msg = "常规减伤20%";
1386
- if (weaponData.type === "能量武器") {
1386
+ if (weaponData.type === "热能武器") {
1387
1387
  reduction = 0.4;
1388
- msg = "能量武器减伤40%";
1388
+ msg = "热能武器减伤40%";
1389
1389
  }
1390
1390
  const newDamage = Math.floor(initialDamage * (1 - reduction));
1391
1391
  return {
@@ -1687,11 +1687,11 @@ function apply(ctx, config) {
1687
1687
  case "能量武器专家":
1688
1688
  const weapons = await ctx2.database.get("ggcevo_equipment", {
1689
1689
  handle,
1690
- level: { $gte: 6 }
1690
+ level: { $gte: 3 }
1691
1691
  });
1692
1692
  const hasEnergyWeapon = weapons.some((weapon) => {
1693
1693
  const weaponConfigEntry = Object.values(weaponConfig).find((c) => c.id === weapon.weaponId);
1694
- return weaponConfigEntry?.type === "能量";
1694
+ return weaponConfigEntry?.type === "能量武器";
1695
1695
  });
1696
1696
  return {
1697
1697
  success: hasEnergyWeapon,
@@ -2602,33 +2602,44 @@ ${itemDetails.join("\n")}`;
2602
2602
  if (!handle || !itemName || amount <= 0) {
2603
2603
  return "参数格式错误,正确格式:给予 用户句柄 物品名称 数量";
2604
2604
  }
2605
+ const parsedAmount = Math.floor(amount);
2605
2606
  if (itemName === "金币") {
2606
2607
  const [signData] = await ctx.database.get("ggcevo_sign", { handle });
2608
+ const newTotal = (signData?.totalRewards || 0) + parsedAmount;
2607
2609
  await ctx.database.upsert("ggcevo_sign", [{
2608
2610
  handle,
2609
- totalRewards: (signData?.totalRewards || 0) + Math.floor(amount),
2611
+ totalRewards: newTotal,
2610
2612
  lastSign: signData?.lastSign || /* @__PURE__ */ new Date(0),
2611
- // 保持原有最后签到时间
2612
2613
  monthlyDays: signData?.monthlyDays || 0
2613
- // 保持月签到天数
2614
2614
  }]);
2615
- return `成功为 ${handle} 添加 ${amount} 金币!当前金币总数:${(signData?.totalRewards || 0) + amount}`;
2616
- }
2617
- const validItems = Object.keys(initDefaultItems);
2618
- if (!validItems.includes(itemName)) {
2619
- return `无效物品名称,可用物品:${validItems.join("、")}`;
2615
+ return `成功为 ${handle} 添加 ${parsedAmount} 金币!当前总数:${newTotal}`;
2616
+ } else if (itemName === "红晶") {
2617
+ const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
2618
+ const currentRed = careerData?.redcrystal || 0;
2619
+ const newRed = currentRed + parsedAmount;
2620
+ await ctx.database.upsert("ggcevo_careers", [{
2621
+ handle,
2622
+ redcrystal: newRed,
2623
+ group: careerData?.group || "",
2624
+ career: careerData?.career || "",
2625
+ date: careerData?.date || /* @__PURE__ */ new Date()
2626
+ }]);
2627
+ return `成功为 ${handle} 添加 ${parsedAmount} 红晶!当前总数:${newRed}`;
2628
+ } else {
2629
+ const validItems = Object.keys(initDefaultItems);
2630
+ if (!validItems.includes(itemName)) {
2631
+ return `无效物品名称,可用物品:${validItems.join("、")}`;
2632
+ }
2633
+ const itemId = initDefaultItems[itemName].id;
2634
+ const [backpack] = await ctx.database.get("ggcevo_backpack", { handle, itemId });
2635
+ const newQuantity = (backpack?.quantity || 0) + parsedAmount;
2636
+ await ctx.database.upsert("ggcevo_backpack", [{
2637
+ handle,
2638
+ itemId,
2639
+ quantity: newQuantity
2640
+ }], ["handle", "itemId"]);
2641
+ return `成功为 ${handle} 添加 ${parsedAmount} 个${itemName}!当前总数:${newQuantity}`;
2620
2642
  }
2621
- const itemId = initDefaultItems[itemName].id;
2622
- const [backpack] = await ctx.database.get("ggcevo_backpack", {
2623
- handle,
2624
- itemId
2625
- });
2626
- await ctx.database.upsert("ggcevo_backpack", [{
2627
- handle,
2628
- itemId,
2629
- quantity: (backpack?.quantity || 0) + Math.floor(amount)
2630
- }], ["handle", "itemId"]);
2631
- return `成功为 ${handle} 添加 ${amount} 个${itemName}!当前总数:${(backpack?.quantity || 0) + amount}`;
2632
2643
  } catch (err) {
2633
2644
  console.error("[给予命令错误]", err);
2634
2645
  return "操作失败:" + (err instanceof Error ? err.message : "数据库异常");
@@ -3092,8 +3103,8 @@ ${achievementList.join("\n")}`;
3092
3103
  `玩家数: ${lobby.slotsHumansTaken}/${lobby.slotsHumansTotal}`,
3093
3104
  `🏆 安全玩家:${atElements || "无"}`
3094
3105
  ].join("\n");
3095
- const [groupId] = config.groupId;
3096
- await ctx.broadcast([groupId], message);
3106
+ const groupId = [...config.groupId];
3107
+ await ctx.broadcast(groupId, message);
3097
3108
  processedLobbies.add(lobby.id);
3098
3109
  }
3099
3110
  }
@@ -3433,6 +3444,7 @@ ${validTypes.join("、")}`;
3433
3444
  }).then((records) => records[0]);
3434
3445
  let actualPrice = config2.price;
3435
3446
  let discountMessage = "";
3447
+ let equippedCount;
3436
3448
  if (activeWish) {
3437
3449
  actualPrice = Math.floor(config2.price * 0.8);
3438
3450
  discountMessage = ` (祈愿优惠价,原价${config2.price})`;
@@ -3456,11 +3468,23 @@ ${validTypes.join("、")}`;
3456
3468
  modificationSlots: 1,
3457
3469
  equipped: false
3458
3470
  }], ["handle", "weaponId"]);
3471
+ equippedCount = await ctx.database.select("ggcevo_equipment").where({ handle, equipped: true }).execute((row) => import_koishi.$.count(row.weaponId));
3472
+ if (equippedCount === 0) {
3473
+ await ctx.database.set(
3474
+ "ggcevo_equipment",
3475
+ { handle, weaponId: config2.id },
3476
+ { equipped: true }
3477
+ );
3478
+ }
3459
3479
  });
3460
3480
  let message = `成功购买 ${weapon}!花费 ${actualPrice}枚金币${discountMessage}。`;
3461
3481
  if (activeWish) {
3462
3482
  message += `
3463
3483
  🦗 蚱蜢优购祈愿已使用,下次购买将恢复原价。`;
3484
+ }
3485
+ if (equippedCount === 0) {
3486
+ message += `
3487
+ 已自动为您装备当前武器!`;
3464
3488
  }
3465
3489
  return message + "\n输入“武器仓库”查看你拥有的武器。";
3466
3490
  });
@@ -3489,9 +3513,9 @@ ${validTypes.join("、")}`;
3489
3513
  "🛡️ 您当前拥有的武器",
3490
3514
  '使用"装备武器 武器名称"来装备武器',
3491
3515
  "⚡表示当前装备武器",
3492
- "────────────────",
3516
+ "──────────────",
3493
3517
  ...weaponDetails.length ? weaponDetails : ["空空如也,快去“武器库”看看吧!"],
3494
- "────────────────",
3518
+ "──────────────",
3495
3519
  "💡 武器效果说明:",
3496
3520
  "🔧 改装效果在战斗中生效"
3497
3521
  ].join("\n");
@@ -3868,8 +3892,8 @@ ${validTypes.join("、")}`;
3868
3892
  await session.send(resultMessage);
3869
3893
  if (broadcastMessage) {
3870
3894
  const finalBroadcast = Array.isArray(broadcastMessage) ? broadcastMessage.join("\n") : broadcastMessage;
3871
- const [groupId] = config2.groupId;
3872
- await ctx.broadcast([groupId], finalBroadcast);
3895
+ const groupId = [...config2.groupId];
3896
+ await ctx.broadcast(groupId, finalBroadcast);
3873
3897
  }
3874
3898
  });
3875
3899
  ctx.command("ggcevo/伤害榜 [page]", "查看当前主宰伤害排名").usage("输入 伤害榜 [页码] 查看对应页的排行榜,每页10条").action(async (_, page) => {
@@ -4010,8 +4034,8 @@ ${validTypes.join("、")}`;
4010
4034
  case "酥手空空":
4011
4035
  newGold = Math.max(0, newGold - 50);
4012
4036
  const kfcMsg = '🍗【疯狂星期四警报】有人抽中了"酥手空空"!钱包空空如也,现在急需好心人V他50金币!慈悲为怀的指挥官,速带黄金救场,解救同袍于水火!🆘';
4013
- const [groupId] = config.groupId;
4014
- await ctx.broadcast([groupId], kfcMsg);
4037
+ const groupId = [...config.groupId];
4038
+ await ctx.broadcast(groupId, kfcMsg);
4015
4039
  break;
4016
4040
  case "夜市赠礼":
4017
4041
  const [backpack] = await ctx.database.get("ggcevo_backpack", { handle, itemId: 1 });
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.63",
4
+ "version": "1.2.65",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [