英雄图鉴bug修改
parent
9e22fed4ad
commit
2f675017fa
|
@ -2,7 +2,7 @@ package com.ljsd.jieling.core;
|
|||
|
||||
public interface GlobalsDef {
|
||||
String DEFAULT_NAME = "无名妖灵师";
|
||||
int VERSION_CODE=1;//后端兼容版本号
|
||||
int VERSION_CODE=2;//后端兼容版本号
|
||||
int MAP_MISSION_RETURN = -9999;
|
||||
int MAP_MISSION_FAILURE = -10000;
|
||||
|
||||
|
|
|
@ -152,6 +152,7 @@ public class GMRequestHandler extends BaseHandler{
|
|||
Hero hero = cUser.getHeroManager().getHeroMap().get(heroId);
|
||||
if(prarm2-hero.getStar()>0){
|
||||
hero.upStar(prarm2-hero.getStar());
|
||||
cUser.getHeroManager().addHeroHandBook(hero.getTemplateId(),hero.getStar());
|
||||
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
|
||||
Map<Integer, SCHeroRankUpConfig> scHeroRankUpConfigByType = STableManager.getFigureConfig(HeroStaticConfig.class).getScHeroRankUpConfigByShow(GlobalsDef.UP_STAR_TYPE,scHero.getStar());
|
||||
Map<Integer, SCHeroRankUpConfig> scHeroRankUpConfigByTypeTree = new TreeMap<>(scHeroRankUpConfigByType);
|
||||
|
@ -365,6 +366,7 @@ public class GMRequestHandler extends BaseHandler{
|
|||
maxStar = heroStarId+1>maxStar?heroStarId+1:maxStar;
|
||||
}
|
||||
heroTmp.upStar(maxStar-heroTmp.getStar());
|
||||
cUser.getHeroManager().addHeroHandBook(heroTmp.getTemplateId(),heroTmp.getStar());
|
||||
SCHeroRankUpConfig scHeroRankUpConfig = scHeroRankUpConfigByType.get(maxStar-1);
|
||||
cUser.getUserMissionManager().onGameEvent(cUser, GameEvent.HERO_LEVEL_UP,heroTmp.getOriginalLevel(),scHeroRankUpConfig.getOpenLevel());
|
||||
heroTmp.setLevel(scHeroRankUpConfig.getOpenLevel());
|
||||
|
|
|
@ -160,8 +160,13 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
});
|
||||
}
|
||||
|
||||
if (playerInfoManager.getVersionCode()!= GlobalsDef.VERSION_CODE) {
|
||||
if (playerInfoManager.getVersionCode()< GlobalsDef.VERSION_CODE) {
|
||||
if (playerInfoManager.getVersionCode()<1){
|
||||
calPractiveSkillData(user);
|
||||
}
|
||||
if (playerInfoManager.getVersionCode()<2){
|
||||
calHeroHandBookData(user);
|
||||
}
|
||||
playerInfoManager.setVersionCode(GlobalsDef.VERSION_CODE);
|
||||
}
|
||||
// 处理玩家旧头像框,兼容,一个玩家只执行一次
|
||||
|
@ -352,6 +357,9 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
}
|
||||
//修行技能数据兼容
|
||||
private void calPractiveSkillData(User user) {
|
||||
if (!user.getHeroManager().getPracticeSkillMap().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Map<Integer, SXiuXian> xiuxianConfigMap = STableManager.getConfig(SXiuXian.class);
|
||||
for (int i = 1; i <= user.getHeroManager().getPracticeLevel(); i++) {
|
||||
SXiuXian xiuxianConfig = xiuxianConfigMap.get(i);
|
||||
|
@ -361,5 +369,11 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
}
|
||||
}
|
||||
}
|
||||
///英雄图鉴数据兼容
|
||||
private void calHeroHandBookData(User user){
|
||||
for (Map.Entry<String, Hero> heroEntry : user.getHeroManager().getHeroMap().entrySet()) {
|
||||
user.getHeroManager().addHeroHandBook(heroEntry.getValue().getTemplateId(),heroEntry.getValue().getStar());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ public class Cmd_addhero extends GmRoleAbstract{
|
|||
}else {
|
||||
hero.upStar(prarm2-hero.getStar());
|
||||
}
|
||||
|
||||
getUser().getHeroManager().addHeroHandBook(hero.getTemplateId(),hero.getStar());
|
||||
Map<Integer, SCHeroRankUpConfig> scHeroRankUpConfigByType = STableManager.getFigureConfig(HeroStaticConfig.class).getScHeroRankUpConfigByShow(GlobalsDef.UP_STAR_TYPE,scHero.getStar());
|
||||
Map<Integer, SCHeroRankUpConfig> scHeroRankUpConfigByTypeTree = new TreeMap<>(scHeroRankUpConfigByType);
|
||||
SCHeroRankUpConfig scHeroRankUpConfig = ((TreeMap<Integer, SCHeroRankUpConfig>) scHeroRankUpConfigByTypeTree).lowerEntry(hero.getStar()).getValue();
|
||||
|
|
|
@ -293,7 +293,7 @@ public class HeroManager extends MongoBase {
|
|||
}
|
||||
|
||||
public void addHeroHandBook(int heroId,int star){
|
||||
if(heroHandBook.containsKey(heroId)){
|
||||
if(heroHandBook.containsKey(heroId)&&heroHandBook.get(heroId)>=star){
|
||||
return;
|
||||
}
|
||||
heroHandBook.put(heroId,Math.max(heroHandBook.getOrDefault(heroId,0),star));
|
||||
|
|
|
@ -1549,7 +1549,7 @@ public class HeroLogic {
|
|||
// 消耗道具
|
||||
ItemUtil.itemCost(user, removeItemMap, BIReason.COMPLEX_EQUIP_CONSUME, 0);
|
||||
|
||||
rankUpHeroExecute(targetHero);
|
||||
rankUpHeroExecute(user,targetHero);
|
||||
user.getHeroManager().addHeroStar(targetHero.getTemplateId(), targetHero.getStar());
|
||||
Poster.getPoster().dispatchEvent(new HeroUpStarEvent(user.getId(), targetHero.getTemplateId(), targetHero.getStar()));
|
||||
Poster.getPoster().dispatchEvent(new NewWelfareEvent(user, NewWelfareTypeEnum.UPSTAR.getType(), targetHero.getTemplateId()));
|
||||
|
@ -1609,7 +1609,7 @@ public class HeroLogic {
|
|||
}
|
||||
|
||||
|
||||
private void rankUpHeroExecute(Hero hero) throws Exception {
|
||||
private void rankUpHeroExecute(User user,Hero hero) throws Exception {
|
||||
//是否解锁法宝
|
||||
SGameSetting gameSetting = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting();
|
||||
int[][] equipTalismanaUnlock = gameSetting.getEquipTalismanaUnlock();
|
||||
|
@ -1621,8 +1621,8 @@ public class HeroLogic {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
hero.upStar(1);
|
||||
user.getHeroManager().addHeroHandBook(hero.getTemplateId(),hero.getStar());
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue