Search in sources :

Example 16 with ArmourType

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;
}
Also used : Item(delta.games.lotro.lore.items.Item) ArmourType(delta.games.lotro.lore.items.ArmourType) Armour(delta.games.lotro.lore.items.Armour) HashMap(java.util.HashMap) EquipmentLocation(delta.games.lotro.lore.items.EquipmentLocation) WeaponType(delta.games.lotro.lore.items.WeaponType) ItemQuality(delta.games.lotro.lore.items.ItemQuality) Weapon(delta.games.lotro.lore.items.Weapon)

Example 17 with ArmourType

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);
}
Also used : Item(delta.games.lotro.lore.items.Item) ArmourType(delta.games.lotro.lore.items.ArmourType) Armour(delta.games.lotro.lore.items.Armour) WeaponType(delta.games.lotro.lore.items.WeaponType) Weapon(delta.games.lotro.lore.items.Weapon)

Aggregations

ArmourType (delta.games.lotro.lore.items.ArmourType)17 WeaponType (delta.games.lotro.lore.items.WeaponType)9 Armour (delta.games.lotro.lore.items.Armour)8 Item (delta.games.lotro.lore.items.Item)8 ItemQuality (delta.games.lotro.lore.items.ItemQuality)7 EquipmentLocation (delta.games.lotro.lore.items.EquipmentLocation)6 Weapon (delta.games.lotro.lore.items.Weapon)6 ArrayList (java.util.ArrayList)5 BasicStatsSet (delta.games.lotro.character.stats.BasicStatsSet)3 STAT (delta.games.lotro.character.stats.STAT)3 CharacterClass (delta.games.lotro.common.CharacterClass)3 DamageType (delta.games.lotro.lore.items.DamageType)3 ArmourTypeComparator (delta.games.lotro.lore.items.comparators.ArmourTypeComparator)3 FixedDecimalsInteger (delta.games.lotro.utils.FixedDecimalsInteger)3 HashMap (java.util.HashMap)3 ItemStatSliceData (delta.games.lotro.lore.items.stats.ItemStatSliceData)2 SlicesBasedItemStatsProvider (delta.games.lotro.lore.items.stats.SlicesBasedItemStatsProvider)2 JPanel (javax.swing.JPanel)2 ComboBoxController (delta.common.ui.swing.combobox.ComboBoxController)1 ItemSelectionListener (delta.common.ui.swing.combobox.ItemSelectionListener)1