地图表增加字段
parent
b06e783754
commit
47051d6b69
|
|
@ -12,6 +12,7 @@ public class SCMap implements BaseConfig {
|
|||
private int id;
|
||||
private int event;
|
||||
private int[][] groups;
|
||||
private int isMustAppear;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
|
@ -29,4 +30,8 @@ public class SCMap implements BaseConfig {
|
|||
public int[][] getGroups() {
|
||||
return groups;
|
||||
}
|
||||
|
||||
public int getIsMustAppear() {
|
||||
return isMustAppear;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,8 +77,8 @@ public class MapLogic {
|
|||
return;
|
||||
}
|
||||
mapManager.setHeroes(heroes);
|
||||
user.getPlayerInfoManager().setMapId(101);
|
||||
mapManager.setCurMapId(101);
|
||||
user.getPlayerInfoManager().setMapId(mapId);
|
||||
mapManager.setCurMapId(mapId);
|
||||
initMap(mapManager, user);
|
||||
user.setMapManager(mapManager);
|
||||
} else {
|
||||
|
|
@ -141,6 +141,17 @@ public class MapLogic {
|
|||
}
|
||||
for (Map.Entry<Integer, SCMap> entry : scMap.entrySet()) {
|
||||
SCMap scMap1 = entry.getValue();
|
||||
if (scMap1.getIsMustAppear() == 1) {
|
||||
for (int i = 0; i < scMap1.getGroups().length; i++) {
|
||||
int x = scMap1.getGroups()[i][0];
|
||||
int y = scMap1.getGroups()[i][1];
|
||||
int xy = CellUtil.xy2Pos(x, y);
|
||||
MapPointConfig mapPointConfig = MapPointConfig.scMapEventMap.get(scMap1.getEvent());
|
||||
Cell cellValue = new Cell(xy, mapPointConfig.getInitialEventId(), mapPointConfig.getId());
|
||||
newMap.put(xy, cellValue);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
int randomIndex = random.nextInt(scMap1.getGroups().length);
|
||||
int x = scMap1.getGroups()[randomIndex][0];
|
||||
int y = scMap1.getGroups()[randomIndex][1];
|
||||
|
|
|
|||
|
|
@ -305,8 +305,10 @@ public class ExcelUtils {
|
|||
for (Map.Entry<Object, List<Object>> entry : infoMap.entrySet()) {
|
||||
String[] split = entry.getKey().toString().split("#");
|
||||
Object npc = entry.getKey();
|
||||
if (split.length >= 2){
|
||||
Object isMustAppear = 0;
|
||||
if (split.length >= 3){
|
||||
npc = split[1];
|
||||
isMustAppear = split[2];
|
||||
}
|
||||
List<Object> value = entry.getValue();
|
||||
StringBuilder groups = new StringBuilder();
|
||||
|
|
@ -318,13 +320,13 @@ public class ExcelUtils {
|
|||
}
|
||||
}
|
||||
if (i == 0){
|
||||
out.write("id\tEvent\tGroups");
|
||||
out.write("id\tEvent\tGroups\tisMustAppear");
|
||||
out.write("\r\n");
|
||||
out.write("int"+"\t"+"int"+"\t"+"mut,int#int,2");
|
||||
out.write("int"+"\t"+"int"+"\t"+"mut,int#int,2"+"\t"+"int");
|
||||
out.write("\r\n");
|
||||
}
|
||||
i = i +1 ;
|
||||
out.write( i+"\t"+npc+"\t"+groups.toString());
|
||||
out.write( i+"\t"+npc+"\t"+groups.toString()+"\t" + isMustAppear);
|
||||
out.write("\r\n");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue