TASK【ID1008168】【大闹天宫】招募神将的等级,跟文档描述的不一样

back_recharge
zhangshanxue 2020-07-06 20:43:10 +08:00
parent 8253bdcc6a
commit 5043f26ac6
3 changed files with 55 additions and 18 deletions

View File

@ -86,7 +86,7 @@ public class ReliveExpeditionHeroRequest extends BaseHandler<Expedition.ReliveEx
//更新节点 //更新节点
Expedition.ExpeditionNodeInfoIndication.Builder builder = Expedition.ExpeditionNodeInfoIndication.newBuilder(); Expedition.ExpeditionNodeInfoIndication.Builder builder = Expedition.ExpeditionNodeInfoIndication.newBuilder();
builder.addAllHeroInfo(ExpeditionLogic.getInstance().getAllHeroInfo(user,ids)); builder.addAllHeroInfo(ExpeditionLogic.getInstance().getAllHeroInfo(user,new HashSet<>()));
MessageUtil.sendIndicationMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_NOINFO_INDICATION_VALUE, builder.build(), true); MessageUtil.sendIndicationMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_NOINFO_INDICATION_VALUE, builder.build(), true);
} else { } else {

View File

@ -60,12 +60,28 @@ public class Hero extends MongoBase {
this.id = KeyGenUtils.produceIdByModule(UUIDEnum.HERO, uid); this.id = KeyGenUtils.produceIdByModule(UUIDEnum.HERO, uid);
this.templateId = heroTid; this.templateId = heroTid;
this.level = initStar; this.level = initStar;
int[] heroStar = SItem.getsItemMap().get(heroTid).getHeroStar(); SCHero hero1 = SCHero.getsCHero().get(heroTid);
this.star =heroStar[1] ; int initCfgStar = hero1.getStar();
int maxStar = hero1.getMaxRank();
if(hero.getStar()<initCfgStar){
this.star =initCfgStar;
}else if(hero.getStar()>maxStar){
this.star=maxStar;
}else {
this.star = hero.getStar();
}
if(initCfgStar!=hero.getStar()){
Map<Integer, SCHeroRankUpConfig> scHeroRankUpConfigByType = STableManager.getFigureConfig(HeroStaticConfig.class).getScHeroRankUpConfigByShow(GlobalsDef.UP_STAR_TYPE,initCfgStar);
if(scHeroRankUpConfigByType!=null) {
SCHeroRankUpConfig scHeroRankUpConfig = scHeroRankUpConfigByType.get(hero.getStar()-1);
starBreakId = scHeroRankUpConfig.getId();
}
}
this.equipByPositionMap = new HashMap<>(); this.equipByPositionMap = new HashMap<>();
this.soulEquipByPositionMap = hero.soulEquipByPositionMap; this.soulEquipByPositionMap = hero.soulEquipByPositionMap;
this.breakId = hero.breakId; this.breakId = hero.breakId;
this.starBreakId = hero.starBreakId;
this.createTime = (int)(System.currentTimeMillis()/1000); this.createTime = (int)(System.currentTimeMillis()/1000);
this.speed = hero.speed; this.speed = hero.speed;
this.especialEquipLevel = hero.especialEquipLevel; this.especialEquipLevel = hero.especialEquipLevel;

View File

@ -919,9 +919,30 @@ public class ExpeditionLogic {
//random ids //random ids
TreeSet<Integer> tempid = new TreeSet<>(); TreeSet<Integer> tempid = new TreeSet<>();
Set<Integer> tempType = new HashSet<>();
int i=0;
while (tempid.size()<size){ while (tempid.size()<size){
if(i>1000){
LOGGER.error("getRandomTidException:条件不匹配");
break;
}
int i1 = ranndomFromWeight(cfg); int i1 = ranndomFromWeight(cfg);
SExpeditionRecruitConfig sExpeditionRecruitConfig = STableManager.getConfig(SExpeditionRecruitConfig.class).get(i1);
SCHero hero1 = SCHero.getsCHero().get(sExpeditionRecruitConfig.getHeroId());
i++;
if(hero1==null){
LOGGER.error("英雄配置不存在"+i1);
continue;
}
int propertyName = hero1.getPropertyName();
if(tempType.contains(propertyName)){
continue;
}
tempid.add(i1); tempid.add(i1);
tempType.add(propertyName);
i++;
} }
return tempid; return tempid;