招募:当没有某种武将时

This commit is contained in:
luying
2021-05-13 18:12:28 +08:00
parent f1844cb30b
commit f9eb48eb6f

View File

@@ -225,11 +225,18 @@ export function getAllHeroByQuality(quality: number) {
if(quality == 0) return [ GACHA_OCCUPY_HID ];
let allHero: number[] = [];
let allQuality: number[] = [];
for(let { actorId } of gameData.recruit) {
let dicHero = gameData.hero.get(actorId);
if(dicHero.quality == quality) {
allHero.push(actorId);
}
if(allQuality.indexOf(dicHero.quality) == -1) allQuality.push(dicHero.quality);
}
allQuality.sort((a, b) => a - b);
if(allQuality.length == 0) return [];
if(allHero.length == 0) {
allHero = getAllHeroByQuality(allQuality[0]);
}
return allHero;
}