back_recharge
jiahuiwen 2019-04-03 20:43:03 +08:00
parent 27aebc60bb
commit c6a892ab23
2 changed files with 12 additions and 5 deletions

View File

@ -75,7 +75,8 @@ public class MapLogic {
}
// 初始序章地图
if (user.getPlayerInfoManager().getMapId() == 0) {
String error = initTeamInfo(teamId, uid, user, mapManager);
SCMapConfig scMapConfig = SCMapConfig.getsCMapSize().get(100);
String error = initTeamInfo(teamId, uid, user, mapManager, scMapConfig.getMoveConfused());
if (!error.isEmpty()){
LOGGER.info("enterMap() uid=>{} error =>{} ", uid, error);
MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), "");
@ -123,7 +124,7 @@ public class MapLogic {
MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), "精力不足!");
return;
}
String error = initTeamInfo(teamId, uid, user, mapManager);
String error = initTeamInfo(teamId, uid, user, mapManager, scMapConfig.getMoveConfused());
if (!error.isEmpty()){
LOGGER.info("enterMap() uid=>{} error =>{} ", uid, error);
MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), "");
@ -153,13 +154,14 @@ public class MapLogic {
mapEnterResponse.addAllMapList(cells);
mapEnterResponse.setLeftStep(mapManager.getTotalStep());
mapEnterResponse.setCurXY(mapManager.getCurXY());
mapEnterResponse.addAllWakeCells(mapManager.getWalkCells() == null ? new ArrayList<>() : mapManager.getWalkCells());
if (mapManager.getTemporaryItems() != null) {
mapEnterResponse.setTemporaryItems(CBean2Proto.getDrop(mapManager.getTemporaryItems()));
}
MessageUtil.sendMessage(iSession, 1, messageType.getNumber(), mapEnterResponse.build(), true);
}
private String initTeamInfo(int teamId, int uid, User user, MapManager mapManager) throws Exception {
private String initTeamInfo(int teamId, int uid, User user, MapManager mapManager, int moveUse) throws Exception {
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
if (teamPosHeroInfos == null || teamPosHeroInfos.isEmpty()) {
return "阵容不存在";
@ -182,7 +184,7 @@ public class MapLogic {
return "阵容有误";
}
mapManager.setTeamId(teamId);
mapManager.setTotalStep(totalStep + 5);
mapManager.setTotalStep(totalStep + moveUse * 5);
return "";
}

View File

@ -332,7 +332,12 @@ public class CombatLogic {
if(type == GlobalsDef.FOOD_ADDITION_EXPLORE_TYPE){
for(int[] effectPara : effectParas){
if(effectPara[0] == GlobalsDef.EXPLORE_MAP_ACTION_POWER_RORMULA_TYPE){
mapManager.setTotalStep(mapManager.getTotalStep() + effectPara[1]);
SCMapConfig scMapConfig = SCMapConfig.getsCMapSize().get(mapManager.getCurMapId());
int totalStep = mapManager.getTotalStep();
if (totalStep < scMapConfig.getMoveConfused() * 5) {
totalStep = scMapConfig.getMoveConfused() * 5;
}
mapManager.setTotalStep(totalStep + effectPara[1]);
}
}
}