主线关卡限制条件增加

back_recharge
yuanshuai 2021-12-13 10:12:29 +08:00
parent 8a77b7c2d5
commit ea545c50ac
1 changed files with 439 additions and 408 deletions

View File

@ -114,6 +114,7 @@ public class MapLogic {
public AbstractMap getMap(int mapTypeId) throws Exception { public AbstractMap getMap(int mapTypeId) throws Exception {
return MapEnum.getToAbstractMap(mapTypeId); return MapEnum.getToAbstractMap(mapTypeId);
} }
public AbstractMap getMap(User user) throws Exception { public AbstractMap getMap(User user) throws Exception {
int curMapType = user.getMapManager().getCurMapType(); int curMapType = user.getMapManager().getCurMapType();
if (curMapType == 0) { if (curMapType == 0) {
@ -363,7 +364,6 @@ public class MapLogic {
// } // }
/** /**
*
* @param teamId * @param teamId
* @param uid * @param uid
* @param user * @param user
@ -732,6 +732,7 @@ public class MapLogic {
LOGGER.info("the uid+{},the lastXy={}", uid, lastXY); LOGGER.info("the uid+{},the lastXy={}", uid, lastXY);
MessageUtil.sendMessage(session, 1, messageType.getNumber(), mapUpdateResponse.build(), true); MessageUtil.sendMessage(session, 1, messageType.getNumber(), mapUpdateResponse.build(), true);
} }
private Set<Integer> getOpenCells(int mapId, List<Integer> cells) { private Set<Integer> getOpenCells(int mapId, List<Integer> cells) {
int square = 3;//范围是3 int square = 3;//范围是3
Set<Integer> openCells = new HashSet<>(); Set<Integer> openCells = new HashSet<>();
@ -1275,9 +1276,9 @@ public class MapLogic {
/** /**
* *
* * <p>
// * @param session * // * @param session
// * @param messageType * // * @param messageType
*/ */
// public void fastFight(ISession session, MessageTypeProto.MessageType messageType) throws Exception { // public void fastFight(ISession session, MessageTypeProto.MessageType messageType) throws Exception {
// int uid = session.getUid(); // int uid = session.getUid();
@ -1709,8 +1710,6 @@ public class MapLogic {
// } // }
// MessageUtil.sendMessage(session, 1, messageType.getNumber(), fightEndResponse.build(), true); // MessageUtil.sendMessage(session, 1, messageType.getNumber(), fightEndResponse.build(), true);
// } // }
public void initMapMission(MapManager mapManager) { public void initMapMission(MapManager mapManager) {
int mapId = mapManager.getCurMapId(); int mapId = mapManager.getCurMapId();
if (mapManager.getCopyMissionProgresById(mapId) != null) { if (mapManager.getCopyMissionProgresById(mapId) != null) {
@ -2060,7 +2059,6 @@ public class MapLogic {
} }
/** /**
* *
* *
@ -2079,8 +2077,6 @@ public class MapLogic {
} }
/** /**
* *
*/ */
@ -2094,8 +2090,7 @@ public class MapLogic {
if (mineFightId != fightId) { if (mineFightId != fightId) {
LOGGER.info("startMainLevelFight==> uid={},fightId={}, levelDifficulty is not allow ", uid, fightId); LOGGER.info("startMainLevelFight==> uid={},fightId={}, levelDifficulty is not allow ", uid, fightId);
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE); throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
} } else if (mainLevelManager.getState() != 1) {
else if (mainLevelManager.getState()!=1){
// 动态匹配最新的表数据 // 动态匹配最新的表数据
if (sMainLevelConfig != null && sMainLevelConfig.getNextLevel() != -1 && user.getPlayerInfoManager().getLevel() >= sMainLevelConfig.getLevelLimit()) { if (sMainLevelConfig != null && sMainLevelConfig.getNextLevel() != -1 && user.getPlayerInfoManager().getLevel() >= sMainLevelConfig.getLevelLimit()) {
mainLevelManager.setState(1); mainLevelManager.setState(1);
@ -2138,6 +2133,8 @@ public class MapLogic {
* 3鸿6-15 * 3鸿6-15
* 4 * 4
* 55-10 * 55-10
* 7
*
* @param user * @param user
* @param openRule * @param openRule
* @return * @return
@ -2152,20 +2149,20 @@ public class MapLogic {
} }
switch (type) { switch (type) {
case 1: { case 1: {
if (ints[1]> HardStageLogic.getHardStageStarsSum(user)) { if (HardStageLogic.getHardStageStarsSum(user) < ints[1]) {
return false; return false;
} }
break; break;
} }
case 2: { case 2: {
if (ints[1]> user.getMapManager().getLastMonsterAttack()-1) { if (user.getMapManager().getLastMonsterAttack() - 1 < ints[1]) {
return false; return false;
} }
break; break;
} }
case 3: { case 3: {
HongMengAddAttribute hongMengAddAttribute = user.getHeroManager().getResonanceAddition().get(HongMengAttributeEnum.LEVEL); HongMengAddAttribute hongMengAddAttribute = user.getHeroManager().getResonanceAddition().get(HongMengAttributeEnum.LEVEL);
if (hongMengAddAttribute==null||ints[1]> hongMengAddAttribute.value) { if (hongMengAddAttribute == null || hongMengAddAttribute.value < ints[1]) {
return false; return false;
} }
break; break;
@ -2178,13 +2175,25 @@ public class MapLogic {
num++; num++;
} }
} }
if (ints[2]>num) { if (num < ints[2]) {
return false; return false;
} }
break; break;
} }
case 5: { case 5: {
if (ints[1]> user.getHeroManager().GetAllLikableLv()) { if (user.getHeroManager().GetAllLikableLv() < ints[1]) {
return false;
}
break;
}
case 7: {
int num = 0;
for (Map.Entry<String, Hero> stringHeroEntry : user.getHeroManager().getHeroMap().entrySet()) {
if (stringHeroEntry.getValue().getOriginalLevel()>= ints[1]) {
num++;
}
}
if (num < ints[2]) {
return false; return false;
} }
break; break;
@ -2291,7 +2300,6 @@ public class MapLogic {
} }
/** /**
* *
* *
@ -2415,8 +2423,6 @@ public class MapLogic {
} }
public void gmCrossFight(int uid, int arrayMapId) throws Exception { public void gmCrossFight(int uid, int arrayMapId) throws Exception {
User user = UserManager.getUser(uid); User user = UserManager.getUser(uid);
if (user == null || user.getMapManager() == null) { if (user == null || user.getMapManager() == null) {
@ -2455,7 +2461,6 @@ public class MapLogic {
} }
public void clearNormalMonster(User user) throws Exception { public void clearNormalMonster(User user) throws Exception {
LOGGER.info("删除当前地图小怪!!"); LOGGER.info("删除当前地图小怪!!");
Map<Integer, MapPointConfig> configMap = MapPointConfig.scMapEventMap; Map<Integer, MapPointConfig> configMap = MapPointConfig.scMapEventMap;
@ -2475,8 +2480,10 @@ public class MapLogic {
int[] x = Arrays.stream(destoryCell.toArray(new Integer[destoryCell.size()])).mapToInt(Integer::valueOf).toArray(); int[] x = Arrays.stream(destoryCell.toArray(new Integer[destoryCell.size()])).mapToInt(Integer::valueOf).toArray();
BehaviorUtil.destoryPoints(user, x); BehaviorUtil.destoryPoints(user, x);
} }
/** /**
* 使Buff * 使Buff
*
* @param session * @param session
* @param messageType * @param messageType
*/ */
@ -2603,6 +2610,7 @@ public class MapLogic {
MessageUtil.sendMessage(session, 1, messageType.getNumber(), FbStarRewardResponse.build(), true); MessageUtil.sendMessage(session, 1, messageType.getNumber(), FbStarRewardResponse.build(), true);
} }
public void recordDifficultMap(ISession session, int fbId, int difficultyId, MessageTypeProto.MessageType messageType) throws Exception { public void recordDifficultMap(ISession session, int fbId, int difficultyId, MessageTypeProto.MessageType messageType) throws Exception {
MapManager mapManager = UserManager.getUser(session.getUid()).getMapManager(); MapManager mapManager = UserManager.getUser(session.getUid()).getMapManager();
@ -2615,6 +2623,7 @@ public class MapLogic {
} }
MessageUtil.sendMessage(session, 1, messageType.getNumber(), null, true); MessageUtil.sendMessage(session, 1, messageType.getNumber(), null, true);
} }
//GM调用 //GM调用
public void setTower(int uid, int towerNumber) throws Exception { public void setTower(int uid, int towerNumber) throws Exception {
UserManager.getUser(uid).getMapManager().setTrialFloor(towerNumber); UserManager.getUser(uid).getMapManager().setTrialFloor(towerNumber);
@ -2622,6 +2631,7 @@ public class MapLogic {
/** /**
* *
*
* @param session * @param session
* @param * @param
* @param messageType * @param messageType
@ -2648,6 +2658,7 @@ public class MapLogic {
/** /**
* 使 * 使
*
* @param session * @param session
* @param heroId * @param heroId
* @param messageType * @param messageType
@ -2701,6 +2712,7 @@ public class MapLogic {
/** /**
* *
*
* @param session * @param session
* @param messageType * @param messageType
*/ */
@ -2772,6 +2784,7 @@ public class MapLogic {
/** /**
* *
*
* @param session * @param session
* @param messageType * @param messageType
*/ */
@ -2799,6 +2812,7 @@ public class MapLogic {
/** /**
* *
*
* @param session * @param session
* @param cellId * @param cellId
* @param content * @param content
@ -2836,6 +2850,7 @@ public class MapLogic {
/** /**
* *
*
* @param session * @param session
* @param messageType * @param messageType
* @throws Exception * @throws Exception
@ -2848,6 +2863,7 @@ public class MapLogic {
/** /**
* *
*
* @param session * @param session
* @param messageType * @param messageType
*/ */
@ -2864,6 +2880,7 @@ public class MapLogic {
/** /**
* *
*
* @param user * @param user
* @throws Exception * @throws Exception
*/ */
@ -2891,6 +2908,7 @@ public class MapLogic {
/** /**
* *
*
* @param uid * @param uid
* @throws Exception * @throws Exception
*/ */
@ -2900,6 +2918,7 @@ public class MapLogic {
/** /**
* *
*
* @param session * @param session
* @param messageType * @param messageType
*/ */
@ -2974,8 +2993,10 @@ public class MapLogic {
} }
} }
/** /**
* *
*
* @throws Exception * @throws Exception
*/ */
public void resetEndlessInfo() throws Exception { public void resetEndlessInfo() throws Exception {
@ -2987,8 +3008,10 @@ public class MapLogic {
clearEndLessDrop(entry.getValue().getUid()); clearEndLessDrop(entry.getValue().getUid());
} }
} }
/** /**
* *
*
* @throws Exception * @throws Exception
*/ */
public void resetTrialInfo() throws Exception { public void resetTrialInfo() throws Exception {
@ -3007,6 +3030,7 @@ public class MapLogic {
// resetMapInfo(user,false); // resetMapInfo(user,false);
} }
} }
public void trialClear(ISession session) throws Exception { public void trialClear(ISession session) throws Exception {
User user = UserManager.getUser(session.getUid()); User user = UserManager.getUser(session.getUid());
MapManager mapManager = user.getMapManager(); MapManager mapManager = user.getMapManager();
@ -3066,6 +3090,7 @@ public class MapLogic {
/** /**
* *
*
* @param session * @param session
* @param type * @param type
* @param messageType * @param messageType
@ -3161,7 +3186,6 @@ public class MapLogic {
} }
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), TeamEnum.FORMATION_NORMAL.getTeamId(), 1000, "", GameFightType.DailyChallenge, sDailyChallengeConfig.getMonsterId(), 3); PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), TeamEnum.FORMATION_NORMAL.getTeamId(), 1000, "", GameFightType.DailyChallenge, sDailyChallengeConfig.getMonsterId(), 3);
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent); FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
CommonProto.FightData fightData = CommonProto.FightData.newBuilder() CommonProto.FightData fightData = CommonProto.FightData.newBuilder()
@ -3209,6 +3233,7 @@ public class MapLogic {
/** /**
* *
*
* @param session * @param session
* @param heroes * @param heroes
* @param messageType * @param messageType
@ -3272,6 +3297,7 @@ public class MapLogic {
/** /**
* *
*
* @param session * @param session
* @param messageType * @param messageType
* @throws Exception * @throws Exception
@ -3298,6 +3324,7 @@ public class MapLogic {
/** /**
* *
*
* @param boxPosition * @param boxPosition
* @param boxReward * @param boxReward
* @param user * @param user
@ -3394,6 +3421,7 @@ public class MapLogic {
/** /**
* *
*
* @param session * @param session
* @param index * @param index
* @param messageType * @param messageType
@ -3445,6 +3473,7 @@ public class MapLogic {
groupId = levelDifficult.getMonsterId()[position]; groupId = levelDifficult.getMonsterId()[position];
return groupId; return groupId;
} }
public int getDifficultReward(int rewardId, int level, int mapId) { public int getDifficultReward(int rewardId, int level, int mapId) {
Map<Integer, Map<Integer, Integer>> mapDifficult = SEndlessDifficulty.mapDifficult; Map<Integer, Map<Integer, Integer>> mapDifficult = SEndlessDifficulty.mapDifficult;
Map<Integer, Integer> levelMap = mapDifficult.get(mapId); Map<Integer, Integer> levelMap = mapDifficult.get(mapId);
@ -3468,6 +3497,7 @@ public class MapLogic {
return rewardId; return rewardId;
} }
public void getAllEndlessTreasureInfo(ISession session, MessageTypeProto.MessageType messageType) throws Exception { public void getAllEndlessTreasureInfo(ISession session, MessageTypeProto.MessageType messageType) throws Exception {
int uid = session.getUid(); int uid = session.getUid();
User user = UserManager.getUser(uid); User user = UserManager.getUser(uid);
@ -3481,6 +3511,7 @@ public class MapLogic {
MessageUtil.sendMessage(session, 1, messageType.getNumber(), response.build(), true); MessageUtil.sendMessage(session, 1, messageType.getNumber(), response.build(), true);
} }
public MapInfoProto.EndlessTreasureInfoResponse.Builder getEndlessResponseBuilder(EndlessTreasureReward worldTreasureReward) { public MapInfoProto.EndlessTreasureInfoResponse.Builder getEndlessResponseBuilder(EndlessTreasureReward worldTreasureReward) {
MapInfoProto.EndlessTreasureInfoResponse.Builder response = MapInfoProto.EndlessTreasureInfoResponse.newBuilder(); MapInfoProto.EndlessTreasureInfoResponse.Builder response = MapInfoProto.EndlessTreasureInfoResponse.newBuilder();
// if(worldTreasureReward.getFirstStartTime()!=0&&worldTreasureReward.getFirstStartTime()<=TimeUtils.nowInt()&&worldTreasureReward.getCreateTime()>TimeUtils.now()/1000){ // if(worldTreasureReward.getFirstStartTime()!=0&&worldTreasureReward.getFirstStartTime()<=TimeUtils.nowInt()&&worldTreasureReward.getCreateTime()>TimeUtils.now()/1000){