use of eidolons.game.module.adventure.travel.MacroGroup in project Eidolons by IDemiurge.
the class AreaManager method getRandomCreepGroup.
// TODO pass MIN_MAX !
private static MacroGroup getRandomCreepGroup(Area area) {
Loop.startLoop(10);
while (!Loop.loopEnded()) {
ENCOUNTER_SUBGROUP group = new RandomWizard<ENCOUNTER_SUBGROUP>().getObjectByWeight(area.getProperty(MACRO_PROPS.ENCOUNTER_SUBGROUPS), // TODO
ENCOUNTER_SUBGROUP.class);
List<ObjType> pool;
if (group != null) {
pool = DataManager.getTypesSubGroup(DC_TYPE.ENCOUNTERS, group.toString());
} else // TODO
{
pool = DataManager.getTypes(DC_TYPE.ENCOUNTERS);
}
FilterMaster.filterByParam(pool, PARAMS.POWER_MINIMUM, EncounterMaster.getMaxCreepWavePower(), DC_TYPE.ENCOUNTERS, false);
FilterMaster.filterByParam(pool, PARAMS.POWER_MAXIMUM, EncounterMaster.getMinCreepWavePower(), DC_TYPE.ENCOUNTERS, true);
// more filter! By TYPE? TODO
if (pool.isEmpty()) {
continue;
}
// higher probability for non-bosses?
String waveName = new RandomWizard<ObjType>().getRandomListItem(pool).getName();
MacroGroup macroGroup = new MacroGroup(waveName, area);
return macroGroup;
}
return null;
}
use of eidolons.game.module.adventure.travel.MacroGroup in project Eidolons by IDemiurge.
the class AreaManager method newTurn.
// how to figure out which groups got killed in a skirmish?
public static void newTurn() {
// danger_level -> newGroup
for (Region region : MacroManager.getRegions()) {
for (Area area : region.getAreas()) {
area.modifyParameter(MACRO_PARAMS.AREA_CREEP_POWER_TOTAL, TimeMaster.getHoursPerTurn() * area.getIntParam(MACRO_PARAMS.CREEP_POWER_PER_HOUR));
checkAddGroups(area);
for (MacroGroup group : area.getGroups()) {
if (group.isAmbushing()) {
// preCheck continue;
} else {
if (!group.checkSetAmbush()) {
group.wander();
}
}
}
}
}
}
use of eidolons.game.module.adventure.travel.MacroGroup in project Eidolons by IDemiurge.
the class AreaManager method addRandomGroup.
private static void addRandomGroup(Area area) {
MacroGroup group = getRandomCreepGroup(area);
if (group == null) {
return;
}
addGroup(area, group);
Boolean min_max_normal = null;
area.modifyParameter(MACRO_PARAMS.AREA_CREEP_POWER_TOTAL, EncounterMaster.getPower(group.getEncounterType(), min_max_normal));
}
Aggregations