Search in sources :

Example 6 with SlicesBasedItemStatsProvider

use of delta.games.lotro.lore.items.stats.SlicesBasedItemStatsProvider in project lotro-tools by dmorcellet.

the class ItemNormalization method findArmourTypeFromFormulas.

private void findArmourTypeFromFormulas(Armour armour) {
    String slices = armour.getProperty(ItemPropertyNames.FORMULAS);
    if (slices != null) {
        SlicesBasedItemStatsProvider provider = SlicesBasedItemStatsProvider.fromPersistedString(slices);
        ItemStatSliceData data = provider.getSliceForStat(STAT.ARMOUR);
        if (data != null) {
            String armourDescription = data.getAdditionalParameter();
            ArmourType sliceType = SlicesBasedItemStatsProvider.getArmorType(armourDescription);
            if (sliceType != null) {
                ArmourType itemType = armour.getArmourType();
                if (itemType != sliceType) {
                    if (itemType != null) {
                        System.out.println("Updated armour type from: " + itemType + " to " + sliceType + " for " + armour);
                    }
                    armour.setArmourType(sliceType);
                }
            }
        }
    }
}
Also used : ArmourType(delta.games.lotro.lore.items.ArmourType) SlicesBasedItemStatsProvider(delta.games.lotro.lore.items.stats.SlicesBasedItemStatsProvider) ItemStatSliceData(delta.games.lotro.lore.items.stats.ItemStatSliceData)

Aggregations

SlicesBasedItemStatsProvider (delta.games.lotro.lore.items.stats.SlicesBasedItemStatsProvider)6 BasicStatsSet (delta.games.lotro.character.stats.BasicStatsSet)4 ItemStatSliceData (delta.games.lotro.lore.items.stats.ItemStatSliceData)4 FixedDecimalsInteger (delta.games.lotro.utils.FixedDecimalsInteger)4 STAT (delta.games.lotro.character.stats.STAT)2 Armour (delta.games.lotro.lore.items.Armour)2 ArmourType (delta.games.lotro.lore.items.ArmourType)2 EquipmentLocation (delta.games.lotro.lore.items.EquipmentLocation)2 Item (delta.games.lotro.lore.items.Item)2 CharacterClass (delta.games.lotro.common.CharacterClass)1 ItemQuality (delta.games.lotro.lore.items.ItemQuality)1 ItemStatsProvider (delta.games.lotro.lore.items.stats.ItemStatsProvider)1 ArrayList (java.util.ArrayList)1