Search in sources :

Example 1 with ItemGenerator

use of eidolons.client.cc.logic.items.ItemGenerator in project Eidolons by IDemiurge.

the class ContainerMaster method generateJewelry.

private List<ObjType> generateJewelry(ITEM_RARITY rarity, List<ObjType> group) {
    ItemGenerator generator = ItemGenerator.getDefaultGenerator();
    JEWELRY_ITEM_TRAIT[] traits = getJewelryTraits(rarity);
    MAGICAL_ITEM_LEVEL[] levels = getJewelryLevels(rarity);
    for (ObjType sub : new ArrayList<>(group)) for (MAGICAL_ITEM_LEVEL level : levels) for (JEWELRY_ITEM_TRAIT trait : traits) group.add(generator.getOrCreateJewelry(sub, trait, level));
    return group;
}
Also used : JEWELRY_ITEM_TRAIT(eidolons.content.DC_CONSTS.JEWELRY_ITEM_TRAIT) ObjType(main.entity.type.ObjType) ItemGenerator(eidolons.client.cc.logic.items.ItemGenerator) MAGICAL_ITEM_LEVEL(eidolons.content.DC_CONSTS.MAGICAL_ITEM_LEVEL)

Example 2 with ItemGenerator

use of eidolons.client.cc.logic.items.ItemGenerator in project Eidolons by IDemiurge.

the class ContainerMaster method generateTypes.

private List<ObjType> generateTypes(CONTAINER_CONTENTS c, ITEM_RARITY rarity, List<ObjType> group) {
    if (c == CONTAINER_CONTENTS.POTIONS || group.get(0).getGroup().equalsIgnoreCase("Alchemy")) {
        return DataManager.getTypesGroup(DC_TYPE.ITEMS, "Alchemy");
    // return DataManager.gettype;
    }
    if (c == CONTAINER_CONTENTS.JEWELRY || group.get(0).getOBJ_TYPE_ENUM() == DC_TYPE.JEWELRY) {
        if (!ItemGenerator.isJewelryOn())
            return null;
        return generateJewelry(rarity, group);
    }
    ItemGenerator generator = ItemGenerator.getDefaultGenerator();
    MATERIAL[] materials = getMaterials(rarity);
    QUALITY_LEVEL[] qualityLevels = getQualityLevels(rarity);
    for (ObjType type : new ArrayList<>(group)) {
        if (type.isGenerated()) {
            continue;
        }
        for (MATERIAL material : materials) {
            if (!ItemMaster.checkMaterial(type, material))
                continue;
            for (QUALITY_LEVEL quality : qualityLevels) {
                boolean weapon = type.getOBJ_TYPE_ENUM() == DC_TYPE.WEAPONS;
                String name = ItemGenerator.generateName(quality, material, type);
                ObjType newType = DataManager.getType(name, type.getOBJ_TYPE());
                if (newType == null)
                    newType = generator.generateItem(weapon, quality, material, type);
                group.add(newType);
            }
        }
    }
    return group;
}
Also used : ObjType(main.entity.type.ObjType) ItemGenerator(eidolons.client.cc.logic.items.ItemGenerator) QUALITY_LEVEL(main.content.enums.entity.ItemEnums.QUALITY_LEVEL) MATERIAL(main.content.enums.entity.ItemEnums.MATERIAL)

Aggregations

ItemGenerator (eidolons.client.cc.logic.items.ItemGenerator)2 ObjType (main.entity.type.ObjType)2 JEWELRY_ITEM_TRAIT (eidolons.content.DC_CONSTS.JEWELRY_ITEM_TRAIT)1 MAGICAL_ITEM_LEVEL (eidolons.content.DC_CONSTS.MAGICAL_ITEM_LEVEL)1 MATERIAL (main.content.enums.entity.ItemEnums.MATERIAL)1 QUALITY_LEVEL (main.content.enums.entity.ItemEnums.QUALITY_LEVEL)1