use of eidolons.game.module.adventure.faction.Faction in project Eidolons by IDemiurge.
the class WorldGenerator method generateFactions.
private static void generateFactions() {
for (String sub : StringMaster.openContainer(world.getProperty(MACRO_PROPS.FACTIONS))) {
boolean me = world.checkProperty(MACRO_PROPS.PLAYER_FACTION, sub);
ObjType type = DataManager.getType(sub, MACRO_OBJ_TYPES.FACTIONS);
FLAG_COLOR color = new EnumMaster<FLAG_COLOR>().retrieveEnumConst(FLAG_COLOR.class, type.getProperty(PROPS.FLAG_COLOR));
if (color == null)
color = FLAG_COLOR.BROWN;
DC_Player player = new DC_Player(sub, color, type.getProperty(G_PROPS.EMBLEM), type.getProperty(G_PROPS.IMAGE), me ? ALLEGIENCE.ALLY : ALLEGIENCE.ENEMY);
Faction faction = new Faction(type, player);
game.addFaction(faction);
if (me)
game.setPlayerFaction(faction);
}
}
use of eidolons.game.module.adventure.faction.Faction in project Eidolons by IDemiurge.
the class WorldGenerator method createParty.
private static MacroParty createParty(MacroRef ref, String s) {
Coordinates coordinates = new Coordinates(true, Integer.valueOf(VariableManager.getVar(s, 0)), Integer.valueOf(VariableManager.getVar(s, 1)));
String string = (VariableManager.getVar(s, 2));
Faction faction = null;
if (StringMaster.isEmpty(string)) {
faction = game.getPlayerFaction();
} else if (string.equalsIgnoreCase("player")) {
Party party = DC_Game.game.getMetaMaster().getPartyManager().getParty();
if (party == null) {
return null;
}
MacroParty playerParty = new MacroParty(getMacroPartyType(party), game, ref, party);
game.setPlayerParty(playerParty);
playerParty.setFaction(game.getPlayerFaction());
playerParty.setCoordinates(coordinates);
return playerParty;
} else
faction = game.getFaction(string);
String name = VariableManager.removeVarPart(s);
MacroParty party = new MacroParty(DataManager.getType(name, DC_TYPE.PARTY), ref.getGame(), ref);
party.setCoordinates(coordinates);
party.setFaction(faction);
party.setOriginalOwner(faction.getOwner());
party.setOwner(faction.getOwner());
return party;
}
Aggregations