神应最大等级

back_recharge
duhui 2022-09-07 15:06:04 +08:00
parent 6ee2ba5d88
commit 5cf5552eb8
1 changed files with 6 additions and 2 deletions

View File

@ -19,12 +19,14 @@ import com.ljsd.jieling.util.ItemUtil;
import com.ljsd.jieling.util.MessageUtil;
import config.SErrorCodeEerverConfig;
import config.SGodHoodTreeLevel;
import config.SJewelConfig;
import manager.STableManager;
import org.springframework.stereotype.Component;
import rpc.protocols.HeroInfoProto;
import rpc.protocols.MessageTypeProto;
import java.util.List;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.stream.Collectors;
@ -57,13 +59,15 @@ public class UpgradeGodTreeHandler extends BaseHandler<HeroInfoProto.UpgradeGodT
}
// 升级次数
int count = proto.getCount();
TreeMap<Integer, SGodHoodTreeLevel> treeMap = new TreeMap<>(STableManager.getConfig(SGodHoodTreeLevel.class));
Map<Integer, SJewelConfig> config = STableManager.getConfig(SJewelConfig.class);
int godHoodMaxlv = config.get(jewel.getEquipId()).getGodHoodMaxlv();
int godTreeLv = jewel.getGodTreeLv();
if (godTreeLv + count > treeMap.size()){
if (godTreeLv + count > godHoodMaxlv){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE,"超过建木神树最大等级");
}
TreeMap<Integer, SGodHoodTreeLevel> treeMap = new TreeMap<>(STableManager.getConfig(SGodHoodTreeLevel.class));
SortedMap<Integer, SGodHoodTreeLevel> subMap = treeMap.subMap(godTreeLv, godTreeLv + count);
List<int[][]> collect = subMap.values().stream().map(v -> new int[][]{v.getLvupCost()}).collect(Collectors.toList());