koishi-plugin-ggcevo-game 2.0.5 → 2.0.7

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
@@ -20,6 +20,7 @@ export interface Config {
20
20
  enableCurfew: boolean;
21
21
  enablePlayRequirement: boolean;
22
22
  enableGuguBattle: boolean;
23
+ enableMatchesRequirement: boolean;
23
24
  }
24
25
  export declare const Config: Schema<Config>;
25
26
  export declare function apply(ctx: Context, config: Config): void;
package/lib/index.js CHANGED
@@ -7481,7 +7481,9 @@ var Config = import_koishi.Schema.intersect([
7481
7481
  rankseason: import_koishi.Schema.string().description("当前赛季名称(影响兑换系统)").default("S1"),
7482
7482
  autorank: import_koishi.Schema.boolean().description("自动同步天梯数据").default(false),
7483
7483
  ignoreGlobalLimit: import_koishi.Schema.boolean().description("禁用全局兑换限制(谨慎开启)").default(false),
7484
- pointBonusEnabled: import_koishi.Schema.boolean().description("是否开启积分加成功能").default(false)
7484
+ pointBonusEnabled: import_koishi.Schema.boolean().description("是否开启积分加成功能").default(false),
7485
+ enableMatchesRequirement: import_koishi.Schema.boolean().description("兑换物品是否需要场次需求").default(true)
7486
+ // 默认开启
7485
7487
  }).description("赛季配置"),
7486
7488
  // 对战系统配置组
7487
7489
  import_koishi.Schema.object({
@@ -8059,8 +8061,12 @@ function apply(ctx, config) {
8059
8061
  if (existingEntries.length > 0) {
8060
8062
  return `⛔ 您已被列入黑名单。`;
8061
8063
  }
8064
+ const [record] = await ctx.database.get("ggcevo_sign", { handle });
8065
+ if (!record) {
8066
+ return "📅 请先进行一次签到后再进行抽奖。";
8067
+ }
8062
8068
  const [backpack] = await ctx.database.get("ggcevo_backpack", { handle, itemId: 1 });
8063
- const quantity = backpack?.quantity;
8069
+ const quantity = backpack?.quantity || 0;
8064
8070
  if (quantity < 1) {
8065
8071
  return "您背包内的咕咕币不足。";
8066
8072
  }
@@ -8073,11 +8079,10 @@ function apply(ctx, config) {
8073
8079
  const result = await gachaWithPity(ctx, handle);
8074
8080
  if (result) winCount++;
8075
8081
  }
8076
- const [record] = await ctx.database.get("ggcevo_sign", { handle });
8077
8082
  return [
8078
8083
  `🎰 您使用了${quantity}枚咕咕币`,
8079
8084
  winCount > 0 ? `🎉 其中获得${winCount}张兑换券!` : "💔 本次未获得任何兑换券",
8080
- `📊 当前保底进度:${record.pityCounter}/90`
8085
+ `📊 当前保底进度:${record.pityCounter || 0}/90`
8081
8086
  ].join("\n");
8082
8087
  });
8083
8088
  ctx.command("ggcevo/单抽").action(async (argv) => {
@@ -8829,7 +8834,8 @@ ${ticketMessage}${effectMessage}`;
8829
8834
  `处罚原因: ${item.reason}`,
8830
8835
  `处罚次数: ${item.count}`,
8831
8836
  `审核人: ${item.reviewer}`,
8832
- `处罚时间: ${item.date.toLocaleString("zh-CN", { timeZone: "Asia/Shanghai" })}`
8837
+ // toLocaleString 改为 toLocaleDateString 只显示日期
8838
+ `处罚时间: ${item.date.toLocaleDateString("zh-CN", { timeZone: "Asia/Shanghai" })}`
8833
8839
  ];
8834
8840
  let finalText = baseInfo.join("\n");
8835
8841
  return finalText;
@@ -8937,16 +8943,18 @@ ${items.join("、")}
8937
8943
  if (!name2) return "已取消操作,请重新输入。";
8938
8944
  const configname = itemConfig[name2];
8939
8945
  if (!configname) return "无效的物品名称,请重新输入。";
8940
- const matchesRequirement = {
8941
- t3: 150,
8942
- t2: 200,
8943
- t1: 250,
8944
- t0: 350
8945
- };
8946
- const requiredMatches = matchesRequirement[configname.quality];
8947
- if (seasonMatches < requiredMatches) {
8948
- return `❌ 兑换【${name2}】需要在本赛季完成${requiredMatches}场游戏
8946
+ if (config.enableMatchesRequirement) {
8947
+ const matchesRequirement = {
8948
+ t3: 150,
8949
+ t2: 200,
8950
+ t1: 250,
8951
+ t0: 350
8952
+ };
8953
+ const requiredMatches = matchesRequirement[configname.quality];
8954
+ if (seasonMatches < requiredMatches) {
8955
+ return `❌ 兑换【${name2}】需要在本赛季完成${requiredMatches}场游戏
8949
8956
  您当前赛季场次: ${seasonMatches}场(还需${requiredMatches - seasonMatches}场)`;
8957
+ }
8950
8958
  }
8951
8959
  const userRecords = await ctx.database.get("ggcevo_exchange", { handle, item: name2 });
8952
8960
  if (userRecords.length > 0) return "您已经兑换过该物品。";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-ggcevo-game",
3
3
  "description": "星际争霸2咕咕虫-evolved地图的专属游戏助手插件,集成天梯排行、抽奖系统、签到福利、兑换商城等丰富功能。",
4
- "version": "2.0.5",
4
+ "version": "2.0.7",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -19,7 +19,7 @@
19
19
  "peerDependencies": {
20
20
  "@koishijs/plugin-proxy-agent": "^0.3.3",
21
21
  "koishi": "^4.18.7",
22
- "koishi-plugin-sc2arcade-search": "^1.2.3"
22
+ "koishi-plugin-sc2arcade-search": "^1.2.4"
23
23
  },
24
24
  "koishi": {
25
25
  "service": {