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);
}
}
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()));
}
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);
}
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;
}
Aggregations