use of main.content.enums.entity.ItemEnums.QUALITY_LEVEL in project Eidolons by IDemiurge.
the class ShopView method getFilterConditions.
@Override
protected Condition getFilterConditions() {
// non-enchanted jewelry permitted to enchant manually?
// new NotCondition(
// new StringComparison(StringMaster.getValueRef
// (KEYS.MATCH, PROPS.MAGICAL_ITEM_TRAIT), "", true));
OrConditions specialConditions = new OrConditions(ConditionMaster.getTYPECondition(DC_TYPE.JEWELRY), new Conditions(new NotCondition(new StringComparison("{MATCH_" + G_PROPS.QUALITY_LEVEL + "}", "", true)), ConditionMaster.getTYPECondition(DC_TYPE.ITEMS)));
Conditions conditions = new Conditions(new NotCondition(new StringComparison("{MATCH_" + G_PROPS.MATERIAL + "}", "", true)));
Conditions qualityConditions = new OrConditions();
for (QUALITY_LEVEL quality : getQualityLevels()) {
qualityConditions.add(new StringComparison(StringMaster.getValueRef(KEYS.MATCH, G_PROPS.QUALITY_LEVEL), StringMaster.getWellFormattedString(quality.toString()), true));
}
conditions.add(qualityConditions);
return new OrConditions(specialConditions, conditions);
}
use of main.content.enums.entity.ItemEnums.QUALITY_LEVEL 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;
}
use of main.content.enums.entity.ItemEnums.QUALITY_LEVEL 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;
}
use of main.content.enums.entity.ItemEnums.QUALITY_LEVEL in project Eidolons by IDemiurge.
the class ItemGenerator method init.
public void init() {
// if (!basicMode)
ContentGenerator.initMaterials();
if (!isGenerationOn()) {
return;
}
for (QUALITY_LEVEL q : ItemEnums.QUALITY_LEVEL.values()) {
ConcurrentMap qMap = new ConcurrentMap<>();
itemMaps.put(q, qMap);
for (MATERIAL m : ItemEnums.MATERIAL.values()) {
qMap.put(m, new ConcurrentMap<>());
}
}
baseWeaponTypes.addAll(DataManager.getTypes(DC_TYPE.WEAPONS));
baseArmorTypes.addAll(DataManager.getTypes(DC_TYPE.ARMOR));
baseJewelryTypes.addAll(DataManager.getTypes(DC_TYPE.JEWELRY));
baseItemTypes.addAll(DataManager.getTypes(DC_TYPE.ITEMS));
// baseGarmentTypes.addAll(DataManager.getTypes(OBJ_TYPES.GARMENT));
DataManager.setBaseGarmentTypes(baseGarmentTypes.toArray(new ObjType[baseGarmentTypes.size()]));
DataManager.setBaseWeaponTypes(baseWeaponTypes.toArray(new ObjType[baseWeaponTypes.size()]));
DataManager.setBaseArmorTypes(baseArmorTypes.toArray(new ObjType[baseArmorTypes.size()]));
DataManager.setBaseJewelryTypes(baseJewelryTypes.toArray(new ObjType[baseJewelryTypes.size()]));
DataManager.setBaseItemTypes(baseItemTypes.toArray(new ObjType[baseItemTypes.size()]));
// basicGenerator = new ItemGenerator(true);
try {
// (isBasicMode() ? basicGenerator : defaultGenerator).
generateItemObjTypes();
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
}
DataManager.setItemMaps(itemMaps);
}
use of main.content.enums.entity.ItemEnums.QUALITY_LEVEL in project Eidolons by IDemiurge.
the class UnitShop method checkQualityRange.
private static boolean checkQualityRange(ObjType type, Unit unit) {
if (type.getOBJ_TYPE_ENUM() == DC_TYPE.JEWELRY) {
return true;
}
if (type.getOBJ_TYPE_ENUM() == DC_TYPE.ITEMS) {
return true;
}
String itemProperty = type.getProperty(G_PROPS.QUALITY_LEVEL);
String property = unit.getProperty(PROPS.QUALITY_LEVEL_RANGE);
if (property.isEmpty()) {
property = DEFAULT_QUALITY_RANGE;
}
if (!property.contains(StringMaster.CONTAINER_SEPARATOR)) {
return property.equalsIgnoreCase(itemProperty);
}
QUALITY_LEVEL quality = ItemEnums.QUALITY_LEVEL.valueOf(StringMaster.getEnumFormat(itemProperty));
int index = Arrays.asList(ItemEnums.QUALITY_LEVEL.values()).indexOf(quality);
List<String> range = StringMaster.openContainer(property);
int min = Arrays.asList(ItemEnums.QUALITY_LEVEL.values()).indexOf(ItemEnums.QUALITY_LEVEL.valueOf(StringMaster.getEnumFormat(range.get(0))));
int max = -1;
try {
max = Arrays.asList(ItemEnums.QUALITY_LEVEL.values()).indexOf(ItemEnums.QUALITY_LEVEL.valueOf(StringMaster.getEnumFormat(range.get(1))));
} catch (Exception e) {
}
if (max == -1) {
max = min;
}
return !(index < min || index > max);
}
Aggregations