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;
@ -85,10 +101,10 @@ public class Hero extends MongoBase {
this.especialEquipLevel = 1; this.especialEquipLevel = 1;
if(initStar!=scHero.getStar()){ if(initStar!=scHero.getStar()){
Map<Integer, SCHeroRankUpConfig> scHeroRankUpConfigByType = STableManager.getFigureConfig(HeroStaticConfig.class).getScHeroRankUpConfigByShow(GlobalsDef.UP_STAR_TYPE,scHero.getStar()); Map<Integer, SCHeroRankUpConfig> scHeroRankUpConfigByType = STableManager.getFigureConfig(HeroStaticConfig.class).getScHeroRankUpConfigByShow(GlobalsDef.UP_STAR_TYPE,scHero.getStar());
if(scHeroRankUpConfigByType!=null) { if(scHeroRankUpConfigByType!=null) {
SCHeroRankUpConfig scHeroRankUpConfig = scHeroRankUpConfigByType.get(initStar-1); SCHeroRankUpConfig scHeroRankUpConfig = scHeroRankUpConfigByType.get(initStar-1);
starBreakId = scHeroRankUpConfig.getId(); starBreakId = scHeroRankUpConfig.getId();
} }
} }
createTime = (int)(System.currentTimeMillis()/1000); createTime = (int)(System.currentTimeMillis()/1000);

View File

@ -480,10 +480,10 @@ public class ExpeditionLogic {
} }
int ints = staffsSet.size()+1;//默认品质 int ints = staffsSet.size()+1;//默认品质
try { try {
ints = MathUtils.randomFromWeight(cfg.getHolyProbability()); ints = MathUtils.randomFromWeight(cfg.getHolyProbability());
}catch (Exception e){ }catch (Exception e){
break; break;
// e.printStackTrace(); // e.printStackTrace();
} }
Map<Integer, Integer> type2holy2weight = STableManager.getFigureConfig(CommonStaticConfig.class).getType2holy2weight(ints); Map<Integer, Integer> type2holy2weight = STableManager.getFigureConfig(CommonStaticConfig.class).getType2holy2weight(ints);
int i1 = ranndomFromWeight(type2holy2weight); int i1 = ranndomFromWeight(type2holy2weight);
@ -747,7 +747,7 @@ public class ExpeditionLogic {
} }
SExpeditionHolyConfig orDefault = effectItems.getOrDefault(sExpeditionHolyConfig.geteffect(), null); SExpeditionHolyConfig orDefault = effectItems.getOrDefault(sExpeditionHolyConfig.geteffect(), null);
if(null!=orDefault&&sExpeditionHolyConfig.gettype()<=orDefault.gettype()){ if(null!=orDefault&&sExpeditionHolyConfig.gettype()<=orDefault.gettype()){
continue; continue;
} }
effectItems.put(sExpeditionHolyConfig.geteffect(),sExpeditionHolyConfig); effectItems.put(sExpeditionHolyConfig.geteffect(),sExpeditionHolyConfig);
} }
@ -874,8 +874,8 @@ public class ExpeditionLogic {
// if(isTemp){ // if(isTemp){
// user.getExpeditionManager().addEquipToTemp(user, newequip); // user.getExpeditionManager().addEquipToTemp(user, newequip);
// }else { // }else {
user.getExpeditionManager().addEquip(user, newequip); user.getExpeditionManager().addEquip(user, newequip);
// } // }
newHero.updateEquipPositionMap(next.getKey(), newequip.getId()); newHero.updateEquipPositionMap(next.getKey(), newequip.getId());
} }
@ -889,11 +889,11 @@ public class ExpeditionLogic {
Jewel j = (Jewel) propertyItem; Jewel j = (Jewel) propertyItem;
Jewel newequip = new Jewel(user.getId(), j.getEquipId()); Jewel newequip = new Jewel(user.getId(), j.getEquipId());
// if(isTemp){ // if(isTemp){
// user.getExpeditionManager().addEquipToTemp(user, newequip); // user.getExpeditionManager().addEquipToTemp(user, newequip);
// }else { // }else {
user.getExpeditionManager().addEquip(user, newequip); user.getExpeditionManager().addEquip(user, newequip);
// } // }
newHero.addJewel(newequip.getId()); newHero.addJewel(newequip.getId());
} }
if(isTemp){ if(isTemp){
@ -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;