koishi-plugin-ggcevo-game 1.3.49 → 1.3.51

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 +3 -1
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -4581,7 +4581,9 @@ ${items.join("、")}
4581
4581
  const powerDiff = initiatorPower - targetPower;
4582
4582
  let winRate = 50 + powerDiff / 50 * 0.1;
4583
4583
  winRate = Math.min(Math.max(winRate, 5), 95);
4584
- const isWin = Math.random() * 100 < winRate;
4584
+ const randInt = Math.floor(Math.random() * 1e4);
4585
+ const winRateInt = Math.floor(winRate * 100);
4586
+ const isWin = randInt < winRateInt;
4585
4587
  let stealPercentage = getRandomInt(1, 5);
4586
4588
  let goldTransfer = Math.floor(
4587
4589
  (isWin ? targetGold : initiatorGold) * stealPercentage / 100
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.3.49",
4
+ "version": "1.3.51",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [