|
|
|
@ -825,23 +825,31 @@ public class HeroLogic{
|
|
|
|
|
int templateId = hero.getTemplateId();
|
|
|
|
|
SCHero scHero = SCHero.getsCHero().get(templateId);
|
|
|
|
|
SHeroLevlConfig sHeroLevlConfig = SHeroLevlConfig.getsCHero().get(hero.getLevel());
|
|
|
|
|
float characterLevelPara = sHeroLevlConfig.getCharacterLevelPara();
|
|
|
|
|
Map<Integer, Float> paraForHero = getParaForHero(hero);
|
|
|
|
|
int[][] characterLevelPara = sHeroLevlConfig.getCharacterLevelPara();
|
|
|
|
|
Map<Integer, Object> paraForHero = getParaForHero(hero);
|
|
|
|
|
Map<Integer,Float> baseValueMap = new HashMap<>();
|
|
|
|
|
baseValueMap.put(GlobalsDef.HP_TYPE,getBaseValueByType(scHero,GlobalsDef.HP_TYPE));
|
|
|
|
|
baseValueMap.put(GlobalsDef.ATTACK_TYPE,getBaseValueByType(scHero,GlobalsDef.ATTACK_TYPE));
|
|
|
|
|
baseValueMap.put(GlobalsDef.PHYSICAL_DEFENCE_TYPE,getBaseValueByType(scHero,GlobalsDef.PHYSICAL_DEFENCE_TYPE));
|
|
|
|
|
baseValueMap.put(GlobalsDef.MAGIC_DEFENCE_TYPE,getBaseValueByType(scHero,GlobalsDef.MAGIC_DEFENCE_TYPE));
|
|
|
|
|
baseValueMap.put(GlobalsDef.SPEED_TYPE,getBaseValueByType(scHero,GlobalsDef.SPEED_TYPE));
|
|
|
|
|
for(Map.Entry<Integer,Float> item : baseValueMap.entrySet()){
|
|
|
|
|
Integer attributeType = item.getKey();
|
|
|
|
|
Float heroBaseValue = item.getValue();
|
|
|
|
|
if(attributeType == GlobalsDef.SPEED_TYPE){
|
|
|
|
|
result.put (attributeType,(int)(heroBaseValue * sHeroLevlConfig.getSpeedLevelPara() + STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().calSpeed(heroBaseValue, hero.getBreakId())));
|
|
|
|
|
}else{
|
|
|
|
|
result.put(attributeType,(int)(heroBaseValue * ( 1 + paraForHero.get(GlobalsDef.RANKUP_PARA_TYPE)/10000.f) * characterLevelPara + heroBaseValue * paraForHero.get(GlobalsDef.BREAK_PARA_TYPE)/10000.f));
|
|
|
|
|
int[] levelAttr = Arrays.stream(characterLevelPara).filter(param -> param[0] == attributeType).findFirst().get();
|
|
|
|
|
float value = heroBaseValue + levelAttr[1];
|
|
|
|
|
int[][] rankUpParam = (int[][]) paraForHero.get(GlobalsDef.RANKUP_PARA_TYPE);
|
|
|
|
|
if(rankUpParam!=null){
|
|
|
|
|
int[] rankAttr = Arrays.stream(rankUpParam).filter(param -> param[0] == attributeType).findFirst().get();
|
|
|
|
|
value = value *(rankAttr[2] == 0 ? 1 : (rankAttr[2] / 10000.f))+rankAttr[1];
|
|
|
|
|
}
|
|
|
|
|
int[][] breakParam = (int[][]) paraForHero.get(GlobalsDef.BREAK_PARA_TYPE);
|
|
|
|
|
if(breakParam!=null){
|
|
|
|
|
int[] breakAttr = Arrays.stream(breakParam).filter(param -> param[0] == attributeType).findFirst().get();
|
|
|
|
|
value += breakAttr[1];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result.put(attributeType,(int)value);
|
|
|
|
|
System.out.println(result);
|
|
|
|
|
}
|
|
|
|
|
if(!isForce){
|
|
|
|
|
Map<Integer, Integer> secondaryFactorMap = scHero.getSecondaryFactorMap();
|
|
|
|
@ -856,22 +864,30 @@ public class HeroLogic{
|
|
|
|
|
Map<Integer,Integer> result = new HashMap<>();
|
|
|
|
|
SCHero scHero = SCHero.getsCHero().get(templateId);
|
|
|
|
|
SHeroLevlConfig sHeroLevlConfig = SHeroLevlConfig.getsCHero().get(heroLevl);
|
|
|
|
|
float characterLevelPara = sHeroLevlConfig.getCharacterLevelPara();
|
|
|
|
|
Map<Integer, Float> paraForHero = getParaForRobotHero(scHero,heroLevl,templateId);
|
|
|
|
|
int[][] characterLevelPara = sHeroLevlConfig.getCharacterLevelPara();
|
|
|
|
|
Map<Integer, Object> paraForHero = getParaForRobotHero(scHero,heroLevl,templateId);
|
|
|
|
|
Map<Integer,Float> baseValueMap = new HashMap<>();
|
|
|
|
|
baseValueMap.put(GlobalsDef.HP_TYPE,getBaseValueByType(scHero,GlobalsDef.HP_TYPE));
|
|
|
|
|
baseValueMap.put(GlobalsDef.ATTACK_TYPE,getBaseValueByType(scHero,GlobalsDef.ATTACK_TYPE));
|
|
|
|
|
baseValueMap.put(GlobalsDef.PHYSICAL_DEFENCE_TYPE,getBaseValueByType(scHero,GlobalsDef.PHYSICAL_DEFENCE_TYPE));
|
|
|
|
|
baseValueMap.put(GlobalsDef.MAGIC_DEFENCE_TYPE,getBaseValueByType(scHero,GlobalsDef.MAGIC_DEFENCE_TYPE));
|
|
|
|
|
baseValueMap.put(GlobalsDef.SPEED_TYPE,getBaseValueByType(scHero,GlobalsDef.SPEED_TYPE));
|
|
|
|
|
for(Map.Entry<Integer,Float> item : baseValueMap.entrySet()){
|
|
|
|
|
Integer attributeType = item.getKey();
|
|
|
|
|
Float heroBaseValue = item.getValue();
|
|
|
|
|
if(attributeType == GlobalsDef.SPEED_TYPE){
|
|
|
|
|
result.put (attributeType,(int)(heroBaseValue * sHeroLevlConfig.getSpeedLevelPara() + STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().calSpeed(heroBaseValue, heroBreakId)));
|
|
|
|
|
}else{
|
|
|
|
|
result.put(attributeType,(int)(heroBaseValue * ( 1 + paraForHero.get(GlobalsDef.RANKUP_PARA_TYPE)/10000.f) * characterLevelPara + heroBaseValue * paraForHero.get(GlobalsDef.BREAK_PARA_TYPE)/10000.f));
|
|
|
|
|
int[] levelAttr = Arrays.stream(characterLevelPara).filter(param -> param[0] == attributeType).findFirst().get();
|
|
|
|
|
float value = heroBaseValue + levelAttr[1];
|
|
|
|
|
int[][] rankUpParam = (int[][]) paraForHero.get(GlobalsDef.RANKUP_PARA_TYPE);
|
|
|
|
|
if(rankUpParam!=null){
|
|
|
|
|
int[] rankAttr = Arrays.stream(rankUpParam).filter(param -> param[0] == attributeType).findFirst().get();
|
|
|
|
|
value *= rankAttr[1] == 0 ? 1 : rankAttr[1] / 10000.f+rankAttr[2];
|
|
|
|
|
}
|
|
|
|
|
int[][] breakParam = (int[][]) paraForHero.get(GlobalsDef.BREAK_PARA_TYPE);
|
|
|
|
|
if(breakParam!=null){
|
|
|
|
|
int[] breakAttr = Arrays.stream(breakParam).filter(param -> param[0] == attributeType).findFirst().get();
|
|
|
|
|
value += breakAttr[1];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result.put(attributeType,(int)value);
|
|
|
|
|
}
|
|
|
|
|
if(!isForce){
|
|
|
|
|
Map<Integer, Integer> secondaryFactorMap = scHero.getSecondaryFactorMap();
|
|
|
|
@ -900,11 +916,12 @@ public class HeroLogic{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Map<Integer,Float> getParaRate(SCHero scHero,int heroStar,int heroLevel,int heroBreakId){
|
|
|
|
|
Map<Integer,Float> result = new HashMap<>(2);
|
|
|
|
|
float rankupPara =0.0f;
|
|
|
|
|
private Map<Integer,Object> getParaRate(SCHero scHero,int heroStar,int heroLevel,int heroBreakId){
|
|
|
|
|
System.out.println(scHero.getId());
|
|
|
|
|
Map<Integer,Object> result = new HashMap<>(2);
|
|
|
|
|
Object rankupPara=null;
|
|
|
|
|
//突破系数
|
|
|
|
|
float breakPara = 0.0f;
|
|
|
|
|
Object breakPara=null;
|
|
|
|
|
Map<Integer, SCHeroRankUpConfig> scHeroRankUpConfigByTypeOfStar = STableManager.getFigureConfig(HeroStaticConfig.class).getScHeroRankUpConfigByType(GlobalsDef.UP_STAR_TYPE,scHero.getStar());
|
|
|
|
|
if(scHeroRankUpConfigByTypeOfStar!= null){
|
|
|
|
|
SCHeroRankUpConfig scHeroRankUpConfig = scHeroRankUpConfigByTypeOfStar.get(heroStar-1);
|
|
|
|
@ -920,7 +937,8 @@ public class HeroLogic{
|
|
|
|
|
|
|
|
|
|
Map<Integer, SCHeroRankUpConfig> scHeroRankUpConfigByTypOfBreak = STableManager.getFigureConfig(HeroStaticConfig.class).getScHeroRankUpConfigByType(GlobalsDef.BREAK_TYPE,scHero.getStar());
|
|
|
|
|
for( SCHeroRankUpConfig scHeroRankUpConfigTmp :scHeroRankUpConfigByTypOfBreak.values()){
|
|
|
|
|
if( heroLevel >= scHeroRankUpConfigTmp.getLimitLevel() && heroBreakId>= scHeroRankUpConfigTmp.getId() && breakPara< scHeroRankUpConfigTmp.getRankupPara()){
|
|
|
|
|
// && breakPara< scHeroRankUpConfigTmp.getRankupPara()
|
|
|
|
|
if( heroLevel >= scHeroRankUpConfigTmp.getLimitLevel() && heroBreakId>= scHeroRankUpConfigTmp.getId() ){
|
|
|
|
|
breakPara = scHeroRankUpConfigTmp.getRankupPara();
|
|
|
|
|
}
|
|
|
|
|
if(heroLevel < scHeroRankUpConfigTmp.getOpenLevel()){
|
|
|
|
@ -932,13 +950,13 @@ public class HeroLogic{
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Map<Integer,Float> getParaForHero(Hero hero){
|
|
|
|
|
private Map<Integer,Object> getParaForHero(Hero hero){
|
|
|
|
|
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
|
|
|
|
|
return getParaRate(scHero, hero.getStar(), hero.getLevel(), hero.getBreakId());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//todo
|
|
|
|
|
private Map<Integer,Float> getParaForRobotHero(SCHero scHero,int level,int breakId){
|
|
|
|
|
private Map<Integer,Object> getParaForRobotHero(SCHero scHero,int level,int breakId){
|
|
|
|
|
return getParaRate(scHero, scHero.getStar(),level, breakId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|