Search in sources :

Example 1 with MATERIAL

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

the class DataManager method getItemType.

private static ObjType getItemType(String typeName, OBJ_TYPE obj_type) {
    ObjType type = getBaseItemType(typeName, obj_type);
    if (type != null) {
        return type;
    }
    if (obj_type.equals(DC_TYPE.JEWELRY)) {
        // main.system.auxiliary.log.LogMaster.log(log,"NO JEWELRY!  "  );
        return null;
    }
    int i = 0;
    List<String> parts = StringMaster.openContainer(typeName, " ");
    String qualityName = parts.get(0);
    QUALITY_LEVEL q = new EnumMaster<QUALITY_LEVEL>().retrieveEnumConst(QUALITY_LEVEL.class, qualityName);
    if (q == null) {
        q = ItemEnums.QUALITY_LEVEL.NORMAL;
    } else {
        i++;
    }
    String materialName = parts.get(i);
    MATERIAL m = new EnumMaster<MATERIAL>().retrieveEnumConst(MATERIAL.class, materialName);
    while (m == null) {
        i++;
        if (i > parts.size() - 1) {
            return null;
        }
        materialName += " " + parts.get(i);
        m = new EnumMaster<MATERIAL>().retrieveEnumConst(MATERIAL.class, materialName);
    }
    String baseTypeName = "";
    for (int a = i; a <= parts.size() - 1; a++) {
        baseTypeName += parts.get(a) + " ";
    }
    ObjType baseType = getBaseItemType(baseTypeName, obj_type);
    // int j = 0;
    // if (baseType == null) {
    // baseType = getBaseItemType(parts.get(parts.size() - 2) + " "
    // + baseTypeName, obj_type);
    // j++;
    // }
    // typeName.replace(baseTypeName, "");
    // materialName = typeName.replace(qualityName, "");
    // while (parts.size() - i > j) {
    // materialName += parts.get(i) + " ";
    // i++;
    // }
    Map<MATERIAL, Map<ObjType, ObjType>> map = itemMaps.get(q);
    Map<ObjType, ObjType> map2 = map.get(m);
    return map2.get(baseType);
}
Also used : ObjType(main.entity.type.ObjType) EnumMaster(main.system.auxiliary.EnumMaster) QUALITY_LEVEL(main.content.enums.entity.ItemEnums.QUALITY_LEVEL) MATERIAL(main.content.enums.entity.ItemEnums.MATERIAL)

Example 2 with MATERIAL

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

the class UnitShop method specialCheck.

private static boolean specialCheck(Unit unit, ObjType type) {
    if (type.getOBJ_TYPE_ENUM() == DC_TYPE.JEWELRY) {
        // TODO
        return true;
    }
    if (type.getOBJ_TYPE_ENUM() == DC_TYPE.ITEMS) {
        // TODO
        return true;
    }
    String property = unit.getProperty(PROPS.ALLOWED_MATERIAL);
    if (property.isEmpty()) {
        SHOP_LEVEL shopLevel = SHOP_LEVEL.COMMON;
        if (unit.getLevel() > 5) {
            shopLevel = SHOP_LEVEL.QUALITY;
        }
        if (unit.getLevel() > 8) {
            shopLevel = SHOP_LEVEL.OPULENT;
        }
        if (unit.getLevel() < 3) {
            shopLevel = SHOP_LEVEL.POOR;
        }
        List<MATERIAL> levelMaterials = ShopMaster.getMaterialsForShopLevel(shopLevel);
        property = StringMaster.constructStringContainer(levelMaterials);
    }
    return StringMaster.compare(type.getProperty(G_PROPS.MATERIAL), property, false);
}
Also used : SHOP_LEVEL(main.content.CONTENT_CONSTS2.SHOP_LEVEL) MATERIAL(main.content.enums.entity.ItemEnums.MATERIAL)

Example 3 with MATERIAL

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

the class DurabilityRule method physicalDamage.

public static int physicalDamage(int damage, int blocked, DAMAGE_TYPE damage_type, DC_HeroSlotItem armor, DC_WeaponObj weapon, boolean simulation) {
    int self_damage_mod = armor.getIntParam(DC_ContentManager.getArmorSelfDamageParamForDmgType(damage_type));
    if (!RuleMaster.isRuleOn(RULE.DURABILITY))
        self_damage_mod = 0;
    else if (self_damage_mod == 0)
        self_damage_mod = 100;
    // new EnumMaster<ENUM>().retrieveEnumConst(ENUM.class, )
    MATERIAL m1 = armor.getMaterial();
    MATERIAL m2 = weapon.getMaterial();
    int armor_vs_weapon = m1.getHardness() - m2.getHardness();
    int armor_amount = blocked * self_damage_mod / 100;
    armor_amount = MathMaster.addFactor(armor_amount, armor_vs_weapon);
    DurabilityReductionEffect durabilityReductionEffect = new DurabilityReductionEffect(false, armor_amount);
    durabilityReductionEffect.setSimulation(simulation);
    Ref ref = Ref.getSelfTargetingRefCopy(armor);
    ref.setID(KEYS.WEAPON, weapon.getId());
    if (armor_amount > 0)
        durabilityReductionEffect.apply(ref);
    self_damage_mod = weapon.getIntParam(DC_ContentManager.getArmorSelfDamageParamForDmgType(damage_type));
    int weapon_amount = blocked * self_damage_mod / 100;
    weapon_amount = MathMaster.addFactor(weapon_amount, armor_vs_weapon);
    durabilityReductionEffect = new DurabilityReductionEffect(true, weapon_amount);
    durabilityReductionEffect.setSimulation(simulation);
    durabilityReductionEffect.apply(Ref.getSelfTargetingRefCopy(weapon));
    return durabilityReductionEffect.getDurabilityLost();
}
Also used : DurabilityReductionEffect(eidolons.ability.effects.oneshot.rule.DurabilityReductionEffect) Ref(main.entity.Ref) MATERIAL(main.content.enums.entity.ItemEnums.MATERIAL)

Example 4 with MATERIAL

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

the class ArcadeManager method generateMaterialQualityForRegion.

public Condition generateMaterialQualityForRegion(ARCADE_REGION region) {
    Conditions c = new Conditions();
    MATERIAL[] materials = new MATERIAL[0];
    QUALITY_LEVEL[] qualities = new QUALITY_LEVEL[0];
    // TODO and what about jewelry?
    switch(region) {
        case DUSK_DALE:
            break;
        case GREYLEAF_WOODS:
            break;
        case WRAITH_MARSHES:
            break;
        case MISTY_SHORES:
            break;
        case BLIGHTSTONE_DESERT:
            qualities = new QUALITY_LEVEL[] { ItemEnums.QUALITY_LEVEL.ANCIENT, ItemEnums.QUALITY_LEVEL.OLD, ItemEnums.QUALITY_LEVEL.MASTERPIECE };
            materials = new MATERIAL[] { ItemEnums.MATERIAL.ADAMANTIUM };
            break;
    }
    OrConditions mC = new OrConditions();
    OrConditions qC = new OrConditions();
    for (MATERIAL m : materials) {
        mC.add(new StringComparison(StringMaster.getValueRef(KEYS.MATCH, G_PROPS.MATERIAL), m.getName(), true));
    }
    for (QUALITY_LEVEL q : qualities) {
        mC.add(new StringComparison(StringMaster.getValueRef(KEYS.MATCH, G_PROPS.QUALITY_LEVEL), q.getName(), true));
    }
    c.add(mC);
    c.add(qC);
    return c;
}
Also used : OrConditions(main.elements.conditions.OrConditions) StringComparison(main.elements.conditions.StringComparison) QUALITY_LEVEL(main.content.enums.entity.ItemEnums.QUALITY_LEVEL) Conditions(main.elements.conditions.Conditions) OrConditions(main.elements.conditions.OrConditions) MATERIAL(main.content.enums.entity.ItemEnums.MATERIAL)

Example 5 with MATERIAL

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

the class ItemGenerator method generateCloaks.

private void generateCloaks() {
    List<MATERIAL> materials = new ArrayList<>();
    materials.addAll(Arrays.asList(DEFAULT_MATERIALS_CLOTH));
    materials.addAll(Arrays.asList(DEFAULT_MATERIALS_SKINS));
    for (ObjType type : DataManager.getTypesSubGroup(DC_TYPE.GARMENT, ItemEnums.GARMENT_TYPE.BOOTS + "")) {
        for (QUALITY_LEVEL q : ItemEnums.QUALITY_LEVEL.values()) {
            for (MATERIAL m : materials) {
            // generateItem_(quality, material, type)
            }
        }
    }
}
Also used : ObjType(main.entity.type.ObjType) ArrayList(java.util.ArrayList) QUALITY_LEVEL(main.content.enums.entity.ItemEnums.QUALITY_LEVEL) 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