From 8a77b7c2d51eecaa6b3e3efacfcba6585f0d8556 Mon Sep 17 00:00:00 2001 From: yuanshuai <243578945@qq.com> Date: Fri, 10 Dec 2021 18:43:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=85=B3=E5=8D=A1=E9=99=84?= =?UTF-8?q?=E5=8A=A0=E6=9D=A1=E4=BB=B6=E5=8A=9F=E8=83=BD=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ljsd/jieling/handler/map/MapLogic.java | 72 +++++++++++++++++++ .../main/java/config/SMainLevelConfig.java | 7 ++ 2 files changed, 79 insertions(+) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java index f74de0d19..ae66c8d07 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java @@ -34,8 +34,10 @@ import com.ljsd.jieling.logic.dao.*; import com.ljsd.jieling.logic.dao.root.User; import com.ljsd.jieling.logic.fight.*; import com.ljsd.jieling.logic.fight.result.FightResult; +import com.ljsd.jieling.logic.hardStage.HardStageLogic; import com.ljsd.jieling.logic.hero.HeroAttributeEnum; import com.ljsd.jieling.logic.hero.HeroLogic; +import com.ljsd.jieling.logic.hero.HongMengAttributeEnum; import com.ljsd.jieling.logic.item.ItemLogic; import com.ljsd.jieling.logic.mission.GameEvent; import com.ljsd.jieling.logic.player.PlayerLogic; @@ -2102,6 +2104,11 @@ public class MapLogic { throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE); } } + boolean isOpenRule=CheckFigthLevelOpen(user,sMainLevelConfig.getOpenRule()); + if (!isOpenRule){ + LOGGER.info("startMainLevelFight==> uid={},fightId={}, levelDifficulty is not allow ", uid, fightId); + throw new ErrorCodeException(ErrorCode.HANDLE_FAILED); + } List teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId); if (teamPosHeroInfos == null || teamPosHeroInfos.size() == 0) { @@ -2123,6 +2130,71 @@ public class MapLogic { } + /** + * 检测附加关卡解锁条件 + * 0:无限制 + * 1:山河星数(3-20后) + * 2:心魔层数(3-10后) + * 3:鸿蒙阵等级(6-15后) + * 4:指定星级(运算星级)装备数量(初始可用) + * 5:英雄总好感度等级(5-10后) + * @param user + * @param openRule + * @return + * @throws Exception + */ + private boolean CheckFigthLevelOpen(User user,int[][] openRule) throws Exception { + boolean isOpen = true; + for (int[] ints : openRule) { + int type = ints[0]; + if (type == 0) { + break; + } + switch (type) { + case 1:{ + if (ints[1]> HardStageLogic.getHardStageStarsSum(user)) { + return false; + } + break; + } + case 2: { + if (ints[1]> user.getMapManager().getLastMonsterAttack()-1) { + return false; + } + break; + } + case 3:{ + HongMengAddAttribute hongMengAddAttribute = user.getHeroManager().getResonanceAddition().get(HongMengAttributeEnum.LEVEL); + if (hongMengAddAttribute==null||ints[1]> hongMengAddAttribute.value) { + return false; + } + break; + } + case 4:{ + int num=0; + MapequipConfig=STableManager.getConfig(SEquipConfig.class); + for (Map.Entry entry : user.getItemManager().getEquipBookMap().entrySet()) { + if (equipConfig.get(entry.getKey()).getStar()>=ints[1]) { + num++; + } + } + if (ints[2]>num) { + return false; + } + break; + } + case 5:{ + if (ints[1]> user.getHeroManager().GetAllLikableLv()) { + return false; + } + break; + } + + } + } + return isOpen; + } + public void endMainLevelFight(ISession session, String frames, int fightId, MessageTypeProto.MessageType messageType) throws Exception { int uid = session.getUid(); User user = UserManager.getUser(uid); diff --git a/tablemanager/src/main/java/config/SMainLevelConfig.java b/tablemanager/src/main/java/config/SMainLevelConfig.java index fd7ca12c5..0b3a12e5d 100644 --- a/tablemanager/src/main/java/config/SMainLevelConfig.java +++ b/tablemanager/src/main/java/config/SMainLevelConfig.java @@ -15,6 +15,8 @@ public class SMainLevelConfig implements BaseConfig { private int levelLimit; + private int[][] openRule;//附加关卡解锁条件 + private int monsterGroup; private int[] reward; @@ -31,6 +33,7 @@ public class SMainLevelConfig implements BaseConfig { private int[][] invasionBossReward; + private int invasionBossTime; private int invasionBossRefresh; @@ -143,4 +146,8 @@ public class SMainLevelConfig implements BaseConfig { public int getPlotId() { return storyId; } + + public int[][] getOpenRule() { + return openRule; + } } \ No newline at end of file