无尽生成小怪修改

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

View File

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