use of eidolons.game.battlecraft.logic.dungeon.universal.Dungeon in project Eidolons by IDemiurge.
the class LE_MapMaster method loadBlock.
public void loadBlock() {
if (blockChooser == null) {
blockChooser = new FileChooser(PathFinder.getMapBlockFolderPath());
}
String filePath = blockChooser.launch(PathFinder.getMapBlockFolderPath(), "");
if (filePath == null) {
return;
}
Document node = XML_Converter.getDoc(FileManager.readFile(filePath));
Dungeon dungeon = getLevel().getDungeon();
LocationBuilder.constructBlock(node, getPlan().getBlocks().size(), null, getPlan(), dungeon);
}
use of eidolons.game.battlecraft.logic.dungeon.universal.Dungeon in project Eidolons by IDemiurge.
the class LE_MapMaster method alterSize.
public void alterSize(boolean x, String newValue) {
Dungeon dungeon = LevelEditor.getCurrentLevel().getDungeon();
int newSize = StringMaster.getInteger(newValue);
Integer size = x ? dungeon.getCellsX() : dungeon.getCellsY();
boolean reduce = newSize < size;
String TRUE = x ? "RIGHT" : "DOWN";
String FALSE = x ? "LEFT" : "UP";
DialogMaster.ask("Where to " + (reduce ? "crop" : "expand") + "?", true, TRUE, FALSE, "BOTH");
// save-load onto new map of diff size with offset?
Boolean plus_negative_both_sides = (Boolean) WaitMaster.waitForInput(WAIT_OPERATIONS.OPTION_DIALOG);
/*
* expand zone
*
* introduce offset
*
*/
LevelEditor.getCurrentLevel().getMinimap().init();
LevelEditor.getCurrentLevel().getMinimap().getGrid().refresh();
}
use of eidolons.game.battlecraft.logic.dungeon.universal.Dungeon in project Eidolons by IDemiurge.
the class LE_MapMaster method generateNew.
public static void generateNew(Mission mission, Level level, boolean alt) {
DUNGEON_TEMPLATES template = new EnumMaster<DUNGEON_TEMPLATES>().retrieveEnumConst(DUNGEON_TEMPLATES.class, ListChooser.chooseEnum(DUNGEON_TEMPLATES.class));
if (template == null) {
if (!DialogMaster.confirm("Generate by standard template?")) {
return;
}
}
Dungeon dungeon = level.getDungeon();
// dungeon.setPlan(null);
// ++ size, fills, zone prefs ++ BUILD PARAMS
dungeon.setTemplate(template);
initBuildParams(alt, level.getLocation());
// new DungeonMapGenerator()
// new Location()
DungeonMaster master = level.getDungeonMaster();
LevelEditor.getSimulation().getUnits().clear();
level.init();
level.getMinimap().init();
level.getMinimap().getGrid().refresh();
}
use of eidolons.game.battlecraft.logic.dungeon.universal.Dungeon in project Eidolons by IDemiurge.
the class Level method getCopy.
public Level getCopy() {
// TODO use xml? no, it must be fast...
Dungeon dungeon = new Dungeon(this.location.getType());
location.setPlan(this.location.getPlan().getCopy());
Level copy = new Level(dungeon, mission);
// plan, blocks, zones
return copy;
}
use of eidolons.game.battlecraft.logic.dungeon.universal.Dungeon in project Eidolons by IDemiurge.
the class Location method initRootLevel.
private void initRootLevel() {
// TODO entrance fit?
if (isScenario()) {
String data = FileManager.readFile(PathFinder.getDungeonLevelFolder() + getPlaceOrScenario().getProperty(MACRO_PROPS.ROOT_LEVEL));
DungeonPlan plan = new LocationBuilder().loadDungeonMap(data);
root = plan.getDungeon();
return;
} else {
ObjType type = RandomWizard.getObjTypeByWeight(getPlaceOrScenario().getProperty(MACRO_PROPS.ROOT_POOL), DC_TYPE.DUNGEONS);
root = new Dungeon(type);
}
}
Aggregations