【家园功能1.0.3】建筑升级添加前置建筑等级验证,建筑解锁逻辑优化
parent
4e852db95b
commit
ad1cf08eae
|
|
@ -85,7 +85,7 @@ public class ArchitectureUnLockHandler implements IEventHandler {
|
|||
break;
|
||||
default:
|
||||
// 其他条件暂不处理,有需求再加
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
|
||||
// 浮生殿解锁触发任务
|
||||
|
|
|
|||
|
|
@ -73,6 +73,20 @@ public class HomeLogic {
|
|||
LOGGER.error("浮生门,表信息,建筑id不存在:{}", info.getId());
|
||||
continue;
|
||||
}
|
||||
//升级前置条件
|
||||
int[] rule = landLevel.getRule();
|
||||
if (rule != null){
|
||||
ArchitectureInfo info1 = user.getPlayerInfoManager().getArchitectureInfoMap().get(rule[0]);
|
||||
if (info1 == null){
|
||||
LOGGER.error("浮生门,前置建筑未解锁,升级的建筑:{},前置建筑:{}",id,rule[0]);
|
||||
continue;
|
||||
}
|
||||
int level = Optional.ofNullable(config.get(info1.getId())).map(SHomeLandLevel::getlevel).orElse(0);
|
||||
if (level < rule[1]){
|
||||
LOGGER.error("浮生门,前置建筑等级不足,升级的建筑:{},前置建筑等级:{}",id,level);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// 最高等级
|
||||
int maxId = config.values().stream().filter(v->v.getPoolID()==landLevel.getPoolID()).mapToInt(SHomeLandLevel::getlevel).max().orElse(0);
|
||||
if (info.getId() == maxId) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue