计算战力方法,部分注释旧逻辑删除,需要可回滚
parent
77c25705f9
commit
9457e48c5c
|
@ -1676,6 +1676,15 @@ public class HeroLogic{
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算队伍战力
|
||||
* @param user
|
||||
* @param hero
|
||||
* @param isForce
|
||||
* @param teamId
|
||||
* @return
|
||||
*/
|
||||
public Map<Integer,Long> calHeroNotBufferAttribute(User user, Hero hero,boolean isForce,int teamId){
|
||||
Map<Integer, Long> heroAllAttribute = calHeroAllAttribute(user, hero,isForce);
|
||||
heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(),heroAllAttribute.get(GlobalsDef.HP_TYPE));
|
||||
|
@ -1690,7 +1699,8 @@ public class HeroLogic{
|
|||
if(teamId!=0){
|
||||
int heroNum = user.getTeamPosManager().getTeamPosForHero().get(teamId).size();
|
||||
if(teamId==GlobalsDef.TRIAL_TEAM){
|
||||
heroNum = 5;//森罗环境固定为5
|
||||
//森罗环境固定为5
|
||||
heroNum = 5;
|
||||
}
|
||||
int[][] pokemonAttr = calPokemonAttribute(pokemonManager);
|
||||
for(int i = 0 ; i <pokemonAttr.length;i++){
|
||||
|
@ -1739,11 +1749,10 @@ public class HeroLogic{
|
|||
}
|
||||
combinedAttribute(SPlayerHeadIcon.getHeadIconMap().get(entry.getKey()).getUnlockProperty(),heroAllAttribute);
|
||||
}
|
||||
|
||||
//装备总战力评分
|
||||
int equipForce=0;
|
||||
boolean needRemove = false;
|
||||
Iterator<Map.Entry<Integer, Integer>> iterator = hero.getEquipByHongmengPositionMap(user.getHeroManager()).entrySet().iterator();
|
||||
// Map<Integer,Integer> suiteNumByIdMap = new HashMap<>();
|
||||
// 套装list初始化
|
||||
ArrayList<SEquipConfig> suiteNumList = new ArrayList<>();
|
||||
while (iterator.hasNext()){
|
||||
|
@ -1756,7 +1765,6 @@ public class HeroLogic{
|
|||
}
|
||||
combinedAttribute(propertyValueByIdMap,heroAllAttribute);
|
||||
equipForce+=sEquipConfig.getScore();
|
||||
// suiteNumByIdMap.put(sEquipConfig.getId(),suiteNumByIdMap.getOrDefault(sEquipConfig.getSuiteID(),0)+1);
|
||||
// 添加到套装list
|
||||
suiteNumList.add(sEquipConfig);
|
||||
}
|
||||
|
@ -1783,39 +1791,6 @@ public class HeroLogic{
|
|||
num-=1;
|
||||
}
|
||||
}
|
||||
// if(!suiteNumByIdMap.isEmpty()){
|
||||
// suiteNumByIdMap.forEach((suiteId,suiteNums)->{
|
||||
// SEquipSuiteConfig sEquipSuiteConfig =SEquipSuiteConfig.config.get(suiteId);
|
||||
// if( null!=sEquipSuiteConfig){
|
||||
// Map<Integer, Integer> suitePropertyMap = sEquipSuiteConfig.getSuiteMap().get(suiteNums);
|
||||
// if(suitePropertyMap!=null){
|
||||
// combinedAttribute(suitePropertyMap,heroAllAttribute);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
if(needRemove){
|
||||
AyyncWorker ayyncWorker = new AyyncWorker(user,true,user1 -> {
|
||||
Map<String, Hero> heroMap = user1.getHeroManager().getHeroMap();
|
||||
for(Hero heroTmp : heroMap.values()){
|
||||
Iterator<Map.Entry<Integer, Integer>> iterator1 = heroTmp.getEquipByHongmengPositionMap(user.getHeroManager()).entrySet().iterator();
|
||||
boolean isUpate = false;
|
||||
while (iterator1.hasNext()){
|
||||
Map.Entry<Integer, Integer> next = iterator1.next();
|
||||
Integer equipId = next.getValue();
|
||||
PropertyItem equip = equipMap.get(equipId);
|
||||
if(equip == null){
|
||||
iterator1.remove();
|
||||
isUpate = true;
|
||||
}
|
||||
}
|
||||
if(isUpate){
|
||||
heroTmp.setEquipByPositionMap(heroTmp.getEquipByHongmengPositionMap(user.getHeroManager()));
|
||||
}
|
||||
}
|
||||
});
|
||||
ProtocolsManager.getInstance().updateAyncWorker(ayyncWorker);
|
||||
}
|
||||
|
||||
//工坊科技树加成
|
||||
Map<Integer, Integer> techProfressionMap = user.getWorkShopController().getTechnologyMap().get(scHero.getProfession());
|
||||
|
@ -1897,13 +1872,9 @@ public class HeroLogic{
|
|||
}
|
||||
}
|
||||
if(levelProperty!=0){
|
||||
// System.out.println("宝器强化共鸣"+"......"+propertyToString(config.get(levelProperty).getProperty()));
|
||||
|
||||
combinedAttribute(config.get(levelProperty).getProperty(),heroAllAttribute);
|
||||
}
|
||||
if(buildLevelProperty!=0){
|
||||
// System.out.println("宝器精炼共鸣"+"......"+propertyToString(config.get(buildLevelProperty).getProperty()));
|
||||
|
||||
combinedAttribute(config.get(buildLevelProperty).getProperty(),heroAllAttribute);
|
||||
}
|
||||
}
|
||||
|
@ -1917,8 +1888,7 @@ public class HeroLogic{
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
// //皮肤、称号加成
|
||||
// //皮肤、称号加成 -- 前端未实现,暂时注释
|
||||
// int decoration = user.getPlayerInfoManager().getDecoration();
|
||||
// int designation = user.getPlayerInfoManager().getDesignation();
|
||||
// if(decoration!=0&&SPlayerAppearance.sPlayerAppearanceMap.get(decoration)!=null){
|
||||
|
@ -1927,12 +1897,13 @@ public class HeroLogic{
|
|||
// combinedAttribute(SPlayerAppearance.sPlayerAppearanceMap.get(designation).getProperty(),heroAllAttribute);
|
||||
// }
|
||||
//
|
||||
// //坐骑加成
|
||||
// //坐骑加成 -- 前端未实现,暂时注释
|
||||
// if(user.getPlayerInfoManager().getRide()!=0){
|
||||
// int rideLevel = user.getPlayerInfoManager().getRideLevel();
|
||||
// int[][] property = SPlayerMountLevelUp.sPlayerMountLevelUpMap.get(rideLevel).getProperty();
|
||||
// combinedAttribute(property,heroAllAttribute);
|
||||
// }
|
||||
|
||||
//公会技能加成
|
||||
Map<Integer, Integer> guildSkill = user.getGuildMyInfo().getGuildSkill();
|
||||
if(guildSkill.containsKey(scHero.getProfession())){
|
||||
|
@ -1952,9 +1923,7 @@ public class HeroLogic{
|
|||
combinedAttribute(arraySkills,heroAllAttribute);
|
||||
}
|
||||
|
||||
|
||||
//阵营光环加成
|
||||
|
||||
if(teamId!=0){
|
||||
try {
|
||||
int[][] elementEffect = CombatLogic.getInstance().elementEffect(user,teamId);
|
||||
|
@ -1991,8 +1960,6 @@ public class HeroLogic{
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
if(!heroSkillAdMap.isEmpty()){
|
||||
combinedAttribute(heroSkillAdMap,heroAllAttribute);
|
||||
heroSkillAdMap.clear();
|
||||
|
@ -2046,14 +2013,6 @@ public class HeroLogic{
|
|||
return heroAllAttribute;
|
||||
}
|
||||
|
||||
private String propertyToString(int[][] property){
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for(int[] pro:property){
|
||||
builder.append(pro[0]).append("#").append(pro[1]).append("\n");
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算机器人英雄熟悉
|
||||
* @param scHero
|
||||
|
|
Loading…
Reference in New Issue