TASK【ID1008168】【大闹天宫】招募神将的等级,跟文档描述的不一样
parent
8253bdcc6a
commit
5043f26ac6
|
@ -86,7 +86,7 @@ public class ReliveExpeditionHeroRequest extends BaseHandler<Expedition.ReliveEx
|
|||
|
||||
//更新节点
|
||||
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);
|
||||
|
||||
} else {
|
||||
|
|
|
@ -60,12 +60,28 @@ public class Hero extends MongoBase {
|
|||
this.id = KeyGenUtils.produceIdByModule(UUIDEnum.HERO, uid);
|
||||
this.templateId = heroTid;
|
||||
this.level = initStar;
|
||||
int[] heroStar = SItem.getsItemMap().get(heroTid).getHeroStar();
|
||||
this.star =heroStar[1] ;
|
||||
SCHero hero1 = SCHero.getsCHero().get(heroTid);
|
||||
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.soulEquipByPositionMap = hero.soulEquipByPositionMap;
|
||||
this.breakId = hero.breakId;
|
||||
this.starBreakId = hero.starBreakId;
|
||||
this.createTime = (int)(System.currentTimeMillis()/1000);
|
||||
this.speed = hero.speed;
|
||||
this.especialEquipLevel = hero.especialEquipLevel;
|
||||
|
@ -85,10 +101,10 @@ public class Hero extends MongoBase {
|
|||
this.especialEquipLevel = 1;
|
||||
if(initStar!=scHero.getStar()){
|
||||
Map<Integer, SCHeroRankUpConfig> scHeroRankUpConfigByType = STableManager.getFigureConfig(HeroStaticConfig.class).getScHeroRankUpConfigByShow(GlobalsDef.UP_STAR_TYPE,scHero.getStar());
|
||||
if(scHeroRankUpConfigByType!=null) {
|
||||
SCHeroRankUpConfig scHeroRankUpConfig = scHeroRankUpConfigByType.get(initStar-1);
|
||||
starBreakId = scHeroRankUpConfig.getId();
|
||||
}
|
||||
if(scHeroRankUpConfigByType!=null) {
|
||||
SCHeroRankUpConfig scHeroRankUpConfig = scHeroRankUpConfigByType.get(initStar-1);
|
||||
starBreakId = scHeroRankUpConfig.getId();
|
||||
}
|
||||
}
|
||||
|
||||
createTime = (int)(System.currentTimeMillis()/1000);
|
||||
|
|
|
@ -480,10 +480,10 @@ public class ExpeditionLogic {
|
|||
}
|
||||
int ints = staffsSet.size()+1;//默认品质
|
||||
try {
|
||||
ints = MathUtils.randomFromWeight(cfg.getHolyProbability());
|
||||
ints = MathUtils.randomFromWeight(cfg.getHolyProbability());
|
||||
}catch (Exception e){
|
||||
break;
|
||||
// e.printStackTrace();
|
||||
// e.printStackTrace();
|
||||
}
|
||||
Map<Integer, Integer> type2holy2weight = STableManager.getFigureConfig(CommonStaticConfig.class).getType2holy2weight(ints);
|
||||
int i1 = ranndomFromWeight(type2holy2weight);
|
||||
|
@ -747,7 +747,7 @@ public class ExpeditionLogic {
|
|||
}
|
||||
SExpeditionHolyConfig orDefault = effectItems.getOrDefault(sExpeditionHolyConfig.geteffect(), null);
|
||||
if(null!=orDefault&&sExpeditionHolyConfig.gettype()<=orDefault.gettype()){
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
effectItems.put(sExpeditionHolyConfig.geteffect(),sExpeditionHolyConfig);
|
||||
}
|
||||
|
@ -874,8 +874,8 @@ public class ExpeditionLogic {
|
|||
// if(isTemp){
|
||||
// user.getExpeditionManager().addEquipToTemp(user, newequip);
|
||||
// }else {
|
||||
user.getExpeditionManager().addEquip(user, newequip);
|
||||
// }
|
||||
user.getExpeditionManager().addEquip(user, newequip);
|
||||
// }
|
||||
|
||||
newHero.updateEquipPositionMap(next.getKey(), newequip.getId());
|
||||
}
|
||||
|
@ -889,11 +889,11 @@ public class ExpeditionLogic {
|
|||
Jewel j = (Jewel) propertyItem;
|
||||
Jewel newequip = new Jewel(user.getId(), j.getEquipId());
|
||||
|
||||
// if(isTemp){
|
||||
// user.getExpeditionManager().addEquipToTemp(user, newequip);
|
||||
// }else {
|
||||
user.getExpeditionManager().addEquip(user, newequip);
|
||||
// }
|
||||
// if(isTemp){
|
||||
// user.getExpeditionManager().addEquipToTemp(user, newequip);
|
||||
// }else {
|
||||
user.getExpeditionManager().addEquip(user, newequip);
|
||||
// }
|
||||
newHero.addJewel(newequip.getId());
|
||||
}
|
||||
if(isTemp){
|
||||
|
@ -919,9 +919,30 @@ public class ExpeditionLogic {
|
|||
|
||||
//random ids
|
||||
TreeSet<Integer> tempid = new TreeSet<>();
|
||||
Set<Integer> tempType = new HashSet<>();
|
||||
int i=0;
|
||||
while (tempid.size()<size){
|
||||
if(i>1000){
|
||||
LOGGER.error("getRandomTidException:条件不匹配");
|
||||
break;
|
||||
}
|
||||
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);
|
||||
tempType.add(propertyName);
|
||||
i++;
|
||||
|
||||
}
|
||||
return tempid;
|
||||
|
||||
|
|
Loading…
Reference in New Issue