Search in sources :

Example 1 with Faction

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);
    }
}
Also used : ObjType(main.entity.type.ObjType) FLAG_COLOR(main.system.graphics.ColorManager.FLAG_COLOR) DC_Player(eidolons.game.battlecraft.logic.battle.universal.DC_Player) Faction(eidolons.game.module.adventure.faction.Faction)

Example 2 with 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;
}
Also used : Party(eidolons.client.cc.logic.party.Party) MacroParty(eidolons.game.module.adventure.entity.MacroParty) MacroParty(eidolons.game.module.adventure.entity.MacroParty) Coordinates(main.game.bf.Coordinates) Faction(eidolons.game.module.adventure.faction.Faction)

Aggregations

Faction (eidolons.game.module.adventure.faction.Faction)2 Party (eidolons.client.cc.logic.party.Party)1 DC_Player (eidolons.game.battlecraft.logic.battle.universal.DC_Player)1 MacroParty (eidolons.game.module.adventure.entity.MacroParty)1 ObjType (main.entity.type.ObjType)1 Coordinates (main.game.bf.Coordinates)1 FLAG_COLOR (main.system.graphics.ColorManager.FLAG_COLOR)1