koishi-plugin-ggcevo-game 1.5.28 → 1.5.30

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.
package/lib/database.d.ts CHANGED
@@ -211,7 +211,6 @@ export interface PKProtection {
211
211
  export interface spaceship {
212
212
  handle: string;
213
213
  id: number;
214
- status: string;
215
214
  createTime: Date;
216
215
  }
217
216
  export interface explore {
package/lib/index.js CHANGED
@@ -580,7 +580,7 @@ var SyndicatedItems = {
580
580
  type: "设备工具",
581
581
  description: "一个小型辛迪加机器人,可以破坏电子银行账户",
582
582
  price: 0,
583
- redCrystalCost: 30,
583
+ redCrystalCost: 60,
584
584
  condition: "辛迪加海盗阵营",
585
585
  effects: "每日签到金币奖励+50%"
586
586
  },
@@ -625,7 +625,7 @@ var SyndicatedItems = {
625
625
  type: "设备工具",
626
626
  description: "建造机器人,用于自动采集太空矿物",
627
627
  price: 0,
628
- redCrystalCost: 20,
628
+ redCrystalCost: 30,
629
629
  condition: "辛迪加海盗阵营",
630
630
  effects: "挖矿收益提高10%;可使用红晶升级(每次升级提高5%-10%,最多提高100%)"
631
631
  }
@@ -1029,32 +1029,32 @@ var Spacestationtechnology = [
1029
1029
  {
1030
1030
  level: 1,
1031
1031
  cost: 500,
1032
- description: "提高挖矿效率,获得的收益提高5%",
1033
- careerBonus: "挖矿的收益额外提高5%"
1032
+ description: "提高挖矿效率,获得的收益提高10%",
1033
+ careerBonus: "挖矿的收益额外提高10%"
1034
1034
  },
1035
1035
  {
1036
1036
  level: 2,
1037
1037
  cost: 1750,
1038
- description: "提高挖矿效率,获得的收益提高10%",
1039
- careerBonus: "挖矿的收益额外提高10%"
1038
+ description: "提高挖矿效率,获得的收益提高20%",
1039
+ careerBonus: "挖矿的收益额外提高20%"
1040
1040
  },
1041
1041
  {
1042
1042
  level: 3,
1043
1043
  cost: 2950,
1044
- description: "提高挖矿效率,获得的收益提高15%",
1045
- careerBonus: "挖矿的收益额外提高15%"
1044
+ description: "提高挖矿效率,获得的收益提高30%",
1045
+ careerBonus: "挖矿的收益额外提高30%"
1046
1046
  },
1047
1047
  {
1048
1048
  level: 4,
1049
1049
  cost: 4250,
1050
- description: "提高挖矿效率,获得的收益提高20%",
1051
- careerBonus: "挖矿的收益额外提高20%"
1050
+ description: "提高挖矿效率,获得的收益提高40%",
1051
+ careerBonus: "挖矿的收益额外提高40%"
1052
1052
  },
1053
1053
  {
1054
1054
  level: 5,
1055
1055
  cost: 5375,
1056
- description: "提高挖矿效率,获得的收益提高25%",
1057
- careerBonus: "挖矿的收益额外提高25%,并且单次挖矿时间上限增加至48小时"
1056
+ description: "提高挖矿效率,获得的收益提高50%",
1057
+ careerBonus: "挖矿的收益额外提高50%,并且单次挖矿时间上限增加至48小时"
1058
1058
  }
1059
1059
  ]
1060
1060
  },
@@ -1166,32 +1166,32 @@ var Spacestationtechnology = [
1166
1166
  {
1167
1167
  level: 1,
1168
1168
  cost: 500,
1169
- description: "升级空间站关键系统,完成任务奖励+5%",
1170
- careerBonus: "完成任务奖励额外+5%"
1169
+ description: "升级空间站关键系统,完成任务奖励+10%",
1170
+ careerBonus: "完成任务奖励额外+10%"
1171
1171
  },
1172
1172
  {
1173
1173
  level: 2,
1174
1174
  cost: 1250,
1175
- description: "升级空间站关键系统,完成任务奖励+10%",
1176
- careerBonus: "完成任务奖励额外+10%"
1175
+ description: "升级空间站关键系统,完成任务奖励+20%",
1176
+ careerBonus: "完成任务奖励额外+20%"
1177
1177
  },
1178
1178
  {
1179
1179
  level: 3,
1180
1180
  cost: 2250,
1181
- description: "升级空间站关键系统,完成任务奖励+15%",
1182
- careerBonus: "完成任务奖励额外+15%"
1181
+ description: "升级空间站关键系统,完成任务奖励+30%",
1182
+ careerBonus: "完成任务奖励额外+30%"
1183
1183
  },
1184
1184
  {
1185
1185
  level: 4,
1186
1186
  cost: 2950,
1187
- description: "升级空间站关键系统,完成任务奖励+20%",
1188
- careerBonus: "完成任务奖励额外+20%"
1187
+ description: "升级空间站关键系统,完成任务奖励+40%",
1188
+ careerBonus: "完成任务奖励额外+40%"
1189
1189
  },
1190
1190
  {
1191
1191
  level: 5,
1192
1192
  cost: 3550,
1193
- description: "升级空间站关键系统,完成任务奖励+25%",
1194
- careerBonus: "完成任务奖励额外+25%"
1193
+ description: "升级空间站关键系统,完成任务奖励+50%",
1194
+ careerBonus: "完成任务奖励额外+50%"
1195
1195
  }
1196
1196
  ]
1197
1197
  },
@@ -1205,32 +1205,32 @@ var Spacestationtechnology = [
1205
1205
  {
1206
1206
  level: 1,
1207
1207
  cost: 500,
1208
- description: "升级空间站聚变反应堆控制,探索的金币收益提高5%",
1209
- careerBonus: "探索的金币收益额外提高5%"
1208
+ description: "升级空间站聚变反应堆控制,探索的金币收益提高10%",
1209
+ careerBonus: "探索的金币收益额外提高10%"
1210
1210
  },
1211
1211
  {
1212
1212
  level: 2,
1213
1213
  cost: 1450,
1214
- description: "升级空间站聚变反应堆控制,探索的金币收益提高10%",
1215
- careerBonus: "探索的金币收益额外提高10%"
1214
+ description: "升级空间站聚变反应堆控制,探索的金币收益提高20%",
1215
+ careerBonus: "探索的金币收益额外提高20%"
1216
1216
  },
1217
1217
  {
1218
1218
  level: 3,
1219
- cost: 2250,
1220
- description: "升级空间站聚变反应堆控制,探索的金币收益提高15%",
1221
- careerBonus: "探索的金币收益额外提高15%"
1219
+ cost: 2950,
1220
+ description: "升级空间站聚变反应堆控制,探索的金币收益提高30%",
1221
+ careerBonus: "探索的金币收益额外提高30%"
1222
1222
  },
1223
1223
  {
1224
1224
  level: 4,
1225
- cost: 2950,
1226
- description: "升级空间站聚变反应堆控制,探索的金币收益提高20%",
1227
- careerBonus: "探索的金币收益额外提高20%"
1225
+ cost: 4250,
1226
+ description: "升级空间站聚变反应堆控制,探索的金币收益提高40%",
1227
+ careerBonus: "探索的金币收益额外提高40%"
1228
1228
  },
1229
1229
  {
1230
1230
  level: 5,
1231
- cost: 3550,
1232
- description: "升级空间站聚变反应堆控制,探索的金币收益提高25%",
1233
- careerBonus: "探索的金币收益额外提高25%"
1231
+ cost: 5350,
1232
+ description: "升级空间站聚变反应堆控制,探索的金币收益提高50%",
1233
+ careerBonus: "探索的金币收益额外提高50%"
1234
1234
  }
1235
1235
  ]
1236
1236
  }
@@ -1239,7 +1239,7 @@ var itemupgrades = [
1239
1239
  {
1240
1240
  id: 1,
1241
1241
  name: "自动采掘机器人",
1242
- upgradeCostBase: 20,
1242
+ upgradeCostBase: 10,
1243
1243
  // 升级基础成本
1244
1244
  minUpgrade: 5,
1245
1245
  // 每次升级最小提升
@@ -6916,14 +6916,14 @@ var spaceship = {
6916
6916
  miningbonus: 10,
6917
6917
  explorebonus: 0,
6918
6918
  effect: "",
6919
- price: 1e3
6919
+ price: 500
6920
6920
  },
6921
6921
  "TX-12S隐形巡洋舰": {
6922
6922
  id: 2,
6923
6923
  description: "TX-12S是标准星际巡洋舰的改型",
6924
6924
  miningbonus: 10,
6925
6925
  explorebonus: 10,
6926
- effect: "探索的成功率提高20%",
6926
+ effect: "探索的成功率提高20%;探索时不会被掠夺",
6927
6927
  price: 1500
6928
6928
  },
6929
6929
  "TX-12A突击巡洋舰": {
@@ -6931,15 +6931,15 @@ var spaceship = {
6931
6931
  description: "TX-12S是标准星际巡洋舰的改型",
6932
6932
  miningbonus: 0,
6933
6933
  explorebonus: 20,
6934
- effect: "探索发生掠夺的概率提高20%",
6934
+ effect: "探索发生掠夺的概率提高10%;掠夺的成功率提高10%",
6935
6935
  price: 2e3
6936
6936
  },
6937
6937
  "庞兽号歼星舰": {
6938
6938
  id: 4,
6939
6939
  description: "巨兽级歼星舰的小型化版本",
6940
6940
  miningbonus: 0,
6941
- explorebonus: 20,
6942
- effect: "探索发生掠夺的概率提高50%;掠夺的收益额外提高30%",
6941
+ explorebonus: 30,
6942
+ effect: "探索发生掠夺的概率提高30%;掠夺的成功率提高30%",
6943
6943
  price: 6e3
6944
6944
  }
6945
6945
  };
@@ -7251,7 +7251,6 @@ function apply(ctx, config) {
7251
7251
  ctx.model.extend("ggcevo_spaceship", {
7252
7252
  handle: "string",
7253
7253
  id: "unsigned",
7254
- status: "string",
7255
7254
  createTime: "timestamp"
7256
7255
  }, {
7257
7256
  primary: "handle"
@@ -7610,14 +7609,8 @@ ${itemDetails.join("\n")}`;
7610
7609
  else if (monthlyDays === 21) baseTickets = 6;
7611
7610
  else if (monthlyDays === 28) baseTickets = 7;
7612
7611
  else baseTickets = 3;
7613
- let tickets = baseTickets;
7612
+ const basePoints = getRandomInt(50, 100);
7614
7613
  const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
7615
- let basePoints;
7616
- if (monthlyDays < 7) basePoints = getRandomInt(20, 40);
7617
- else if (monthlyDays < 14) basePoints = getRandomInt(40, 60);
7618
- else if (monthlyDays < 21) basePoints = getRandomInt(60, 80);
7619
- else if (monthlyDays < 28) basePoints = getRandomInt(80, 100);
7620
- else basePoints = getRandomInt(100, 200);
7621
7614
  if (careerData?.group === "人类联盟") {
7622
7615
  totalBonus += 0.2;
7623
7616
  messages.push("🏛️ 人类联盟阵营:+20%金币");
@@ -7629,6 +7622,8 @@ ${itemDetails.join("\n")}`;
7629
7622
  messages.push("💎 CRED-17生效:+50%金币");
7630
7623
  }
7631
7624
  }
7625
+ let baseFinalPoints = Math.round(basePoints * (1 + totalBonus));
7626
+ let baseFinalTickets = baseTickets;
7632
7627
  const [meowEffect] = await ctx.database.get("ggcevo_wish", {
7633
7628
  handle,
7634
7629
  wishname: "喵喵财源",
@@ -7636,12 +7631,13 @@ ${itemDetails.join("\n")}`;
7636
7631
  endTime: { $gte: now },
7637
7632
  isused: false
7638
7633
  });
7634
+ let multiplier = 1;
7639
7635
  if (meowEffect) {
7640
- tickets = baseTickets * 2;
7641
- totalBonus += 1;
7642
- messages.push("🐾 喵喵财源祈愿:金币+100%,咕咕币+100%");
7636
+ multiplier = 2;
7637
+ messages.push("🐾 喵喵财源祈愿:金币×2,咕咕币×2");
7643
7638
  }
7644
- const finalPoints = Math.round(basePoints * (1 + totalBonus));
7639
+ const finalPoints = Math.round(baseFinalPoints * multiplier);
7640
+ const finalTickets = Math.round(baseFinalTickets * multiplier);
7645
7641
  let redCrystal = 0;
7646
7642
  if (careerData?.group === "辛迪加海盗" && careerData.career === "辛迪加财务经理") {
7647
7643
  if (monthlyDays < 7) redCrystal = 1;
@@ -7671,7 +7667,7 @@ ${itemDetails.join("\n")}`;
7671
7667
  await ctx.database.upsert("ggcevo_backpack", [{
7672
7668
  handle,
7673
7669
  itemId: 1,
7674
- quantity: (backpack?.quantity || 0) + tickets
7670
+ quantity: (backpack?.quantity || 0) + finalTickets
7675
7671
  }]);
7676
7672
  if (redCrystal > 0) {
7677
7673
  await ctx.database.upsert("ggcevo_careers", [{
@@ -7687,14 +7683,12 @@ ${itemDetails.join("\n")}`;
7687
7683
  ▸ ${messages.join("\n▸ ")}`;
7688
7684
  }
7689
7685
  let coinMessage = `💰 金币 x ${finalPoints}`;
7690
- if (totalBonus > 0) {
7691
- coinMessage += ` (基础值:${basePoints}金币)`;
7686
+ if (totalBonus > 0 || multiplier > 1) {
7687
+ coinMessage += ` (基础值:${basePoints}金币)`;
7692
7688
  }
7693
- let ticketMessage;
7694
- if (meowEffect) {
7695
- ticketMessage = `🪙 咕咕币 x ${tickets} (基础值:${baseTickets}枚)`;
7696
- } else {
7697
- ticketMessage = `🪙 咕咕币 x ${tickets}`;
7689
+ let ticketMessage = `🪙 咕咕币 x ${finalTickets}`;
7690
+ if (multiplier > 1) {
7691
+ ticketMessage += ` (基础值:${baseTickets}枚,财源后:${finalTickets}枚)`;
7698
7692
  }
7699
7693
  return `签到成功!本月累计签到${monthlyDays}天,获得:
7700
7694
  ${coinMessage}
@@ -10926,9 +10920,6 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
10926
10920
  return "⛔ 您已被列入黑名单。";
10927
10921
  }
10928
10922
  const [career] = await ctx.database.get("ggcevo_careers", { handle });
10929
- const allowedGroups = ["人类联盟", "辛迪加海盗"];
10930
- if (!allowedGroups.includes(career.group)) {
10931
- }
10932
10923
  const [tech] = await ctx.database.get("ggcevo_tech", { handle, techId: 1 });
10933
10924
  const techLevel = tech?.level || 0;
10934
10925
  const warehouseItems = await ctx.database.get("ggcevo_warehouse", { handle });
@@ -10948,7 +10939,7 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
10948
10939
  totalMined: 0
10949
10940
  // 初始化总收益
10950
10941
  });
10951
- return "⛏️ 首次挖矿作业已开始,请至少等待1小时后才可收获。\n提示:基础收益为每半小时3枚金币";
10942
+ return "⛏️ 首次挖矿作业已开始,请至少等待1小时后才可收获。\n提示:基础收益为每半小时4枚金币";
10952
10943
  }
10953
10944
  const nowtime = /* @__PURE__ */ new Date();
10954
10945
  const chinaStart = record.startTime;
@@ -10963,25 +10954,25 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
10963
10954
  `⏱️ 当前时间:${nowtime.toLocaleString("zh-CN", { hour12: false })}`,
10964
10955
  `⏳ 还需等待:${remaining}分钟`,
10965
10956
  `💡 提示:本轮挖矿1小时后才可收获并自动开始下一轮挖矿
10966
- 基础收益为每半小时3枚金币`
10957
+ 基础收益为每半小时4枚金币`
10967
10958
  ].join("\n");
10968
10959
  }
10969
10960
  let halfHours = Math.floor(duration / 30);
10970
- let base = halfHours * 3;
10961
+ let base = halfHours * 4;
10971
10962
  const maxHalfHours = career.group === "人类联盟" && techLevel === 5 ? 96 : 48;
10972
10963
  halfHours = Math.min(halfHours, maxHalfHours);
10973
- base = Math.round(Math.min(base, maxHalfHours * 3));
10964
+ base = Math.min(base, maxHalfHours * 4);
10974
10965
  let techBonusRate = 0;
10975
10966
  let careerBonusRate = 0;
10976
10967
  let shipBonusRate = 0;
10977
10968
  let minerBonusRate = 0;
10978
10969
  if (career.group === "人类联盟") {
10979
- const baseTechRates = [0, 0.05, 0.1, 0.15, 0.2, 0.25];
10980
- techBonusRate = techLevel > 0 ? baseTechRates[Math.min(techLevel, 5)] : 0;
10970
+ const baseTechRates = [0, 0.1, 0.2, 0.3, 0.4, 0.5];
10971
+ techBonusRate = baseTechRates[Math.min(techLevel, 5)];
10981
10972
  const techCareers = ["深空矿工", "情报副官"];
10982
10973
  if (techCareers.includes(career.career)) {
10983
10974
  const careerBonusRates = [0, 0.1, 0.2, 0.3, 0.4, 0.5];
10984
- careerBonusRate = techLevel > 0 ? careerBonusRates[Math.min(techLevel, 5)] : 0;
10975
+ careerBonusRate = careerBonusRates[Math.min(techLevel, 5)];
10985
10976
  }
10986
10977
  }
10987
10978
  if (career.career === "深空矿工") {
@@ -11006,7 +10997,7 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11006
10997
  shipBonusRate = allowedShips[shipName];
11007
10998
  }
11008
10999
  }
11009
- const totalBonusRate = Math.max(techBonusRate, careerBonusRate) + shipBonusRate + itemBonusRate + minerBonusRate;
11000
+ const totalBonusRate = techBonusRate + careerBonusRate + shipBonusRate + itemBonusRate + minerBonusRate;
11010
11001
  const total = Math.round(base * (1 + totalBonusRate));
11011
11002
  await ctx.database.withTransaction(async () => {
11012
11003
  await ctx.database.upsert("ggcevo_sign", [{
@@ -11038,16 +11029,15 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11038
11029
  rewardLine += ` (基础值:${base}金币)`;
11039
11030
  }
11040
11031
  reportLines.push(rewardLine);
11041
- const hasMainBonus = Math.max(techBonusRate, careerBonusRate) > 0;
11032
+ const techCareerBonus = techBonusRate + careerBonusRate;
11033
+ const hasTechCareerBonus = techCareerBonus > 0;
11042
11034
  const hasShipBonus = shipBonusRate > 0;
11043
11035
  const hasItemBonus = itemBonusRate > 0;
11044
11036
  const hasMinerBonus = minerBonusRate > 0;
11045
- if (hasMainBonus || hasShipBonus || hasItemBonus || hasMinerBonus) {
11037
+ if (hasTechCareerBonus || hasShipBonus || hasItemBonus || hasMinerBonus) {
11046
11038
  reportLines.push(`⚡ 加成效果:`);
11047
- if (hasMainBonus) {
11048
- const bonusRate = Math.max(techBonusRate, careerBonusRate);
11049
- let bonusDesc = `⚙️ 采掘系统科技Lv.${techLevel}:+${(bonusRate * 100).toFixed(0)}%金币`;
11050
- reportLines.push(`▸ ${bonusDesc}`);
11039
+ if (hasTechCareerBonus) {
11040
+ reportLines.push(`▸ ⚙️ 科技加成Lv.${techLevel}:+${(techCareerBonus * 100).toFixed(0)}%金币`);
11051
11041
  }
11052
11042
  if (hasShipBonus) {
11053
11043
  reportLines.push(`▸ 🚀 ${shipName}:+${(shipBonusRate * 100).toFixed(0)}%金币`);
@@ -11063,7 +11053,7 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11063
11053
  }
11064
11054
  }
11065
11055
  reportLines.push(`🏆 历史总挖矿收益:${record.totalMined + total}金币`);
11066
- reportLines.push("💡 已自动开始下一轮挖矿\n基础收益为每半小时3枚金币");
11056
+ reportLines.push("💡 已自动开始下一轮挖矿\n基础收益为每半小时4枚金币");
11067
11057
  return reportLines.join("\n");
11068
11058
  });
11069
11059
  ctx.command("ggcevo/任务 [name]").usage('输入"任务"查看所有任务列表,或"任务 任务名称"查看详细任务信息').action(async ({ session }, name2) => {
@@ -11150,7 +11140,7 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11150
11140
  const baseTotal = taskConfig.price * completableTimes;
11151
11141
  let baseBonus = 0;
11152
11142
  if (techLevel > 0) {
11153
- baseBonus = careerData?.group === "人类联盟" && ["舰长", "情报副官"].includes(careerData?.career) ? [0, 10, 20, 30, 40, 50][techLevel] : [0, 5, 10, 15, 20, 25][techLevel];
11143
+ baseBonus = careerData?.group === "人类联盟" && ["舰长", "情报副官"].includes(careerData?.career) ? [0, 20, 40, 60, 80, 100][techLevel] : [0, 10, 20, 30, 40, 50][techLevel];
11154
11144
  }
11155
11145
  const captainBonus = careerData?.group === "人类联盟" && careerData.career === "舰长" ? 50 : 0;
11156
11146
  const totalBonus = baseBonus + captainBonus;
@@ -11436,20 +11426,31 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11436
11426
  const careerCoinBonus = careerName === "总工程师" ? 50 : 0;
11437
11427
  const [shipRecord] = await ctx.database.get("ggcevo_spaceship", { handle });
11438
11428
  let shipBonus = 0;
11439
- let shipEffect = "";
11440
11429
  let plunderRateBonus = 0;
11441
- let plunderBonusEffect = 0;
11430
+ let isBehemoth = false;
11431
+ let isStealthShip = false;
11432
+ let stealthShipEffectAdded = false;
11442
11433
  if (shipRecord) {
11443
11434
  const ship = Object.values(spaceship).find((s) => s.id === shipRecord.id);
11444
11435
  if (ship) {
11445
- shipBonus = ship.explorebonus || 0;
11446
- shipEffect = ship.effect || "";
11447
- if (ship.id === 3) {
11448
- plunderRateBonus = 20;
11449
- } else if (ship.id === 4) {
11450
- plunderRateBonus = 50;
11451
- plunderBonusEffect = 30;
11436
+ switch (ship.id) {
11437
+ case 2:
11438
+ shipBonus = 10;
11439
+ isStealthShip = true;
11440
+ break;
11441
+ case 3:
11442
+ shipBonus = 20;
11443
+ plunderRateBonus = 20;
11444
+ break;
11445
+ case 4:
11446
+ shipBonus = 30;
11447
+ plunderRateBonus = 30;
11448
+ isBehemoth = true;
11449
+ break;
11450
+ default:
11451
+ shipBonus = ship.explorebonus || 0;
11452
11452
  }
11453
+ if (ship.id === 2) stealthShipEffectAdded = true;
11453
11454
  }
11454
11455
  }
11455
11456
  const [techReactor] = await ctx.database.get("ggcevo_tech", { handle, techId: 6 });
@@ -11457,15 +11458,11 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11457
11458
  let techBonusRate = 0;
11458
11459
  let careerBonusRate = 0;
11459
11460
  if (career.group === "人类联盟" && techLevel > 0) {
11460
- const baseRates = [0, 0.05, 0.1, 0.15, 0.2, 0.25];
11461
+ const baseRates = [0, 0.1, 0.2, 0.3, 0.4, 0.5];
11461
11462
  techBonusRate = baseRates[techLevel];
11462
11463
  const specialCareers = ["总工程师", "情报副官"];
11463
- if (specialCareers.includes(careerName)) {
11464
- careerBonusRate = baseRates[techLevel];
11465
- }
11464
+ if (specialCareers.includes(careerName)) careerBonusRate = baseRates[techLevel];
11466
11465
  }
11467
- const totalTechBonusRate = techBonusRate + careerBonusRate;
11468
- const techBonusPercent = totalTechBonusRate * 100;
11469
11466
  const [record] = await ctx.database.get("ggcevo_explore", { handle });
11470
11467
  const now = /* @__PURE__ */ new Date();
11471
11468
  if (record && record.status === "探索中") {
@@ -11483,52 +11480,22 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11483
11480
  const returnsIncrement = (record.returns || 0) + 1;
11484
11481
  const galaxyData2 = galaxy[record.galaxy];
11485
11482
  let successRate = galaxyData2.success;
11486
- if (career.group === "人类联盟" && record.galaxy === "联盟星系") {
11487
- successRate += 0.1;
11488
- } else if (career.group === "辛迪加海盗" && record.galaxy === "辛迪加星系") {
11489
- successRate += 0.1;
11490
- }
11483
+ if (career.group === "人类联盟" && record.galaxy === "联盟星系") successRate += 0.1;
11484
+ else if (career.group === "辛迪加海盗" && record.galaxy === "辛迪加星系") successRate += 0.1;
11485
+ if (stealthShipEffectAdded) successRate += 0.2;
11491
11486
  successRate = Math.min(successRate, 1);
11492
- const isSuccess = Math.random() < successRate;
11493
11487
  let baseCoinReward = Math.floor(Math.random() * 51) + 50;
11494
- const baseCoinBeforeBonus = baseCoinReward;
11495
11488
  baseCoinReward = Math.floor(baseCoinReward * galaxyData2.bonus);
11496
- const bonusPercent2 = Math.round((galaxyData2.bonus - 1) * 100);
11497
- let totalBonus = 0;
11498
- const bonusEffects = [];
11499
- if (galaxyData2.bonus > 1) {
11500
- bonusEffects.push(`星系金币加成:+${bonusPercent2}%`);
11501
- }
11502
- if (shipBonus !== 0) {
11503
- totalBonus += shipBonus;
11504
- bonusEffects.push(`飞船:金币收益+${shipBonus}%`);
11505
- }
11506
- if (record.plunderbonus) {
11507
- totalBonus += record.plunderbonus;
11508
- bonusEffects.push(`掠夺事件:${record.plunderbonus > 0 ? "+" : ""}${record.plunderbonus}%`);
11509
- }
11510
- totalBonus += techBonusPercent;
11511
- if (totalTechBonusRate > 0) {
11512
- const careerDesc = careerBonusRate > 0 ? ` (${careerName})` : "";
11513
- bonusEffects.push(`⚙️ 反应堆科技Lv.${techLevel}:金币收益+${techBonusPercent.toFixed(0)}%${careerDesc}`);
11514
- }
11515
- if (careerCoinBonus > 0) {
11516
- totalBonus += careerCoinBonus;
11517
- bonusEffects.push(`⚙️ ${careerName}职业:金币收益+${careerCoinBonus}%`);
11518
- }
11489
+ let totalBonus = shipBonus + (record.plunderbonus || 0) + (techBonusRate + careerBonusRate) * 100 + careerCoinBonus;
11519
11490
  let finalCoin = baseCoinReward * (1 + totalBonus / 100);
11520
- if (!isSuccess) {
11521
- finalCoin *= 0.5;
11522
- bonusEffects.push("探索失败:奖励-50%");
11523
- }
11491
+ const isSuccess = Math.random() < successRate;
11492
+ if (!isSuccess) finalCoin *= 0.5;
11524
11493
  finalCoin = Math.floor(finalCoin);
11525
11494
  const [signRecord] = await ctx.database.get("ggcevo_sign", { handle });
11526
11495
  let newTotalRewards = finalCoin;
11527
11496
  if (signRecord) {
11528
- newTotalRewards = signRecord.totalRewards + finalCoin;
11529
- await ctx.database.set("ggcevo_sign", { handle }, {
11530
- totalRewards: newTotalRewards
11531
- });
11497
+ newTotalRewards += signRecord.totalRewards;
11498
+ await ctx.database.set("ggcevo_sign", { handle }, { totalRewards: newTotalRewards });
11532
11499
  } else {
11533
11500
  await ctx.database.create("ggcevo_sign", {
11534
11501
  handle,
@@ -11553,9 +11520,7 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11553
11520
  await ctx.database.set("ggcevo_warehouse", {
11554
11521
  handle,
11555
11522
  itemId: item.id
11556
- }, {
11557
- quantity: existing.quantity + 1
11558
- });
11523
+ }, { quantity: existing.quantity + 1 });
11559
11524
  } else {
11560
11525
  await ctx.database.create("ggcevo_warehouse", {
11561
11526
  handle,
@@ -11574,33 +11539,15 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11574
11539
  galaxy: null,
11575
11540
  returns: returnsIncrement,
11576
11541
  plunderbonus: 0
11577
- // 重置加成
11578
11542
  });
11579
- let resultMessage = isSuccess ? "🎉 探索成功!" : "⚠️ 探索失败!";
11580
- let coinDisplay = `💰金币 +${finalCoin}`;
11581
- if (totalBonus !== 0 || !isSuccess) {
11582
- let baseInfo = `基础 ${baseCoinBeforeBonus}`;
11583
- if (galaxyData2.bonus > 1) {
11584
- baseInfo += ` → ${baseCoinReward}(+${bonusPercent2}%)`;
11585
- }
11586
- coinDisplay += ` (${baseInfo})`;
11587
- }
11588
- let rewardMessage = coinDisplay;
11589
- if (itemRewards.length > 0) {
11590
- rewardMessage += `
11591
- 📦 获得:${itemRewards.join("、")}`;
11592
- }
11593
- if (bonusEffects.length > 0) {
11594
- rewardMessage += `
11595
- ⚡ 加成效果:${bonusEffects.join(",")}`;
11596
- }
11597
11543
  return [
11598
- resultMessage,
11544
+ isSuccess ? "🎉 探索成功!" : "⚠️ 探索失败!",
11599
11545
  `🌌 星系:${record.galaxy}`,
11600
11546
  `🔮 实际成功率:${(successRate * 100).toFixed(1)}%`,
11601
11547
  `🏆 已探索次数:${returnsIncrement}`,
11602
11548
  "--------------------------------",
11603
- rewardMessage,
11549
+ `💰 金币 +${finalCoin}`,
11550
+ ...itemRewards.length > 0 ? [`📦 获得:${itemRewards.join("、")}`] : [],
11604
11551
  "💡 已自动结束探索任务"
11605
11552
  ].join("\n");
11606
11553
  }
@@ -11608,11 +11555,11 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11608
11555
  if (!galaxyName) {
11609
11556
  const exploreOptions = [];
11610
11557
  for (const [name3, info] of Object.entries(galaxy)) {
11611
- const bonusPercent2 = Math.round((info.bonus - 1) * 100);
11558
+ const bonusPercent = Math.round((info.bonus - 1) * 100);
11612
11559
  exploreOptions.push([
11613
11560
  `【${name3}】`,
11614
11561
  `- 成功率:${(info.success * 100).toFixed(0)}%`,
11615
- `- 金币加成:${bonusPercent2 > 0 ? "+" : ""}${bonusPercent2}%`,
11562
+ `- 金币加成:${bonusPercent > 0 ? "+" : ""}${bonusPercent}%`,
11616
11563
  `- 可获得:${info.available}`,
11617
11564
  `- 特殊效果:${info.effect}`
11618
11565
  ].join("\n"));
@@ -11631,49 +11578,53 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11631
11578
  const actualPlunderRate = basePlunderRate + plunderRateBonus / 100;
11632
11579
  const canPlunder = Math.random() < actualPlunderRate;
11633
11580
  if (canPlunder) {
11634
- const otherPlayers = await ctx.database.get("ggcevo_explore", {
11581
+ const explorers = await ctx.database.get("ggcevo_explore", {
11635
11582
  galaxy: galaxyName,
11636
11583
  status: "探索中",
11637
- handle: { $ne: handle },
11638
- // 排除自己
11639
- plunderbonus: { $gte: 0 }
11640
- // 只选择plunderbonus>=0的玩家
11584
+ handle: { $ne: handle }
11641
11585
  });
11642
- if (otherPlayers.length > 0) {
11643
- const target = otherPlayers[Math.floor(Math.random() * otherPlayers.length)];
11644
- await session.send(`❗ 您在探索过程中发现了【${target.name}】的飞船,是否掠夺?(30秒内输入"是"来进行掠夺)`);
11645
- const response = await session.prompt(3e4);
11646
- if (response === "是") {
11647
- const success = Math.random() < 0.2;
11648
- let playerBonus, targetBonus;
11649
- if (success) {
11650
- let baseReward = 20;
11651
- if (plunderBonusEffect > 0) {
11652
- baseReward += plunderBonusEffect;
11586
+ if (explorers.length > 0) {
11587
+ const shipHandles = explorers.map((e) => e.handle);
11588
+ const ships = await ctx.database.get("ggcevo_spaceship", {
11589
+ handle: { $in: shipHandles }
11590
+ });
11591
+ const shipMap = new Map(ships.map((ship) => [ship.handle, ship.id]));
11592
+ const plunderTargets = explorers.filter((explorer) => {
11593
+ const shipId = shipMap.get(explorer.handle);
11594
+ return shipId !== 2;
11595
+ });
11596
+ if (plunderTargets.length > 0) {
11597
+ const target = plunderTargets[Math.floor(Math.random() * plunderTargets.length)];
11598
+ await session.send(`❗ 您在探索过程中发现了【${target.name}】的飞船,是否掠夺?(30秒内输入"是"来进行掠夺)`);
11599
+ const response = await session.prompt(3e4);
11600
+ if (response === "是") {
11601
+ let baseSuccessRate = 0.5;
11602
+ if (isBehemoth) baseSuccessRate += 0.3;
11603
+ if (shipRecord?.id === 3) baseSuccessRate += 0.1;
11604
+ const success = Math.random() < baseSuccessRate;
11605
+ let playerBonus, targetBonus;
11606
+ if (success) {
11607
+ playerBonus = 20;
11608
+ targetBonus = -20;
11609
+ } else {
11610
+ playerBonus = -20;
11611
+ targetBonus = 20;
11653
11612
  }
11654
- playerBonus = baseReward;
11655
- targetBonus = -20;
11656
- } else {
11657
- playerBonus = -20;
11658
- targetBonus = 20;
11613
+ await ctx.database.upsert("ggcevo_explore", [{
11614
+ handle,
11615
+ name: name2,
11616
+ startTime: /* @__PURE__ */ new Date(),
11617
+ galaxy: galaxyName,
11618
+ returns: record?.returns || 0,
11619
+ plunderbonus: playerBonus,
11620
+ status: "探索中"
11621
+ }], ["handle"]);
11622
+ const [targetRecord] = await ctx.database.get("ggcevo_explore", { handle: target.handle });
11623
+ await ctx.database.set("ggcevo_explore", { handle: target.handle }, {
11624
+ plunderbonus: (targetRecord.plunderbonus || 0) + targetBonus
11625
+ });
11626
+ return success ? `✅ 掠夺成功!您获得${playerBonus}%金币加成,${target.name}的金币收益被降低了20%。` : `❌ 掠夺失败!您的金币收益被降低20%,${target.name}获得了20%的金币收益加成。`;
11659
11627
  }
11660
- await ctx.database.upsert("ggcevo_explore", [{
11661
- handle,
11662
- name: name2,
11663
- startTime: /* @__PURE__ */ new Date(),
11664
- galaxy: galaxyName,
11665
- returns: record?.returns || 0,
11666
- plunderbonus: playerBonus,
11667
- // 掠夺者加成值
11668
- status: "探索中"
11669
- }], ["handle"]);
11670
- const [targetRecord] = await ctx.database.get("ggcevo_explore", {
11671
- handle: target.handle
11672
- });
11673
- await ctx.database.set("ggcevo_explore", { handle: target.handle }, {
11674
- plunderbonus: (targetRecord.plunderbonus || 0) + targetBonus
11675
- });
11676
- return success ? `✅ 掠夺成功!您获得${playerBonus}%金币加成,${target.name}的金币收益被降低了20%。` : `❌ 掠夺失败!您的金币收益被降低20%,${target.name}获得了20%的金币收益加成。`;
11677
11628
  }
11678
11629
  }
11679
11630
  }
@@ -11687,49 +11638,17 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11687
11638
  status: "探索中"
11688
11639
  }], ["handle"]);
11689
11640
  const galaxyData = galaxy[galaxyName];
11690
- let bonusInfo = [];
11691
- const bonusPercent = Math.round((galaxyData.bonus - 1) * 100);
11692
- if (bonusPercent > 0) {
11693
- bonusInfo.push(`💰 星系金币加成:+${bonusPercent}%`);
11694
- }
11695
- if (career.group === "人类联盟" && galaxyName === "联盟星系") {
11696
- bonusInfo.push("人类联盟阵营:成功率+10%");
11697
- } else if (career.group === "辛迪加海盗" && galaxyName === "辛迪加星系") {
11698
- bonusInfo.push("辛迪加海盗阵营:成功率+10%");
11699
- }
11700
- if (shipBonus > 0) {
11701
- bonusInfo.push(`飞船:金币收益+${shipBonus}%`);
11702
- }
11703
- if (shipEffect) {
11704
- bonusInfo.push(`飞船效果:${shipEffect}`);
11705
- }
11706
- if (plunderRateBonus > 0) {
11707
- bonusInfo.push(`🗡️ 掠夺概率提升:+${plunderRateBonus}%`);
11708
- }
11709
- if (plunderBonusEffect > 0) {
11710
- bonusInfo.push(`💰 掠夺收益加成:+${plunderBonusEffect}%`);
11711
- }
11712
- if (totalTechBonusRate > 0) {
11713
- const careerDesc = careerBonusRate > 0 ? ` (${careerName})` : "";
11714
- bonusInfo.push(`⚙️ 反应堆科技Lv.${techLevel}:金币收益+${techBonusPercent.toFixed(0)}%${careerDesc}`);
11715
- }
11716
- if (careerCoinBonus > 0) {
11717
- bonusInfo.push(`🧑‍🚀 ${careerName}职业:金币收益+${careerCoinBonus}%`);
11718
- }
11719
11641
  let estimatedRate = galaxyData.success;
11720
11642
  if (career.group === "人类联盟" && galaxyName === "联盟星系") estimatedRate += 0.1;
11721
11643
  if (career.group === "辛迪加海盗" && galaxyName === "辛迪加星系") estimatedRate += 0.1;
11644
+ if (isStealthShip) estimatedRate += 0.2;
11722
11645
  estimatedRate = Math.min(estimatedRate, 1) * 100;
11723
11646
  return [
11724
11647
  `🚀 开始探索 ${galaxyName}`,
11725
11648
  `⏱️ 开始时间:${(/* @__PURE__ */ new Date()).toLocaleString("zh-CN", { hour12: false })}`,
11726
11649
  `⏳ 持续时间:12小时`,
11727
11650
  `📊 预计成功率:${estimatedRate.toFixed(0)}%`,
11728
- // 显示所有加成信息
11729
- ...bonusInfo.length ? bonusInfo.map((info) => `⭐ ${info}`) : ["⭐ 无加成效果"],
11730
- `🏆 可获得:${galaxyData.available}`,
11731
- `✨ 星系效果:${galaxyData.effect}`,
11732
- "💡 探索完成后将获得奖励,可持续进行探索任务"
11651
+ "💡 探索完成后将自动获得奖励"
11733
11652
  ].join("\n");
11734
11653
  });
11735
11654
  const shipIdToName = {};
@@ -11780,10 +11699,7 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11780
11699
  `🔭 探索加成:+${ship.explorebonus}%金币`,
11781
11700
  `⛏️ 挖矿加成:+${ship.miningbonus}%金币`,
11782
11701
  `💡 特殊效果:${ship.effect || "无"}`,
11783
- `🛒 购买价格:${ship.price}金币`,
11784
- `📅 获得时间:${shipRecord.createTime.toLocaleString("zh-CN", { hour12: false })}`,
11785
- `🔋 状态:${shipRecord.status}`,
11786
- `💰 当前金币余额:${coins}`
11702
+ `📅 获得时间:${shipRecord.createTime.toLocaleString("zh-CN", { hour12: false })}`
11787
11703
  ].join("\n");
11788
11704
  });
11789
11705
  ctx.command("ggcevo/购买飞船 [shipName]").action(async ({ session }, shipName) => {
@@ -11836,8 +11752,6 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11836
11752
  await ctx.database.create("ggcevo_spaceship", {
11837
11753
  handle,
11838
11754
  id: ship.id,
11839
- status: "空闲",
11840
- // 设置初始状态
11841
11755
  createTime: now
11842
11756
  });
11843
11757
  }
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.5.28",
4
+ "version": "1.5.30",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [