koishi-plugin-ggcevo-game 1.2.39 → 1.2.40

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 +40 -21
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -337,6 +337,7 @@ function apply(ctx, config) {
337
337
  description: "用于隐秘射击的最佳武器,但是无法穿透护甲",
338
338
  price: 550,
339
339
  tagEffects: {
340
+ "护盾": 0.8,
340
341
  "轻甲": 0.5,
341
342
  "重甲": 0.2
342
343
  }
@@ -396,7 +397,7 @@ function apply(ctx, config) {
396
397
  },
397
398
  {
398
399
  name: "王权增幅",
399
- effect: "攻击伤害+10%"
400
+ effect: "攻击伤害+5%"
400
401
  },
401
402
  {
402
403
  name: "金柚赐福",
@@ -768,8 +769,8 @@ function apply(ctx, config) {
768
769
  endTime: { $gte: /* @__PURE__ */ new Date() }
769
770
  });
770
771
  if (sovereignEffect) {
771
- damage *= 1.1;
772
- effectMessage.push(`👑 王权增幅祈愿生效(攻击伤害+10%)`);
772
+ damage *= 1.05;
773
+ effectMessage.push(`👑 王权增幅祈愿生效(攻击伤害+5%)`);
773
774
  }
774
775
  if (lamentEffect) {
775
776
  const levelBonus = 0.1 * (equippedWeapon.level + 1);
@@ -941,7 +942,7 @@ function apply(ctx, config) {
941
942
  const totalBosses = await ctx.database.select("ggcevo_boss").execute((row) => import_koishi.$.count(row.name));
942
943
  if (totalBosses === 0) {
943
944
  await activateNextBossGroup();
944
- ctx.broadcast(config.groupId, `🔄 BOSS系统已初始化,首个主宰已登场!`);
945
+ await ctx.broadcast(config.groupId, [`🔄 咕咕PVE系统已初始化,首个主宰已登场!`]);
945
946
  return;
946
947
  }
947
948
  const now = /* @__PURE__ */ new Date();
@@ -955,9 +956,9 @@ function apply(ctx, config) {
955
956
  groupId: group.groupId
956
957
  });
957
958
  await activateNextBossGroup(group.groupId);
958
- ctx.broadcast(
959
+ await ctx.broadcast(
959
960
  config.groupId,
960
- `🔄 新的主宰已刷新,快去挑战吧!`
961
+ [`🔄 新的主宰已刷新,快去挑战吧!`]
961
962
  );
962
963
  }
963
964
  }, 60 * 1e3);
@@ -1305,7 +1306,7 @@ ${itemDetails.join("\n")}`;
1305
1306
  if (!backpack) return "您还没有签到。";
1306
1307
  const memberInfo = await session.event?.member?.roles;
1307
1308
  if (memberInfo?.includes("member")) {
1308
- return "❌拒绝访问,仅限管理员和群主领取每月津贴。";
1309
+ return "❌ 拒绝访问,仅限管理员和群主领取每月津贴。";
1309
1310
  }
1310
1311
  const now = /* @__PURE__ */ new Date();
1311
1312
  const chinatime = convertUTCtoChinaTime(now);
@@ -1523,7 +1524,7 @@ ${itemDetails.join("\n")}`;
1523
1524
  }
1524
1525
  }
1525
1526
  }, 60 * 60 * 1e3);
1526
- ctx.command("ggcevo/数据同步", { authority: 3 }).action(async () => {
1527
+ ctx.command("ggcevo/胜点榜数据同步", { authority: 3 }).action(async () => {
1527
1528
  try {
1528
1529
  const ggcmap = await ctx.database.get("sc2arcade_map", { guildId: config.ggcqun });
1529
1530
  const lastdate = ggcmap[0].lastdate;
@@ -1579,7 +1580,7 @@ ${itemDetails.join("\n")}`;
1579
1580
  lastdate: new Date(currentMaxDate.toISOString())
1580
1581
  });
1581
1582
  }
1582
- return "✅ 胜点榜数据手动同步成功!";
1583
+ return "✅ 胜点榜数据同步成功!";
1583
1584
  } catch (err) {
1584
1585
  console.error("错误:", err);
1585
1586
  return "服务器繁忙,请稍后尝试。";
@@ -2037,6 +2038,9 @@ ${output}`;
2037
2038
  if (existingEntries.length > 0) {
2038
2039
  return `❌ 拒绝访问,您已被列入黑名单。`;
2039
2040
  }
2041
+ await session.send(`您确定要使用3张兑换券换取一枚扭蛋币吗?(请在30秒内回复“是”确认)`);
2042
+ const confirm = await session.prompt(3e4);
2043
+ if (confirm !== "是") return "已取消操作。";
2040
2044
  const [backpack] = await ctx.database.get("ggcevo_backpack", { handle, itemId: 3 });
2041
2045
  const [coupon] = await ctx.database.get("ggcevo_backpack", { handle, itemId: 2 });
2042
2046
  if (!coupon || coupon.quantity < 3) {
@@ -2103,7 +2107,7 @@ ${output}`;
2103
2107
  try {
2104
2108
  const handleRegex = /^([1235])-S2-([12])-(\d+)$/;
2105
2109
  if (!handleRegex.test(handle)) {
2106
- return "句柄格式错误,请重新输入";
2110
+ return "句柄格式错误,请重新输入。";
2107
2111
  }
2108
2112
  const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
2109
2113
  if (existingEntries.length > 0) {
@@ -2317,7 +2321,7 @@ ${achievementList.join("\n")}`;
2317
2321
  const parsedUser = import_koishi.h.parse(user)[0];
2318
2322
  if (!parsedUser || parsedUser.type !== "at" || !parsedUser.attrs.id) return "参数格式错误,请输入“pk @指定pk玩家”。";
2319
2323
  const targetUserId = parsedUser.attrs.id;
2320
- const targetUsername = session.bot.getGuildMember(config.ggcqun, targetUserId);
2324
+ const targetUsername = await session.bot.getGuildMember(config.ggcqun, targetUserId);
2321
2325
  const [targetprofile] = await ctx.database.get("sc2arcade_player", { userId: targetUserId });
2322
2326
  if (!targetprofile) return "对方尚未绑定句柄。";
2323
2327
  const initiatorHandle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -2395,7 +2399,7 @@ ${achievementList.join("\n")}`;
2395
2399
  const initiatorRank = initiatorData[0]?.rank || 0;
2396
2400
  const targetRank = targetData[0]?.rank || 0;
2397
2401
  const initiatorRankname = initiatorData[0]?.name || session.username;
2398
- const targetRankname = targetData[0]?.name || (await targetUsername).name;
2402
+ const targetRankname = targetData[0]?.name || (targetUsername.name || targetUsername.user.name);
2399
2403
  const [initiatorSign, targetSign] = await Promise.all([
2400
2404
  ctx.database.get("ggcevo_sign", initiatorHandle),
2401
2405
  ctx.database.get("ggcevo_sign", targetHandle)
@@ -2503,7 +2507,7 @@ ${achievementList.join("\n")}`;
2503
2507
  pageNum < totalPages ? `输入 pk榜 ${pageNum + 1} 查看下一页` : "已是最后一页"
2504
2508
  ].join("\n");
2505
2509
  });
2506
- ctx.command("ggcevo/切换pk状态", "切换玩家对战状态").action(async ({ session }) => {
2510
+ ctx.command("ggcevo/切换pk状态", "切换玩家对战状态").alias("切换pk").action(async ({ session }) => {
2507
2511
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
2508
2512
  if (!profile) return "您暂未绑定句柄。";
2509
2513
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -2591,6 +2595,10 @@ ${validTypes.join("、")}`;
2591
2595
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
2592
2596
  if (!profile) return "您暂未绑定句柄";
2593
2597
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
2598
+ const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
2599
+ if (existingEntries.length > 0) {
2600
+ return `❌ 拒绝访问,您已被列入黑名单。`;
2601
+ }
2594
2602
  const [signInfo] = await ctx.database.get("ggcevo_sign", { handle });
2595
2603
  if (!weapon) return "如果您想购买武器,请输入“购买 武器名称”。";
2596
2604
  if (!weaponConfig[weapon]) return "无效的武器名称,请重新输入。";
@@ -2680,6 +2688,10 @@ ${validTypes.join("、")}`;
2680
2688
  if (!weaponConfig[weapon]) return "请输入“装备 武器名称”来装备一把你拥有的武器。";
2681
2689
  const config2 = weaponConfig[weapon];
2682
2690
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
2691
+ const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
2692
+ if (existingEntries.length > 0) {
2693
+ return `❌ 拒绝访问,您已被列入黑名单。`;
2694
+ }
2683
2695
  const [owned] = await ctx.database.get("ggcevo_equipment", {
2684
2696
  handle,
2685
2697
  weaponId: config2.id
@@ -2707,6 +2719,10 @@ ${validTypes.join("、")}`;
2707
2719
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
2708
2720
  if (!profile) return "您暂未绑定句柄。";
2709
2721
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
2722
+ const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
2723
+ if (existingEntries.length > 0) {
2724
+ return `❌ 拒绝访问,您已被列入黑名单。`;
2725
+ }
2710
2726
  const [signInfo] = await ctx.database.get("ggcevo_sign", { handle });
2711
2727
  const [equipment] = await ctx.database.get("ggcevo_equipment", {
2712
2728
  handle,
@@ -2785,6 +2801,10 @@ ${validTypes.join("、")}`;
2785
2801
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
2786
2802
  if (!profile) return "您暂未绑定句柄";
2787
2803
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
2804
+ const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
2805
+ if (existingEntries.length > 0) {
2806
+ return `❌ 拒绝访问,您已被列入黑名单。`;
2807
+ }
2788
2808
  const [signInfo] = await ctx.database.get("ggcevo_sign", { handle });
2789
2809
  const [equipment] = await ctx.database.get("ggcevo_equipment", {
2790
2810
  handle,
@@ -2865,7 +2885,7 @@ ${validTypes.join("、")}`;
2865
2885
  handle,
2866
2886
  equipped: true
2867
2887
  });
2868
- if (!equippedWeapon) return "请先装备武器再挑战主宰。";
2888
+ if (!equippedWeapon) return "请先装备武器再攻击。";
2869
2889
  const activeBosses = await ctx.database.get("ggcevo_boss", { isActive: true });
2870
2890
  if (!activeBosses.length) return "当前没有存活的主宰。";
2871
2891
  const targetBoss = normalizedTarget === "主宰" ? activeBosses.find((b) => b.type === "主宰") : activeBosses.find((b) => b.type === "子代");
@@ -2874,7 +2894,7 @@ ${validTypes.join("、")}`;
2874
2894
  const [weaponName, weaponData] = weaponConfigEntry;
2875
2895
  const { damage: baseDamage, hasCrit, effectMessage } = await calculateTotalDamage(ctx, session, equippedWeapon, targetBoss);
2876
2896
  const bossGroup = bossPool.find((g) => g.main.id === targetBoss.groupId);
2877
- if (!bossGroup) return "无法获取BOSS组配置";
2897
+ if (!bossGroup) return "无法获取BOSS组配置。";
2878
2898
  const maxHP = targetBoss.type === "主宰" ? bossGroup.main.maxHP : bossGroup.minions.find((m) => m.name === targetBoss.name)?.maxHP || 0;
2879
2899
  let initialDamage = Math.min(baseDamage, targetBoss.HP);
2880
2900
  let currentHP = targetBoss.HP - initialDamage;
@@ -2923,8 +2943,8 @@ ${validTypes.join("、")}`;
2923
2943
  });
2924
2944
  await ctx.database.upsert("ggcevo_boss", updates, ["name"]);
2925
2945
  healMessages.push(
2926
- `❄️ ${targetBoss.name} 触发【冰霜环绕】,自身恢复45%最大生命值(+${healAmount}HP)`,
2927
- `🌪️ 寒霜地狱降临!所有存活的异形获得30%减伤效果`
2946
+ `❄️ ${targetBoss.name} 触发【冰霜环绕】,自身回复45%最大生命值(+${healAmount}HP)`,
2947
+ `🌪️ 【寒霜地狱】降临!所有存活的主宰和子代将获得30%减伤效果`
2928
2948
  );
2929
2949
  }
2930
2950
  if (targetBoss.type === "子代" && targetBoss.skills.includes("冰霜回复") && hpPercentage <= 0.3) {
@@ -2945,7 +2965,7 @@ ${validTypes.join("、")}`;
2945
2965
  );
2946
2966
  }
2947
2967
  triggeredSkills.push("冰霜回复");
2948
- healMessages.push(`❄️ ${targetBoss.name} 触发【冰霜回复】,自身恢复20%最大生命值(+${selfHeal}HP),主宰恢复20%最大生命值(+${mainHeal}HP)`);
2968
+ healMessages.push(`❄️ ${targetBoss.name} 触发【冰霜回复】,自身回复20%最大生命值(+${selfHeal}HP),主宰回复20%最大生命值(+${mainHeal}HP)`);
2949
2969
  }
2950
2970
  }
2951
2971
  const isDefeated = currentHP <= 0;
@@ -3200,8 +3220,7 @@ ${validTypes.join("、")}`;
3200
3220
  ] : [],
3201
3221
  // 冰霜进化特殊处理(新增条件判断)
3202
3222
  ...targetBoss.skills.includes("冰霜进化") && weaponName === "零度之下" ? [
3203
- `❄️ ${targetBoss.name} 触发【冰霜进化】免疫冰霜伤害!`,
3204
- `🩹 反而恢复 ${baseDamage} 生命值`
3223
+ `❄️ ${targetBoss.name} 触发【冰霜进化】免疫冰霜伤害!并且回复 ${baseDamage} 生命值`
3205
3224
  ] : [
3206
3225
  `造成伤害:${initialDamage}${hasCrit ? "(✨ 暴击)" : ""}`,
3207
3226
  ...healMessages
@@ -3215,7 +3234,7 @@ ${validTypes.join("、")}`;
3215
3234
  if (broadcastMessage) {
3216
3235
  const finalBroadcast = Array.isArray(broadcastMessage) ? broadcastMessage.join("\n") : broadcastMessage;
3217
3236
  await new Promise((resolve) => setTimeout(resolve, 500));
3218
- ctx.broadcast(config2.groupId, finalBroadcast);
3237
+ await ctx.broadcast(config2.groupId, finalBroadcast);
3219
3238
  }
3220
3239
  return;
3221
3240
  });
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.39",
4
+ "version": "1.2.40",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [