Search in sources :

Example 11 with Weapon

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

the class ItemNormalization method normalizeMiscWeapons.

private Item normalizeMiscWeapons(Item item) {
    String category = item.getProperty(ItemPropertyNames.TULKAS_CATEGORY);
    String name = item.getName();
    if (name == null)
        return item;
    name = name.toLowerCase();
    WeaponType type = null;
    if (("1".equals(category)) || ("12".equals(category)) || ("24".equals(category)) || ("30".equals(category)) || ("40".equals(category)) || ("44".equals(category))) {
        if (item instanceof Weapon) {
            type = ((Weapon) item).getWeaponType();
        }
        if (type == null) {
            if ("12".equals(category)) {
                if (name.indexOf("great axe") != -1)
                    type = WeaponType.TWO_HANDED_AXE;
                else
                    type = WeaponType.ONE_HANDED_AXE;
            } else if ("1".equals(category)) {
                if (name.indexOf("bow") != -1)
                    type = WeaponType.BOW;
                else if (name.indexOf("javelin") != -1)
                    type = WeaponType.JAVELIN;
                else
                    type = null;
            } else if ("24".equals(category)) {
                if (name.indexOf("mallet") != -1)
                    type = WeaponType.TWO_HANDED_HAMMER;
                else
                    type = WeaponType.ONE_HANDED_HAMMER;
            } else if ("40".equals(category)) {
                type = WeaponType.ONE_HANDED_CLUB;
            } else if ("30".equals(category)) {
                if (name.indexOf("mace") != -1)
                    type = WeaponType.ONE_HANDED_MACE;
                else if (name.indexOf("hammer") != -1)
                    type = WeaponType.ONE_HANDED_HAMMER;
                else if (name.indexOf("club") != -1)
                    type = WeaponType.ONE_HANDED_CLUB;
                else if (name.indexOf("old reliable") != -1)
                    type = WeaponType.ONE_HANDED_CLUB;
            } else if ("44".equals(category)) {
                if (name.indexOf("mace") != -1)
                    type = WeaponType.ONE_HANDED_MACE;
                else if (name.indexOf("hammer") != -1)
                    type = WeaponType.ONE_HANDED_HAMMER;
                else if (name.indexOf("club") != -1)
                    type = WeaponType.ONE_HANDED_CLUB;
                else if (name.indexOf("sword") != -1)
                    type = WeaponType.ONE_HANDED_SWORD;
                else if (name.indexOf("blade") != -1)
                    type = WeaponType.ONE_HANDED_SWORD;
                else if (name.indexOf("great axe") != -1)
                    type = WeaponType.TWO_HANDED_AXE;
                else if (name.indexOf("oathbreaker's bane") != -1)
                    type = WeaponType.ONE_HANDED_SWORD;
                else if (name.indexOf("falchion") != -1)
                    type = WeaponType.ONE_HANDED_SWORD;
            }
        }
        if (type == null) {
            System.out.println("Weapon type not found: category:" + category + ", name:" + name);
            type = WeaponType.OTHER;
        }
        item.removeProperty(ItemPropertyNames.TULKAS_CATEGORY);
        item.removeProperty(ItemPropertyNames.LEGACY_CATEGORY);
        item = setWeaponTypeFromCategory(item, null, type);
        item.setSubCategory(null);
    }
    return item;
}
Also used : WeaponType(delta.games.lotro.lore.items.WeaponType) Weapon(delta.games.lotro.lore.items.Weapon) LegendaryWeapon(delta.games.lotro.lore.items.legendary.LegendaryWeapon)

Example 12 with Weapon

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

the class ItemNormalization method normalizeWeapons.

private Item normalizeWeapons(Item item) {
    item = setWeaponTypeFromCategory(item, "10", WeaponType.DAGGER);
    item = setWeaponTypeFromCategory(item, "36", WeaponType.HALBERD);
    item = setWeaponTypeFromCategory(item, "110", WeaponType.JAVELIN);
    item = setWeaponTypeFromCategory(item, "29", WeaponType.CROSSBOW);
    item = setWeaponTypeFromCategory(item, "46", WeaponType.SPEAR);
    item = setWeaponTypeFromCategory(item, "34", WeaponType.STAFF);
    // item=setWeaponTypeFromCategory(item,"12",WeaponType.ONE_HANDED_AXE);
    item = setWeaponTypeFromCategory(item, "One-handed Axe", WeaponType.ONE_HANDED_AXE);
    item = setWeaponTypeFromCategory(item, "Two-handed Axe", WeaponType.TWO_HANDED_AXE);
    item = setWeaponTypeFromCategory(item, "One-handed Sword", WeaponType.ONE_HANDED_SWORD);
    item = setWeaponTypeFromCategory(item, "Two-handed Sword", WeaponType.TWO_HANDED_SWORD);
    item = setWeaponTypeFromCategory(item, "One-handed Club", WeaponType.ONE_HANDED_CLUB);
    item = setWeaponTypeFromCategory(item, "Rune-stone", WeaponType.RUNE_STONE);
    item = setWeaponTypeFromCategory(item, "Staff", WeaponType.STAFF);
    item = setWeaponTypeFromCategory(item, "Dagger", WeaponType.DAGGER);
    if (item instanceof Weapon) {
        Weapon weapon = (Weapon) item;
        WeaponType type = weapon.getWeaponType();
        if (type != null) {
            EquipmentLocation loc = type.isRanged() ? EquipmentLocation.RANGED_ITEM : EquipmentLocation.MAIN_HAND;
            weapon.setEquipmentLocation(loc);
            item.removeProperty(ItemPropertyNames.TULKAS_CATEGORY);
            item.removeProperty(ItemPropertyNames.LEGACY_CATEGORY);
            item.setSubCategory(null);
            // Fix problem with Captains having Crossbows
            if (type == WeaponType.CROSSBOW) {
                if (item.getRequiredClass() == CharacterClass.CAPTAIN) {
                    item.setRequiredClass(null);
                }
            }
        }
    }
    return item;
}
Also used : EquipmentLocation(delta.games.lotro.lore.items.EquipmentLocation) WeaponType(delta.games.lotro.lore.items.WeaponType) Weapon(delta.games.lotro.lore.items.Weapon) LegendaryWeapon(delta.games.lotro.lore.items.legendary.LegendaryWeapon)

Example 13 with Weapon

use of delta.games.lotro.lore.items.Weapon 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)

Aggregations

Weapon (delta.games.lotro.lore.items.Weapon)13 Armour (delta.games.lotro.lore.items.Armour)10 WeaponType (delta.games.lotro.lore.items.WeaponType)9 Item (delta.games.lotro.lore.items.Item)8 ArmourType (delta.games.lotro.lore.items.ArmourType)6 EquipmentLocation (delta.games.lotro.lore.items.EquipmentLocation)5 CharacterClass (delta.games.lotro.common.CharacterClass)4 ItemQuality (delta.games.lotro.lore.items.ItemQuality)4 BasicStatsSet (delta.games.lotro.character.stats.BasicStatsSet)3 DamageType (delta.games.lotro.lore.items.DamageType)3 LegendaryWeapon (delta.games.lotro.lore.items.legendary.LegendaryWeapon)3 HashMap (java.util.HashMap)3 STAT (delta.games.lotro.character.stats.STAT)2 Legendary (delta.games.lotro.lore.items.legendary.Legendary)2 FixedDecimalsInteger (delta.games.lotro.utils.FixedDecimalsInteger)2 ArrayList (java.util.ArrayList)2 ComboBoxController (delta.common.ui.swing.combobox.ComboBoxController)1 FloatEditionController (delta.common.ui.swing.text.FloatEditionController)1 IntegerEditionController (delta.common.ui.swing.text.IntegerEditionController)1 Money (delta.games.lotro.common.Money)1