神像强化十次

This commit is contained in:
mamengke01
2020-12-26 12:14:56 +08:00
parent bfa0755739
commit 667c85e686
4 changed files with 97 additions and 23 deletions

View File

@@ -527,4 +527,23 @@ export function returnHeroCeRatio(hero: HeroType) {
// 缩小战力
export function reduceCe(ce: number = 0) {
return Math.floor(ce / HERO_CE_RATIO / HERO_CE_RATIO)
}
export function getRandNum(min, max) {
let randNum = min + Math.floor(Math.random()*(max - min + 1));
return randNum;
}
export function getRandomArr(allarr, ranNum) {
let arr = deepCopy(allarr);
var result = [];
if (arr.length <= ranNum) {
result = result.concat(arr);
return result;
}
for (var i = 0; i < ranNum; i++) {
var ran = Math.floor(Math.random() * arr.length);
result.push(arr.splice(ran, 1)[0]);
};
return result;
}