Search in sources :

Example 6 with MATERIAL

use of main.content.enums.entity.ItemEnums.MATERIAL in project Eidolons by IDemiurge.

the class ItemGenerator method generateItemType.

@Override
public ObjType generateItemType(String typeName, OBJ_TYPE type) {
    if (type == (DC_TYPE.JEWELRY)) {
        if (ItemGenerator.isJewelryOn())
            return generateJewelry(typeName);
        return null;
    }
    if (type == (DC_TYPE.ITEMS)) {
    // return getOrCreateItem(typeName);
    }
    // TODO generic C_TYPE for armor?
    boolean weapon = type.equals(DC_TYPE.WEAPONS);
    // String baseTypeName = typeName;
    String name = StringMaster.getFirstItem(typeName, " ");
    QUALITY_LEVEL quality = new EnumMaster<QUALITY_LEVEL>().retrieveEnumConst(QUALITY_LEVEL.class, name);
    if (quality != null)
        typeName = typeName.replace(quality.toString(), "").trim();
    else
        quality = QUALITY_LEVEL.NORMAL;
    name = StringMaster.getFirstItem(typeName, " ");
    MATERIAL material = new EnumMaster<MATERIAL>().retrieveEnumConst(MATERIAL.class, name, true, false);
    if (material == null) {
        name = name + StringMaster.getFirstItem(typeName.replace(name, "").trim(), " ");
        material = new EnumMaster<MATERIAL>().retrieveEnumConst(MATERIAL.class, name);
    }
    if (material == null) {
        return null;
    }
    typeName = typeName.replace(material.toString(), "").trim();
    ObjType baseType = DataManager.getType(typeName, type, true);
    if (baseType == null)
        return null;
    return generateItem(weapon, quality, material, baseType);
}
Also used : EnumMaster(main.system.auxiliary.EnumMaster) ObjType(main.entity.type.ObjType) QUALITY_LEVEL(main.content.enums.entity.ItemEnums.QUALITY_LEVEL) MATERIAL(main.content.enums.entity.ItemEnums.MATERIAL)

Example 7 with MATERIAL

use of main.content.enums.entity.ItemEnums.MATERIAL in project Eidolons by IDemiurge.

the class ShopMaster method getMaterialsForShopLevel.

public static List<MATERIAL> getMaterialsForShopLevel(SHOP_LEVEL shopLevel) {
    int level = 0;
    switch(shopLevel) {
        case POOR:
            break;
        case COMMON:
            level = 1;
            break;
        case QUALITY:
            level = 2;
            break;
        case OPULENT:
            level = 3;
            break;
    }
    List<MATERIAL> list = new ArrayList<>();
    for (MATERIAL m : ItemEnums.MATERIAL.values()) {
        int material_level = 1;
        switch(m) {
            case CRYSTAL:
            case LIZARD_SKIN:
            case STEEL:
            case SILVER:
            case SILK:
            case BLACKWOOD:
            case BLACK_BONE:
                material_level = 2;
                break;
            case THIN_LEATHER:
            case COPPER:
            case COTTON:
            case RED_OAK:
            case ONYX:
                material_level = 0;
                break;
            case TROLL_SKIN:
            case ADAMANTIUM:
            case BILEWOOD:
            case BRIGHT_STEEL:
            case DARK_STEEL:
            case DEFILED_STEEL:
            case DEMON_STEEL:
            case DRAGONHIDE:
            case DRAGON_BONE:
            case ELDRITCH_STEEL:
            case FEYWOOD:
            case MAN_BONE:
            case METEORITE:
            case MITHRIL:
            case MOON_SILVER:
            case PALEWOOD:
            case PALE_STEEL:
            case PLATINUM:
            case WAILWOOD:
            case WARP_STEEL:
            case WRAITH_STEEL:
            case STAR_EMBER:
            case SOULSTONE:
                material_level = 3;
                break;
            default:
                break;
        }
        if (material_level <= level) {
            list.add(m);
        }
    }
    return list;
}
Also used : ArrayList(java.util.ArrayList) MATERIAL(main.content.enums.entity.ItemEnums.MATERIAL)

Example 8 with MATERIAL

use of main.content.enums.entity.ItemEnums.MATERIAL 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)

Example 9 with MATERIAL

use of main.content.enums.entity.ItemEnums.MATERIAL in project Eidolons by IDemiurge.

the class DebugMaster method selectWeaponType.

private boolean selectWeaponType() {
    MATERIAL material = ItemEnums.MATERIAL.STEEL;
    // if (DialogMaster.confirm("Select material?"))
    QUALITY_LEVEL quality = ItemEnums.QUALITY_LEVEL.NORMAL;
    // if (DialogMaster.confirm("Select material?"))
    selectedType = DataManager.getItem(quality, material, ListChooser.chooseType(ItemGenerator.getBaseTypes(DC_TYPE.WEAPONS)));
    return selectedType != null;
}
Also used : QUALITY_LEVEL(main.content.enums.entity.ItemEnums.QUALITY_LEVEL) MATERIAL(main.content.enums.entity.ItemEnums.MATERIAL)

Example 10 with MATERIAL

use of main.content.enums.entity.ItemEnums.MATERIAL in project Eidolons by IDemiurge.

the class ItemGenerator method generateJewelry.

public void generateJewelry() {
    for (ObjType type : DataManager.getTypes(DC_TYPE.JEWELRY)) {
        boolean ring = ItemMaster.isRing(type);
        for (MATERIAL material : getJewelryMaterials(type.getProperty(G_PROPS.ITEM_MATERIAL_GROUP))) {
            ObjType newType = generateEmptyJewelryItem(ring, type, material);
            newType.setProperty(G_PROPS.JEWELRY_GROUP, DataManager.EMPTY);
            DataManager.addType(newType.getName(), DC_TYPE.JEWELRY, newType);
        }
    }
    for (JEWELRY_PASSIVE_ENCHANTMENT ench : JEWELRY_PASSIVE_ENCHANTMENT.values()) {
        boolean leveled = ench.isLeveled();
        List<ObjType> types;
        types = DataManager.toTypeList(// (leveled) ? PAS_LEVEL_JEWELRY:
        ench.getItemTypes(), DC_TYPE.JEWELRY);
        for (ObjType type : types) {
            // TODO      ObjType newType = generateJewelryPassiveEnchantment(ench, type, level);
            if (type.isGenerated()) {
                continue;
            }
            boolean ring = ItemMaster.isRing(type);
            if (ring) {
                if (!ench.isRing()) {
                    continue;
                }
            }
            if (!leveled) {
                ObjType newType = generateEmptyJewelryItem(ring, type, null);
                newType = generateJewelryItem(ring, newType, ench, null);
                newType.setProperty(G_PROPS.JEWELRY_GROUP, DataManager.ENCH);
                continue;
            }
            for (MAGICAL_ITEM_LEVEL level : MAGICAL_ITEM_LEVEL.values()) {
                ObjType newType = generateEmptyJewelryItem(ring, type, null);
                newType = generateJewelryItem(ring, newType, ench, level);
                newType.setProperty(G_PROPS.JEWELRY_GROUP, DataManager.ENCH);
            }
        }
    }
    for (JEWELRY_ITEM_TRAIT trait : JEWELRY_ITEM_TRAIT.values()) {
        // continue;
        for (ObjType type : DataManager.toTypeList(trait.getJewelryTypes(), DC_TYPE.JEWELRY)) {
            if (type.isGenerated()) {
                continue;
            }
            for (MAGICAL_ITEM_LEVEL level : MAGICAL_ITEM_LEVEL.values()) {
                boolean ring = ItemMaster.isRing(type);
                generateJewelryItem(type, trait, level);
            }
        }
    }
// MAGICAL_ITEM_TRAIT trait = MAGICAL_ITEM_TRAIT.ATTRIBUTE_BONUS;
// for (ObjType type : DataManager
// .convertToTypeList(ATTR_JEWELRY, OBJ_TYPES.JEWELRY)) {
// if (type.isGenerated())
// continue;
// for (MAGICAL_ITEM_LEVEL level : MAGICAL_ITEM_LEVEL.values()) {
// boolean ring = type
// .checkProperty(G_PROPS.JEWELRY_TYPE, JEWELRY_TYPE.RING
// + "");
// generateJewelryItem(ring, type, trait, level);
// }
// }
}
Also used : ObjType(main.entity.type.ObjType) MATERIAL(main.content.enums.entity.ItemEnums.MATERIAL)

Aggregations

MATERIAL (main.content.enums.entity.ItemEnums.MATERIAL)13 QUALITY_LEVEL (main.content.enums.entity.ItemEnums.QUALITY_LEVEL)8 ObjType (main.entity.type.ObjType)8 ArrayList (java.util.ArrayList)3 EnumMaster (main.system.auxiliary.EnumMaster)3 DurabilityReductionEffect (eidolons.ability.effects.oneshot.rule.DurabilityReductionEffect)1 ItemGenerator (eidolons.client.cc.logic.items.ItemGenerator)1 DC_HeroItemObj (eidolons.entity.item.DC_HeroItemObj)1 SHOP_LEVEL (main.content.CONTENT_CONSTS2.SHOP_LEVEL)1 ConcurrentMap (main.data.ConcurrentMap)1 Conditions (main.elements.conditions.Conditions)1 OrConditions (main.elements.conditions.OrConditions)1 StringComparison (main.elements.conditions.StringComparison)1 Ref (main.entity.Ref)1 RandomWizard (main.system.auxiliary.RandomWizard)1 WeightMap (main.system.datatypes.WeightMap)1