diff --git a/Assets/ManagedResources/~Lua/Modules/Pokemon/PokemonManager.lua b/Assets/ManagedResources/~Lua/Modules/Pokemon/PokemonManager.lua index 132a97788a..521f100c22 100644 --- a/Assets/ManagedResources/~Lua/Modules/Pokemon/PokemonManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Pokemon/PokemonManager.lua @@ -59,7 +59,32 @@ function this.GetSinglePokemonData(_did) end --获取所有灵兽数据 function this.GetPokemonDatas() - return pokemons + local list = {} + for k,v in pairs(pokemons) do + table.insert(list, v) + end + -- 排序 + local AllPokemonFormationDids = PokemonManager.GetAllPokemonFormationDids() + table.sort(list, function(a,b) + if AllPokemonFormationDids[a.dynamicId] and AllPokemonFormationDids[b.dynamicId] or not AllPokemonFormationDids[a.dynamicId] and not AllPokemonFormationDids[b.dynamicId] then + if spiritAnimal[a.id].Quality == spiritAnimal[b.id].Quality then + if a.star == b.star then + if a.lv == b.lv then + return a.id < b.id + else + return a.lv > b.lv + end + else + return a.star > b.star + end + else + return spiritAnimal[a.id].Quality > spiritAnimal[b.id].Quality + end + else + return AllPokemonFormationDids[a.dynamicId] and not AllPokemonFormationDids[b.dynamicId] + end + end) + return list end --获取所有灵兽数据 function this.GetPokemonResolveDatas()