计算异妖战力问题

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,21 +1315,34 @@ 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();
Integer comonpentLevel = comonpentsLevelItem.getValue(); Integer comonpentLevel = comonpentsLevelItem.getValue();
Map<Integer, SDifferDemonsComonpentsConfig> sDifferDemonsComonpentsConfigMap = SDifferDemonsComonpentsConfig.getsDifferDemonsComonpentsConfigMap(comonpentId); Map<Integer, SDifferDemonsComonpentsConfig> sDifferDemonsComonpentsConfigMap = SDifferDemonsComonpentsConfig.getsDifferDemonsComonpentsConfigMap(comonpentId);
SDifferDemonsComonpentsConfig sDifferDemonsComonpentsConfig = sDifferDemonsComonpentsConfigMap.get(comonpentLevel); SDifferDemonsComonpentsConfig sDifferDemonsComonpentsConfig = sDifferDemonsComonpentsConfigMap.get(comonpentLevel);
Map<Integer, Map<Integer, Integer>> extraAddMap = sDifferDemonsComonpentsConfig.getExtraAddMap(); Map<Integer, Map<Integer, Integer>> extraAddMap = sDifferDemonsComonpentsConfig.getExtraAddMap();
combinedAttribute(sDifferDemonsComonpentsConfig.getBaseAttribute(),pokemonAttributeMap); combinedAttribute(sDifferDemonsComonpentsConfig.getBaseAttribute(), pokemonAttributeMap);
if(extraAddMap!=null){ if (extraAddMap != null) {
for(Map<Integer, Integer> item : extraAddMap.values()){ for (Map<Integer, Integer> item : extraAddMap.values()) {
combinedAttribute(item,pokemonAttributeMap); combinedAttribute(item, pokemonAttributeMap);
} }
} }
} }
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();