Search in sources :

Example 11 with DC_Game

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

the class Loader method initializeObjects.

private static void initializeObjects(List<Obj> objects) {
    DC_Game game = DC_Game.game;
    DC_GameState state = game.getState();
    for (Obj obj : objects) {
        state.addObject(obj);
    }
}
Also used : 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) DC_Game(eidolons.game.core.game.DC_Game)

Example 12 with DC_Game

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

the class AiTrainingResult method construct.

public void construct() {
    DC_Game game = DC_Game.game;
    Unit unit = game.getMaster().getUnitByName(parameters.getTraineeType().getName(), new Ref());
    unitStats = game.getBattleMaster().getStatManager().getStats().getUnitStatMap().get(unit);
    allyStats = game.getBattleMaster().getStatManager().getStats().getPlayerStats(unit.getOwner());
    allyStats = game.getBattleMaster().getStatManager().getStats().getPlayerStats(game.getPlayer(!unit.getOwner().isMe()));
}
Also used : Ref(main.entity.Ref) DC_Game(eidolons.game.core.game.DC_Game) Unit(eidolons.entity.obj.unit.Unit)

Example 13 with DC_Game

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

the class AiTrainer method runAiScenario.

private AiTrainingResult runAiScenario(String presetPath) {
    if (!AiTrainingRunner.evolutionTestMode) {
        RandomWizard.setAveraged(parameters.deterministic);
        if (parameters.getEnvironmentType() == TRAINING_ENVIRONMENT.PRESET) {
            new GameLauncher(GAME_SUBCLASS.TEST).launchPreset(presetPath);
        } else if (parameters.getEnvironmentType() == TRAINING_ENVIRONMENT.SAVE) {
            Loader.setPendingLoadPath(presetPath);
            DC_Game game = new GameLauncher(GAME_SUBCLASS.TEST).initDC_Game();
            game.start(true);
        } else if (parameters.getEnvironmentType() == TRAINING_ENVIRONMENT.DUNGEON_LEVEL) {
            GameLauncher a = new GameLauncher(GAME_SUBCLASS.SCENARIO);
            if (StringMaster.isEmpty(parameters.getPartyData())) {
                parameters.setPartyData(getDefaultPartyData());
            }
            a.PLAYER_PARTY = parameters.getPartyData();
            if (StringMaster.isEmpty(parameters.getDungeonData())) {
                parameters.setDungeonData(getDefaultDungeonData());
            }
            a.setDungeon(parameters.getDungeonData());
            DC_Game game = a.initGame();
            game.start(true);
        }
    }
    DC_Game.game.getAiManager().getPriorityProfileManager().setPriorityProfile(trainee, profile);
    boolean result = (boolean) WaitMaster.waitForInput(WAIT_OPERATIONS.GAME_FINISHED);
    if (!result) {
        throw new RuntimeException();
    }
    return evaluateResult(profile, parameters, criteria);
}
Also used : GameLauncher(eidolons.game.core.launch.GameLauncher) DC_Game(eidolons.game.core.game.DC_Game)

Example 14 with DC_Game

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

the class EncounterMaster method resolveEncounter.

public static boolean resolveEncounter(Encounter e) {
    // return outcome, what for? Fled, Surrendered
    Boolean choice = DialogMaster.askAndWait(getEncounterDescription(e), true, "Fight", "Flee", "Parlay");
    boolean result = false;
    if (choice == null) {
        result = parlay(e);
    } else {
        if (!choice) {
            result = flee(e);
        }
    }
    if (result) {
        return true;
    }
    encounterBeingResolved = true;
    // save macro game
    // DC_Game.game.getBattleManager().setEncounter(e);
    // DC_Game.game.getBattleManager().setEncounter(true);
    DC_Game game = DC_Game.game;
    // game.setPlayerParty(e.getDefendingParty().getMicroParty());
    // game.getDungeonMaster().initEncounterDungeon(e);
    // if (!game.isBattleInit()) {
    // game.battleInit();
    // }
    // game.getBattleManager().setEncounter(e);
    // game.getBattleMaster().getBattleConstructor().setEncounterSequence(getWaveSequence(e));
    // Launcher.launchDC(e.getDefendingParty().getName(), false);
    boolean outcome = (boolean) WaitMaster.waitForInput(WAIT_OPERATIONS.BATTLE_FINISHED);
    // game.getBattleManager().setEncounter(null);
    return outcome;
}
Also used : DC_Game(eidolons.game.core.game.DC_Game)

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