Search in sources :

Example 6 with DC_Game

use of eidolons.game.core.game.DC_Game in project Eidolons by IDemiurge.

the class Simulation method init.

public static void init(boolean testmode) {
    game = new DC_Game(true);
    game.init();
    if (testmode) {
        return;
    }
    CharacterCreator.setGame(getGame());
    CharacterCreator.init();
}
Also used : DC_Game(eidolons.game.core.game.DC_Game)

Example 7 with DC_Game

use of eidolons.game.core.game.DC_Game in project Eidolons by IDemiurge.

the class CombatScriptExecutor method doUnitOperation.

private boolean doUnitOperation(COMBAT_SCRIPT_FUNCTION function, Ref ref, String[] args) {
    int i = 0;
    Unit unit = (Unit) ref.getObj(args[0]);
    if (unit == null) {
        String name = args[i];
        if (DataManager.isTypeName(name))
            i++;
        else
            name = null;
        if (unit == null) {
            Boolean power = null;
            Boolean distance = null;
            Boolean ownership = null;
            unit = ((DC_Game) ref.getGame()).getMaster().getUnitByName(name, ref, ownership, distance, power);
        }
    }
    // options - annihilate, ...
    switch(function) {
        case COMMENT:
            return doComment(unit, args[i]);
        case REMOVE:
            return doRemove(unit);
        case KILL:
            return doKill(unit);
    }
    return false;
}
Also used : DC_Game(eidolons.game.core.game.DC_Game) Unit(eidolons.entity.obj.unit.Unit)

Example 8 with DC_Game

use of eidolons.game.core.game.DC_Game in project Eidolons by IDemiurge.

the class Loader method loadNewGame.

public static DC_Game loadNewGame(String savePath) {
    String data = FileManager.readFile(savePath);
    DC_Game game = GameFactory.createGame(GAME_SUBCLASS.TEST);
    Node dungeonNode = XML_Converter.findNode(data, Saver.DUNGEON_NODE);
    initDungeon(dungeonNode);
    game.init();
    // initFlags(); dungeon is not set!
    game.battleInit();
    loadGame(data);
    game.start(true);
    return game;
}
Also used : Node(org.w3c.dom.Node) DC_Game(eidolons.game.core.game.DC_Game)

Example 9 with DC_Game

use of eidolons.game.core.game.DC_Game in project Eidolons by IDemiurge.

the class Loader method createObjects.

private static List<Obj> createObjects(List<String> objectNodes) {
    DC_Game game = DC_Game.game;
    List<Obj> objects = new ArrayList<>();
    // TODO ID ORDER MUST BE PRESERVED! put in parameter?
    for (String typesNode : objectNodes) {
        Document node = XML_Converter.getDoc(typesNode);
        DC_TYPE TYPE = DC_TYPE.getType(node.getNodeName());
        for (Node subNode : XML_Converter.getNodeList(node)) {
            String sub = XML_Converter.getStringFromXML(subNode);
            game.setIdManager(new DC_IdManager(game));
            Map<PROPERTY, String> props = getPropsFromNode(sub);
            Map<PARAMETER, String> params = getParamsFromNode(sub);
            ObjType type = DataManager.getType(subNode.getNodeName(), TYPE);
            // preset ID?! init containers by id... including buffs; but first create them
            Ref ref = new Ref(game);
            Node refNode = XML_Converter.findNode(sub, Saver.OBJ_NODE);
            if (refNode != null)
                for (String substring : StringMaster.open(refNode.getTextContent())) {
                    ref.setValue(KEYS.valueOf(substring.split("=")[0].toUpperCase()), substring.split("=")[1]);
                }
            String ownerName = null;
            DC_Player owner = game.getBattleMaster().getPlayerManager().getPlayer(// property?
            ownerName);
            if (owner == null) {
                owner = DC_Player.NEUTRAL;
            }
            Coordinates c = new Coordinates(params.get(G_PARAMS.POS_X) + "-" + params.get(G_PARAMS.POS_Y));
            Obj object = createObj(type, c.x, c.y, owner, game, ref);
            object.getPropMap().putAll(props);
            object.getParamMap().putAll(params);
            object.setId(StringMaster.getInteger(props.get(G_PROPS.ID)));
            objects.add(object);
            init(object);
        }
    }
    return objects;
}
Also used : DC_TYPE(main.content.DC_TYPE) PROPERTY(main.content.values.properties.PROPERTY) Node(org.w3c.dom.Node) Coordinates(main.game.bf.Coordinates) ArrayList(java.util.ArrayList) DC_Game(eidolons.game.core.game.DC_Game) Document(org.w3c.dom.Document) DC_Player(eidolons.game.battlecraft.logic.battle.universal.DC_Player) Ref(main.entity.Ref) DC_IdManager(eidolons.entity.DC_IdManager) ObjType(main.entity.type.ObjType) DC_WeaponObj(eidolons.entity.item.DC_WeaponObj) DC_QuickItemObj(eidolons.entity.item.DC_QuickItemObj) DC_BuffObj(eidolons.entity.obj.attach.DC_BuffObj) DC_FeatObj(eidolons.entity.obj.attach.DC_FeatObj) DC_JewelryObj(eidolons.entity.item.DC_JewelryObj) DC_SpellObj(eidolons.entity.active.DC_SpellObj) Obj(main.entity.obj.Obj) DC_ArmorObj(eidolons.entity.item.DC_ArmorObj) PARAMETER(main.content.values.parameters.PARAMETER)

Example 10 with DC_Game

use of eidolons.game.core.game.DC_Game in project Eidolons by IDemiurge.

the class XlsMaster method main.

public static void main(String[] args) {
    String types = "units;";
    for (DC_TYPE type : TYPES) {
        types += type.getName() + ";";
    }
    CoreEngine.setSelectivelyReadTypes(types);
    // args[0];
    String path = "Y:\\Google Drive\\Project Eidolons\\content\\";
    String filename = path + "content.xls";
    DC_Engine.mainMenuInit();
    int i = 0;
    HSSFWorkbook workbook = new HSSFWorkbook();
    new DC_Game();
    for (DC_TYPE TYPE : TYPES) {
        PARAMS[] params = PARAM_ARRAYS[i];
        String[] formulas = FORMULA_ARRAYS[i];
        createSheet(workbook, TYPE, GROUPS_ARRAYS[i], params, formulas);
        i++;
    }
    try {
        FileOutputStream fileOut = new FileOutputStream(filename);
        workbook.write(fileOut);
        fileOut.close();
    } catch (IOException e) {
        main.system.ExceptionMaster.printStackTrace(e);
    }
    System.out.println("Content excel file has been generated!");
}
Also used : DC_TYPE(main.content.DC_TYPE) FileOutputStream(java.io.FileOutputStream) DC_Game(eidolons.game.core.game.DC_Game) PARAMS(eidolons.content.PARAMS) IOException(java.io.IOException) HSSFWorkbook(org.apache.poi.hssf.usermodel.HSSFWorkbook)

Aggregations

DC_Game (eidolons.game.core.game.DC_Game)14 Unit (eidolons.entity.obj.unit.Unit)5 Ref (main.entity.Ref)3 DC_SpellObj (eidolons.entity.active.DC_SpellObj)2 DC_ArmorObj (eidolons.entity.item.DC_ArmorObj)2 DC_JewelryObj (eidolons.entity.item.DC_JewelryObj)2 DC_QuickItemObj (eidolons.entity.item.DC_QuickItemObj)2 DC_WeaponObj (eidolons.entity.item.DC_WeaponObj)2 DC_BuffObj (eidolons.entity.obj.attach.DC_BuffObj)2 DC_FeatObj (eidolons.entity.obj.attach.DC_FeatObj)2 GameLauncher (eidolons.game.core.launch.GameLauncher)2 ScreenData (eidolons.libgdx.screens.ScreenData)2 DC_TYPE (main.content.DC_TYPE)2 Obj (main.entity.obj.Obj)2 ObjType (main.entity.type.ObjType)2 Node (org.w3c.dom.Node)2 PARAMS (eidolons.content.PARAMS)1 DC_IdManager (eidolons.entity.DC_IdManager)1 DC_Obj (eidolons.entity.obj.DC_Obj)1 DC_Player (eidolons.game.battlecraft.logic.battle.universal.DC_Player)1