koishi-plugin-ggcevo-game 1.3.61 → 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 +68 -47
  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
  }
@@ -4582,7 +4582,13 @@ ${items.join("、")}
4582
4582
  const now2 = /* @__PURE__ */ new Date();
4583
4583
  const timeDiff = now2.getTime() - joinDate.getTime();
4584
4584
  const diffInDays = Math.floor(timeDiff / (1e3 * 60 * 60 * 24));
4585
- 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) {
4586
4592
  return `🛡️ 该玩家是人类联盟成员,尚在30天保护期内(剩余${30 - diffInDays}天),无法挑战`;
4587
4593
  }
4588
4594
  }
@@ -4841,13 +4847,28 @@ ${items.join("、")}
4841
4847
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
4842
4848
  const [techData] = await ctx.database.get("ggcevo_tech", { handle, techId: 2 }).catch(() => [{ level: 0 }]);
4843
4849
  const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
4844
- const techLevel = techData?.level || 0;
4845
- const isCareerMatch = Spacestationtechnology.find((t) => t.techId === 2).careerNames.includes(careerData?.career);
4846
- const BASE_DISCOUNTS = [0, 0, 0, 0, 0];
4847
- const CAREER_DISCOUNTS = [0, 0, 10, 15, 20];
4848
- const baseDiscount = techLevel > 0 ? BASE_DISCOUNTS[techLevel - 1] : 0;
4849
- const careerDiscount = isCareerMatch ? CAREER_DISCOUNTS[techLevel - 1] : 0;
4850
- 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
+ }
4851
4872
  const activeWish = await ctx.database.get("ggcevo_Wish_Record", {
4852
4873
  handle,
4853
4874
  wishname: "蚱蜢优购",
@@ -4855,16 +4876,12 @@ ${items.join("、")}
4855
4876
  endTime: { $gte: /* @__PURE__ */ new Date() },
4856
4877
  isused: false
4857
4878
  }).then((records) => records[0]);
4858
- const grasshopperDiscount = activeWish ? 20 : 0;
4859
- let totalDiscount = techDiscount + grasshopperDiscount;
4860
- totalDiscount = Math.min(totalDiscount, 100);
4861
- const discountDetails = [];
4862
- if (techDiscount > 0) {
4863
- discountDetails.push(`武器系统 Lv${techLevel}:${techDiscount}%`);
4864
- }
4879
+ let grasshopperDiscount = activeWish ? 20 : 0;
4865
4880
  if (grasshopperDiscount > 0) {
4866
- discountDetails.push(`蚱蜢优购:${grasshopperDiscount}%`);
4881
+ discountDetails.push(`🦗 蚱蜢优购:${grasshopperDiscount}%`);
4867
4882
  }
4883
+ let totalDiscount = techDiscount + weaponSpecialistDiscount + grasshopperDiscount;
4884
+ totalDiscount = Math.min(totalDiscount, 100);
4868
4885
  const typeStats = Object.values(weaponConfig).filter((weapon) => weapon.price !== 0).reduce((stats, weapon) => {
4869
4886
  stats[weapon.type] = (stats[weapon.type] || 0) + 1;
4870
4887
  return stats;
@@ -4873,12 +4890,11 @@ ${items.join("、")}
4873
4890
  return [
4874
4891
  "🏪 咕咕武器库分类 🏪",
4875
4892
  '使用 "武器库 类型名称" 查看详细列表',
4893
+ totalDiscount > 0 && `💰 当前折扣:
4894
+ ${discountDetails.length ? `${discountDetails.join("\n")}` : ""}`,
4876
4895
  "====================",
4877
4896
  ...Object.entries(typeStats).map(([typeName, count]) => `▸ ${typeName} (${count}种)`),
4878
- "====================",
4879
- totalDiscount > 0 && `
4880
- 🔧 当前购买折扣:
4881
- ${discountDetails.length ? ` ${discountDetails.join(" \n ")}` : ""}`
4897
+ "===================="
4882
4898
  ].filter(Boolean).join("\n");
4883
4899
  }
4884
4900
  if (!Object.keys(typeStats).includes(type)) {
@@ -4895,21 +4911,21 @@ ${Object.keys(typeStats).join("、")}`;
4895
4911
  `基础伤害:${config2.damage}`,
4896
4912
  `价格:${actualPrice}金币${totalDiscount > 0 ? ` (原价${config2.price})` : ""}`,
4897
4913
  specialEffect,
4898
- // 新增特殊效果显示
4899
4914
  "特性:",
4900
4915
  tagEffectsDesc,
4901
- `描述:${config2.description}`
4916
+ `描述:${config2.description}`,
4917
+ "------------------"
4902
4918
  ].filter(Boolean).join("\n");
4903
4919
  });
4904
4920
  return [
4905
4921
  `🏪 咕咕武器库 - ${type} 🏪`,
4906
- "使用“购买 武器名称”指令进行购买",
4907
- totalDiscount > 0 && `🔧 当前购买折扣:
4908
- ${discountDetails.length ? ` ${discountDetails.join(" \n ")}` : ""}`,
4922
+ '使用"购买 武器名称"指令进行购买',
4923
+ totalDiscount > 0 && `💰 当前折扣:
4924
+ ${discountDetails.length ? `${discountDetails.join("\n")}` : ""}`,
4909
4925
  "====================",
4910
4926
  ...items,
4911
4927
  items.length === 0 ? "⚠️ 该分类下暂无可用武器" : ""
4912
- ].filter(Boolean).join("\n\n");
4928
+ ].filter(Boolean).join("\n");
4913
4929
  });
4914
4930
  ctx.command("ggcevo/爆破库 [type]").usage("输入“爆破库”查看分类,或“爆破库 类型”查看详细物品").action(async ({ session }, type) => {
4915
4931
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
@@ -4941,7 +4957,8 @@ ${validTypes.join("、")}`;
4941
4957
  `类型:${item.type}`,
4942
4958
  `价格:${item.price}金币`,
4943
4959
  `效果:${item.effects}`,
4944
- `描述:${item.description}`
4960
+ `描述:${item.description}`,
4961
+ "------------------"
4945
4962
  ].join("\n"));
4946
4963
  return [
4947
4964
  `💣 爆破装备库 - ${type} 💣`,
@@ -4949,7 +4966,7 @@ ${validTypes.join("、")}`;
4949
4966
  "====================",
4950
4967
  ...items,
4951
4968
  items.length === 0 ? "⚠️ 该分类下暂无可用物品" : ""
4952
- ].join("\n\n");
4969
+ ].join("\n");
4953
4970
  });
4954
4971
  ctx.command("ggcevo/购买 <item>").action(async ({ session }, item) => {
4955
4972
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
@@ -5216,7 +5233,7 @@ ${validTypes.join("、")}`;
5216
5233
  const actualCost = Math.floor(modInfo.cost * (1 - discountRate / 100));
5217
5234
  const [signInfo] = await ctx.database.get("ggcevo_sign", { handle });
5218
5235
  if ((signInfo?.totalRewards || 0) < actualCost) {
5219
- return `需要 ${actualCost} 金币,当前持有:${signInfo?.totalRewards || 0}`;
5236
+ return `改装需要 ${actualCost} 金币,当前持有:${signInfo?.totalRewards || 0}`;
5220
5237
  }
5221
5238
  await ctx.database.set(
5222
5239
  "ggcevo_equipment",
@@ -5226,13 +5243,15 @@ ${validTypes.join("、")}`;
5226
5243
  await ctx.database.set("ggcevo_sign", { handle }, {
5227
5244
  totalRewards: signInfo.totalRewards - actualCost
5228
5245
  });
5229
- const discountMsg = discountRate > 0 ? `武器升级平台 Lv${techLevel} 折扣:${discountRate}%` : "";
5230
5246
  return [
5231
5247
  `✅ ${weapon} 成功安装 ${mod}!`,
5232
- discountMsg,
5233
- `花费金币:${actualCost}${discountRate > 0 ? `(原价${modInfo.cost})` : ""}`,
5248
+ `花费金币:${actualCost}${discountRate > 0 ? ` (原价${modInfo.cost})` : ""}`,
5249
+ discountRate > 0 && [
5250
+ "折扣明细:",
5251
+ `⚙️ 武器升级平台 Lv${techLevel}:${discountRate}%`
5252
+ ].join("\n"),
5234
5253
  `改装槽:${equipment.installedMods.length + 1}/${equipment.modificationSlots}`
5235
- ].join("\n");
5254
+ ].filter(Boolean).join("\n");
5236
5255
  }, "processModInstallation");
5237
5256
  const showModList = /* @__PURE__ */ __name(async () => {
5238
5257
  const [techData] = await ctx.database.get("ggcevo_tech", { handle, techId: 3 }).catch(() => [{ level: 0 }]);
@@ -5252,8 +5271,8 @@ ${validTypes.join("、")}`;
5252
5271
  return [
5253
5272
  `【${name2}】${config2.isExclusive ? ` (专属:${config2.exclusiveTo})` : ""}`,
5254
5273
  `价格:${actualPrice}金币${discountRate > 0 ? ` (原价${config2.cost})` : ""}`,
5255
- `效果:${config2.effect.replace(/▸/g, "▸ ")}`,
5256
- config2.isExclusive ? "※ 每个武器只能安装一个专属模块" : ""
5274
+ `效果:${config2.effect}`,
5275
+ "------------------"
5257
5276
  ].filter(Boolean).join("\n");
5258
5277
  }, "formatMod");
5259
5278
  const baseUniversalDiscount = [5, 10][techLevel - 1] || 0;
@@ -5265,20 +5284,23 @@ ${validTypes.join("、")}`;
5265
5284
  return [
5266
5285
  `🛠️ ${weapon} 专属模块 🛠️`,
5267
5286
  "使用「改装 武器名称 模块名称」安装",
5268
- exclusiveDiscountRate > 0 && `🔧 当前专属模块折扣:${exclusiveDiscountRate}% (武器升级平台 Lv${techLevel})`,
5287
+ "※ 每个武器只能安装一个专属模块",
5288
+ exclusiveDiscountRate > 0 && `💰 当前专属模块折扣:
5289
+ ⚙️ 武器升级平台 Lv${techLevel}:${exclusiveDiscountRate}%`,
5269
5290
  "====================",
5270
- exclusiveMods.length ? exclusiveMods.join("\n\n") : "该武器暂无专属模块"
5271
- ].filter(Boolean).join("\n\n");
5291
+ exclusiveMods.length ? exclusiveMods.join("\n") : "该武器暂无专属模块"
5292
+ ].filter(Boolean).join("\n");
5272
5293
  } else {
5273
5294
  const universalMods = Object.entries(modConfig).filter(([_, m]) => !m.isExclusive).map(([name2, cfg]) => formatMod(name2, cfg));
5274
5295
  return [
5275
5296
  "🛠️ 通用武器模块 🛠️",
5276
5297
  "使用「改装 武器名称 模块名称」安装通用模块",
5277
- "输入「改装 武器名称」查询武器的专属模块",
5278
- universalDiscountRate > 0 && `🔧 当前通用模块折扣:${universalDiscountRate}% (武器升级平台 Lv${techLevel})`,
5298
+ "使用「改装 武器名称」查询武器专属模块",
5299
+ universalDiscountRate > 0 && `💰 当前通用模块折扣:
5300
+ ⚙️ 武器升级平台 Lv${techLevel}:${universalDiscountRate}%`,
5279
5301
  "====================",
5280
- universalMods.join("\n\n")
5281
- ].filter(Boolean).join("\n\n");
5302
+ universalMods.join("\n")
5303
+ ].filter(Boolean).join("\n");
5282
5304
  }
5283
5305
  }, "showModList");
5284
5306
  if (mod) {
@@ -5580,13 +5602,12 @@ ${validTypes.join("、")}`;
5580
5602
  techId: 4
5581
5603
  });
5582
5604
  let techBonusPercent = 0;
5583
- if (securityTech && securityTech.level >= 1) {
5605
+ if (securityTech && securityTech.level >= 1 && careerData?.group === "人类联盟") {
5584
5606
  const techLevel = securityTech.level - 1;
5585
5607
  const securityConfig = Spacestationtechnology.find((t) => t.techId === 4);
5586
5608
  const isEligibleForCareerBonus = securityConfig?.careerNames.includes(career);
5587
5609
  techBonusPercent = isEligibleForCareerBonus ? SECURITY_BONUS_MAPPING.career[techLevel] : SECURITY_BONUS_MAPPING.base[techLevel];
5588
5610
  }
5589
- const techMessage = techBonusPercent ? ` + ${techBonusPercent}% (${securityTech.level}级安防系统${career ? ` + ${career}职业加成` : ""})` : "";
5590
5611
  let careerMultiplier = 0;
5591
5612
  let careerMessage = "";
5592
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.61",
4
+ "version": "1.3.62",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [