计算异妖战力问题

back_recharge
wangyuan 2019-05-30 12:58:11 +08:00
parent 5b977ec2ae
commit 56455fefbe
2 changed files with 20 additions and 10 deletions

View File

@ -1315,6 +1315,20 @@ public class HeroLogic {
public int calPokenmonForce(Pokemon pokemon){ public int calPokenmonForce(Pokemon pokemon){
Map<Integer,Integer> pokemonAttributeMap = new HashMap<>(); Map<Integer,Integer> pokemonAttributeMap = new HashMap<>();
combinePokemonAttribute(pokemonAttributeMap, pokemon);
return calForce(pokemonAttributeMap);
}
public int calAllPokenmonForce(User user){
Map<Integer,Integer> pokemonAttributeMap = new HashMap<>();
Map<Integer, Pokemon> pokemonMap = user.getPokemonManager().getPokemonMap();
for(Pokemon pokemon : pokemonMap.values()){
combinePokemonAttribute(pokemonAttributeMap, pokemon);
}
return calForce(pokemonAttributeMap);
}
private void combinePokemonAttribute(Map<Integer, Integer> pokemonAttributeMap, Pokemon pokemon) {
Map<Integer, Integer> comonpentsLevelMap = pokemon.getComonpentsLevelMap(); Map<Integer, Integer> comonpentsLevelMap = pokemon.getComonpentsLevelMap();
for (Map.Entry<Integer, Integer> comonpentsLevelItem : comonpentsLevelMap.entrySet()) { for (Map.Entry<Integer, Integer> comonpentsLevelItem : comonpentsLevelMap.entrySet()) {
Integer comonpentId = comonpentsLevelItem.getKey(); Integer comonpentId = comonpentsLevelItem.getKey();
@ -1329,7 +1343,6 @@ public class HeroLogic {
} }
} }
} }
return calForce(pokemonAttributeMap);
} }
public int calEquipForce(Equip equip){ public int calEquipForce(Equip equip){

View File

@ -120,10 +120,7 @@ public class MissionLoigc {
break; break;
case POKEMON_ALL_FORCE: case POKEMON_ALL_FORCE:
Map<Integer, Pokemon> pokemonMap = user.getPokemonManager().getPokemonMap(); count = HeroLogic.getInstance().calAllPokenmonForce(user);
for(Pokemon pokemon : pokemonMap.values()){
count = HeroLogic.getInstance().calPokenmonForce(pokemon);
}
break; break;
case ARENA_CHALLENEGE_NUMS: case ARENA_CHALLENEGE_NUMS:
count = cumulationData.getArenaFightNums(); count = cumulationData.getArenaFightNums();