koishi-plugin-ggcevo-game 1.4.90 → 1.4.92

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 +46 -8
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -740,7 +740,7 @@ var syndicatePirateConfig = [
740
740
  },
741
741
  {
742
742
  professionName: "计算机专家",
743
- effect: "黑市订购设备工具类享有50%折扣; 被动应战的PK对战结果为失败时,不会损失金币;每日获得3枚红晶(前日每被PK一次,红晶数量-1,下限为1)",
743
+ effect: "黑市订购设备工具类享有50%折扣; 主动发起的PK胜率提高10%; 每日主动PK次数增加3次;被动PK失败时有50%的概率不损失金币",
744
744
  requirements: "仓库中至少拥有一个黑市订购的设备工具类物品",
745
745
  Jobtransfer: true,
746
746
  costredcrystal: 30
@@ -748,9 +748,9 @@ var syndicatePirateConfig = [
748
748
  {
749
749
  professionName: "指挥官",
750
750
  effect: "可以使用红晶升级独特的辛迪加空间站科技;购买光剑(传奇)享有50%的折扣",
751
- requirements: "",
752
- Jobtransfer: false,
753
- costredcrystal: 10
751
+ requirements: "PK胜利20次及以上;非辛迪加炮灰新兵职业",
752
+ Jobtransfer: true,
753
+ costredcrystal: 35
754
754
  },
755
755
  {
756
756
  professionName: "装甲兵",
@@ -900,6 +900,26 @@ async function checkTransferRequirements(ctx, handle, profession) {
900
900
  message: hasModifiedWeapon ? "" : "需要至少拥有一把改装了3个模块的武器"
901
901
  };
902
902
  }
903
+ // +++ 新增指挥官检查 +++
904
+ case "指挥官": {
905
+ if (careerData?.career === "辛迪加炮灰新兵") {
906
+ return {
907
+ success: false,
908
+ message: "非辛迪加炮灰新兵职业才能转职为指挥官"
909
+ };
910
+ }
911
+ const [pkProfile] = await ctx.database.get("ggcevo_pk", { handle });
912
+ if (!pkProfile) {
913
+ return {
914
+ success: false,
915
+ message: "没有PK记录,需要PK胜利20次及以上"
916
+ };
917
+ }
918
+ return {
919
+ success: pkProfile.wins >= 20,
920
+ message: pkProfile.wins >= 20 ? "" : `需要PK胜利20次及以上(当前${pkProfile.wins}次)`
921
+ };
922
+ }
903
923
  case "清洁工":
904
924
  if (!mainBoss) return { success: false, message: "当前暂无伤害榜。" };
905
925
  const cleanTop20 = await ctx.database.select("ggcevo_boss_damage").where({ bossGroupId: mainBoss.groupId }).orderBy("totalDamage", "desc").limit(20).execute();
@@ -7589,6 +7609,10 @@ ${items.join("、")}
7589
7609
  const [targetCareer] = await ctx.database.get("ggcevo_careers", {
7590
7610
  handle: targetHandle
7591
7611
  });
7612
+ let dailyPKLimit = config.dailyPKLimit;
7613
+ if (initiatorCareer?.career === "计算机专家") {
7614
+ dailyPKLimit += 3;
7615
+ }
7592
7616
  const validGroups = /* @__PURE__ */ new Set(["人类联盟", "辛迪加海盗"]);
7593
7617
  if (!initiatorCareer?.group || !validGroups.has(initiatorCareer.group)) {
7594
7618
  return "❌ 您尚未加入人类联盟或辛迪加海盗,不能参与PK";
@@ -7706,8 +7730,8 @@ ${protectionList}
7706
7730
  if (!isSameDate(convertUTCtoChinaTime(initiatorPK.lastPK), now)) {
7707
7731
  initiatorPK.todayCount = 0;
7708
7732
  }
7709
- if (initiatorPK.todayCount >= config.dailyPKLimit) {
7710
- return `今日挑战次数已用尽(${config.dailyPKLimit}次/日)。`;
7733
+ if (initiatorPK.todayCount >= dailyPKLimit) {
7734
+ return `今日挑战次数已用尽(${dailyPKLimit}次/日)。`;
7711
7735
  }
7712
7736
  const nowChina = convertUTCtoChinaTime(/* @__PURE__ */ new Date());
7713
7737
  const todayStart = new Date(nowChina);
@@ -7752,6 +7776,10 @@ ${protectionList}
7752
7776
  const powerDiff = initiatorPower - targetPower;
7753
7777
  let winRate = 50 + powerDiff / 100 * 0.1;
7754
7778
  winRate = Math.min(Math.max(winRate, 5), 95);
7779
+ if (initiatorCareer?.career === "计算机专家") {
7780
+ winRate += 10;
7781
+ }
7782
+ winRate = Math.min(Math.max(winRate, 5), 100);
7755
7783
  const randInt = Math.floor(Math.random() * 1e4);
7756
7784
  const winRateInt = Math.floor(winRate * 100);
7757
7785
  const isWin = randInt < winRateInt;
@@ -7770,8 +7798,10 @@ ${protectionList}
7770
7798
  }
7771
7799
  let computerExpertProtection = false;
7772
7800
  if (isWin && targetCareer?.career === "计算机专家") {
7773
- computerExpertProtection = true;
7774
- goldTransfer = 0;
7801
+ if (Math.random() < 0.5) {
7802
+ computerExpertProtection = true;
7803
+ goldTransfer = 0;
7804
+ }
7775
7805
  }
7776
7806
  let hornEffect = false;
7777
7807
  let extraGold = 0;
@@ -7869,6 +7899,14 @@ ${protectionList}
7869
7899
  result.push(`💸 您从口袋里拿出了${goldTransfer}枚金币上交给对方`);
7870
7900
  }
7871
7901
  const bonusEffects = [];
7902
+ if (initiatorCareer?.career === "计算机专家") {
7903
+ const usedCount = initiatorPK.todayCount + 1;
7904
+ bonusEffects.push(
7905
+ `▸ 💻 计算机专家特权:`,
7906
+ ` - 主动PK胜率+10%(最高可至100%)`,
7907
+ ` - 每日挑战次数+3(${usedCount}/${dailyPKLimit})`
7908
+ );
7909
+ }
7872
7910
  if (targetCareer.group === "人类联盟" && isWin) {
7873
7911
  bonusEffects.push(`▸ 🛡️ 人类联盟:应战者PK失败时仅损失1%的金币`);
7874
7912
  }
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.4.90",
4
+ "version": "1.4.92",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [