Search in sources :

Example 1 with Dungeon

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);
}
Also used : Dungeon(eidolons.game.battlecraft.logic.dungeon.universal.Dungeon) FileChooser(main.swing.generic.components.editors.FileChooser) Document(org.w3c.dom.Document)

Example 2 with 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();
}
Also used : Dungeon(eidolons.game.battlecraft.logic.dungeon.universal.Dungeon)

Example 3 with Dungeon

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();
}
Also used : DUNGEON_TEMPLATES(eidolons.game.battlecraft.logic.dungeon.location.LocationBuilder.DUNGEON_TEMPLATES) Dungeon(eidolons.game.battlecraft.logic.dungeon.universal.Dungeon) DungeonMaster(eidolons.game.battlecraft.logic.dungeon.universal.DungeonMaster)

Example 4 with Dungeon

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;
}
Also used : Dungeon(eidolons.game.battlecraft.logic.dungeon.universal.Dungeon)

Example 5 with Dungeon

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);
    }
}
Also used : LocationBuilder(eidolons.game.battlecraft.logic.dungeon.location.LocationBuilder) ObjType(main.entity.type.ObjType) DungeonPlan(eidolons.game.battlecraft.logic.dungeon.location.building.DungeonPlan) Dungeon(eidolons.game.battlecraft.logic.dungeon.universal.Dungeon)

Aggregations

Dungeon (eidolons.game.battlecraft.logic.dungeon.universal.Dungeon)16 LocationBuilder (eidolons.game.battlecraft.logic.dungeon.location.LocationBuilder)4 DungeonPlan (eidolons.game.battlecraft.logic.dungeon.location.building.DungeonPlan)4 ObjType (main.entity.type.ObjType)4 File (java.io.File)2 Ref (main.entity.Ref)2 Coordinates (main.game.bf.Coordinates)2 Color (com.badlogic.gdx.graphics.Color)1 EndGameEffect (eidolons.ability.effects.special.meta.EndGameEffect)1 Structure (eidolons.entity.obj.Structure)1 DUNGEON_TEMPLATES (eidolons.game.battlecraft.logic.dungeon.location.LocationBuilder.DUNGEON_TEMPLATES)1 DungeonMaster (eidolons.game.battlecraft.logic.dungeon.universal.DungeonMaster)1 ENTRANCE_LAYOUT (eidolons.game.module.dungeoncrawl.dungeon.DungeonLevelMaster.ENTRANCE_LAYOUT)1 Location (eidolons.game.module.dungeoncrawl.dungeon.Location)1 BufferedImage (java.awt.image.BufferedImage)1 ArrayList (java.util.ArrayList)1 Abilities (main.ability.Abilities)1 ActiveAbility (main.ability.ActiveAbility)1 COLOR_THEME (main.content.CONTENT_CONSTS.COLOR_THEME)1 SUBDUNGEON_TYPE (main.content.enums.DungeonEnums.SUBDUNGEON_TYPE)1