Search in sources :

Example 1 with ENCOUNTER_TYPE

use of main.content.enums.EncounterEnums.ENCOUNTER_TYPE in project Eidolons by IDemiurge.

the class ArenaBattleConstructor method constructWaveSequence.

public Map<Wave, Integer> constructWaveSequence(ENCOUNTER_TYPE[] encounter_sequence) {
    Integer round = getRoundNumber();
    if (SkirmishMaster.isSkirmish()) {
        return SkirmishMaster.constructWaveSequences(round);
    }
    Map<Wave, Integer> map = new XLinkedMap<>();
    if (alt != null) {
        alt = !alt;
    } else {
        alt = checkAltEncounter();
    }
    List<ObjType> waves = getWaveTypes(getDungeon().getType(), alt);
    List<ObjType> waveBuffer = new ArrayList<>(waves);
    for (ENCOUNTER_TYPE type : encounter_sequence) {
        if (waveBuffer.isEmpty()) {
            waveBuffer = DataManager.getTypesGroup(DC_TYPE.ENCOUNTERS, StringMaster.getWellFormattedString(type.toString()));
        }
        waves = new ArrayList<>(waveBuffer);
        Conditions conditions = new Conditions(getEncounterTypeCondition(type));
        List<ObjType> filteredWaves = new Filter<ObjType>(game, conditions).filter(waves);
        if (!filteredWaves.isEmpty()) {
            waves = filteredWaves;
        } else {
            continue;
        }
        ObjType waveType = getWaveType(waves, type);
        waveType = new ObjType(waveType);
        FACING_DIRECTION side = null;
        // getMaster().getDungeonMaster().getPositioner().nextSide();
        waveType.setProperty(PROPS.SPAWNING_SIDE, side.getName());
        Coordinates c = pickSpawnCoordinateForWave(type, round, waveType);
        Wave wave = new Wave(c, waveType, game, new Ref(game), game.getPlayer(false));
        wave.initUnitMap();
        map.put(wave, round);
        if (Eidolons.DEV_MODE) {
            game.getLogManager().logInfo(wave.toString() + " on round #" + round);
        }
        LogMaster.log(1, wave.toString() + " on round #" + round);
        // TODO subtract from
        round += getRoundsToFight(waveType, type);
    // total pool
    }
    setIndex(getIndex() + 1);
    return map;
}
Also used : XLinkedMap(main.data.XLinkedMap) ENCOUNTER_TYPE(main.content.enums.EncounterEnums.ENCOUNTER_TYPE) Coordinates(main.game.bf.Coordinates) ArrayList(java.util.ArrayList) Conditions(main.elements.conditions.Conditions) FACING_DIRECTION(main.game.bf.Coordinates.FACING_DIRECTION) Ref(main.entity.Ref) ObjType(main.entity.type.ObjType)

Example 2 with ENCOUNTER_TYPE

use of main.content.enums.EncounterEnums.ENCOUNTER_TYPE in project Eidolons by IDemiurge.

the class WaveAssembler method getPowerPercentage.

public int getPowerPercentage(Wave wave) {
    ENCOUNTER_TYPE TYPE = wave.getWaveType();
    int power = 0;
    switch(TYPE) {
        case BOSS:
            power = BOSS_POWER;
        case ELITE:
            power = ELITE_POWER;
        case REGULAR:
            power = REGULAR_POWER;
        case CONTINUOUS:
            break;
    }
    Integer mod = wave.getIntParam(PARAMS.POWER_MOD);
    if (mod == 0) {
        if (wave.getEncounterType() == EncounterEnums.ENCOUNTER_TYPE.BOSS) {
            mod = ENCOUNTER_DEFAULT_BOSS_POWER_MOD;
        } else {
            mod = 100;
        }
    }
    power = MathMaster.applyMod(power, mod);
    // dungeon = manager.getGame().getDungeonMaster().getDungeon();
    if (dungeon != null) {
        mod = dungeon.getIntParam(PARAMS.POWER_MOD);
        if (mod == 0) {
            if (dungeon.isBoss()) {
                mod = DUNGEON_DEFAULT_BOSS_POWER_MOD;
            } else {
                mod = 100;
            }
        }
        power = MathMaster.applyMod(power, mod);
    }
    return power;
}
Also used : ENCOUNTER_TYPE(main.content.enums.EncounterEnums.ENCOUNTER_TYPE)

Aggregations

ENCOUNTER_TYPE (main.content.enums.EncounterEnums.ENCOUNTER_TYPE)2 ArrayList (java.util.ArrayList)1 XLinkedMap (main.data.XLinkedMap)1 Conditions (main.elements.conditions.Conditions)1 Ref (main.entity.Ref)1 ObjType (main.entity.type.ObjType)1 Coordinates (main.game.bf.Coordinates)1 FACING_DIRECTION (main.game.bf.Coordinates.FACING_DIRECTION)1