Revert "回滚公用方法"

This reverts commit 89af066d12.
This commit is contained in:
dy 2023-12-29 01:19:47 +08:00
parent 2af3bf426b
commit 7676fc3142
2 changed files with 2 additions and 2 deletions

View File

@ -240,7 +240,7 @@ export function ctor() {
} }
Array.prototype.random = function (this: Array<any>) { Array.prototype.random = function (this: Array<any>) {
return this[PublicShared.randomNum(0, this.length)]; return this[PublicShared.randomNum(0, this.length - 1)];
}; };
Array.prototype.intersection = function (this: Array<any>, other: Array<any>) { Array.prototype.intersection = function (this: Array<any>, other: Array<any>) {

View File

@ -116,7 +116,7 @@ export class PublicShared {
* *
*/ */
static randomNum(min: number, max: number) { static randomNum(min: number, max: number) {
return Math.floor(Math.random() * (max - min) + min); return Math.floor(Math.random() * (max - min + 1) + min);
} }
/**获取道具配置 */ /**获取道具配置 */
static getAtnConf(atn: prizeType) { static getAtnConf(atn: prizeType) {