Search in sources :

Example 11 with Dungeon

use of eidolons.game.battlecraft.logic.dungeon.universal.Dungeon in project Eidolons by IDemiurge.

the class ScenarioPrecombatMaster method generateLocation.

private static void generateLocation() {
    location = new Location(getScenario());
    Dungeon dungeon = location.construct();
// DC_Game.game.getDungeonMaster().setDungeon(dungeon);
}
Also used : Dungeon(eidolons.game.battlecraft.logic.dungeon.universal.Dungeon) Location(eidolons.game.module.dungeoncrawl.dungeon.Location)

Example 12 with Dungeon

use of eidolons.game.battlecraft.logic.dungeon.universal.Dungeon in project Eidolons by IDemiurge.

the class ObjectiveMaster method initObjectiveTrigger.

public static void initObjectiveTrigger(OBJECTIVE_TYPE type, String data, Location mission) {
    Dungeon dungeon = mission.getBossLevel();
    objectiveData = data;
    STANDARD_EVENT_TYPE eventType = null;
    Conditions conditions = new Conditions();
    Abilities abilities = new Abilities();
    abilities.add(new ActiveAbility(new FixedTargeting(), new EndGameEffect(true)));
    Ref ref = new Ref();
    Integer id = null;
    String name;
    switch(type) {
        case BOSS:
            eventType = STANDARD_EVENT_TYPE.UNIT_HAS_BEEN_KILLED;
            Coordinates c = DC_ObjInitializer.getCoordinatesFromObjString(objectiveData);
            // new Coordinates(s);
            name = DC_ObjInitializer.getNameFromObjString(objectiveData);
            // conditions.add(new ObjComparison(KEY, KEYS.TARGET.toString()));
            break;
        case CAPTURE_HOLD:
            // "As long as
            break;
        case SURVIVE_TIME:
            break;
        case ESCAPE:
            // eventType = STANDARD_EVENT_TYPE.UNIT_GONE_THRU_ENTRANCE;
            break;
        case ITEM:
            break;
    }
    // some objectives will be initialized on a condition, e.g. capture-hold
    addTrigger(eventType, conditions, abilities);
}
Also used : ActiveAbility(main.ability.ActiveAbility) Ref(main.entity.Ref) Abilities(main.ability.Abilities) FixedTargeting(main.elements.targeting.FixedTargeting) Dungeon(eidolons.game.battlecraft.logic.dungeon.universal.Dungeon) STANDARD_EVENT_TYPE(main.game.logic.event.Event.STANDARD_EVENT_TYPE) EndGameEffect(eidolons.ability.effects.special.meta.EndGameEffect) Coordinates(main.game.bf.Coordinates) Conditions(main.elements.conditions.Conditions)

Example 13 with Dungeon

use of eidolons.game.battlecraft.logic.dungeon.universal.Dungeon in project Eidolons by IDemiurge.

the class IlluminationMaster method getIllumination.

public Integer getIllumination(Unit source, DC_Obj target) {
    Integer illumination = 0;
    if (source == master.getSeeingUnit()) {
        illumination = cache.get(target);
        if (illumination != null) {
            return illumination;
        }
    }
    Ref ref = new Ref(source);
    ref.setMatch(target.getId());
    if (target.getVisibilityLevel() == VISIBILITY_LEVEL.BLOCKED) {
        // master.getSightMaster().getClearShotCondition().preCheck(ref)
        // cache.put(target, -1);
        // return -1;
        illumination = 0;
    } else
        illumination = target.getIntParam(PARAMS.ILLUMINATION);
    Dungeon dungeon = source.getGame().getDungeon();
    illumination += target.getIntParam(PARAMS.LIGHT_EMISSION) / 2;
    if (dungeon != null) {
        illumination = Math.max(illumination, dungeon.getGlobalIllumination());
        globalIllumination = dungeon.getGlobalIllumination() / 5;
    }
    // universal
    illumination += globalIllumination;
    if (illumination <= 0)
        return illumination;
    double ilMod;
    double distance = PositionMaster.getExactDistance(source.getCoordinates(), target.getCoordinates());
    // from 200 to 25 on diff of 8 to -5
    // def sight range of 5, I'd say
    Integer sight = source.getSightRangeTowards(target);
    // sight*=2; //TODO NEW
    double diff = sight - distance;
    if (diff < 0) {
        ilMod = 100 + diff * 100 / ClearShotCondition.SIGHT_RANGE_FACTOR;
    // - diff * diff * 2
    } else {
        // + Math.sqrt(diff * 65)));
        ilMod = (100 + (diff * 12));
    }
    ilMod = Math.min(ilMod, 300);
    ilMod = Math.max(ilMod, 1);
    // TODO DISTANCE FACTOR?
    illumination = (int) Math.round(illumination * ilMod / 100);
    cache.put(target, illumination);
    return illumination;
}
Also used : Ref(main.entity.Ref) Dungeon(eidolons.game.battlecraft.logic.dungeon.universal.Dungeon)

Example 14 with Dungeon

use of eidolons.game.battlecraft.logic.dungeon.universal.Dungeon in project Eidolons by IDemiurge.

the class Location method newSublevel.

private Dungeon newSublevel(Dungeon dungeon, ObjType type, int z, int level, ENTRANCE_LAYOUT entranceLayout) {
    ObjType dungeonType = new ObjType(type);
    if (level != 0) {
        dungeonType.setName(type.getName() + ", Level " + level);
    }
    String group = type.getSubGroupingKey();
    String path = PathFinder.getDungeonLevelFolder() + group + "\\";
    File file = FileManager.getRandomFile(path);
    String data = FileManager.readFile(file);
    DungeonPlan plan = new LocationBuilder().loadDungeonMap(data);
    adjustPlanToEntrance(plan, entranceLayout, file.getName());
    new LocationBuilder().transformDungeonPlan(plan);
    Dungeon sublevel = new Dungeon(dungeonType);
    // dungeon.getSubLevels().add(sublevel);
    return sublevel;
}
Also used : ObjType(main.entity.type.ObjType) LocationBuilder(eidolons.game.battlecraft.logic.dungeon.location.LocationBuilder) DungeonPlan(eidolons.game.battlecraft.logic.dungeon.location.building.DungeonPlan) Dungeon(eidolons.game.battlecraft.logic.dungeon.universal.Dungeon) File(java.io.File)

Example 15 with Dungeon

use of eidolons.game.battlecraft.logic.dungeon.universal.Dungeon in project Eidolons by IDemiurge.

the class WanderAi method getMaxWanderTotalDistance.

public static int getMaxWanderTotalDistance(GroupAI group, GOAL_TYPE type) {
    Boolean x_y_diag = !group.getWanderDirection().isVertical();
    if (group.getWanderDirection().isDiagonal()) {
        x_y_diag = null;
    }
    Dungeon dungeon = group.getLeader().getGame().getDungeon();
    switch(type) {
        case SEARCH:
        // keep the distance from the *target*, not origin...
        case STALK:
    }
    // group.getLeader().getGame().getDungeon().getCellsX()
    if (x_y_diag == null) {
        return (int) Math.round(Math.sqrt(dungeon.getSquare()) * getDistanceFactor(type, group));
    }
    if (x_y_diag) {
        return Math.round(dungeon.getCellsX() * getDistanceFactor(type, group));
    }
    return Math.round(dungeon.getCellsY() * getDistanceFactor(type, group));
// TODO maybe the block, the zone? Whole dungeon could be huge... or
// small...
}
Also used : Dungeon(eidolons.game.battlecraft.logic.dungeon.universal.Dungeon)

Aggregations

Dungeon (eidolons.game.battlecraft.logic.dungeon.universal.Dungeon)16 LocationBuilder (eidolons.game.battlecraft.logic.dungeon.location.LocationBuilder)4 DungeonPlan (eidolons.game.battlecraft.logic.dungeon.location.building.DungeonPlan)4 ObjType (main.entity.type.ObjType)4 File (java.io.File)2 Ref (main.entity.Ref)2 Coordinates (main.game.bf.Coordinates)2 Color (com.badlogic.gdx.graphics.Color)1 EndGameEffect (eidolons.ability.effects.special.meta.EndGameEffect)1 Structure (eidolons.entity.obj.Structure)1 DUNGEON_TEMPLATES (eidolons.game.battlecraft.logic.dungeon.location.LocationBuilder.DUNGEON_TEMPLATES)1 DungeonMaster (eidolons.game.battlecraft.logic.dungeon.universal.DungeonMaster)1 ENTRANCE_LAYOUT (eidolons.game.module.dungeoncrawl.dungeon.DungeonLevelMaster.ENTRANCE_LAYOUT)1 Location (eidolons.game.module.dungeoncrawl.dungeon.Location)1 BufferedImage (java.awt.image.BufferedImage)1 ArrayList (java.util.ArrayList)1 Abilities (main.ability.Abilities)1 ActiveAbility (main.ability.ActiveAbility)1 COLOR_THEME (main.content.CONTENT_CONSTS.COLOR_THEME)1 SUBDUNGEON_TYPE (main.content.enums.DungeonEnums.SUBDUNGEON_TYPE)1