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