Search in sources :

Example 11 with Place

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

the class MacroTimeMaster method processMapObjects.

private void processMapObjects() {
    Coordinates c = MacroGame.getGame().getPlayerParty().getCoordinates();
    for (Place place : MacroGame.getGame().getState().getPlaces()) {
        MAP_OBJ_INFO_LEVEL infoLevel = MAP_OBJ_INFO_LEVEL.UNKNOWN;
        if (place.getCoordinates().dst(c) < 500) {
            infoLevel = MAP_OBJ_INFO_LEVEL.KNOWN;
            place.setDetected(true);
        }
        place.setInfoLevel(infoLevel);
    }
// for (MacroParty party : MacroGame.getGame().getState().getParties()) {
// if (party.getCurrentDestination() == null)
// continue;
// TravelManager.travel(delta);
// TravelMaster.travel(party, delta);
// }
}
Also used : MAP_OBJ_INFO_LEVEL(eidolons.game.module.adventure.map.MapVisionMaster.MAP_OBJ_INFO_LEVEL) Coordinates(main.game.bf.Coordinates) Place(eidolons.game.module.adventure.map.Place)

Example 12 with Place

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

the class WorldGenerator method createPlace.

private static Place createPlace(MacroRef ref, String s) {
    s = formatPointVarString(s);
    String typeName = VariableManager.removeVarPart(s);
    ObjType t = DataManager.getType(typeName, MACRO_OBJ_TYPES.PLACE);
    if (t == null) {
        return null;
    }
    Place place = new Place(game, t, ref);
    if (VariableManager.getVarPart(s).contains("-")) {
        Coordinates c = new Coordinates(true, VariableManager.getVarPart(s));
        place.setCoordinates(c);
    } else {
        place.resetCoordinates();
    }
    // DungeonMaster.generateDungeonsForPlace(place);
    return place;
}
Also used : ObjType(main.entity.type.ObjType) Coordinates(main.game.bf.Coordinates) Place(eidolons.game.module.adventure.map.Place)

Example 13 with Place

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

the class WorldGenerator method createRegion.

public static Region createRegion(ObjType type, MacroRef ref) {
    // template
    // add places, towns and routes
    region = new Region(game, type, ref);
    // init default towns/places ; then add randomized
    for (String s : StringMaster.open(region.getProperty(MACRO_PROPS.AREAS))) {
        type = DataManager.getType(s, MACRO_OBJ_TYPES.AREA);
        Area area = new Area(ref.getGame(), type, ref);
        region.getAreas().add(area);
    }
    for (String s : StringMaster.open(region.getProperty(MACRO_PROPS.PARTIES))) {
        try {
            MacroParty party = createParty(ref, s);
            region.addParty(party);
        } catch (Exception e) {
            main.system.ExceptionMaster.printStackTrace(e);
        }
    }
    for (String s : StringMaster.open(region.getProperty(MACRO_PROPS.PLACES))) {
        Place place = createPlace(ref, s);
        if (place != null)
            region.addPlace(place);
    }
    for (String s : StringMaster.open(region.getProperty(MACRO_PROPS.TOWNS))) {
        Town town = createTown(ref, s);
        region.addTown(town);
    }
    generateRoutes();
    return region;
/*
         * r.getProperty(MACRO_PROPS.PLACES) Places - Power level ++ will be
		 * appearing as the game progresses
		 * 
		 * Routes - there should be at least 1 between each 2 places as
		 * "default" (preset) and then we can generate additional randomized
		 * routes For non-preset Places, we can use some metrics...
		 */
}
Also used : Area(eidolons.game.module.adventure.map.Area) MacroParty(eidolons.game.module.adventure.entity.MacroParty) Town(eidolons.game.module.adventure.town.Town) Region(eidolons.game.module.adventure.map.Region) Place(eidolons.game.module.adventure.map.Place)

Example 14 with Place

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

the class MapObjStage method bindEvents.

protected void bindEvents() {
    GuiEventManager.bind(CREATE_PARTY, param -> {
        MacroParty party = (MacroParty) param.get();
        if (party == null) {
            return;
        }
        PartyActor partyActor = PartyActorFactory.getParty(party);
        addActor(partyActor);
        if (party.isMine()) {
            setMainParty(party);
            setMainPartyActor(partyActor);
            MapScreen.getInstance().getGuiStage().setMainPartyMarker(PartyActorFactory.getParty(party));
        }
        parties.add(partyActor);
        wanderAi.update();
    });
    GuiEventManager.bind(CREATE_PLACE, param -> {
        Place place = (Place) param.get();
        PlaceActor placeActor = PlaceActorFactory.getPlace(place);
        addActor(placeActor);
        places.add(placeActor);
    });
    GuiEventManager.bind(REMOVE_MAP_OBJ, param -> {
        MapActor actor = (MapActor) param.get();
        actor.remove();
        wanderAi.update();
    });
}
Also used : MacroParty(eidolons.game.module.adventure.entity.MacroParty) Place(eidolons.game.module.adventure.map.Place)

Example 15 with Place

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

the class TravelMasterOld method getAvailablePlaces.

public static Set<Place> getAvailablePlaces(MacroParty party) {
    Set<Place> list = new HashSet<>();
    // via available routes! across Areas...
    Set<Route> routes = getAvailableRoutes(party);
    for (Route r : routes) {
        // if (r.getDestination())
        list.add(r.getDestination());
        list.add(r.getOrigin());
    }
    return list;
}
Also used : Place(eidolons.game.module.adventure.map.Place) Route(eidolons.game.module.adventure.map.Route) HashSet(java.util.HashSet)

Aggregations

Place (eidolons.game.module.adventure.map.Place)16 Route (eidolons.game.module.adventure.map.Route)6 MacroParty (eidolons.game.module.adventure.entity.MacroParty)5 Coordinates (main.game.bf.Coordinates)3 Region (eidolons.game.module.adventure.map.Region)2 Vector2 (com.badlogic.gdx.math.Vector2)1 MacroRef (eidolons.game.module.adventure.MacroRef)1 Area (eidolons.game.module.adventure.map.Area)1 MAP_OBJ_INFO_LEVEL (eidolons.game.module.adventure.map.MapVisionMaster.MAP_OBJ_INFO_LEVEL)1 Town (eidolons.game.module.adventure.town.Town)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 ObjType (main.entity.type.ObjType)1