koishi-plugin-ggcevo-game 1.6.33 → 1.6.35

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/index.d.ts CHANGED
@@ -17,6 +17,7 @@ export interface Config {
17
17
  unlimitedBossAttack: boolean;
18
18
  pointBonusEnabled: boolean;
19
19
  enableViolationAlert: boolean;
20
+ enableCurfew: boolean;
20
21
  }
21
22
  export declare const Config: Schema<Config>;
22
23
  export declare function apply(ctx: Context, config: Config): void;
package/lib/index.js CHANGED
@@ -468,7 +468,7 @@ var weaponConfig = {
468
468
  damage: 90,
469
469
  armorDamageReduction: 0,
470
470
  description: "一件传奇武器",
471
- specialeffect: "无法暴击;每次攻击时有20%的概率造成核爆,额外造成50%的伤害,连续攻击每次提升5%概率",
471
+ specialeffect: "无法暴击;每次攻击时有20%的概率造成核爆,额外造成50%的伤害",
472
472
  price: 6400,
473
473
  redCrystalCost: 200,
474
474
  isantiair: true,
@@ -854,7 +854,7 @@ var syndicatePirateConfig = [
854
854
  effect: "每日签到能额外获得5枚红晶",
855
855
  requirements: "当月累计签到14天及以上",
856
856
  Jobtransfer: true,
857
- costredcrystal: 40
857
+ costredcrystal: 20
858
858
  },
859
859
  {
860
860
  professionName: "计算机专家",
@@ -3951,7 +3951,7 @@ var BattleEffectProcessor = {
3951
3951
  let fusionExplosionTriggered = false;
3952
3952
  if (weaponName !== "核聚变重炮") return null;
3953
3953
  const currentCombo = equippedWeapon?.comboCount || 0;
3954
- const fusionTriggerProbability = 0.2 + currentCombo * 0.05;
3954
+ const fusionTriggerProbability = 0.2 + currentCombo * 0;
3955
3955
  if (Math.random() < fusionTriggerProbability) {
3956
3956
  fusionExplosionTriggered = true;
3957
3957
  messages.push(`💥 【核聚变爆炸】触发:额外造成50%伤害`);
@@ -5457,7 +5457,19 @@ var ggcevoUpdates = [
5457
5457
  - 回调了能量武器专家的职业效果
5458
5458
  - 禁用了棱镜水晶,使用拆卸可返还100%金币
5459
5459
  - 新增资源商店,输入“兑换资源”查看
5460
- - 修改“兑换”指令,更改为“兑换赞助物品”
5460
+ - 修改“兑换”指令,更改为“兑换赞助物品”,并且优化了显示信息
5461
+ - 暂时关闭了“兑换金币”和“兑换红晶”
5462
+ `.trim()
5463
+ },
5464
+ {
5465
+ version: "1.6.35",
5466
+ time: "2025-07-17",
5467
+ content: `
5468
+ - 下调了辛迪加财务的转职所需红晶
5469
+ - 削弱了核聚变重炮的武器效果
5470
+ - 调整了击败奖励
5471
+ - 增加了签到验证机制(需近3日内玩过地图)
5472
+ - 增加了宵禁机制(夜间18:00-24:00将无法在群聊中使用咕咕之战功能,可私聊使用)
5461
5473
  `.trim()
5462
5474
  }
5463
5475
  ];
@@ -6281,6 +6293,17 @@ var GUESSING_ITEMS = [
6281
6293
  // 可以继续添加更多竞猜项目
6282
6294
  // { id: 2, description: '其他竞猜项目', odds: 2.5, status: 'closed' },
6283
6295
  ];
6296
+ function fixedCurfewCheck(session, config) {
6297
+ if (!config.enableCurfew || session.isDirect) return true;
6298
+ const now = /* @__PURE__ */ new Date();
6299
+ const hours = now.getUTCHours() + 8;
6300
+ const currentHour = hours >= 24 ? hours - 24 : hours;
6301
+ if (currentHour >= 18 && currentHour < 24) {
6302
+ return false;
6303
+ }
6304
+ return true;
6305
+ }
6306
+ __name(fixedCurfewCheck, "fixedCurfewCheck");
6284
6307
 
6285
6308
  // src/boss/damagecalculation.ts
6286
6309
  async function calculateTotalDamage(ctx, session, config, equippedWeapon, targetBoss, careerData) {
@@ -6587,11 +6610,11 @@ async function handleBossDefeatRewards(ctx, targetBoss) {
6587
6610
  damageRecords.forEach((record, index) => {
6588
6611
  const rank = index + 1;
6589
6612
  let coupons = 0;
6590
- if (rank === 1) coupons = 50;
6591
- else if (rank === 2) coupons = 45;
6592
- else if (rank === 3) coupons = 40;
6593
- else if (rank <= 10) coupons = 30;
6594
- else if (rank <= 20) coupons = 20;
6613
+ if (rank === 1) coupons = 35;
6614
+ else if (rank === 2) coupons = 30;
6615
+ else if (rank === 3) coupons = 25;
6616
+ else if (rank <= 10) coupons = 20;
6617
+ else if (rank <= 20) coupons = 15;
6595
6618
  else if (rank <= 50) coupons = 10;
6596
6619
  else coupons = 5;
6597
6620
  const hasDoubleWish = doubleWishHandles.has(record.handle);
@@ -7294,7 +7317,8 @@ var inject = {
7294
7317
  var Config = import_koishi.Schema.intersect([
7295
7318
  // 基础配置组
7296
7319
  import_koishi.Schema.object({
7297
- proxyAgent: import_koishi.Schema.string().description("代理服务器地址")
7320
+ proxyAgent: import_koishi.Schema.string().description("代理服务器地址"),
7321
+ enableCurfew: import_koishi.Schema.boolean().description("是否开启宵禁模式(18:00-24:00禁止群聊指令)").default(false)
7298
7322
  }).description("基础设置"),
7299
7323
  // 赛季与兑换配置组
7300
7324
  import_koishi.Schema.object({
@@ -7968,6 +7992,24 @@ ${itemDetails.join("\n")}`;
7968
7992
  return `您今天已经签到过了!本月累计签到${record.monthlyDays}天。`;
7969
7993
  }
7970
7994
  }
7995
+ const threeDaysAgo = new Date(now.getTime() - 3 * 24 * 60 * 60 * 1e3);
7996
+ try {
7997
+ const requestOptions = config.proxyAgent ? { proxyAgent: config.proxyAgent } : void 0;
7998
+ const matchData = await ctx.http.get(
7999
+ `https://api.sc2arcade.com/profiles/${regionId}/${realmId}/${profileId}/matches?orderDirection=desc`,
8000
+ requestOptions
8001
+ );
8002
+ const hasRecentPlay = matchData.results.some((match) => {
8003
+ const matchDate = new Date(match.date);
8004
+ return matchDate >= threeDaysAgo;
8005
+ });
8006
+ if (!hasRecentPlay) {
8007
+ return "🚫 需要最近3天内游玩过至少1次游戏才能签到。";
8008
+ }
8009
+ } catch (apiError) {
8010
+ console.error("游戏记录API请求失败:", apiError);
8011
+ return "⚠️ 无法验证游戏记录,请稍后重试。";
8012
+ }
7971
8013
  let monthlyDays = 1;
7972
8014
  if (record) {
7973
8015
  const lastSignChina = convertUTCtoChinaTime(record.lastSign);
@@ -8616,6 +8658,17 @@ ${ticketMessage}${effectMessage}`;
8616
8658
  return `⛔ 您已被列入黑名单。`;
8617
8659
  }
8618
8660
  const currentSeason = config.rankseason;
8661
+ const backpackItems = await ctx.database.get("ggcevo_backpack", { handle });
8662
+ const normalCoupon = backpackItems.find((item) => item.itemId === 2);
8663
+ const petCoupons = backpackItems.filter((item) => item.itemId >= 3 && item.itemId <= 6);
8664
+ const petCouponMap = { 3: "t3", 4: "t2", 5: "t1", 6: "t0" };
8665
+ let petCouponInfo = "";
8666
+ for (const coupon of petCoupons) {
8667
+ const quality = petCouponMap[coupon.itemId];
8668
+ if (petCouponInfo) petCouponInfo += " | ";
8669
+ petCouponInfo += `${quality}级券(${coupon.quantity})`;
8670
+ }
8671
+ if (!petCouponInfo) petCouponInfo = "无";
8619
8672
  const qualityGroups = {};
8620
8673
  for (const [itemName, config2] of Object.entries(itemConfig)) {
8621
8674
  const configname2 = config2;
@@ -8645,7 +8698,13 @@ ${ticketMessage}${effectMessage}`;
8645
8698
  t0: 6
8646
8699
  };
8647
8700
  const order = ["t0", "t1", "t2", "t3"];
8648
- let message = "请在30秒内输入可兑换物品名称(显示格式:物品名 [剩余/总量]):\n";
8701
+ let message = "===== 当前资源 =====\n";
8702
+ message += `普通兑奖券: ${normalCoupon?.quantity || 0}张
8703
+ `;
8704
+ message += `宠物扭蛋券: ${petCouponInfo}
8705
+
8706
+ `;
8707
+ message += "请在30秒内输入可兑换物品名称(显示格式:物品名 [剩余/总量]):\n";
8649
8708
  message += "注意:限量物品将在赛季更新时补货,限定物品[史蒂夫]除外。\n";
8650
8709
  for (const quality of order) {
8651
8710
  const items = qualityGroups[quality] || [];
@@ -8675,52 +8734,48 @@ ${items.join("、")}
8675
8734
  }
8676
8735
  const qualityMap = { "t3": 4, "t2": 5, "t1": 6, "t0": 7 };
8677
8736
  const petItems = new Set(
8678
- // 动态生成宠物集合
8679
8737
  Object.entries(itemConfig).filter(([_, config2]) => config2.type === "宠物").map(([name3]) => name3)
8680
8738
  );
8681
8739
  let cost = configname.cost;
8682
8740
  let itemId = 2;
8683
8741
  let couponName = "兑奖券";
8684
8742
  if (petItems.has(name2)) {
8685
- const [specialCoupon] = await ctx.database.get("ggcevo_backpack", {
8686
- handle,
8687
- itemId: qualityMap[configname.quality]
8688
- });
8743
+ const specialCoupon = backpackItems.find(
8744
+ (item) => item.itemId === qualityMap[configname.quality]
8745
+ );
8689
8746
  if (specialCoupon?.quantity >= 1) {
8690
8747
  itemId = qualityMap[configname.quality];
8691
8748
  cost = 1;
8692
- couponName = `${configname.quality}级宠物扭蛋`;
8749
+ couponName = `${configname.quality}级宠物扭蛋券`;
8693
8750
  }
8694
8751
  }
8695
- const [coupon] = await ctx.database.get("ggcevo_backpack", { handle, itemId });
8696
- if (!coupon || coupon.quantity < cost) {
8697
- const requireMsg = petItems.has(name2) ? `需要1个${configname.quality}级宠物扭蛋或${configname.cost}张兑奖券` : `需要${configname.cost}张兑奖券`;
8752
+ const couponItem = backpackItems.find((item) => item.itemId === itemId);
8753
+ if (!couponItem || couponItem.quantity < cost) {
8754
+ const requireMsg = petItems.has(name2) ? `需要1个${configname.quality}级宠物扭蛋券或${configname.cost}张普通兑奖券` : `需要${configname.cost}张普通兑奖券`;
8698
8755
  return `${requireMsg}
8699
- 您当前持有:${coupon?.quantity || 0}个${couponName}`;
8756
+ 您当前持有:${couponItem?.quantity || 0}个${couponName}`;
8700
8757
  }
8701
8758
  const isGlobal = configname.isLimited || config.ignoreGlobalLimit === false;
8702
8759
  await ctx.database.withTransaction(async () => {
8703
8760
  await ctx.database.set(
8704
8761
  "ggcevo_backpack",
8705
8762
  { handle, itemId },
8706
- { quantity: coupon.quantity - cost }
8763
+ { quantity: couponItem.quantity - cost }
8707
8764
  );
8708
8765
  await ctx.database.create("ggcevo_exchange", {
8709
8766
  userId: session.userId,
8710
8767
  handle,
8711
8768
  item: name2,
8712
8769
  type: configname.type,
8713
- // 从配置中获取类型
8714
8770
  date: /* @__PURE__ */ new Date(),
8715
8771
  GlobalLimit: isGlobal,
8716
- // 关键字段设置
8717
8772
  season: currentSeason
8718
8773
  });
8719
8774
  });
8720
8775
  return `🎉 恭喜!您使用${cost}个${couponName}兑换了【${name2}】`;
8721
8776
  } catch (error) {
8722
8777
  console.error("兑换失败:", error);
8723
- return "兑换失败";
8778
+ return "兑换失败,请稍后再试";
8724
8779
  }
8725
8780
  });
8726
8781
  ctx.command("ggcevo/兑换扭蛋币").action(async ({ session }) => {
@@ -8923,6 +8978,8 @@ ${items.join("、")}
8923
8978
  ctx.command("ggcevo/pk [user]", "发起玩家对战").alias("挑战").action(async (argv, user) => {
8924
8979
  try {
8925
8980
  const session = argv.session;
8981
+ const Curfew = fixedCurfewCheck(session, config);
8982
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
8926
8983
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
8927
8984
  if (!profile) return "🔒 需要先绑定游戏句柄。";
8928
8985
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -9304,6 +9361,8 @@ ${protectionList}
9304
9361
  ].join("\n");
9305
9362
  });
9306
9363
  ctx.command("ggcevo/武器库 [category]").usage('输入"武器库"查看类型,或"武器库 类型"查看详细武器信息').action(async ({ session }, category) => {
9364
+ const Curfew = fixedCurfewCheck(session, config);
9365
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
9307
9366
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
9308
9367
  if (!profile) return "⚠️ 需要先绑定游戏句柄";
9309
9368
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -9447,6 +9506,8 @@ ${displayDiscounts.join("\n")}` : "",
9447
9506
  ].filter(Boolean).join("\n");
9448
9507
  });
9449
9508
  ctx.command("ggcevo/爆破库 [type]").usage("输入“爆破库”查看分类,或“爆破库 类型”查看详细物品").action(async ({ session }, type) => {
9509
+ const Curfew = fixedCurfewCheck(session, config);
9510
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
9450
9511
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
9451
9512
  if (!profile) return "⚠️ 需要先绑定游戏句柄";
9452
9513
  const filteredItems = Object.values(SyndicatedItems).filter(
@@ -9494,6 +9555,8 @@ ${validTypes.join("、")}`;
9494
9555
  ].join("\n");
9495
9556
  });
9496
9557
  ctx.command("ggcevo/购买 <item>").action(async ({ session }, item) => {
9558
+ const Curfew = fixedCurfewCheck(session, config);
9559
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
9497
9560
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
9498
9561
  if (!profile) return "🔒 需要先绑定游戏句柄。";
9499
9562
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -9501,15 +9564,15 @@ ${validTypes.join("、")}`;
9501
9564
  if (existingEntries.length > 0) return "⛔ 您已被列入黑名单。";
9502
9565
  const allItems = { ...weaponConfig, ...SyndicatedItems };
9503
9566
  if (!item) return '请输入"购买 物品名称"来购买所需物品。';
9504
- const config2 = allItems[item];
9505
- if (!config2) return "无效的物品名称,请重新输入。";
9506
- if (config2.price <= 0) return "❌ 该物品不可直接购买";
9507
- const isWeapon = ["能量武器", "热能武器", "实弹武器", "传奇武器"].includes(config2.category);
9508
- const isLegendaryWeapon = config2.category === "传奇武器";
9567
+ const itemconfig = allItems[item];
9568
+ if (!itemconfig) return "无效的物品名称,请重新输入。";
9569
+ if (itemconfig.price <= 0) return "❌ 该物品不可直接购买";
9570
+ const isWeapon = ["能量武器", "热能武器", "实弹武器", "传奇武器"].includes(itemconfig.category);
9571
+ const isLegendaryWeapon = itemconfig.category === "传奇武器";
9509
9572
  if (isWeapon) {
9510
9573
  const existingWeapon = await ctx.database.get("ggcevo_weapons", {
9511
9574
  handle,
9512
- weaponId: config2.id
9575
+ weaponId: itemconfig.id
9513
9576
  });
9514
9577
  if (existingWeapon.length > 0) return `❌ 您已经拥有${item},无法重复购买`;
9515
9578
  }
@@ -9549,10 +9612,10 @@ ${validTypes.join("、")}`;
9549
9612
  const techLevel = weaponTech?.level || 0;
9550
9613
  const techConfigData = Spacestationtechnology.find((tech) => tech.techId === 2);
9551
9614
  if (!isLegendaryWeapon && playerGroup === "人类联盟" && techLevel > 0 && techConfigData) {
9552
- if (config2.level && config2.level <= techLevel) {
9615
+ if (itemconfig.level && itemconfig.level <= techLevel) {
9553
9616
  const isCareerBonus = techConfigData.careerNames.includes(playerCareer);
9554
9617
  totalDiscount += 25;
9555
- discountDetails.push(`▸ 🔧 武器系统Lv${techLevel}: ${isCareerBonus ? "50%" : "25%"}折扣 (适用${romanLevels[config2.level]}类武器)`);
9618
+ discountDetails.push(`▸ 🔧 武器系统Lv${techLevel}: ${isCareerBonus ? "50%" : "25%"}折扣 (适用${romanLevels[itemconfig.level]}类武器)`);
9556
9619
  if (isCareerBonus) {
9557
9620
  totalDiscount += 25;
9558
9621
  }
@@ -9584,15 +9647,15 @@ ${validTypes.join("、")}`;
9584
9647
  }
9585
9648
  }
9586
9649
  totalDiscount = Math.min(totalDiscount, 100);
9587
- let actualPrice = config2.price;
9650
+ let actualPrice = itemconfig.price;
9588
9651
  if (totalDiscount > 0) {
9589
- actualPrice = Math.floor(config2.price * (100 - totalDiscount) / 100);
9652
+ actualPrice = Math.floor(itemconfig.price * (100 - totalDiscount) / 100);
9590
9653
  actualPrice = Math.max(actualPrice, 1);
9591
9654
  }
9592
9655
  if ((signInfo?.totalRewards || 0) < actualPrice) {
9593
9656
  let priceInfo = `需要 ${actualPrice} 金币`;
9594
9657
  if (discountDetails.length > 0) {
9595
- priceInfo += ` (原价${config2.price})`;
9658
+ priceInfo += ` (原价${itemconfig.price})`;
9596
9659
  }
9597
9660
  return `❌ 金币不足,${priceInfo}`;
9598
9661
  }
@@ -9620,7 +9683,7 @@ ${validTypes.join("、")}`;
9620
9683
  if (isWeapon) {
9621
9684
  await ctx.database.upsert("ggcevo_weapons", [{
9622
9685
  handle,
9623
- weaponId: config2.id,
9686
+ weaponId: itemconfig.id,
9624
9687
  level: 0,
9625
9688
  modificationSlots: 1,
9626
9689
  equipped: false,
@@ -9631,7 +9694,7 @@ ${validTypes.join("、")}`;
9631
9694
  if (equippedCount === 0) {
9632
9695
  await ctx.database.set(
9633
9696
  "ggcevo_weapons",
9634
- { handle, weaponId: config2.id },
9697
+ { handle, weaponId: itemconfig.id },
9635
9698
  { equipped: true }
9636
9699
  );
9637
9700
  isAutoEquipped = true;
@@ -9639,11 +9702,11 @@ ${validTypes.join("、")}`;
9639
9702
  } else {
9640
9703
  const [existing] = await ctx.database.get("ggcevo_warehouse", {
9641
9704
  handle,
9642
- itemId: config2.id
9705
+ itemId: itemconfig.id
9643
9706
  });
9644
9707
  await ctx.database.upsert("ggcevo_warehouse", [{
9645
9708
  handle,
9646
- itemId: config2.id,
9709
+ itemId: itemconfig.id,
9647
9710
  quantity: (existing?.quantity || 0) + 1
9648
9711
  }], ["handle", "itemId"]);
9649
9712
  }
@@ -9651,7 +9714,7 @@ ${validTypes.join("、")}`;
9651
9714
  let message = `✅ 成功购买${isWeapon ? "武器" : "物品"}「${item}」
9652
9715
  `;
9653
9716
  if (discountDetails.length > 0) {
9654
- message += `花费 ${actualPrice} 金币 (原价${config2.price} 金币)`;
9717
+ message += `花费 ${actualPrice} 金币 (原价${itemconfig.price} 金币)`;
9655
9718
  message += `
9656
9719
  💰 折扣明细:
9657
9720
  ${discountDetails.join("\n")}`;
@@ -9673,13 +9736,15 @@ ${discountDetails.join("\n")}`;
9673
9736
  }
9674
9737
  message += "\n输入「武器仓库」查看详情";
9675
9738
  } else {
9676
- const [current] = await ctx.database.get("ggcevo_warehouse", { handle, itemId: config2.id });
9739
+ const [current] = await ctx.database.get("ggcevo_warehouse", { handle, itemId: itemconfig.id });
9677
9740
  message += `
9678
9741
  当前持有数量:${current?.quantity || 1},输入「仓库」查看物品`;
9679
9742
  }
9680
9743
  return message;
9681
9744
  });
9682
9745
  ctx.command("ggcevo/武器仓库").action(async ({ session }) => {
9746
+ const Curfew = fixedCurfewCheck(session, config);
9747
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
9683
9748
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
9684
9749
  if (!profile) return "🔒 需要先绑定游戏句柄。";
9685
9750
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -9716,6 +9781,8 @@ ${discountDetails.join("\n")}`;
9716
9781
  ].join("\n");
9717
9782
  });
9718
9783
  ctx.command("ggcevo/装备武器 <weapon>").alias("装备").action(async ({ session }, weapon) => {
9784
+ const Curfew = fixedCurfewCheck(session, config);
9785
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
9719
9786
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
9720
9787
  if (!profile) return "🔒 需要先绑定游戏句柄。";
9721
9788
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -9725,10 +9792,10 @@ ${discountDetails.join("\n")}`;
9725
9792
  }
9726
9793
  if (!weapon) return "请输入“装备武器 武器名称”来装备一把你拥有的武器。";
9727
9794
  if (!weaponConfig[weapon]) return "武器名称错误,请输入“装备武器 武器名称”来装备一把你拥有的武器。";
9728
- const config2 = weaponConfig[weapon];
9795
+ const itemconfig = weaponConfig[weapon];
9729
9796
  const [owned] = await ctx.database.get("ggcevo_weapons", {
9730
9797
  handle,
9731
- weaponId: config2.id
9798
+ weaponId: itemconfig.id
9732
9799
  });
9733
9800
  if (!owned) return "您尚未获得该武器。";
9734
9801
  await ctx.database.withTransaction(async () => {
@@ -9736,20 +9803,22 @@ ${discountDetails.join("\n")}`;
9736
9803
  "ggcevo_weapons",
9737
9804
  {
9738
9805
  handle,
9739
- weaponId: { $ne: config2.id }
9806
+ weaponId: { $ne: itemconfig.id }
9740
9807
  // 排除当前武器
9741
9808
  },
9742
9809
  { equipped: false }
9743
9810
  );
9744
9811
  await ctx.database.upsert("ggcevo_weapons", [{
9745
9812
  handle,
9746
- weaponId: config2.id,
9813
+ weaponId: itemconfig.id,
9747
9814
  equipped: true
9748
9815
  }], ["handle", "weaponId"]);
9749
9816
  });
9750
9817
  return `您已成功装备武器 ${weapon}!`;
9751
9818
  });
9752
9819
  ctx.command("ggcevo/升级科技 <target>", "升级空间站科技").action(async ({ session }, target) => {
9820
+ const Curfew = fixedCurfewCheck(session, config);
9821
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
9753
9822
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
9754
9823
  if (!profile) return "🔒 需要先绑定游戏句柄。";
9755
9824
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -9767,6 +9836,8 @@ ${discountDetails.join("\n")}`;
9767
9836
  return handleTechUpgrade(ctx, handle, target);
9768
9837
  });
9769
9838
  ctx.command("ggcevo/升级武器 <target>", "升级武器").alias("升级").action(async ({ session }, target) => {
9839
+ const Curfew = fixedCurfewCheck(session, config);
9840
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
9770
9841
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
9771
9842
  if (!profile) return "🔒 需要先绑定游戏句柄。";
9772
9843
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -9783,6 +9854,8 @@ ${discountDetails.join("\n")}`;
9783
9854
  return handleWeaponUpgrade(ctx, handle, target);
9784
9855
  });
9785
9856
  ctx.command("ggcevo/改装武器 <weapon> [mod]", "安装武器模块").alias("改装").action(async ({ session }, weapon, mod) => {
9857
+ const Curfew = fixedCurfewCheck(session, config);
9858
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
9786
9859
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
9787
9860
  if (!profile) return "🔒 需要先绑定游戏句柄。";
9788
9861
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -9939,6 +10012,8 @@ ${discountDetails.join("\n")}`;
9939
10012
  }
9940
10013
  });
9941
10014
  ctx.command("ggcevo/拆卸 <weapon> <mod>", "卸载武器模块,专属模块返还50%金币,通用模块返还80%金币").action(async ({ session }, weapon, mod) => {
10015
+ const Curfew = fixedCurfewCheck(session, config);
10016
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
9942
10017
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
9943
10018
  if (!profile) return "🔒 需要先绑定游戏句柄。";
9944
10019
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -9961,13 +10036,13 @@ ${discountDetails.join("\n")}`;
9961
10036
  let refundReason;
9962
10037
  if (isRecyclable) {
9963
10038
  refundRate = 1;
9964
- refundReason = "⚠️ 回收模式开启:全额返还金币";
10039
+ refundReason = "ℹ️ 全额返还金币";
9965
10040
  } else if (modInfo.isExclusive) {
9966
10041
  refundRate = 0.5;
9967
- refundReason = "专属模块返还50%";
10042
+ refundReason = "ℹ️ 专属模块返还50%金币";
9968
10043
  } else {
9969
10044
  refundRate = 0.8;
9970
- refundReason = "通用模块返还80%";
10045
+ refundReason = "ℹ️ 通用模块返还80%金币";
9971
10046
  }
9972
10047
  const refund = Math.floor(modInfo.cost * refundRate);
9973
10048
  const newMods = equipment.installedMods.filter((m) => m !== mod);
@@ -9982,18 +10057,21 @@ ${discountDetails.join("\n")}`;
9982
10057
  handle,
9983
10058
  totalRewards: newBalance
9984
10059
  }], ["handle"]);
9985
- return [
10060
+ const responseLines = [
9986
10061
  `✅ 已从 ${weapon} 拆卸 ${mod} 模块`,
9987
- `返还金币:${refund} (原价${modInfo.cost}, ${refundReason})`,
10062
+ refund === modInfo.cost ? `返还金币:${refund}` : `返还金币:${refund} (原价${modInfo.cost})`,
9988
10063
  `当前金币总额:${newBalance}`,
9989
10064
  `剩余模块:${newMods.join(", ") || "无"}`,
9990
- isRecyclable ? "ℹ️ 回收模式模块拆卸返还100%" : modInfo.isExclusive ? "ℹ️ 专属模块拆卸只返还50%" : ""
9991
- ].filter(Boolean).join("\n");
10065
+ refundReason
10066
+ ];
10067
+ return responseLines.filter(Boolean).join("\n");
9992
10068
  });
9993
10069
  ctx.guild().command("ggcevo/攻击 <bossName>").usage("请输入要攻击的异形名称(例如:攻击 异齿猛兽 或 攻击 寒冰王蛇)").action(async (argv, bossName) => {
9994
10070
  const session = argv.session;
9995
10071
  let bossEventBroadcast = null;
9996
10072
  let cleanerRewardBroadcast = null;
10073
+ const Curfew = fixedCurfewCheck(session, config);
10074
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
9997
10075
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
9998
10076
  if (!profile) return "🔒 需要先绑定游戏句柄。";
9999
10077
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -10010,8 +10088,7 @@ ${discountDetails.join("\n")}`;
10010
10088
  return `当前没有找到名为 ${bossName} 的可攻击目标。
10011
10089
  请攻击当前存活的异形:${activeNames || "无"}。`;
10012
10090
  }
10013
- const config2 = ctx.config;
10014
- const unlimitedBossAttack = config2.unlimitedBossAttack;
10091
+ const unlimitedBossAttack = config.unlimitedBossAttack;
10015
10092
  if (!unlimitedBossAttack) {
10016
10093
  const lastAttack = await ctx.database.get("ggcevo_boss_damage", { handle });
10017
10094
  if (lastAttack.length > 0) {
@@ -10045,7 +10122,7 @@ ${discountDetails.join("\n")}`;
10045
10122
  ctx,
10046
10123
  session,
10047
10124
  handle,
10048
- config2,
10125
+ config,
10049
10126
  equippedWeapon,
10050
10127
  verifiedBoss,
10051
10128
  activeBosses,
@@ -10064,7 +10141,7 @@ ${discountDetails.join("\n")}`;
10064
10141
  ctx,
10065
10142
  session,
10066
10143
  handle,
10067
- config2,
10144
+ config,
10068
10145
  equippedWeapon,
10069
10146
  verifiedBoss,
10070
10147
  weaponName,
@@ -10177,7 +10254,7 @@ ${discountDetails.join("\n")}`;
10177
10254
  redcrystalMessage
10178
10255
  );
10179
10256
  await session.send(resultMessage);
10180
- const groupId = [...config2.groupId];
10257
+ const groupId = [...config.groupId];
10181
10258
  await handleBroadcasts(
10182
10259
  ctx,
10183
10260
  groupId,
@@ -10188,6 +10265,8 @@ ${discountDetails.join("\n")}`;
10188
10265
  ctx.command("ggcevo/攻击假人 [name]").option("tags", "-t <tags:string> 添加BOSS标签(逗号分隔)").option("passives", "-p <passives:string> 添加被动技能(逗号分隔)").option("hp", "-l <hp:number> 模拟假人血量").option("energy", "-e <energy:number> 模拟假人能量").option("skillStacks", "-s <stacks:number> 技能层数").option("cold", "-c <cold:number> 寒冷层数").option("status", "-a <status:number> 状态层数").option("armor", "-d <armor:number> 护甲").option("burn", "-b <burn:number> 燃烧层数").action(async (argv, name2) => {
10189
10266
  const session = argv.session;
10190
10267
  const { options } = argv;
10268
+ const Curfew = fixedCurfewCheck(session, config);
10269
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
10191
10270
  if (!name2) {
10192
10271
  name2 = "测试假人";
10193
10272
  }
@@ -10322,7 +10401,9 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
10322
10401
  pageNum < totalPages ? `输入 伤害榜 ${pageNum + 1} 查看下一页` : "已是最后一页"
10323
10402
  ].join("\n");
10324
10403
  });
10325
- ctx.command("ggcevo/异形信息", "查看当前主宰信息").alias("yx信息").action(async () => {
10404
+ ctx.command("ggcevo/异形信息", "查看当前主宰信息").alias("yx信息").action(async ({ session }) => {
10405
+ const Curfew = fixedCurfewCheck(session, config);
10406
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
10326
10407
  const activeBosses = await ctx.database.get("ggcevo_boss", { isActive: true });
10327
10408
  if (!activeBosses.length) return "当前没有存活的异形,请等待12点或0点刷新。";
10328
10409
  const mainBoss = activeBosses.find((b) => b.type === "主宰");
@@ -10514,6 +10595,8 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
10514
10595
  });
10515
10596
  ctx.command("ggcevo/祈愿").action(async (argv) => {
10516
10597
  const session = argv.session;
10598
+ const Curfew = fixedCurfewCheck(session, config);
10599
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
10517
10600
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
10518
10601
  if (!profile) return "🔒 需要先绑定游戏句柄。";
10519
10602
  const { regionId, realmId, profileId } = profile;
@@ -10591,6 +10674,8 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
10591
10674
  ⏳ 效果持续至 ${formattedEndTime}`;
10592
10675
  });
10593
10676
  ctx.command("ggcevo/加入 <faction>", "加入阵营").alias("加入阵营").action(async ({ session }, faction) => {
10677
+ const Curfew = fixedCurfewCheck(session, config);
10678
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
10594
10679
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
10595
10680
  if (!profile) return "🔒 需要先绑定游戏句柄。";
10596
10681
  const { regionId, realmId, profileId } = profile;
@@ -10655,6 +10740,8 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
10655
10740
  }
10656
10741
  });
10657
10742
  ctx.command("ggcevo/退出", "退出当前阵营").alias("退出阵营").action(async ({ session }) => {
10743
+ const Curfew = fixedCurfewCheck(session, config);
10744
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
10658
10745
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
10659
10746
  if (!profile) return "🔒 需要先绑定游戏句柄。";
10660
10747
  const { regionId, realmId, profileId } = profile;
@@ -10705,6 +10792,8 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
10705
10792
  }
10706
10793
  });
10707
10794
  ctx.command("ggcevo/转职 [profession]", "转职系统").action(async ({ session }, profession) => {
10795
+ const Curfew = fixedCurfewCheck(session, config);
10796
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
10708
10797
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
10709
10798
  if (!profile) return "🔒 需要先绑定游戏句柄。";
10710
10799
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -10714,16 +10803,16 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
10714
10803
  }
10715
10804
  const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
10716
10805
  if (!careerData) return "请先加入阵营后使用转职功能。";
10717
- let config2;
10806
+ let careerconfig;
10718
10807
  if (careerData.group === "人类联盟") {
10719
- config2 = spaceStationCrewConfig;
10808
+ careerconfig = spaceStationCrewConfig;
10720
10809
  } else if (careerData.group === "辛迪加海盗") {
10721
- config2 = syndicatePirateConfig;
10810
+ careerconfig = syndicatePirateConfig;
10722
10811
  } else {
10723
10812
  return "未知阵营无法显示职业信息。";
10724
10813
  }
10725
10814
  if (!profession) {
10726
- const availableCareers = config2.filter(
10815
+ const availableCareers = careerconfig.filter(
10727
10816
  (p) => p.Jobtransfer && p.professionName !== careerData.career
10728
10817
  );
10729
10818
  const careerList = availableCareers.map((p) => {
@@ -10744,7 +10833,7 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
10744
10833
  "💡 转职后原有职业效果将被替换"
10745
10834
  ].join("\n");
10746
10835
  }
10747
- const targetProfession = config2.find((p) => p.professionName === profession);
10836
+ const targetProfession = careerconfig.find((p) => p.professionName === profession);
10748
10837
  if (!targetProfession) return "该职业不存在。";
10749
10838
  if (!targetProfession.Jobtransfer) return "该职业无法直接转职。";
10750
10839
  if (careerData.career === profession) return "您已经是该职业了。";
@@ -10787,6 +10876,8 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
10787
10876
  });
10788
10877
  ctx.command("ggcevo/职业信息", "查看当前阵营与职业状态").action(async ({ session }) => {
10789
10878
  try {
10879
+ const Curfew = fixedCurfewCheck(session, config);
10880
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
10790
10881
  const [profile] = await ctx.database.get("sc2arcade_player", {
10791
10882
  userId: session.userId
10792
10883
  });
@@ -10855,6 +10946,8 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
10855
10946
  }
10856
10947
  });
10857
10948
  ctx.command("ggcevo/黑市 [category]", "辛迪加海盗专属黑市").usage('输入"黑市"查看分类,或"黑市 分类名称"查看详细').action(async ({ session }, category) => {
10949
+ const Curfew = fixedCurfewCheck(session, config);
10950
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
10858
10951
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
10859
10952
  if (!profile) return "🔒 需要先绑定游戏句柄。";
10860
10953
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -10985,6 +11078,8 @@ ${discountDetails.join("\n")}` : "",
10985
11078
  ].filter(Boolean).join("\n");
10986
11079
  });
10987
11080
  ctx.command("ggcevo/订购 <item>").action(async ({ session }, item) => {
11081
+ const Curfew = fixedCurfewCheck(session, config);
11082
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
10988
11083
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
10989
11084
  if (!profile) return "🔒 需要先绑定游戏句柄。";
10990
11085
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -11109,6 +11204,8 @@ ${discountReason}` : "",
11109
11204
  });
11110
11205
  ctx.command("ggcevo/仓库").action(async (argv) => {
11111
11206
  const session = argv.session;
11207
+ const Curfew = fixedCurfewCheck(session, config);
11208
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
11112
11209
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
11113
11210
  if (!profile) return "🔒 需要先绑定游戏句柄。";
11114
11211
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -11164,6 +11261,8 @@ ${discountReason}` : "",
11164
11261
  const session = argv.session;
11165
11262
  let bossEventBroadcast = null;
11166
11263
  let cleanerRewardBroadcast = null;
11264
+ const Curfew = fixedCurfewCheck(session, config);
11265
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
11167
11266
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
11168
11267
  if (!profile) return "🔒 需要先绑定游戏句柄。";
11169
11268
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -11218,6 +11317,8 @@ ${discountReason}` : "",
11218
11317
  }
11219
11318
  });
11220
11319
  ctx.command("ggcevo/科技 [techName]", "查看空间站科技信息").usage("输入“科技”查看列表,或“科技 科技名称”查看详细信息").action(async ({ session }, techName) => {
11320
+ const Curfew = fixedCurfewCheck(session, config);
11321
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
11221
11322
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
11222
11323
  if (!profile) return "🔒 需要先绑定游戏句柄。";
11223
11324
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -11279,6 +11380,8 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11279
11380
  ].filter(Boolean).join("\n");
11280
11381
  });
11281
11382
  ctx.command("ggcevo/挖矿").action(async ({ session }) => {
11383
+ const Curfew = fixedCurfewCheck(session, config);
11384
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
11282
11385
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
11283
11386
  if (!profile) return "🔒 需要先绑定游戏句柄。";
11284
11387
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -11422,6 +11525,8 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11422
11525
  return reportLines.join("\n");
11423
11526
  });
11424
11527
  ctx.command("ggcevo/任务 [name]").usage('输入"任务"查看所有任务列表,或"任务 任务名称"查看详细任务信息').action(async ({ session }, name2) => {
11528
+ const Curfew = fixedCurfewCheck(session, config);
11529
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
11425
11530
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
11426
11531
  if (!profile) return "⚠️ 需要先绑定游戏句柄";
11427
11532
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -11476,6 +11581,8 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11476
11581
  });
11477
11582
  ctx.command("ggcevo/完成任务 <name:text>", "完成指定任务领取奖励").usage('输入"完成任务 任务名称"来完成任务并领取奖励').action(async ({ session }, name2) => {
11478
11583
  try {
11584
+ const Curfew = fixedCurfewCheck(session, config);
11585
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
11479
11586
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
11480
11587
  if (!profile) return "⚠️ 需要先绑定游戏句柄";
11481
11588
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -11551,6 +11658,8 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11551
11658
  });
11552
11659
  ctx.command("ggcevo/购买保护卡", "花费600金币购买一周PK保护卡").alias("购买pk保护卡").action(async ({ session }) => {
11553
11660
  try {
11661
+ const Curfew = fixedCurfewCheck(session, config);
11662
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
11554
11663
  const userId = session.userId;
11555
11664
  const [profile] = await ctx.database.get("sc2arcade_player", { userId });
11556
11665
  if (!profile) return "🔒 请先绑定游戏句柄。";
@@ -11612,6 +11721,8 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11612
11721
  });
11613
11722
  ctx.command("ggcevo/开启军械库防爆门").alias("打开军械库防爆门").action(async (argv) => {
11614
11723
  const session = argv.session;
11724
+ const Curfew = fixedCurfewCheck(session, config);
11725
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
11615
11726
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
11616
11727
  if (!profile) return "🔒 请先绑定游戏句柄。";
11617
11728
  const { regionId, realmId, profileId } = profile;
@@ -11662,6 +11773,8 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11662
11773
  ].join("\n");
11663
11774
  });
11664
11775
  ctx.command("ggcevo/技能 [异形名称]").usage('查询异形技能,输入"技能"查看所有异形,输入"技能 异形名称"查询详细技能').action(async ({ session }, unitName) => {
11776
+ const Curfew = fixedCurfewCheck(session, config);
11777
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
11665
11778
  const allUnits = /* @__PURE__ */ new Set();
11666
11779
  bossPool.forEach((boss) => {
11667
11780
  allUnits.add(boss.main.name);
@@ -11752,6 +11865,8 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11752
11865
  });
11753
11866
  ctx.command("ggcevo/咕咕更新").action(async ({ session }) => {
11754
11867
  try {
11868
+ const Curfew = fixedCurfewCheck(session, config);
11869
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
11755
11870
  const latestUpdates = [...ggcevoUpdates].sort((a, b) => compareVersions(a.version, b.version)).slice(0, 3);
11756
11871
  if (latestUpdates.length === 0) {
11757
11872
  return "🛑 暂无更新记录";
@@ -11776,6 +11891,8 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11776
11891
  }
11777
11892
  });
11778
11893
  ctx.command("ggcevo/探索 [galaxyName]").action(async ({ session }, galaxyName) => {
11894
+ const Curfew = fixedCurfewCheck(session, config);
11895
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
11779
11896
  const possibleItems = [
11780
11897
  { id: 2, name: "闪光弹", type: "手榴弹", chance: 0.1 },
11781
11898
  { id: 4, name: "脉冲手雷", type: "手榴弹", chance: 0.1 },
@@ -12140,6 +12257,8 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
12140
12257
  shipIdToName[data.id] = name2;
12141
12258
  }
12142
12259
  ctx.command("ggcevo/飞船信息").action(async ({ session }) => {
12260
+ const Curfew = fixedCurfewCheck(session, config);
12261
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
12143
12262
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
12144
12263
  if (!profile) return "🔒 需要先绑定游戏句柄。";
12145
12264
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -12166,6 +12285,8 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
12166
12285
  ].join("\n");
12167
12286
  });
12168
12287
  ctx.command("ggcevo/购买飞船 [shipName]").alias("飞船").action(async ({ session }, shipName) => {
12288
+ const Curfew = fixedCurfewCheck(session, config);
12289
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
12169
12290
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
12170
12291
  if (!profile) return "🔒 需要先绑定游戏句柄。";
12171
12292
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -12173,7 +12294,7 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
12173
12294
  return "⛔ 您已被列入黑名单。";
12174
12295
  }
12175
12296
  const [signRecord] = await ctx.database.get("ggcevo_sign", { handle });
12176
- if (!signRecord) return "请先进行至少一次签到获得金币后购买飞船";
12297
+ if (!signRecord) return "请先进行至少一次签到获得金币后购买飞船";
12177
12298
  const coins = signRecord.totalRewards;
12178
12299
  if (!shipName) {
12179
12300
  const shipList = Object.keys(spaceship).map((name2) => {
@@ -12237,6 +12358,8 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
12237
12358
  ].join("\n");
12238
12359
  });
12239
12360
  ctx.command("ggcevo/升级物品 [itemName]", "升级辛迪加海盗物品").usage('输入"升级物品"查看可升级列表,或"升级物品 物品名称"进行升级').action(async ({ session }, itemName) => {
12361
+ const Curfew = fixedCurfewCheck(session, config);
12362
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
12240
12363
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
12241
12364
  if (!profile) return "🔒 需要先绑定游戏句柄。";
12242
12365
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -12244,7 +12367,7 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
12244
12367
  return "⛔ 您已被列入黑名单。";
12245
12368
  }
12246
12369
  const [career] = await ctx.database.get("ggcevo_careers", { handle });
12247
- if (!career) return "🚫 未查询到您的阵营信息";
12370
+ if (!career) return "🚫 仅限辛迪加海盗阵营使用";
12248
12371
  if (career.group !== "辛迪加海盗") {
12249
12372
  return `🚫 仅限辛迪加海盗阵营使用`;
12250
12373
  }
@@ -12373,6 +12496,8 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
12373
12496
  胜点榜基准日: ${now.toLocaleDateString()}`;
12374
12497
  });
12375
12498
  ctx.command("ggcevo/竞猜 [itemId] [amount] [guess]", "参与竞猜游戏").usage('输入"竞猜"查看可竞猜项目,"竞猜 项目ID 金额 内容"进行竞猜').example("竞猜 1 500 寒冰王蛇").action(async ({ session }, itemId, amount, guess) => {
12499
+ const Curfew = fixedCurfewCheck(session, config);
12500
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
12376
12501
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
12377
12502
  if (!profile) return "🔒 需要先绑定游戏句柄";
12378
12503
  const { regionId, realmId, profileId } = profile;
@@ -12469,9 +12594,14 @@ ${validBossNames.join("、")}`;
12469
12594
  }
12470
12595
  });
12471
12596
  ctx.command("ggcevo/兑换资源 [name] [amount]").usage('输入"兑换资源"查看可兑换资源列表\n输入"兑换资源 物品名称 [数量]"进行兑换').action(async ({ session }, name2, amount) => {
12597
+ const Curfew = fixedCurfewCheck(session, config);
12598
+ if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。";
12472
12599
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
12473
12600
  if (!profile) return "🔒 需要先绑定游戏句柄";
12474
12601
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
12602
+ if ((await ctx.database.get("ggcevo_blacklist", { handle })).length) {
12603
+ return "⛔ 您已被列入黑名单。";
12604
+ }
12475
12605
  const resourceItems = {
12476
12606
  "金币": { valuePerCoupon: 100, currencyField: "totalRewards", table: "ggcevo_sign" },
12477
12607
  "红晶": { valuePerCoupon: 1, currencyField: "redcrystal", table: "ggcevo_careers" }
@@ -12486,13 +12616,19 @@ ${validBossNames.join("、")}`;
12486
12616
  '使用 "兑换资源 物品名称 数量" 进行兑换',
12487
12617
  `您当前持有: ${coupon?.quantity || 0}张资源兑换券`,
12488
12618
  "====================",
12489
- ...Object.entries(resourceItems).map(([itemName, config3]) => `▸ ${itemName}:1张券兑换${config3.valuePerCoupon}${itemName === "金币" ? "金币" : "红晶"}`),
12619
+ ...Object.entries(resourceItems).map(([itemName, config2]) => `▸ ${itemName}:1张券兑换${config2.valuePerCoupon}${itemName === "金币" ? "金币" : "红晶"}`),
12490
12620
  "====================",
12491
12621
  '输入示例:"兑换资源 金币 5"(兑换500金币)'
12492
12622
  ].join("\n");
12493
12623
  }
12494
- const config2 = resourceItems[name2];
12495
- if (!config2) return `⚠️ 无效物品名称,可用选项:${Object.keys(resourceItems).join("、")}`;
12624
+ const itemconfig = resourceItems[name2];
12625
+ if (!itemconfig) return `⚠️ 无效物品名称,可用选项:${Object.keys(resourceItems).join("、")}`;
12626
+ if (name2 === "红晶") {
12627
+ const [career] = await ctx.database.get("ggcevo_careers", { handle });
12628
+ if (!career || career.group !== "辛迪加海盗") {
12629
+ return `⚠️ 兑换红晶失败:仅限【辛迪加海盗】组织成员兑换,您当前属于【${career?.group || "无"}】`;
12630
+ }
12631
+ }
12496
12632
  const exchangeAmount = parseInt(amount) || 1;
12497
12633
  if (exchangeAmount <= 0 || exchangeAmount > 100) return "⚠️ 兑换数量需在1-100之间";
12498
12634
  const [couponItem] = await ctx.database.get("ggcevo_backpack", {
@@ -12503,7 +12639,7 @@ ${validBossNames.join("、")}`;
12503
12639
  if (couponCount < exchangeAmount) {
12504
12640
  return `⚠️ 兑换券不足,需要${exchangeAmount}张,当前持有:${couponCount}张`;
12505
12641
  }
12506
- const gainAmount = config2.valuePerCoupon * exchangeAmount;
12642
+ const gainAmount = itemconfig.valuePerCoupon * exchangeAmount;
12507
12643
  try {
12508
12644
  await ctx.database.withTransaction(async () => {
12509
12645
  await ctx.database.set(
@@ -12511,19 +12647,19 @@ ${validBossNames.join("、")}`;
12511
12647
  { handle, itemId: 8 },
12512
12648
  { quantity: couponCount - exchangeAmount }
12513
12649
  );
12514
- const [record] = await ctx.database.get(config2.table, { handle });
12650
+ const [record] = await ctx.database.get(itemconfig.table, { handle });
12515
12651
  if (record) {
12516
12652
  await ctx.database.set(
12517
- config2.table,
12653
+ itemconfig.table,
12518
12654
  { handle },
12519
- { [config2.currencyField]: record[config2.currencyField] + gainAmount }
12655
+ { [itemconfig.currencyField]: record[itemconfig.currencyField] + gainAmount }
12520
12656
  );
12521
12657
  } else {
12522
- await ctx.database.create(config2.table, {
12658
+ await ctx.database.create(itemconfig.table, {
12523
12659
  handle,
12524
12660
  userId: session.userId,
12525
- [config2.currencyField]: gainAmount,
12526
- ...config2.table === "ggcevo_sign" ? { lastSign: /* @__PURE__ */ new Date() } : {}
12661
+ [itemconfig.currencyField]: gainAmount,
12662
+ ...itemconfig.table === "ggcevo_sign" ? { lastSign: /* @__PURE__ */ new Date() } : {}
12527
12663
  });
12528
12664
  }
12529
12665
  });
@@ -12602,17 +12738,17 @@ PK同玩家限战:1次/日
12602
12738
  ctx.command("ggcevo/击败奖励").alias("击杀奖励").action(({}) => {
12603
12739
  return `
12604
12740
  🌟 异形主宰击败奖励规则 🌟
12605
- 🏆 前20名奖励(按伤害排名):
12741
+ 🏆 伤害榜奖励(按伤害排名):
12606
12742
  1️⃣ 第1名:
12607
- 50 资源兑换券
12743
+ 35 资源兑换券
12608
12744
  2️⃣ 第2名:
12609
- 45 资源兑换券
12745
+ 30 资源兑换券
12610
12746
  3️⃣ 第3名:
12611
- 40 资源兑换券
12747
+ 25 资源兑换券
12612
12748
  🎖️ 第4-10名:
12613
- 30 资源兑换券
12614
- 💫 第11-20名:
12615
12749
  20 资源兑换券
12750
+ 🎖 第11-20名:
12751
+ 15 资源兑换券
12616
12752
  💫 第21-50名:
12617
12753
  10 资源兑换券
12618
12754
  💝 其他参与者:
@@ -12671,7 +12807,7 @@ PK同玩家限战:1次/日
12671
12807
  📌 重要说明:
12672
12808
  1. 结算后自动发放所有奖励
12673
12809
  2. 勋章可通过背包查看
12674
- 3. 每个赛季2个月
12810
+ 3. 每个赛季持续2个月,可通过“胜点榜”指令查看
12675
12811
  `.trim();
12676
12812
  });
12677
12813
  }
package/lib/utils.d.ts CHANGED
@@ -41,3 +41,4 @@ export declare const GUESSING_ITEMS: {
41
41
  minBet: number;
42
42
  status: string;
43
43
  }[];
44
+ export declare function fixedCurfewCheck(session: any, config: Config): true | false;
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.6.33",
4
+ "version": "1.6.35",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [