招募:当没有某种武将时
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user