地图GM,跳转判断

back_recharge
jiahuiwen 2019-04-01 18:57:58 +08:00
parent dc46b843bb
commit 741c60fccf
2 changed files with 28 additions and 4 deletions

View File

@ -22,7 +22,9 @@ import com.ljsd.jieling.util.TimeUtils;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.HashSet;
import java.util.Map; import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
@Component @Component
@ -84,17 +86,18 @@ public class GMRequestHandler extends BaseHandler{
break; break;
case GlobalGm.OPEN_MAP: case GlobalGm.OPEN_MAP:
SCMapConfig scMapConfig = SCMapConfig.getsCMapSize().get(100 + prarm1); SCMapConfig scMapConfig = SCMapConfig.getsCMapSize().get(100 + prarm1);
Set<Integer> missionIds = new HashSet<>();
if (scMapConfig != null) { if (scMapConfig != null) {
for (int i = 0; i <= prarm1; i++) { for (int i = 0; i <= prarm1; i++) {
int mapId = 100 + prarm1; int mapId = 100 + i;
SCMapConfig crossMap = SCMapConfig.getsCMapSize().get(mapId); SCMapConfig crossMap = SCMapConfig.getsCMapSize().get(mapId);
cUser.getPlayerInfoManager().setMapId(mapId); cUser.getPlayerInfoManager().setMapId(mapId);
if (crossMap.getOpenRule() != null && crossMap.getOpenRule().length > 0) { if (crossMap.getOpenRule() != null && crossMap.getOpenRule().length > 0) {
cUser.getMissionManager().getFinishMissions().add(crossMap.getOpenRule()[0]); missionIds.add(crossMap.getOpenRule()[0]);
} }
} }
} }
// giveItem(cUser,prarm1,prarm2); cUser.getMissionManager().updateFinishMissions(missionIds);
break; break;
default: default:
break; break;

View File

@ -705,7 +705,28 @@ public class MapLogic {
if (nextEventId == 0) { if (nextEventId == 0) {
Map<Integer, Mission> doingMissions = user.getMissionManager().getDoingMissions(); Map<Integer, Mission> doingMissions = user.getMissionManager().getDoingMissions();
Mission mission = doingMissions.get(sOptionAddConditions.getValues()[0][0]); Mission mission = doingMissions.get(sOptionAddConditions.getValues()[0][0]);
if (mission == null || mission.getMissionStep() < jumpTypeValues[0][1]) { if (mission == null || mission.getMissionStep() < sOptionAddConditions.getValues()[0][1]) {
nextEventId = jumpTypeValues[0][1];
} else {
nextEventId = jumpTypeValues[0][0];
}
}
break;
}
// 当前是否处于某个任务的第几步,逻辑参数0处于1不处于#任务id#任务步数|…
case 6:{
Map<Integer, Mission> doingMissions = user.getMissionManager().getDoingMissions();
Mission mission = doingMissions.get(sOptionAddConditions.getValues()[0][1]);
if (sOptionAddConditions.getValues()[0][0] == 0) {
if (mission != null && mission.getMissionStep() == sOptionAddConditions.getValues()[0][2]) {
nextEventId = jumpTypeValues[0][0];
} else {
nextEventId = jumpTypeValues[0][1];
}
} else {
if (mission == null || mission.getMissionStep() != sOptionAddConditions.getValues()[0][2]) {
nextEventId = jumpTypeValues[0][0];
} else {
nextEventId = jumpTypeValues[0][1]; nextEventId = jumpTypeValues[0][1];
} }
} }