From ad1cf08eaea21c90a06cab13e4d0b33842f3e29d Mon Sep 17 00:00:00 2001 From: duhui Date: Mon, 27 Dec 2021 13:45:47 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=AE=B6=E5=9B=AD=E5=8A=9F=E8=83=BD1.?= =?UTF-8?q?0.3=E3=80=91=E5=BB=BA=E7=AD=91=E5=8D=87=E7=BA=A7=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=89=8D=E7=BD=AE=E5=BB=BA=E7=AD=91=E7=AD=89=E7=BA=A7?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=EF=BC=8C=E5=BB=BA=E7=AD=91=E8=A7=A3=E9=94=81?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logic/home/ArchitectureUnLockHandler.java | 2 +- .../com/ljsd/jieling/logic/home/HomeLogic.java | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/home/ArchitectureUnLockHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/home/ArchitectureUnLockHandler.java index 2ce7a1279..dd1c46cfa 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/home/ArchitectureUnLockHandler.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/home/ArchitectureUnLockHandler.java @@ -85,7 +85,7 @@ public class ArchitectureUnLockHandler implements IEventHandler { break; default: // 其他条件暂不处理,有需求再加 - break; + continue; } // 浮生殿解锁触发任务 diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/home/HomeLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/home/HomeLogic.java index d41d3fa92..2e916a32b 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/home/HomeLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/home/HomeLogic.java @@ -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) {