koishi-plugin-ggcevo-game 1.2.61 → 1.2.63

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 +34 -38
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -711,7 +711,7 @@ function apply(ctx, config) {
711
711
  effect: "能量武器攻击伤害+15%",
712
712
  requirements: "拥有一把武器等级为6的能量武器",
713
713
  Jobtransfer: true,
714
- costcoins: 2e3,
714
+ costcoins: 0,
715
715
  costredcrystal: 20
716
716
  },
717
717
  {
@@ -719,7 +719,7 @@ function apply(ctx, config) {
719
719
  effect: "击败主宰能够根据排名获得红晶",
720
720
  requirements: "当期伤害榜排名前3",
721
721
  Jobtransfer: true,
722
- costcoins: 2e3,
722
+ costcoins: 0,
723
723
  costredcrystal: 20
724
724
  },
725
725
  {
@@ -727,7 +727,7 @@ function apply(ctx, config) {
727
727
  effect: "武器等级上限为7级,升级武器享有80%的折扣(可与祈愿叠加)",
728
728
  requirements: "拥有2把武器等级为6的武器",
729
729
  Jobtransfer: false,
730
- costcoins: 3e3,
730
+ costcoins: 0,
731
731
  costredcrystal: 30
732
732
  },
733
733
  {
@@ -735,7 +735,7 @@ function apply(ctx, config) {
735
735
  effect: "使用“侦查步枪”造成的伤害增加15%",
736
736
  requirements: "“侦查步枪”武器等级为6",
737
737
  Jobtransfer: false,
738
- costcoins: 2e3,
738
+ costcoins: 0,
739
739
  costredcrystal: 20
740
740
  },
741
741
  {
@@ -743,7 +743,7 @@ function apply(ctx, config) {
743
743
  effect: "热能武器攻击伤害+15%",
744
744
  requirements: "",
745
745
  Jobtransfer: false,
746
- costcoins: 2e3,
746
+ costcoins: 0,
747
747
  costredcrystal: 20
748
748
  },
749
749
  {
@@ -751,8 +751,8 @@ function apply(ctx, config) {
751
751
  effect: "每日签到能额外获得红晶",
752
752
  requirements: "当月累计签到28天",
753
753
  Jobtransfer: true,
754
- costcoins: 3e3,
755
- costredcrystal: 30
754
+ costcoins: 0,
755
+ costredcrystal: 40
756
756
  },
757
757
  {
758
758
  professionName: "计算机专家",
@@ -3259,16 +3259,14 @@ ${achievementList.join("\n")}`;
3259
3259
  await ctx.database.set("ggcevo_sign", initiatorHandle, { totalRewards: initiatorGold - goldTransfer });
3260
3260
  await ctx.database.set("ggcevo_sign", targetHandle, { totalRewards: targetGold + goldTransfer });
3261
3261
  }
3262
- if (isWin) {
3263
- const [initiatorCareer2] = await ctx.database.get("ggcevo_careers", {
3264
- handle: initiatorHandle
3265
- });
3266
- if (initiatorCareer2?.group === "辛迪加海盗") {
3267
- await ctx.database.upsert("ggcevo_careers", [{
3268
- handle: initiatorHandle,
3269
- redcrystal: (initiatorCareer2.redcrystal || 0) + 1
3270
- }], ["handle"]);
3271
- }
3262
+ const [initiatorCareer2] = await ctx.database.get("ggcevo_careers", {
3263
+ handle: initiatorHandle
3264
+ });
3265
+ if (initiatorCareer2?.group === "辛迪加海盗") {
3266
+ await ctx.database.upsert("ggcevo_careers", [{
3267
+ handle: initiatorHandle,
3268
+ redcrystal: (initiatorCareer2.redcrystal || 0) + 1
3269
+ }], ["handle"]);
3272
3270
  }
3273
3271
  });
3274
3272
  const [initiatorCareer] = await ctx.database.get("ggcevo_careers", {
@@ -3282,7 +3280,7 @@ ${achievementList.join("\n")}`;
3282
3280
  `🎰 金币变动:${stealPercentage}%`
3283
3281
  ];
3284
3282
  isWin ? result.push(`💰 您从对方的口袋里抢夺了${goldTransfer}枚金币`) : result.push(`💸 您从口袋里拿出了${goldTransfer}枚金币上交给对方`);
3285
- isWin && initiatorCareer?.group === "辛迪加海盗" ? result.push(`🔴 海盗阵营奖励:获得1红晶`) : "";
3283
+ initiatorCareer?.group === "辛迪加海盗" ? result.push(`🔴 海盗阵营奖励:获得1红晶`) : "";
3286
3284
  result.push(`📅 剩余挑战次数:${config.dailyPKLimit - (initiatorPK.todayCount + 1)}`);
3287
3285
  return result.join("\n");
3288
3286
  } catch (error) {
@@ -4087,9 +4085,10 @@ ${validTypes.join("、")}`;
4087
4085
  const { regionId, realmId, profileId } = profile;
4088
4086
  const handle = `${regionId}-S2-${realmId}-${profileId}`;
4089
4087
  const validFactions = ["人类联盟", "辛迪加海盗"];
4090
- if (!faction) return `请选择有效阵营:${validFactions.join(" / ")}`;
4088
+ if (!faction) return `请输入“加入 阵营名称”加入对应阵营
4089
+ 有效阵营:${validFactions.join(" / ")}`;
4091
4090
  if (!validFactions.includes(faction)) {
4092
- return `请选择有效阵营:${validFactions.join(" / ")}`;
4091
+ return `您输入的是错误的阵营名称,请选择有效阵营:${validFactions.join(" / ")}`;
4093
4092
  }
4094
4093
  const [existing] = await ctx.database.get("ggcevo_careers", { handle });
4095
4094
  if (existing) {
@@ -4139,7 +4138,7 @@ ${validTypes.join("、")}`;
4139
4138
  date: /* @__PURE__ */ new Date()
4140
4139
  });
4141
4140
  }
4142
- return `花费了${faction === "人类联盟" ? "1000金币" : "2000金币"}成功加入${faction}!${faction === "人类联盟" ? "" : "获得5枚红晶,"}初始职业:${faction === "人类联盟" ? "联盟新兵" : "辛迪加炮灰新兵"}`;
4141
+ return `花费了${faction === "人类联盟" ? "1000金币" : "2000金币"}成功加入${faction}!${faction === "人类联盟" ? "" : "获得5枚红晶,"}初始职业:${faction === "人类联盟" ? "联盟新兵" : "辛迪加炮灰新兵"}`;
4143
4142
  } catch (err) {
4144
4143
  ctx.logger.error("加入阵营失败:", err);
4145
4144
  return "加入阵营时发生错误,请稍后再试";
@@ -4170,16 +4169,16 @@ ${validTypes.join("、")}`;
4170
4169
  `🛠️ ${p.professionName}`,
4171
4170
  `▸ 效果:${p.effect || "暂无效果描述"}`,
4172
4171
  `▸ 需求:${p.requirements || "无特殊要求"}`,
4173
- `▸ 消耗:${p.costcoins}金币` + (careerData.group === "辛迪加海盗" ? ` + ${p.costredcrystal}红晶` : "")
4172
+ `▸ 消耗:` + (careerData.group === "辛迪加海盗" ? `${p.costredcrystal}红晶` : `${p.costcoins}金币`)
4174
4173
  ];
4175
4174
  return info.join("\n");
4176
4175
  });
4177
4176
  return [
4178
4177
  `🎖️ ${careerData.group} 可转职列表(当前职业:${careerData.career})`,
4179
4178
  '使用"转职 职业名称"进行转职',
4180
- "───────────────",
4179
+ "──────────────",
4181
4180
  ...careerList.length ? careerList : ["暂无更多可转职职业"],
4182
- "───────────────",
4181
+ "──────────────",
4183
4182
  "💡 转职后原有职业效果将被替换"
4184
4183
  ].join("\n");
4185
4184
  }
@@ -4204,17 +4203,10 @@ ${validTypes.join("、")}`;
4204
4203
  totalRewards: userCoins - targetProfession.costcoins
4205
4204
  }], ["handle"]);
4206
4205
  } else if (careerData.group === "辛迪加海盗") {
4207
- if (userCoins < targetProfession.costcoins) {
4208
- return `需要金币 ${targetProfession.costcoins},当前 ${userCoins}`;
4209
- }
4210
4206
  if (userRedCrystal < (targetProfession.costredcrystal || 0)) {
4211
4207
  return `需要红晶 ${targetProfession.costredcrystal},当前 ${userRedCrystal}`;
4212
4208
  }
4213
4209
  await Promise.all([
4214
- ctx.database.upsert("ggcevo_sign", [{
4215
- handle,
4216
- totalRewards: userCoins - targetProfession.costcoins
4217
- }], ["handle"]),
4218
4210
  ctx.database.upsert("ggcevo_careers", [{
4219
4211
  handle,
4220
4212
  redcrystal: userRedCrystal - (targetProfession.costredcrystal || 0)
@@ -4226,7 +4218,7 @@ ${validTypes.join("、")}`;
4226
4218
  career: profession,
4227
4219
  date: /* @__PURE__ */ new Date()
4228
4220
  }], ["handle"]);
4229
- return `${careerData.group === "辛迪加海盗" ? `花费${targetProfession.costcoins}金币和${targetProfession.costredcrystal}红晶` : `花费${targetProfession.costcoins}金币`}转职成功!当前职业:${profession}`;
4221
+ return `${careerData.group === "辛迪加海盗" ? `花费${targetProfession.costredcrystal}红晶` : `花费${targetProfession.costcoins}金币`}转职成功!当前职业:${profession}`;
4230
4222
  } catch (err) {
4231
4223
  ctx.logger.error("转职失败:", err);
4232
4224
  return "转职过程中发生错误,请稍后再试";
@@ -4241,23 +4233,27 @@ ${validTypes.join("、")}`;
4241
4233
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
4242
4234
  const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
4243
4235
  if (!careerData) return "您尚未加入任何阵营。";
4236
+ const config2 = careerData.group === "辛迪加海盗" ? syndicatePirateConfig : spaceStationCrewConfig;
4237
+ const profession = config2.find((p) => p.professionName === careerData.career);
4238
+ const effectDisplay = profession?.effect || "暂无特殊效果";
4244
4239
  const joinDate = new Date(careerData.date);
4245
4240
  const formattedDate = `${joinDate.getFullYear()}年${joinDate.getMonth() + 1}月${joinDate.getDate()}日`;
4246
4241
  const infoCard = [
4247
- `🎖️ 当前阵营:${careerData.group}`,
4248
- `🛠️ 当前职业:${careerData.career}`,
4249
- `📅 就职时间:${formattedDate}`
4242
+ `🎯 当前阵营:${careerData.group}`,
4243
+ `👔 当前职业:${careerData.career}`,
4244
+ `✨ 职业效果:${effectDisplay}`,
4245
+ `🗓️ 就职时间:${formattedDate}`
4250
4246
  ];
4251
4247
  if (careerData.group === "辛迪加海盗") {
4252
4248
  infoCard.push(`🔴 持有红晶:${careerData.redcrystal || 0} 个`);
4253
- infoCard.push("💡 提示:红晶可通过主动PK胜利获得");
4249
+ infoCard.push("💡 提示:红晶可通过主动PK获得(无论胜负)");
4254
4250
  } else {
4255
4251
  infoCard.push("💡 提示:使用「转职」命令可变更职业");
4256
4252
  }
4257
4253
  return [
4258
- "=== 职业档案 ===",
4254
+ " 职业档案 ",
4259
4255
  ...infoCard,
4260
- "================"
4256
+ "〓═════════〓"
4261
4257
  ].join("\n");
4262
4258
  } catch (error) {
4263
4259
  ctx.logger.error("查询职业信息失败:", error);
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.61",
4
+ "version": "1.2.63",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [