Search in sources :

Example 1 with MacroGroup

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;
}
Also used : MacroGroup(eidolons.game.module.adventure.travel.MacroGroup) ObjType(main.entity.type.ObjType) RandomWizard(main.system.auxiliary.RandomWizard) ENCOUNTER_SUBGROUP(main.content.enums.EncounterEnums.ENCOUNTER_SUBGROUP)

Example 2 with MacroGroup

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();
                    }
                }
            }
        }
    }
}
Also used : Area(eidolons.game.module.adventure.map.Area) MacroGroup(eidolons.game.module.adventure.travel.MacroGroup) Region(eidolons.game.module.adventure.map.Region)

Example 3 with MacroGroup

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));
}
Also used : MacroGroup(eidolons.game.module.adventure.travel.MacroGroup)

Aggregations

MacroGroup (eidolons.game.module.adventure.travel.MacroGroup)3 Area (eidolons.game.module.adventure.map.Area)1 Region (eidolons.game.module.adventure.map.Region)1 ENCOUNTER_SUBGROUP (main.content.enums.EncounterEnums.ENCOUNTER_SUBGROUP)1 ObjType (main.entity.type.ObjType)1 RandomWizard (main.system.auxiliary.RandomWizard)1