gm hero full level

back_recharge
wangyuan 2019-11-19 11:15:30 +08:00
parent 567cecad79
commit 3679665bb6
3 changed files with 35 additions and 1 deletions

View File

@ -22,4 +22,6 @@ public interface GlobalGm {
int MISSION_LEAD = 18;//任务指引
int ESPECIAL_EQUIP = 19;//增加法宝,星级
int TREASURE_FINISH = 20;//戒灵秘宝一键完成
int FULL_OF = 21; //一键全满
}

View File

@ -299,6 +299,39 @@ public class GMRequestHandler extends BaseHandler{
cUser.getUserMissionManager().getTreasureMissionIdsType().addFinishMissionId(prarm2);
}
break;
case GlobalGm.FULL_OF:
Map<String, Hero> heroMap = cUser.getHeroManager().getHeroMap();
Set<String> cacheHeroIds = new HashSet<>();
Map<Integer, List<TeamPosHeroInfo>> teamPosForHero = cUser.getTeamPosManager().getTeamPosForHero();
for(List<TeamPosHeroInfo> teamPosHeroInfoList : teamPosForHero.values()){
for(TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfoList){
String heroIdTmp = teamPosHeroInfo.getHeroId();
if(cacheHeroIds.add(heroIdTmp)){
Hero heroTmp = cUser.getHeroManager().getHeroMap().get(heroIdTmp);
SCHero scHero = SCHero.getsCHero().get(heroTmp.getTemplateId());
Map<Integer, SCHeroRankUpConfig> scHeroRankUpConfigByType = STableManager.getFigureConfig(HeroStaticConfig.class).getScHeroRankUpConfigByShow(GlobalsDef.UP_STAR_TYPE,scHero.getStar());
int maxStar = 0;
for(Integer heroStarId : scHeroRankUpConfigByType.keySet()){
maxStar = heroStarId+1>maxStar?heroStarId+1:maxStar;
}
heroTmp.upStar(maxStar-heroTmp.getStar());
SCHeroRankUpConfig scHeroRankUpConfig = scHeroRankUpConfigByType.get(maxStar-1);
heroTmp.setLevel(cUser,scHeroRankUpConfig.getOpenLevel());
heroTmp.setStarBreakId(scHeroRankUpConfig.getId());
scHeroRankUpConfigByType = STableManager.getFigureConfig(HeroStaticConfig.class).getScHeroRankUpConfigByShow(GlobalsDef.BREAK_TYPE,scHero.getStar());
for(SCHeroRankUpConfig scHeroRankUpConfigBreak :scHeroRankUpConfigByType.values()){
if(heroTmp.getLevel()>scHeroRankUpConfigBreak.getLimitLevel()){
heroTmp.setBreakId(scHeroRankUpConfigBreak.getId());
}
}
gmBuilder.setDrop(CommonProto.Drop.newBuilder().addHero(CBean2Proto.getHero(heroTmp)).build());
}
}
}
break;
default:
}
try {

View File

@ -78,7 +78,6 @@ public class Hero extends MongoBase {
}
public void upStar(int upStar) throws Exception {
SCHero scHero = SCHero.getsCHero().get(templateId);
this.star += upStar;
updateString("star",star);
}