开启修行等级限制

back_recharge
yuanshuai 2021-09-10 15:09:03 +08:00
parent 5e3b41c2df
commit 3f2c236333
1 changed files with 26 additions and 26 deletions

View File

@ -36,36 +36,36 @@ public class SixiangUpStarRequestHandler extends BaseHandler<HeroInfoProto.Sixia
User user = UserManager.getUser(uid);
SixiangProfessionInfo professionInfo = user.getHeroManager().getSixiangDataMap().get(professionId);
SFourQuadrantConfig fourConfig=SFourQuadrantConfig.configByStrtMap.get(professionInfo.level);
// if (CheckUpStar(user,professionInfo)) {
//
// }else{
// LOGGER.error("四象心法进阶条件不满足");
// throw new ErrorCodeException(ErrorCode.SERVER_DEFINE_SELF);
// }
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<CommonProto.SixiangxinfaPropertyInfo> _list=new ArrayList<>();
for (Map.Entry<Integer, Integer> 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<CommonProto.SixiangxinfaPropertyInfo> _list=new ArrayList<>();
for (Map.Entry<Integer, Integer> 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);
}
}
//检测当前职业是否可以进阶