koishi-plugin-ggcevo-game 1.0.11 → 1.0.13

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 +18 -11
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -452,19 +452,19 @@ ${itemDetails.join("\n")}`;
452
452
  }
453
453
  }
454
454
  let tickets = 3;
455
- let points = 10;
455
+ let points = getRandomInt(10, 20);
456
456
  if (monthlyDays === 7) {
457
457
  tickets = 4;
458
- points = 20;
458
+ points = getRandomInt(20, 30);
459
459
  } else if (monthlyDays === 14) {
460
460
  tickets = 5;
461
- points = 30;
461
+ points = getRandomInt(30, 50);
462
462
  } else if (monthlyDays === 21) {
463
463
  tickets = 6;
464
- points = 40;
464
+ points = getRandomInt(50, 70);
465
465
  } else if (monthlyDays === 28) {
466
466
  tickets = 7;
467
- points = 50;
467
+ points = getRandomInt(70, 100);
468
468
  }
469
469
  await ctx.database.upsert("ggcevo_sign", [{
470
470
  handle,
@@ -509,23 +509,23 @@ ${itemDetails.join("\n")}`;
509
509
  return `补签需要消耗 ${costPoints} 金币,当前金币不足。`;
510
510
  }
511
511
  const newMonthlyDays = record.monthlyDays + 1;
512
- let tickets = 3, points = 10;
512
+ let tickets = 3, points = 0;
513
513
  switch (newMonthlyDays) {
514
514
  case 7:
515
515
  tickets = 4;
516
- points = 10;
516
+ points = 0;
517
517
  break;
518
518
  case 14:
519
519
  tickets = 5;
520
- points = 10;
520
+ points = 0;
521
521
  break;
522
522
  case 21:
523
523
  tickets = 6;
524
- points = 10;
524
+ points = 0;
525
525
  break;
526
526
  case 28:
527
527
  tickets = 7;
528
- points = 10;
528
+ points = 0;
529
529
  break;
530
530
  }
531
531
  await ctx.database.set("ggcevo_sign", { handle }, {
@@ -542,7 +542,8 @@ ${itemDetails.join("\n")}`;
542
542
  month: "2-digit",
543
543
  day: "2-digit"
544
544
  });
545
- return `补签成功!本月累计签到 ${newMonthlyDays} 天,消耗 ${costPoints} 金币,获得 ${points} 金币和 ${tickets} 枚咕咕币`;
545
+ const rewardsMessage = points > 0 ? `获得 ${points} 金币和 ${tickets} 枚咕咕币` : `获得 ${tickets} 枚咕咕币`;
546
+ return `补签成功!本月累计签到 ${newMonthlyDays} 天,消耗 ${costPoints} 金币,${rewardsMessage}`;
546
547
  } catch (error) {
547
548
  console.error("补签错误:", error);
548
549
  return "补签失败,请稍后重试。";
@@ -1433,6 +1434,12 @@ function HiddenAward() {
1433
1434
  return Math.floor(Math.random() * 1e4) < 1;
1434
1435
  }
1435
1436
  __name(HiddenAward, "HiddenAward");
1437
+ function getRandomInt(min, max) {
1438
+ const actualMin = Math.min(min, max);
1439
+ const actualMax = Math.max(min, max);
1440
+ return Math.floor(Math.random() * (actualMax - actualMin + 1)) + actualMin;
1441
+ }
1442
+ __name(getRandomInt, "getRandomInt");
1436
1443
  function PetCapsuleToy() {
1437
1444
  const num = Math.floor(Math.random() * 1e4);
1438
1445
  if (num < 4e3) return "t3级宠物扭蛋";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-ggcevo-game",
3
3
  "description": "星际争霸2游戏大厅咕咕虫-Evo地图专属插件",
4
- "version": "1.0.11",
4
+ "version": "1.0.13",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [