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();
// }
}
}
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));
}
}
}
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;
}
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;
}
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));
}
}
Aggregations