use of delta.games.lotro.lore.items.ArmourType in project lotro-tools by dmorcellet.
the class ScalableItemsFinder method generateItems.
private Map<String, Item> generateItems() {
Map<String, Item> ret = new HashMap<String, Item>();
for (int i = 0; i < PREFIXES.length; i++) {
ItemQuality quality = PREFIX_QUALITY[i];
String prefix = PREFIXES[i];
for (String[] items : ITEMS) {
for (int j = 0; j < items.length; j++) {
String itemName = items[j];
EquipmentLocation location = null;
ArmourType armourType = null;
WeaponType weaponType = null;
if (items == JEWELS) {
location = JEWEL_LOCATIONS[j];
} else if (items == ARMOURS) {
location = ARMOUR_LOCATIONS[j];
armourType = ARMOUR_TYPES[j];
} else if (items == SHIELDS) {
location = EquipmentLocation.OFF_HAND;
armourType = SHIELD_TYPES[j];
} else if (items == WEAPONS) {
weaponType = WEAPON_TYPES[j];
location = weaponType.isRanged() ? EquipmentLocation.RANGED_ITEM : EquipmentLocation.MAIN_HAND;
}
for (String adjective : ADJECTIVES) {
for (String suffix : SUFFIXES) {
String name = generateName(prefix, adjective, itemName, suffix);
Item item = null;
if (armourType != null) {
Armour armour = new Armour();
armour.setArmourType(armourType);
item = armour;
} else if (weaponType != null) {
Weapon weapon = new Weapon();
weapon.setWeaponType(weaponType);
item = weapon;
} else {
item = new Item();
}
item.setName(name);
item.setQuality(quality);
item.setEquipmentLocation(location);
ret.put(name, item);
}
}
}
}
}
return ret;
}
use of delta.games.lotro.lore.items.ArmourType in project lotro-tools by dmorcellet.
the class ConsistencyChecks method consistencyChecks.
/**
* Perform consistency checks.
* @param items Items to use.
*/
public void consistencyChecks(List<Item> items) {
int nbMissingArmourValues = 0;
int nbMissingArmourTypes = 0;
int nbMissingWeaponTypes = 0;
int nbScalables = 0;
int nbFormulas = 0;
for (Item item : items) {
checkItemStats(item);
// Armours
if (item instanceof Armour) {
Armour armour = (Armour) item;
int armourValue = armour.getArmourValue();
if (armourValue == 0) {
nbMissingArmourValues++;
// System.out.println("No armour value for: " + name + " (" + id + ')');
}
ArmourType type = armour.getArmourType();
if (type == null) {
nbMissingArmourTypes++;
// System.out.println("No armour type for: " + name + " (" + id + ')');
}
}
// Weapons
if (item instanceof Weapon) {
Weapon weapon = (Weapon) item;
WeaponType type = weapon.getWeaponType();
if (type == null) {
nbMissingWeaponTypes++;
// System.out.println("No weapon type for: " + name + " (" + id + ')');
}
}
// Scalables
String scalingIds = item.getProperty(ItemPropertyNames.SCALING);
String slicedStats = item.getProperty(ItemPropertyNames.FORMULAS);
if (slicedStats != null) {
nbFormulas++;
if (scalingIds != null) {
nbScalables++;
_scalableItems.add(item);
if (item instanceof Armour) {
Armour armour = (Armour) item;
ArmourType type = armour.getArmourType();
if (type == null) {
System.out.println("No armour type for: " + item + " with formula: " + slicedStats);
}
}
}
}
}
System.out.println("Nb armours with missing armour type: " + nbMissingArmourTypes);
System.out.println("Nb armours with missing armour value: " + nbMissingArmourValues);
System.out.println("Nb weapons with missing type: " + nbMissingWeaponTypes);
System.out.println("Nb legendary items: " + _nbLegendaryItems);
System.out.println("Nb items with stats: " + _nbStats);
System.out.println("Nb items with missing stats: " + _nbMissingStats);
System.out.println("Nb items with formula: " + nbFormulas);
System.out.println("Nb scalable items: " + nbScalables);
// new ItemStatistics().showStatistics(_scalableItems);
}
Aggregations