diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/hero/SixiangUpStarRequestHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/hero/SixiangUpStarRequestHandler.java index 775eea607..db9875fab 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/hero/SixiangUpStarRequestHandler.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/hero/SixiangUpStarRequestHandler.java @@ -36,36 +36,36 @@ public class SixiangUpStarRequestHandler extends BaseHandler _list=new ArrayList<>(); - for (Map.Entry dic : professionInfo.propertyMap.entrySet()) { - CommonProto.SixiangxinfaPropertyInfo propertyInfo= CommonProto.SixiangxinfaPropertyInfo.newBuilder() - .setPropertyId(dic.getKey()) - .setPropertyNum(dic.getValue()) + if (CheckUpStar(user,professionInfo)) { + int[][]costArr=fourConfig.getRankupCost(); + boolean costResult = ItemUtil.itemCost(user,costArr, BIReason.SIXIANG_UP_STAR_COST,professionId); + if (costResult) { + professionInfo.level++; + user.getHeroManager().putSixiangDataMap(professionId,professionInfo); + ///进阶成功刷进阶额外加成属性 + user.getHeroManager().putSixiangPropUpMap(professionId,CalUpStarPropAdd( professionInfo.level)); + List _list=new ArrayList<>(); + for (Map.Entry dic : professionInfo.propertyMap.entrySet()) { + CommonProto.SixiangxinfaPropertyInfo propertyInfo= CommonProto.SixiangxinfaPropertyInfo.newBuilder() + .setPropertyId(dic.getKey()) + .setPropertyNum(dic.getValue()) + .build(); + _list.add(propertyInfo); + } + HeroInfoProto.SixiangUpStarResponse response=HeroInfoProto.SixiangUpStarResponse.newBuilder() + .setStarLv(professionInfo.level) + .addAllInfoList(_list) .build(); - _list.add(propertyInfo); + MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.SIXIANG_UP_STAR_RESPONSE_VALUE,response,true); + }else { + LOGGER.error("四象心法进阶材料不足"); + throw new ErrorCodeException(ErrorCode.SERVER_DEFINE_SELF); } - HeroInfoProto.SixiangUpStarResponse response=HeroInfoProto.SixiangUpStarResponse.newBuilder() - .setStarLv(professionInfo.level) - .addAllInfoList(_list) - .build(); - MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.SIXIANG_UP_STAR_RESPONSE_VALUE,response,true); - }else { - LOGGER.error("四象心法进阶材料不足"); + }else{ + LOGGER.error("四象心法进阶条件不满足"); throw new ErrorCodeException(ErrorCode.SERVER_DEFINE_SELF); } + } //检测当前职业是否可以进阶