计算异妖战力问题
parent
5b977ec2ae
commit
56455fefbe
|
@ -1315,21 +1315,34 @@ public class HeroLogic {
|
|||
|
||||
public int calPokenmonForce(Pokemon pokemon){
|
||||
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();
|
||||
for(Map.Entry<Integer, Integer> comonpentsLevelItem : comonpentsLevelMap.entrySet()){
|
||||
for (Map.Entry<Integer, Integer> comonpentsLevelItem : comonpentsLevelMap.entrySet()) {
|
||||
Integer comonpentId = comonpentsLevelItem.getKey();
|
||||
Integer comonpentLevel = comonpentsLevelItem.getValue();
|
||||
Map<Integer, SDifferDemonsComonpentsConfig> sDifferDemonsComonpentsConfigMap = SDifferDemonsComonpentsConfig.getsDifferDemonsComonpentsConfigMap(comonpentId);
|
||||
SDifferDemonsComonpentsConfig sDifferDemonsComonpentsConfig = sDifferDemonsComonpentsConfigMap.get(comonpentLevel);
|
||||
Map<Integer, Map<Integer, Integer>> extraAddMap = sDifferDemonsComonpentsConfig.getExtraAddMap();
|
||||
combinedAttribute(sDifferDemonsComonpentsConfig.getBaseAttribute(),pokemonAttributeMap);
|
||||
if(extraAddMap!=null){
|
||||
for(Map<Integer, Integer> item : extraAddMap.values()){
|
||||
combinedAttribute(item,pokemonAttributeMap);
|
||||
combinedAttribute(sDifferDemonsComonpentsConfig.getBaseAttribute(), pokemonAttributeMap);
|
||||
if (extraAddMap != null) {
|
||||
for (Map<Integer, Integer> item : extraAddMap.values()) {
|
||||
combinedAttribute(item, pokemonAttributeMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
return calForce(pokemonAttributeMap);
|
||||
}
|
||||
|
||||
public int calEquipForce(Equip equip){
|
||||
|
|
|
@ -120,10 +120,7 @@ public class MissionLoigc {
|
|||
|
||||
break;
|
||||
case POKEMON_ALL_FORCE:
|
||||
Map<Integer, Pokemon> pokemonMap = user.getPokemonManager().getPokemonMap();
|
||||
for(Pokemon pokemon : pokemonMap.values()){
|
||||
count = HeroLogic.getInstance().calPokenmonForce(pokemon);
|
||||
}
|
||||
count = HeroLogic.getInstance().calAllPokenmonForce(user);
|
||||
break;
|
||||
case ARENA_CHALLENEGE_NUMS:
|
||||
count = cumulationData.getArenaFightNums();
|
||||
|
|
Loading…
Reference in New Issue