Search in sources :

Example 6 with CharacterClass

use of delta.games.lotro.common.CharacterClass in project lotro-companion by dmorcellet.

the class CharacterSummaryDialogController method okImpl.

@Override
protected void okImpl() {
    String toonName = _toonName.getText();
    _data.setName(toonName);
    String server = _server.getSelectedItem();
    _data.setServer(server);
    CharacterClass cClass = _class.getSelectedItem();
    _data.setCharacterClass(cClass);
    Race race = _race.getSelectedItem();
    _data.setRace(race);
    CharacterSex sex = _sex.getSelectedItem();
    _data.setCharacterSex(sex);
    String region = _region.getComboBoxController().getSelectedItem();
    _data.setRegion(region);
    int level = _level.getSelectedItem().intValue();
    _data.setLevel(level);
}
Also used : Race(delta.games.lotro.common.Race) CharacterSex(delta.games.lotro.common.CharacterSex) CharacterClass(delta.games.lotro.common.CharacterClass)

Example 7 with CharacterClass

use of delta.games.lotro.common.CharacterClass in project lotro-companion by dmorcellet.

the class CharacterSummaryDialogController method initData.

private void initData() {
    // Toon name
    String name = _data.getName();
    _toonName.setText(name);
    // Server
    String server = _data.getServer();
    _server.selectItem(server);
    // Class
    CharacterClass characterClass = _data.getCharacterClass();
    _class.selectItem(characterClass);
    // Race
    Race race = _data.getRace();
    _race.selectItem(race);
    _region.setRace(race);
    // Sex
    CharacterSex sex = _data.getCharacterSex();
    _sex.selectItem(sex);
    // Region
    String region = _data.getRegion();
    _region.getComboBoxController().selectItem(region);
    // Level
    int level = _data.getLevel();
    _level.selectItem(Integer.valueOf(level));
}
Also used : Race(delta.games.lotro.common.Race) CharacterSex(delta.games.lotro.common.CharacterSex) CharacterClass(delta.games.lotro.common.CharacterClass)

Example 8 with CharacterClass

use of delta.games.lotro.common.CharacterClass in project lotro-tools by dmorcellet.

the class TraitPointsRegistryBuilder method checks.

private void checks() {
    for (CharacterClass cClass : CharacterClass.ALL_CLASSES) {
        List<TraitPoint> points = _registry.getPointsForClass(cClass);
        Collections.sort(points, new TraitPointLabelComparator());
        System.out.println(cClass + ":" + points.size());
        for (TraitPoint point : points) {
            System.out.println("\t" + point.getLabel() + " -- " + point.getId());
        }
    }
    List<TraitPoint> all = _registry.getAll();
    System.out.println("All:" + all.size());
}
Also used : TraitPoint(delta.games.lotro.stats.traitPoints.TraitPoint) TraitPointLabelComparator(delta.games.lotro.stats.traitPoints.comparators.TraitPointLabelComparator) CharacterClass(delta.games.lotro.common.CharacterClass)

Example 9 with CharacterClass

use of delta.games.lotro.common.CharacterClass in project lotro-tools by dmorcellet.

the class TraitPointsRegistryBuilder method buildClassPoints.

private void buildClassPoints() {
    int classIndex = 0;
    for (CharacterClass cClass : CharacterClass.ALL_CLASSES) {
        String category = TraitPointCategories.CLASS;
        String key = cClass.getKey();
        String book1 = BOOK_NAMES[classIndex][0];
        initPoint(key + ":LegendaryBook1", category, "Complete Legendary Book Pages '" + book1 + "'", cClass);
        String book2 = BOOK_NAMES[classIndex][1];
        initPoint(key + ":LegendaryBook2", category, "Complete Legendary Book Pages '" + book2 + "'", cClass);
        String book3 = BOOK_NAMES[classIndex][2];
        initPoint(key + ":LegendaryBook3", category, "Complete Legendary Book Pages '" + book3 + "'", cClass);
        String chain1 = CLASS_QUESTS_CHAIN_NAMES[classIndex][0];
        initPoint(key + ":ClassQuests50", category, "Complete the Level 50 Class Quest Chain '" + chain1 + "'", cClass);
        String chain2 = CLASS_QUESTS_CHAIN_NAMES[classIndex][1];
        initPoint(key + ":ClassQuests58", category, "Complete the Level 58 Class Quest Chain '" + chain2 + "'", cClass);
        if (cClass != CharacterClass.BEORNING) {
            String dwarfBook = IRON_GARNISON_GUARDS_BOOKS[classIndex];
            initPoint(key + ":ReadGuardsBook", category, "Read book of Iron Garrison Guards: '" + dwarfBook + "'", cClass);
        }
        classIndex++;
    }
    // Epic
    TraitPoint epicVol2Book6 = initPoint("EpicVol2Book6", TraitPointCategories.EPIC, "Complete Volume II, Book 6 (Moria)", null);
    for (CharacterClass characterClass : CharacterClass.ALL_CLASSES) {
        if (characterClass != CharacterClass.BEORNING) {
            epicVol2Book6.addRequiredClass(characterClass);
        }
    }
    // Add Beorning specifics
    initPoint("Beorning:ClassQuests15", TraitPointCategories.CLASS, "Complete the Level 15 Class Quest Chain 'The Speech of Animals'", CharacterClass.BEORNING);
    initPoint("Beorning:ClassQuests30", TraitPointCategories.CLASS, "Complete the Level 30 Class Quest Chain 'Hatred of Bear and Man'", CharacterClass.BEORNING);
}
Also used : TraitPoint(delta.games.lotro.stats.traitPoints.TraitPoint) TraitPoint(delta.games.lotro.stats.traitPoints.TraitPoint) CharacterClass(delta.games.lotro.common.CharacterClass)

Example 10 with CharacterClass

use of delta.games.lotro.common.CharacterClass in project lotro-tools by dmorcellet.

the class LotroPlanItemsDbLoader method buildItemFromLine.

private Item buildItemFromLine(LotroPlanTable table, String line) {
    String[] fieldsTrimmed = StringSplitter.split(line.trim(), '\t');
    if (line.startsWith("#")) {
        System.out.println("Ignored: " + line);
        return null;
    }
    if (fieldsTrimmed.length < 2) {
        _section = line.trim();
        System.out.println("Section: " + _section);
        return null;
    }
    String[] fields = StringSplitter.split(line, '\t');
    // Item level
    int itemLevel = NumericTools.parseInt(fields[LotroPlanTable.ITEM_LEVEL_INDEX], -1);
    // Stats
    ItemStatsProvider provider = table.loadStats(fields);
    BasicStatsSet stats = provider.getStats(itemLevel);
    FixedDecimalsInteger armorStat = stats.getStat(STAT.ARMOUR);
    Item item = null;
    Armour armour = null;
    if (armorStat != null) {
        armour = new Armour();
        item = armour;
        armour.setArmourValue(armorStat.intValue());
        stats.removeStat(STAT.ARMOUR);
    } else {
        item = new Item();
    }
    // ID
    String idStr = "";
    int notesIndex = table.getNotesIndex();
    if (fields.length >= notesIndex) {
        idStr = fields[notesIndex].trim();
    }
    int id = 0;
    if (idStr.startsWith("ID:")) {
        idStr = idStr.substring(3).trim();
    }
    id = NumericTools.parseInt(idStr, -1);
    if (id != -1) {
        item.setIdentifier(id);
    }
    // Name
    String name = fields[LotroPlanTable.NAME_INDEX];
    if (name.startsWith("(")) {
        int index = name.indexOf(')');
        idStr = name.substring(1, index).trim();
        id = NumericTools.parseInt(idStr, -1);
        item.setIdentifier(id);
        name = name.substring(index + 1).trim();
    }
    if (name.endsWith(":")) {
        name = name.substring(0, name.length() - 1);
    }
    name = name.replace(' ', ' ');
    if (name.endsWith("s)")) {
        name = name.substring(0, name.length() - 2);
        int index = name.lastIndexOf('(');
        int nbSlots = NumericTools.parseInt(name.substring(index + 1), 0);
        name = name.substring(0, index).trim();
        item.setEssenceSlots(nbSlots);
    }
    if (name.endsWith(")")) {
        String newName = name.substring(0, name.length() - 1);
        int index = newName.lastIndexOf('(');
        String valueStr = newName.substring(index + 1);
        int minLevel;
        if ("TBD".equals(valueStr)) {
            minLevel = -1;
        } else {
            minLevel = NumericTools.parseInt(valueStr, -1);
            name = newName.substring(0, index).trim();
        }
        if (minLevel > 0) {
            item.setMinLevel(Integer.valueOf(minLevel));
        }
    }
    name = name.trim();
    item.setName(name);
    // Item level
    if (itemLevel != -1) {
        item.setItemLevel(Integer.valueOf(itemLevel));
    }
    // Stats
    item.getStats().setStats(stats);
    String slices = provider.toPersistableString();
    int nbSlices = ((SlicesBasedItemStatsProvider) provider).getSlices();
    if (nbSlices > 0) {
        item.setProperty(ItemPropertyNames.FORMULAS, slices);
    }
    // Slot
    EquipmentLocation slot = null;
    if ("Head".equals(_section))
        slot = EquipmentLocation.HEAD;
    else if ("Shoulders".equals(_section))
        slot = EquipmentLocation.SHOULDER;
    else if ("Chest".equals(_section))
        slot = EquipmentLocation.CHEST;
    else if ("Hands".equals(_section))
        slot = EquipmentLocation.HAND;
    else if ("Legs".equals(_section))
        slot = EquipmentLocation.LEGS;
    else if ("Feet".equals(_section))
        slot = EquipmentLocation.FEET;
    else if ("Shields".equals(_section))
        slot = EquipmentLocation.OFF_HAND;
    else if ("Ears".equals(_section))
        slot = EquipmentLocation.EAR;
    else if ("Neck".equals(_section))
        slot = EquipmentLocation.NECK;
    else if ("Wrists".equals(_section))
        slot = EquipmentLocation.WRIST;
    else if ("Fingers".equals(_section))
        slot = EquipmentLocation.FINGER;
    else if ("Pockets".equals(_section))
        slot = EquipmentLocation.POCKET;
    if (slot == null) {
        int categoryIndex = table.getCategoryIndex();
        if ((categoryIndex > 0) && (fields.length >= categoryIndex)) {
            String category = fields[categoryIndex];
            slot = getSlotFromCategory(category);
        }
    }
    // Class requirement
    String classRequirementStr = "";
    int classesIndex = table.getClassesIndex();
    if ((classesIndex != -1) && (fields.length >= classesIndex)) {
        classRequirementStr = fields[classesIndex].trim();
    }
    CharacterClass classRequirement = getClassRequirement(classRequirementStr);
    if (classRequirement != null) {
        item.setRequiredClass(classRequirement);
    }
    if ("Burglar Signals".equals(_section)) {
        item.setSubCategory("Burglar:Signal");
        slot = EquipmentLocation.RANGED_ITEM;
        item.setRequiredClass(CharacterClass.BURGLAR);
    } else if ("Captain Standards".equals(_section)) {
        item.setSubCategory("Captain:Standard");
        slot = EquipmentLocation.RANGED_ITEM;
        item.setRequiredClass(CharacterClass.CAPTAIN);
    } else if ("Hunter Tomes".equals(_section)) {
        String subCategory = "Tome";
        if (name.contains("Wind-rider"))
            subCategory = "Wind-rider";
        if (name.contains("Whisper-draw"))
            subCategory = "Whisper-draw";
        item.setSubCategory("Hunter:" + subCategory);
        slot = EquipmentLocation.CLASS_SLOT;
        item.setRequiredClass(CharacterClass.HUNTER);
    } else if ("Lore-master Brooches".equals(_section)) {
        item.setSubCategory("Lore-master:Stickpin");
        slot = EquipmentLocation.RANGED_ITEM;
        item.setRequiredClass(CharacterClass.LORE_MASTER);
    } else if ("Minstrel Instruments".equals(_section)) {
        item.setSubCategory("Instrument");
        slot = EquipmentLocation.RANGED_ITEM;
        item.setRequiredClass(CharacterClass.MINSTREL);
    } else if ("Rune-keeper Chisels".equals(_section)) {
        String subCategory = "Other";
        if (name.contains("Riffler"))
            subCategory = "Riffler";
        if (name.contains("Chisel"))
            subCategory = "Chisel";
        item.setSubCategory("Rune-keeper:" + subCategory);
        slot = EquipmentLocation.RANGED_ITEM;
        item.setRequiredClass(CharacterClass.RUNE_KEEPER);
    } else if ("Warden Carvings".equals(_section)) {
        item.setSubCategory("Warden:Carving");
        slot = EquipmentLocation.CLASS_SLOT;
        item.setRequiredClass(CharacterClass.WARDEN);
    }
    if (slot != null) {
        item.setEquipmentLocation(slot);
    }
    return item;
}
Also used : SlicesBasedItemStatsProvider(delta.games.lotro.lore.items.stats.SlicesBasedItemStatsProvider) ItemStatsProvider(delta.games.lotro.lore.items.stats.ItemStatsProvider) Item(delta.games.lotro.lore.items.Item) Armour(delta.games.lotro.lore.items.Armour) FixedDecimalsInteger(delta.games.lotro.utils.FixedDecimalsInteger) EquipmentLocation(delta.games.lotro.lore.items.EquipmentLocation) SlicesBasedItemStatsProvider(delta.games.lotro.lore.items.stats.SlicesBasedItemStatsProvider) BasicStatsSet(delta.games.lotro.character.stats.BasicStatsSet) CharacterClass(delta.games.lotro.common.CharacterClass)

Aggregations

CharacterClass (delta.games.lotro.common.CharacterClass)33 Race (delta.games.lotro.common.Race)9 BasicStatsSet (delta.games.lotro.character.stats.BasicStatsSet)7 Item (delta.games.lotro.lore.items.Item)7 Armour (delta.games.lotro.lore.items.Armour)6 EquipmentLocation (delta.games.lotro.lore.items.EquipmentLocation)6 TraitPoint (delta.games.lotro.stats.traitPoints.TraitPoint)5 FixedDecimalsInteger (delta.games.lotro.utils.FixedDecimalsInteger)5 EQUIMENT_SLOT (delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT)4 CharacterSex (delta.games.lotro.common.CharacterSex)4 CharacterData (delta.games.lotro.character.CharacterData)3 STAT (delta.games.lotro.character.stats.STAT)3 DeedType (delta.games.lotro.lore.deeds.DeedType)3 ItemQuality (delta.games.lotro.lore.items.ItemQuality)3 Weapon (delta.games.lotro.lore.items.Weapon)3 WeaponType (delta.games.lotro.lore.items.WeaponType)3 GridBagConstraints (java.awt.GridBagConstraints)3 GridBagLayout (java.awt.GridBagLayout)3 Insets (java.awt.Insets)3 ArrayList (java.util.ArrayList)3