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);
}
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);
}
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();
}
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;
}
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)
}
}
}
}
Aggregations