无尽生成小怪修改

lvxinran 2021-06-08 01:12:03 +08:00
parent d21c4c9249
commit a0db1379a9
2 changed files with 47 additions and 48 deletions

View File

@ -1397,9 +1397,9 @@ public class MapLogic {
} }
int destoryXY = mapManager.getTriggerXY(); int destoryXY = mapManager.getTriggerXY();
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4) { // if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4) {
endlessRefreshMonster(session,destoryXY); // endlessRefreshMonster(session,destoryXY);
} // }
//删点之前进行查找 //删点之前进行查找
if (sChallengeConfig.getType() == 2) { if (sChallengeConfig.getType() == 2) {
STrialConfig sTrialConfig = STrialConfig.sTrialConfigMap.get(mapManager.getTrialInfo().getFloor()); STrialConfig sTrialConfig = STrialConfig.sTrialConfigMap.get(mapManager.getTrialInfo().getFloor());
@ -2940,46 +2940,46 @@ public class MapLogic {
* @param triggerXY * @param triggerXY
* @throws Exception * @throws Exception
*/ */
public void endlessRefreshMonster(ISession session,int triggerXY) throws Exception { // public void endlessRefreshMonster(ISession session,int triggerXY) throws Exception {
User user = UserManager.getUser(session.getUid()); // User user = UserManager.getUser(session.getUid());
MapManager mapManager = user.getMapManager(); // MapManager mapManager = user.getMapManager();
Cell cell = mapManager.getMapInfo().get(triggerXY); // Cell cell = mapManager.getMapInfo().get(triggerXY);
MapPointConfig mapPointConfig = MapPointConfig.getScMapEventMap().get(cell.getPointId()); // MapPointConfig mapPointConfig = MapPointConfig.getScMapEventMap().get(cell.getPointId());
if(mapPointConfig.getStyle()==1){ // if(mapPointConfig.getStyle()==1){
Map<Integer, SCMap> map= SCMap.sCMap.get(mapManager.getCurMapId()); // Map<Integer, SCMap> map= SCMap.sCMap.get(mapManager.getCurMapId());
List<Integer> points = new ArrayList<>(); // List<Integer> points = new ArrayList<>();
for(Map.Entry<Integer, SCMap> entry:map.entrySet()){ // for(Map.Entry<Integer, SCMap> entry:map.entrySet()){
if(entry.getValue().getEvent()!=cell.getPointId()){ // if(entry.getValue().getEvent()!=cell.getPointId()){
continue; // continue;
} // }
boolean flagToAddMonster = true; // boolean flagToAddMonster = true;
int[][] groups = entry.getValue().getGroups(); // int[][] groups = entry.getValue().getGroups();
for(int i = 0;i<groups.length;i++){ // for(int i = 0;i<groups.length;i++){
if(mapManager.getMapInfo().get(CellUtil.xy2Pos(groups[i][0],groups[i][1]))==null){ // if(mapManager.getMapInfo().get(CellUtil.xy2Pos(groups[i][0],groups[i][1]))==null){
continue; // continue;
} // }
if(mapManager.getMapInfo().get(CellUtil.xy2Pos(groups[i][0],groups[i][1])).getPointId()!=0){ // if(mapManager.getMapInfo().get(CellUtil.xy2Pos(groups[i][0],groups[i][1])).getPointId()!=0){
flagToAddMonster = false; // flagToAddMonster = false;
} // }
} // }
if(flagToAddMonster){ // if(flagToAddMonster){
for(int i = 0;i<groups.length;i++){ // for(int i = 0;i<groups.length;i++){
points.add(CellUtil.xy2Pos(groups[i][0], groups[i][1])); // points.add(CellUtil.xy2Pos(groups[i][0], groups[i][1]));
} // }
} // }
} // }
if (points.size()>0){ // if (points.size()>0){
//无尽副本随机空地刷新小怪 // //无尽副本随机空地刷新小怪
int cellPos = points.get(MathUtils.randomInt(points.size())); // int cellPos = points.get(MathUtils.randomInt(points.size()));
Cell addCell = new Cell(cellPos,mapPointConfig.getInitialEventId(),mapPointConfig.getId()); // Cell addCell = new Cell(cellPos,mapPointConfig.getInitialEventId(),mapPointConfig.getId());
LOGGER.info("刷新位置为{}{}",CellUtil.pos2XY(cellPos)[0],CellUtil.pos2XY(cellPos)[1]); // LOGGER.info("刷新位置为{}{}",CellUtil.pos2XY(cellPos)[0],CellUtil.pos2XY(cellPos)[1]);
mapManager.addOrUpdateCell(cellPos,addCell); // mapManager.addOrUpdateCell(cellPos,addCell);
MapInfoProto.RefreshMonsterResponse monsterResponse = MapInfoProto.RefreshMonsterResponse.newBuilder().addCell(CBean2Proto.getCell(addCell)).build(); // MapInfoProto.RefreshMonsterResponse monsterResponse = MapInfoProto.RefreshMonsterResponse.newBuilder().addCell(CBean2Proto.getCell(addCell)).build();
MessageUtil.sendIndicationMessage(session,1, MessageTypeProto.MessageType.ENDLESS_MONSTER_REFRESH_INDICATION_VALUE,monsterResponse,true); // MessageUtil.sendIndicationMessage(session,1, MessageTypeProto.MessageType.ENDLESS_MONSTER_REFRESH_INDICATION_VALUE,monsterResponse,true);
} // }
BehaviorUtil.destoryApointXY(user, triggerXY); // BehaviorUtil.destoryApointXY(user, triggerXY);
} // }
} // }
/** /**
* *

View File

@ -369,11 +369,10 @@ public class EndlessMap extends AbstractMap{
boolean flagToAddMonster = true; boolean flagToAddMonster = true;
int[][] groups = entry.getValue().getGroups(); int[][] groups = entry.getValue().getGroups();
for(int i = 0;i<groups.length;i++){ for(int i = 0;i<groups.length;i++){
if(mapManager.getMapInfo().get(CellUtil.xy2Pos(groups[i][0],groups[i][1]))==null){ Cell curCell = mapManager.getMapInfo().get(CellUtil.xy2Pos(groups[i][0], groups[i][1]));
continue; if(curCell!=null&&curCell.getPointId()!=0){
} flagToAddMonster=false;
if(mapManager.getMapInfo().get(CellUtil.xy2Pos(groups[i][0],groups[i][1])).getPointId()!=0){ break;
flagToAddMonster = false;
} }
} }
if(flagToAddMonster){ if(flagToAddMonster){