use of main.content.enums.EncounterEnums.ENCOUNTER_SUBGROUP 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;
}
Aggregations