From 32bbca91cd8567e18994f08762c3693f97e7a1a1 Mon Sep 17 00:00:00 2001 From: jiahuiwen <1024696487@qq.com> Date: Mon, 25 Feb 2019 17:53:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9C=B0=E5=9B=BE=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ljsd/jieling/handler/map/MapLogic.java | 90 ++++++++++--------- 1 file changed, 48 insertions(+), 42 deletions(-) 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 1a514f7aa..8619e91b5 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 @@ -366,48 +366,7 @@ public class MapLogic { return; } // 1 完成事件点,即进度100% - switch (sOptionAddConditions.getType()) { - case 1:{ - int doneEvent = sOptionAddConditions.getValues()[0][0]; - for (Cell cell1 : mapManager.getMapInfo().values()) { - if (cell1.getPointId() == doneEvent) { - if (cell1.getEventId() >= sOptionAddConditions.getValues()[0][1]) { - nextPoint = jumpTypeValues[0][0]; - } - break; - } - } - break; - } - // 2 物品数量 - case 2:{ - break; - } - // 3 角色属性 - case 3:{ - break; - } - // 完成某个任务的第几步 - case 4:{ - Set finishMissions = user.getMissionManager().getFinishMissions(); - Set takeRewardMissions = user.getMissionManager().getTakeRewardMissions(); - if (finishMissions.contains(sOptionAddConditions.getValues()[0][0]) || takeRewardMissions.contains(sOptionAddConditions.getValues()[0][0])) { - nextPoint = jumpTypeValues[0][0]; - } - if (nextPoint == 0) { - Map doingMissions = user.getMissionManager().getDoingMissions(); - Mission mission = doingMissions.get(sOptionAddConditions.getValues()[0][0]); - if (mission == null || mission.getMissionStep() < jumpTypeValues[0][1]) { - nextPoint = jumpTypeValues[0][1]; - } - } - break; - } - default: { - nextPoint = jumpTypeValues[0][1]; - break; - } - } + nextPoint = getNextPoint(user, mapManager, jumpTypeValues, sOptionAddConditions); break; } // 4 不跳转,关闭界面 @@ -455,6 +414,53 @@ public class MapLogic { MessageUtil.sendMessage(session, 1, messageType.getNumber(), eventUpdateResponse.build(), true); } + private int getNextPoint(User user, MapManager mapManager, int[][] jumpTypeValues, SOptionAddCondition sOptionAddConditions) { + int nextPoint = 0; + switch (sOptionAddConditions.getType()) { + case 1:{ + int doneEvent = sOptionAddConditions.getValues()[0][0]; + for (Cell cell1 : mapManager.getMapInfo().values()) { + if (cell1.getPointId() == doneEvent) { + if (cell1.getEventId() >= sOptionAddConditions.getValues()[0][1]) { + nextPoint = jumpTypeValues[0][0]; + } + break; + } + } + break; + } + // 2 物品数量 + case 2:{ + break; + } + // 3 角色属性 + case 3:{ + break; + } + // 完成某个任务的第几步 + case 4:{ + Set finishMissions = user.getMissionManager().getFinishMissions(); + Set takeRewardMissions = user.getMissionManager().getTakeRewardMissions(); + if (finishMissions.contains(sOptionAddConditions.getValues()[0][0]) || takeRewardMissions.contains(sOptionAddConditions.getValues()[0][0])) { + nextPoint = jumpTypeValues[0][0]; + } + if (nextPoint == 0) { + Map doingMissions = user.getMissionManager().getDoingMissions(); + Mission mission = doingMissions.get(sOptionAddConditions.getValues()[0][0]); + if (mission == null || mission.getMissionStep() < jumpTypeValues[0][1]) { + nextPoint = jumpTypeValues[0][1]; + } + } + break; + } + default: { + nextPoint = jumpTypeValues[0][1]; + break; + } + } + return nextPoint; + } + public CommonProto.Mission getMission(Mission mission) { CommonProto.Mission openMission; StringBuilder state = null;