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