Search in sources :

Example 1 with Town

use of eidolons.game.module.adventure.town.Town in project Eidolons by IDemiurge.

the class WorldGenerator method createTown.

private static Town createTown(MacroRef ref, String s) {
    s = formatPointVarString(s);
    ObjType t = DataManager.getType(VariableManager.removeVarPart(s), MACRO_OBJ_TYPES.TOWN);
    Town town = new Town(game, t, ref);
    if (VariableManager.getVarPart(s).contains("-")) {
        Coordinates c = new Coordinates(true, VariableManager.getVarPart(s));
        town.setCoordinates(c);
    } else {
        town.resetCoordinates();
    }
    return town;
}
Also used : ObjType(main.entity.type.ObjType) Town(eidolons.game.module.adventure.town.Town) Coordinates(main.game.bf.Coordinates)

Example 2 with Town

use of eidolons.game.module.adventure.town.Town 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 3 with Town

use of eidolons.game.module.adventure.town.Town in project Eidolons by IDemiurge.

the class RestMasterOld method applyMacroMode.

public static void applyMacroMode(MacroParty party) {
    mod = 100;
    one_mod = 100;
    vig_mod = 100;
    // TODO from area! or place...
    hp_mod = 100;
    if (party.getTown() != null) {
        Town town = party.getTown();
        for (Tavern t : town.getTaverns()) {
            // t.getProperty(MACRO_PROPS.ROOM_TYPE);
            if (t.getIntParam(MACRO_PARAMS.RENT_DURATION) > 0) {
                // apply mods from Room
                mod = t.getIntParam(MACRO_PARAMS.ROOM_QUALITY_MOD);
                one_mod = t.getIntParam(MACRO_PARAMS.ROOM_QUALITY_MOD);
                vig_mod = t.getIntParam(MACRO_PARAMS.ROOM_QUALITY_MOD);
                hp_mod = t.getIntParam(MACRO_PARAMS.ROOM_QUALITY_MOD);
            }
        }
    }
    for (Unit hero : party.getMembers()) {
        RestMasterOld.applyMacroMode(hero);
    }
}
Also used : Town(eidolons.game.module.adventure.town.Town) Unit(eidolons.entity.obj.unit.Unit) Tavern(eidolons.game.module.adventure.town.Tavern)

Aggregations

Town (eidolons.game.module.adventure.town.Town)3 Unit (eidolons.entity.obj.unit.Unit)1 MacroParty (eidolons.game.module.adventure.entity.MacroParty)1 Area (eidolons.game.module.adventure.map.Area)1 Place (eidolons.game.module.adventure.map.Place)1 Region (eidolons.game.module.adventure.map.Region)1 Tavern (eidolons.game.module.adventure.town.Tavern)1 ObjType (main.entity.type.ObjType)1 Coordinates (main.game.bf.Coordinates)1