Search in sources :

Example 6 with Route

use of eidolons.game.module.adventure.map.Route in project Eidolons by IDemiurge.

the class TravelMasterOld method newTurn.

public static void newTurn() {
    for (MacroParty party : MacroGame.getGame().getParties()) {
        if (party.getStatus() != MACRO_STATUS.TRAVELING) {
            return;
        }
        // party.newTurn(); already done
        Route route = party.getCurrentRoute();
        if (route == null) {
            continue;
        }
        // TODO perhaps travel PER HOUR with a mini-message with progress
        // updates... although if 'nothing happens', it certainly should be
        // skippable
        travel(party, route);
        MacroManager.refreshGui();
    // while (TimeMaster.hoursLeft() > 1) {
    // if (!travel(party, route, 1))
    // break;
    // // TODO reduce Vigor gradually... notify and ask - linked stuff,
    // // possible discoveries (less likely than explore mode but
    // // still... maybe it should be *the same* just with different
    // // stats!
    // MacroManager.refreshGui();
    // }
    }
}
Also used : MacroParty(eidolons.game.module.adventure.entity.MacroParty) Route(eidolons.game.module.adventure.map.Route)

Example 7 with Route

use of eidolons.game.module.adventure.map.Route in project Eidolons by IDemiurge.

the class WorldGenerator method generateRoutes.

private static void generateRoutes() {
    // TODO external routes
    String property = region.getProperty(MACRO_PROPS.INTERNAL_ROUTES);
    for (String routeTypeName : StringMaster.open(property)) {
        ObjType routeType = DataManager.getType(routeTypeName, MACRO_OBJ_TYPES.ROUTE);
        Route r;
        try {
            r = createRoute(routeType);
        } catch (Exception e) {
            main.system.ExceptionMaster.printStackTrace(e);
            continue;
        }
        region.addRoute(r);
    }
    // }
    for (Route r : region.getRoutes()) {
        for (String p : StringMaster.open(r.getProperty(MACRO_PROPS.LINKED_PLACES))) {
            r.addLinkedPlace(region.getPlace(p));
        }
        for (String p : StringMaster.open(r.getProperty(MACRO_PROPS.LINKED_TOWNS))) {
            r.addLinkedTown(region.getTown(p));
        }
        for (String p : StringMaster.open(r.getProperty(MACRO_PROPS.LINKED_ROUTES))) {
            r.addLinkedRoute(region.getRoute(p));
        }
    }
}
Also used : ObjType(main.entity.type.ObjType) Route(eidolons.game.module.adventure.map.Route)

Example 8 with Route

use of eidolons.game.module.adventure.map.Route in project Eidolons by IDemiurge.

the class WorldGenerator method createRoute.

private static Route createRoute(ObjType t) {
    Route r = new Route(game, t, region.getRef());
    Place orig = region.getPlace(r.getProperty(MACRO_PROPS.ORIGIN));
    orig.addRoute(r);
    Place dest = region.getPlace(r.getProperty(MACRO_PROPS.DESTINATION));
    dest.addRoute(r);
    r.setOrigin(orig);
    r.setDestination(dest);
    r.setParam(MACRO_PARAMS.ROUTE_LENGTH, TravelMasterOld.calculateRouteLength(r), true);
    return r;
}
Also used : Route(eidolons.game.module.adventure.map.Route) Place(eidolons.game.module.adventure.map.Place)

Example 9 with Route

use of eidolons.game.module.adventure.map.Route in project Eidolons by IDemiurge.

the class WorldGenerator method createRoute.

private static Route createRoute(String origin, String destination, ObjType t) {
    Route r = new Route(game, t, region.getRef(), region.getPlace(origin), region.getPlace(destination));
    region.getPlace(origin).getRoutes().add(r);
    region.getPlace(destination).getRoutes().add(r);
    r.setParam(MACRO_PARAMS.ROUTE_LENGTH, TravelMasterOld.calculateRouteLength(r), true);
    return r;
}
Also used : Route(eidolons.game.module.adventure.map.Route)

Example 10 with Route

use of eidolons.game.module.adventure.map.Route in project Eidolons by IDemiurge.

the class RouteMaster method afterInit.

public void afterInit() {
    for (Route sub : MacroGame.getGame().getRoutes()) {
        String point = sub.getDestinationPoint();
        sub.setDestination(MacroGame.getGame().getManager().getPlaceForPoint(point));
        point = sub.getOriginPoint();
        sub.setOrigin(MacroGame.getGame().getManager().getPlaceForPoint(point));
    }
}
Also used : Route(eidolons.game.module.adventure.map.Route)

Aggregations

Route (eidolons.game.module.adventure.map.Route)14 Place (eidolons.game.module.adventure.map.Place)6 MacroParty (eidolons.game.module.adventure.entity.MacroParty)3 ObjType (main.entity.type.ObjType)2 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)1 Actor (com.badlogic.gdx.scenes.scene2d.Actor)1 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)1 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)1 NinePatchDrawable (com.badlogic.gdx.scenes.scene2d.utils.NinePatchDrawable)1 Area (eidolons.game.module.adventure.map.Area)1 ValueContainer (eidolons.libgdx.gui.generic.ValueContainer)1 TablePanel (eidolons.libgdx.gui.panels.TablePanel)1 PlaceActor (eidolons.libgdx.screens.map.obj.PlaceActor)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 Coordinates (main.game.bf.Coordinates)1