神王2.0

master_longzhu
grimm 2024-08-05 18:37:01 +08:00
parent 3b288bce05
commit abbd8e67df
2 changed files with 6 additions and 6 deletions

View File

@ -1544,8 +1544,7 @@ public class HeroLogic {
if (consumeMaterialInfoByPosition == null) { if (consumeMaterialInfoByPosition == null) {
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE); throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
} }
CommonProto.Drop.Builder drop = CommonProto.Drop.newBuilder(); CommonProto.Drop.Builder drop = checkAndUpdateConsumeHero(user, heroId, consumeMaterialInfoByPosition, consumeMaterialsList);
checkAndUpdateConsumeHero(user, heroId, consumeMaterialInfoByPosition, consumeMaterialsList, drop);
ItemUtil.itemCost(user, consumeMaterial, BIReason.UP_HEROSTAR_CONSUME, targetHero.getTemplateId()); ItemUtil.itemCost(user, consumeMaterial, BIReason.UP_HEROSTAR_CONSUME, targetHero.getTemplateId());
rankUpHeroExecute(user, targetHero); rankUpHeroExecute(user, targetHero);
user.getHeroManager().addHeroStar(targetHero.getTemplateId(), targetHero.getStar()); user.getHeroManager().addHeroStar(targetHero.getTemplateId(), targetHero.getStar());
@ -7571,7 +7570,7 @@ public class HeroLogic {
Map<Integer, SCHero.ConsumeMaterialInfo> map = shenWang.getConsumeMaterialInfoOfPositionByLv().get(targetLv); Map<Integer, SCHero.ConsumeMaterialInfo> map = shenWang.getConsumeMaterialInfoOfPositionByLv().get(targetLv);
CommonProto.Drop.Builder drop = CommonProto.Drop.newBuilder(); CommonProto.Drop.Builder drop = CommonProto.Drop.newBuilder();
if (map != null){ if (map != null){
checkAndUpdateConsumeHero(user, heroId, map, request.getConsumeMaterialsList(), drop); drop = checkAndUpdateConsumeHero(user, heroId, map, request.getConsumeMaterialsList());
} }
ItemUtil.itemCost(user, shenWang.getNeedItem(), BIReason.SHENWANG_UP_LV_COST, 0); ItemUtil.itemCost(user, shenWang.getNeedItem(), BIReason.SHENWANG_UP_LV_COST, 0);
hero.setShenwangLv(targetLv); hero.setShenwangLv(targetLv);
@ -7588,7 +7587,7 @@ public class HeroLogic {
* @param consumeMaterialsList * @param consumeMaterialsList
* @throws Exception * @throws Exception
*/ */
public void checkAndUpdateConsumeHero(User user, String heroId, Map<Integer, SCHero.ConsumeMaterialInfo> consumeMaterialInfoByPosition, List<HeroInfoProto.ConsumeMaterial> consumeMaterialsList, CommonProto.Drop.Builder drop) throws Exception { public CommonProto.Drop.Builder checkAndUpdateConsumeHero(User user, String heroId, Map<Integer, SCHero.ConsumeMaterialInfo> consumeMaterialInfoByPosition, List<HeroInfoProto.ConsumeMaterial> consumeMaterialsList) throws Exception {
HeroManager heroManager = user.getHeroManager(); HeroManager heroManager = user.getHeroManager();
Hero targetHero = heroManager.getHero(heroId); Hero targetHero = heroManager.getHero(heroId);
SCHero scHero = SCHero.getSCHero(targetHero.getTemplateId()); SCHero scHero = SCHero.getSCHero(targetHero.getTemplateId());
@ -7680,10 +7679,10 @@ public class HeroLogic {
LOGGER.error("hero num not enough"); LOGGER.error("hero num not enough");
throw new ErrorCodeException(ErrorCode.HERO_UN_MATCH); throw new ErrorCodeException(ErrorCode.HERO_UN_MATCH);
} }
//改成归元获得,同时返还法宝获得
drop = consumeBackDrop(user, removeHeroIds);
// 消耗道具 // 消耗道具
ItemUtil.itemCost(user, removeItemMap, BIReason.COMPLEX_EQUIP_CONSUME, 0); ItemUtil.itemCost(user, removeItemMap, BIReason.COMPLEX_EQUIP_CONSUME, 0);
//改成归元获得,同时返还法宝获得
return consumeBackDrop(user, removeHeroIds);
} }
} }

View File

@ -434,6 +434,7 @@ public class CBean2Proto {
.addAllGiftEquipIds(hero.getHeroGiftEquipList()) .addAllGiftEquipIds(hero.getHeroGiftEquipList())
.addAllPotential(toBeanPotential(hero)) .addAllPotential(toBeanPotential(hero))
.setTraining(getTrainingProto(hero)) .setTraining(getTrainingProto(hero))
.setShenwangLv(hero.getShenwangLv())
.build(); .build();
} }