koishi-plugin-ggcevo-game 1.3.60 → 1.3.62

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 +82 -49
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -900,7 +900,7 @@ function apply(ctx, config) {
900
900
  },
901
901
  {
902
902
  professionName: "武器中士",
903
- effect: "攻击伤害+15%",
903
+ effect: "攻击伤害+15%; 购买武器(非传奇)享有20%的折扣",
904
904
  requirements: "当期伤害榜累计造成100及以上伤害",
905
905
  Jobtransfer: true,
906
906
  costcoins: 2e3
@@ -914,7 +914,7 @@ function apply(ctx, config) {
914
914
  },
915
915
  {
916
916
  professionName: "情报副官",
917
- effect: "升级空间站科技花费的金币是原价的80%",
917
+ effect: "升级空间站科技享有20%的折扣",
918
918
  requirements: "至少一个空间站科技等级≥3级",
919
919
  Jobtransfer: true,
920
920
  costcoins: 3e3
@@ -2142,7 +2142,7 @@ function apply(ctx, config) {
2142
2142
  { name: targetBoss.name },
2143
2143
  { energy: newEnergy }
2144
2144
  );
2145
- messages.push(`⚡ 【弧焊枪】触发特效:消耗目标${energyDrain}点能量`);
2145
+ messages.push(`⚡ 【弧焊枪】触发特效:消耗目标200点能量`);
2146
2146
  } else {
2147
2147
  return null;
2148
2148
  }
@@ -2405,7 +2405,9 @@ function apply(ctx, config) {
2405
2405
  startTime: { $lte: /* @__PURE__ */ new Date() },
2406
2406
  endTime: { $gte: /* @__PURE__ */ new Date() },
2407
2407
  isused: false
2408
+ // 只查询未使用过的双倍祈愿
2408
2409
  });
2410
+ const doubleWishIds = doubleWishRecords.map((r) => r.id);
2409
2411
  const doubleWishHandles = new Set(doubleWishRecords.map((r) => r.handle));
2410
2412
  const top20 = damageRecords.slice(0, 20);
2411
2413
  top20.forEach((record, index) => {
@@ -2437,7 +2439,9 @@ function apply(ctx, config) {
2437
2439
  const reward = {
2438
2440
  guguCoins,
2439
2441
  gold,
2440
- playerName: record.playerName
2442
+ playerName: record.playerName,
2443
+ hasDoubleWish
2444
+ // 标记该记录使用了双倍祈愿
2441
2445
  };
2442
2446
  rewardMap.set(record.handle, reward);
2443
2447
  const bonusNote = hasDoubleWish ? " (🧝‍♀ 精灵双倍祈愿生效)" : "";
@@ -2465,7 +2469,9 @@ function apply(ctx, config) {
2465
2469
  rewardMap.set(record.handle, {
2466
2470
  guguCoins,
2467
2471
  gold,
2468
- playerName: record.playerName
2472
+ playerName: record.playerName,
2473
+ hasDoubleWish
2474
+ // 标记该记录使用了双倍祈愿
2469
2475
  });
2470
2476
  });
2471
2477
  rewardMessages.push(`其他参与者获得基础奖励: 3 咕咕币 + 500 金币`);
@@ -2495,6 +2501,12 @@ function apply(ctx, config) {
2495
2501
  quantity: (backpackData?.quantity || 0) + reward.guguCoins
2496
2502
  }], ["handle", "itemId"]);
2497
2503
  }
2504
+ if (doubleWishIds.length > 0) {
2505
+ await ctx2.database.set("ggcevo_Wish_Record", { id: { $in: doubleWishIds } }, {
2506
+ isused: true
2507
+ // 将使用过的双倍祈愿标记为已使用
2508
+ });
2509
+ }
2498
2510
  });
2499
2511
  return { rewardMessages };
2500
2512
  }
@@ -4570,7 +4582,13 @@ ${items.join("、")}
4570
4582
  const now2 = /* @__PURE__ */ new Date();
4571
4583
  const timeDiff = now2.getTime() - joinDate.getTime();
4572
4584
  const diffInDays = Math.floor(timeDiff / (1e3 * 60 * 60 * 24));
4573
- if (diffInDays < 30) {
4585
+ const [targetPKRecord] = await ctx.database.get("ggcevo_pk", {
4586
+ handle: targetHandle
4587
+ });
4588
+ const isNewPlayer = !targetPKRecord;
4589
+ const hasProtection = diffInDays < 30;
4590
+ const isPKDisabled = targetPKRecord && !targetPKRecord.enable;
4591
+ if ((isNewPlayer || isPKDisabled) && hasProtection) {
4574
4592
  return `🛡️ 该玩家是人类联盟成员,尚在30天保护期内(剩余${30 - diffInDays}天),无法挑战`;
4575
4593
  }
4576
4594
  }
@@ -4829,13 +4847,28 @@ ${items.join("、")}
4829
4847
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
4830
4848
  const [techData] = await ctx.database.get("ggcevo_tech", { handle, techId: 2 }).catch(() => [{ level: 0 }]);
4831
4849
  const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
4832
- const techLevel = techData?.level || 0;
4833
- const isCareerMatch = Spacestationtechnology.find((t) => t.techId === 2).careerNames.includes(careerData?.career);
4834
- const BASE_DISCOUNTS = [0, 0, 0, 0, 0];
4835
- const CAREER_DISCOUNTS = [0, 0, 10, 15, 20];
4836
- const baseDiscount = techLevel > 0 ? BASE_DISCOUNTS[techLevel - 1] : 0;
4837
- const careerDiscount = isCareerMatch ? CAREER_DISCOUNTS[techLevel - 1] : 0;
4838
- const techDiscount = Math.max(baseDiscount, careerDiscount);
4850
+ const group = careerData?.group || "";
4851
+ const discountDetails = [];
4852
+ let techDiscount = 0;
4853
+ if (group === "人类联盟") {
4854
+ const techLevel = techData?.level || 0;
4855
+ if (techLevel > 0) {
4856
+ const isCareerMatch = Spacestationtechnology.find((t) => t.techId === 2).careerNames.includes(careerData?.career);
4857
+ const BASE_DISCOUNTS = [0, 0, 0, 0, 0];
4858
+ const CAREER_DISCOUNTS = [0, 0, 10, 15, 20];
4859
+ const baseDiscount = techLevel > 0 ? BASE_DISCOUNTS[techLevel - 1] : 0;
4860
+ const careerDiscount = isCareerMatch ? CAREER_DISCOUNTS[techLevel - 1] : 0;
4861
+ techDiscount = Math.max(baseDiscount, careerDiscount);
4862
+ if (techDiscount > 0) {
4863
+ discountDetails.push(`⚙️ 武器系统 Lv${techLevel}:${techDiscount}%`);
4864
+ }
4865
+ }
4866
+ }
4867
+ let weaponSpecialistDiscount = 0;
4868
+ if (careerData?.career === "武器中士") {
4869
+ weaponSpecialistDiscount = 20;
4870
+ discountDetails.push(`🎖️ 武器中士:20%`);
4871
+ }
4839
4872
  const activeWish = await ctx.database.get("ggcevo_Wish_Record", {
4840
4873
  handle,
4841
4874
  wishname: "蚱蜢优购",
@@ -4843,16 +4876,12 @@ ${items.join("、")}
4843
4876
  endTime: { $gte: /* @__PURE__ */ new Date() },
4844
4877
  isused: false
4845
4878
  }).then((records) => records[0]);
4846
- const grasshopperDiscount = activeWish ? 20 : 0;
4847
- let totalDiscount = techDiscount + grasshopperDiscount;
4848
- totalDiscount = Math.min(totalDiscount, 100);
4849
- const discountDetails = [];
4850
- if (techDiscount > 0) {
4851
- discountDetails.push(`武器系统 Lv${techLevel}:${techDiscount}%`);
4852
- }
4879
+ let grasshopperDiscount = activeWish ? 20 : 0;
4853
4880
  if (grasshopperDiscount > 0) {
4854
- discountDetails.push(`蚱蜢优购:${grasshopperDiscount}%`);
4881
+ discountDetails.push(`🦗 蚱蜢优购:${grasshopperDiscount}%`);
4855
4882
  }
4883
+ let totalDiscount = techDiscount + weaponSpecialistDiscount + grasshopperDiscount;
4884
+ totalDiscount = Math.min(totalDiscount, 100);
4856
4885
  const typeStats = Object.values(weaponConfig).filter((weapon) => weapon.price !== 0).reduce((stats, weapon) => {
4857
4886
  stats[weapon.type] = (stats[weapon.type] || 0) + 1;
4858
4887
  return stats;
@@ -4861,12 +4890,11 @@ ${items.join("、")}
4861
4890
  return [
4862
4891
  "🏪 咕咕武器库分类 🏪",
4863
4892
  '使用 "武器库 类型名称" 查看详细列表',
4893
+ totalDiscount > 0 && `💰 当前折扣:
4894
+ ${discountDetails.length ? `${discountDetails.join("\n")}` : ""}`,
4864
4895
  "====================",
4865
4896
  ...Object.entries(typeStats).map(([typeName, count]) => `▸ ${typeName} (${count}种)`),
4866
- "====================",
4867
- totalDiscount > 0 && `
4868
- 🔧 当前购买折扣:
4869
- ${discountDetails.length ? ` ${discountDetails.join(" \n ")}` : ""}`
4897
+ "===================="
4870
4898
  ].filter(Boolean).join("\n");
4871
4899
  }
4872
4900
  if (!Object.keys(typeStats).includes(type)) {
@@ -4883,21 +4911,21 @@ ${Object.keys(typeStats).join("、")}`;
4883
4911
  `基础伤害:${config2.damage}`,
4884
4912
  `价格:${actualPrice}金币${totalDiscount > 0 ? ` (原价${config2.price})` : ""}`,
4885
4913
  specialEffect,
4886
- // 新增特殊效果显示
4887
4914
  "特性:",
4888
4915
  tagEffectsDesc,
4889
- `描述:${config2.description}`
4916
+ `描述:${config2.description}`,
4917
+ "------------------"
4890
4918
  ].filter(Boolean).join("\n");
4891
4919
  });
4892
4920
  return [
4893
4921
  `🏪 咕咕武器库 - ${type} 🏪`,
4894
- "使用“购买 武器名称”指令进行购买",
4895
- totalDiscount > 0 && `🔧 当前购买折扣:
4896
- ${discountDetails.length ? ` ${discountDetails.join(" \n ")}` : ""}`,
4922
+ '使用"购买 武器名称"指令进行购买',
4923
+ totalDiscount > 0 && `💰 当前折扣:
4924
+ ${discountDetails.length ? `${discountDetails.join("\n")}` : ""}`,
4897
4925
  "====================",
4898
4926
  ...items,
4899
4927
  items.length === 0 ? "⚠️ 该分类下暂无可用武器" : ""
4900
- ].filter(Boolean).join("\n\n");
4928
+ ].filter(Boolean).join("\n");
4901
4929
  });
4902
4930
  ctx.command("ggcevo/爆破库 [type]").usage("输入“爆破库”查看分类,或“爆破库 类型”查看详细物品").action(async ({ session }, type) => {
4903
4931
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
@@ -4929,7 +4957,8 @@ ${validTypes.join("、")}`;
4929
4957
  `类型:${item.type}`,
4930
4958
  `价格:${item.price}金币`,
4931
4959
  `效果:${item.effects}`,
4932
- `描述:${item.description}`
4960
+ `描述:${item.description}`,
4961
+ "------------------"
4933
4962
  ].join("\n"));
4934
4963
  return [
4935
4964
  `💣 爆破装备库 - ${type} 💣`,
@@ -4937,7 +4966,7 @@ ${validTypes.join("、")}`;
4937
4966
  "====================",
4938
4967
  ...items,
4939
4968
  items.length === 0 ? "⚠️ 该分类下暂无可用物品" : ""
4940
- ].join("\n\n");
4969
+ ].join("\n");
4941
4970
  });
4942
4971
  ctx.command("ggcevo/购买 <item>").action(async ({ session }, item) => {
4943
4972
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
@@ -5204,7 +5233,7 @@ ${validTypes.join("、")}`;
5204
5233
  const actualCost = Math.floor(modInfo.cost * (1 - discountRate / 100));
5205
5234
  const [signInfo] = await ctx.database.get("ggcevo_sign", { handle });
5206
5235
  if ((signInfo?.totalRewards || 0) < actualCost) {
5207
- return `需要 ${actualCost} 金币,当前持有:${signInfo?.totalRewards || 0}`;
5236
+ return `改装需要 ${actualCost} 金币,当前持有:${signInfo?.totalRewards || 0}`;
5208
5237
  }
5209
5238
  await ctx.database.set(
5210
5239
  "ggcevo_equipment",
@@ -5214,13 +5243,15 @@ ${validTypes.join("、")}`;
5214
5243
  await ctx.database.set("ggcevo_sign", { handle }, {
5215
5244
  totalRewards: signInfo.totalRewards - actualCost
5216
5245
  });
5217
- const discountMsg = discountRate > 0 ? `武器升级平台 Lv${techLevel} 折扣:${discountRate}%` : "";
5218
5246
  return [
5219
5247
  `✅ ${weapon} 成功安装 ${mod}!`,
5220
- discountMsg,
5221
- `花费金币:${actualCost}${discountRate > 0 ? `(原价${modInfo.cost})` : ""}`,
5248
+ `花费金币:${actualCost}${discountRate > 0 ? ` (原价${modInfo.cost})` : ""}`,
5249
+ discountRate > 0 && [
5250
+ "折扣明细:",
5251
+ `⚙️ 武器升级平台 Lv${techLevel}:${discountRate}%`
5252
+ ].join("\n"),
5222
5253
  `改装槽:${equipment.installedMods.length + 1}/${equipment.modificationSlots}`
5223
- ].join("\n");
5254
+ ].filter(Boolean).join("\n");
5224
5255
  }, "processModInstallation");
5225
5256
  const showModList = /* @__PURE__ */ __name(async () => {
5226
5257
  const [techData] = await ctx.database.get("ggcevo_tech", { handle, techId: 3 }).catch(() => [{ level: 0 }]);
@@ -5240,8 +5271,8 @@ ${validTypes.join("、")}`;
5240
5271
  return [
5241
5272
  `【${name2}】${config2.isExclusive ? ` (专属:${config2.exclusiveTo})` : ""}`,
5242
5273
  `价格:${actualPrice}金币${discountRate > 0 ? ` (原价${config2.cost})` : ""}`,
5243
- `效果:${config2.effect.replace(/▸/g, "▸ ")}`,
5244
- config2.isExclusive ? "※ 每个武器只能安装一个专属模块" : ""
5274
+ `效果:${config2.effect}`,
5275
+ "------------------"
5245
5276
  ].filter(Boolean).join("\n");
5246
5277
  }, "formatMod");
5247
5278
  const baseUniversalDiscount = [5, 10][techLevel - 1] || 0;
@@ -5253,20 +5284,23 @@ ${validTypes.join("、")}`;
5253
5284
  return [
5254
5285
  `🛠️ ${weapon} 专属模块 🛠️`,
5255
5286
  "使用「改装 武器名称 模块名称」安装",
5256
- exclusiveDiscountRate > 0 && `🔧 当前专属模块折扣:${exclusiveDiscountRate}% (武器升级平台 Lv${techLevel})`,
5287
+ "※ 每个武器只能安装一个专属模块",
5288
+ exclusiveDiscountRate > 0 && `💰 当前专属模块折扣:
5289
+ ⚙️ 武器升级平台 Lv${techLevel}:${exclusiveDiscountRate}%`,
5257
5290
  "====================",
5258
- exclusiveMods.length ? exclusiveMods.join("\n\n") : "该武器暂无专属模块"
5259
- ].filter(Boolean).join("\n\n");
5291
+ exclusiveMods.length ? exclusiveMods.join("\n") : "该武器暂无专属模块"
5292
+ ].filter(Boolean).join("\n");
5260
5293
  } else {
5261
5294
  const universalMods = Object.entries(modConfig).filter(([_, m]) => !m.isExclusive).map(([name2, cfg]) => formatMod(name2, cfg));
5262
5295
  return [
5263
5296
  "🛠️ 通用武器模块 🛠️",
5264
5297
  "使用「改装 武器名称 模块名称」安装通用模块",
5265
- "输入「改装 武器名称」查询武器的专属模块",
5266
- universalDiscountRate > 0 && `🔧 当前通用模块折扣:${universalDiscountRate}% (武器升级平台 Lv${techLevel})`,
5298
+ "使用「改装 武器名称」查询武器专属模块",
5299
+ universalDiscountRate > 0 && `💰 当前通用模块折扣:
5300
+ ⚙️ 武器升级平台 Lv${techLevel}:${universalDiscountRate}%`,
5267
5301
  "====================",
5268
- universalMods.join("\n\n")
5269
- ].filter(Boolean).join("\n\n");
5302
+ universalMods.join("\n")
5303
+ ].filter(Boolean).join("\n");
5270
5304
  }
5271
5305
  }, "showModList");
5272
5306
  if (mod) {
@@ -5568,13 +5602,12 @@ ${validTypes.join("、")}`;
5568
5602
  techId: 4
5569
5603
  });
5570
5604
  let techBonusPercent = 0;
5571
- if (securityTech && securityTech.level >= 1) {
5605
+ if (securityTech && securityTech.level >= 1 && careerData?.group === "人类联盟") {
5572
5606
  const techLevel = securityTech.level - 1;
5573
5607
  const securityConfig = Spacestationtechnology.find((t) => t.techId === 4);
5574
5608
  const isEligibleForCareerBonus = securityConfig?.careerNames.includes(career);
5575
5609
  techBonusPercent = isEligibleForCareerBonus ? SECURITY_BONUS_MAPPING.career[techLevel] : SECURITY_BONUS_MAPPING.base[techLevel];
5576
5610
  }
5577
- const techMessage = techBonusPercent ? ` + ${techBonusPercent}% (${securityTech.level}级安防系统${career ? ` + ${career}职业加成` : ""})` : "";
5578
5611
  let careerMultiplier = 0;
5579
5612
  let careerMessage = "";
5580
5613
  let redcrystalMessage = "";
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.3.60",
4
+ "version": "1.3.62",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [