Search in sources :

Example 26 with ObjType

use of main.entity.type.ObjType in project Eidolons by IDemiurge.

the class HqShop method initItems.

private void initItems() {
    items = new ArrayList<>();
    if (isPreset()) {
        items = DataManager.toTypeList(StringMaster.openContainer(getProperty(PROPS.SHOP_ITEMS)), C_OBJ_TYPE.ITEMS);
        return;
    }
    List<ObjType> templates = DataManager.toTypeList(StringMaster.openContainer(getProperty(PROPS.SHOP_ITEM_TEMPLATES)), C_OBJ_TYPE.ITEMS);
    items = getItemsFromTemplates(templates);
    if (getShopType() == null)
        return;
    // addStandardItems(); then randomize
    PROPERTY prop = getShopType().getFilterProp();
    int i = 0;
    String[] item_groups = getShopType().getItem_groups();
    for (String group : item_groups) {
        List<ObjType> pool;
        if (prop == null) {
            pool = DataManager.toTypeList(DataManager.getTypesSubGroupNames(C_OBJ_TYPE.ITEMS, group), C_OBJ_TYPE.ITEMS);
        } else {
            pool = ItemGenerator.getBaseTypes(C_OBJ_TYPE.ITEMS);
            FilterMaster.filter(pool, new PropCondition(prop, group));
        }
        pool = constructPool(pool);
        pool.addAll(getSpecialItems(group));
        i++;
        if (!isRandomized()) {
            for (ObjType item : pool) {
                buyItem(item, 0);
            }
            // buyAll();
            continue;
        }
        // 
        goldToSpend = (100 - spareGold - i * 5) / item_groups.length;
        // some params from Shop ObjType?
        Loop.startLoop(ShopMaster.getMaxItemsPerGroup(this));
        while (!Loop.loopEnded() && !pool.isEmpty()) {
            int randomListIndex = RandomWizard.getRandomListIndex(pool);
            ObjType t = pool.get(randomListIndex);
            if (t == null) {
                continue;
            }
            if (!buyItem(t)) {
                // second loop based on cheapest items?
                break;
            }
        }
    }
}
Also used : ObjType(main.entity.type.ObjType) PROPERTY(main.content.values.properties.PROPERTY) PropCondition(main.elements.conditions.PropCondition)

Example 27 with ObjType

use of main.entity.type.ObjType in project Eidolons by IDemiurge.

the class SkirmishMaster method chooseSkirmish.

public static void chooseSkirmish() {
    // generated mission types?
    // DataManager.getTypesSubGroup(MACRO_OBJ_TYPES.MISSIONS, SKIRMISH);
    // this will be on EDT, so choosing can be same thread, but waiting for
    // result on another
    ChoiceMaster.chooseTypeNewThread(MACRO_OBJ_TYPES.MISSION, DataManager.getTypesGroup(MACRO_OBJ_TYPES.MISSION, "Skirmish"), "Choose Skirmish to Fight in", null, null);
    new Thread(new Runnable() {

        public void run() {
            ObjType type = (ObjType) WaitMaster.waitForInput(WAIT_OPERATIONS.SELECTION);
            if (type != null) {
                File file = FileManager.getFile(type.getProperty(MACRO_PROPS.ROOT_LEVEL));
                if (!file.isFile()) {
                    return;
                }
            // Dungeon dungeon = DungeonBuilder.buildDungeon(FileManager.readFile(file));
            // initSkirmish(type, dungeon);
            // Launcher.resetView(VIEWS.MENU);
            } else {
                Launcher.getMainManager().exitToMainMenu();
            }
        }
    }, " thread").start();
// String name = ListChooser.chooseType(MACRO_OBJ_TYPES.MISSIONS,
// "Skirmish");
// if (type == null)
// Launcher.getMainManager().exitToMainMenu();
// else
// // ObjType type = DataManager.getType(name,
// MACRO_OBJ_TYPES.MISSIONS);
// {
// skirmish = new Skirmish(type,
// type.getProperty(MACRO_PROPS.LEVEL_PATH));
// Launcher.resetView(VIEWS.MENU);
// }
}
Also used : ObjType(main.entity.type.ObjType) File(java.io.File)

Example 28 with ObjType

use of main.entity.type.ObjType in project Eidolons by IDemiurge.

the class ContentGenerator method adjustParties.

public static void adjustParties() {
    for (ObjType type : DataManager.getTypes(DC_TYPE.PARTY)) {
        ObjType leader = DataManager.getType(type.getProperty(PROPS.LEADER), DC_TYPE.CHARS);
        if (leader == null) {
            List<String> members = StringMaster.openContainer(type.getProperty(PROPS.MEMBERS));
            if (members.isEmpty()) {
                continue;
            }
            leader = DataManager.getType(members.get(0), DC_TYPE.CHARS);
            if (leader == null) {
                continue;
            }
            type.setProperty(PROPS.LEADER, leader.getName());
        }
        type.setImage(leader.getImagePath());
    }
}
Also used : ObjType(main.entity.type.ObjType)

Example 29 with ObjType

use of main.entity.type.ObjType in project Eidolons by IDemiurge.

the class PlaceholderGenerator method generate.

public static void generate() {
    /*
        unit subgroups
         */
    for (UNIT_GROUP group : UnitEnums.UNIT_GROUP.values()) {
        for (String sub : StringMaster.openContainer(group.getSubgroups(), ",")) {
            for (PLACEHOLDER_AI_TYPE aiType : PLACEHOLDER_AI_TYPE.values()) {
                ObjType type = generate(group, sub, aiType.name());
                type.setProperty(PROPS.AI_TYPE, aiType.name());
            }
            for (PLACEHOLDER_POWER power : PLACEHOLDER_POWER.values()) {
                generate(group, sub, power.name());
            }
        }
    }
}
Also used : ObjType(main.entity.type.ObjType) UNIT_GROUP(main.content.enums.entity.UnitEnums.UNIT_GROUP)

Example 30 with ObjType

use of main.entity.type.ObjType in project Eidolons by IDemiurge.

the class HT_View method adjustLink.

public void adjustLink(Boolean vertical_horizontal_manual, HT_Node node) {
    ObjType type = node.getType();
    LINK_VARIANT variant = null;
    if (tree.getMap().getLinkForChildType(type) != null) {
        variant = tree.getMap().getLinkForChildType(type).getVariant();
    }
    if (variant == null || vertical_horizontal_manual == null) {
        variant = new EnumMaster<LINK_VARIANT>().retrieveEnumConst(LINK_VARIANT.class, new ListChooser(SELECTION_MODE.SINGLE, LINK_VARIANT.class).choose());
    } else {
        variant = HT_MapBuilder.getShiftedLinkVariant(variant, vertical_horizontal_manual);
    }
    if (variant == null) {
        LogMaster.log(1, type + "'s LINK_VARIANT null !!! ");
        return;
    }
    type.setProperty(PROPS.LINK_VARIANT, variant.toString());
    if (!CoreEngine.isArcaneVault()) {
        XML_Writer.writeXML_ForType(type, isSkill() ? DC_TYPE.SKILLS : DC_TYPE.CLASSES);
    }
    LogMaster.log(1, type + "'s LINK_VARIANT set for " + variant);
    rebuildAndSetTree();
}
Also used : ObjType(main.entity.type.ObjType) EnumMaster(main.system.auxiliary.EnumMaster) LINK_VARIANT(eidolons.client.cc.gui.neo.tree.logic.TreeMap.LINK_VARIANT) ListChooser(main.swing.generic.components.editors.lists.ListChooser)

Aggregations

ObjType (main.entity.type.ObjType)354 ArrayList (java.util.ArrayList)42 Coordinates (main.game.bf.Coordinates)30 Ref (main.entity.Ref)25 Unit (eidolons.entity.obj.unit.Unit)24 OBJ_TYPE (main.content.OBJ_TYPE)18 PROPERTY (main.content.values.properties.PROPERTY)18 DC_TYPE (main.content.DC_TYPE)16 PARAMETER (main.content.values.parameters.PARAMETER)16 File (java.io.File)15 Entity (main.entity.Entity)12 XLinkedMap (main.data.XLinkedMap)11 EnumMaster (main.system.auxiliary.EnumMaster)11 DC_SpellObj (eidolons.entity.active.DC_SpellObj)9 MATERIAL (main.content.enums.entity.ItemEnums.MATERIAL)9 Obj (main.entity.obj.Obj)9 QUALITY_LEVEL (main.content.enums.entity.ItemEnums.QUALITY_LEVEL)8 MusicList (main.music.entity.MusicList)8 Wave (eidolons.game.battlecraft.logic.battle.arena.Wave)6 C_OBJ_TYPE (main.content.C_OBJ_TYPE)6