Search in sources :

Example 1 with CharacterClass

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

the class NewToonDialogController method okImpl.

@Override
protected void okImpl() {
    String toonName = _toonName.getText();
    String server = _server.getSelectedItem();
    CharacterClass cClass = _class.getComboBoxController().getSelectedItem();
    Race race = _race.getSelectedItem();
    CharacterSex sex = _sex.getSelectedItem();
    CharacterData info = new CharacterData();
    info.setName(toonName);
    info.setServer(server);
    info.setCharacterClass(cClass);
    info.setCharacterSex(sex);
    info.setRace(race);
    info.setLevel(1);
    info.setDate(Long.valueOf(System.currentTimeMillis()));
    // Compute stats
    CharacterStatsComputer computer = new CharacterStatsComputer();
    info.getStats().setStats(computer.getStats(info));
    CharactersManager manager = CharactersManager.getInstance();
    CharacterFile toon = manager.addToon(info);
    if (toon == null) {
        showErrorMessage("Character creation failed!");
    }
}
Also used : CharactersManager(delta.games.lotro.character.CharactersManager) CharacterData(delta.games.lotro.character.CharacterData) CharacterStatsComputer(delta.games.lotro.character.stats.CharacterStatsComputer) Race(delta.games.lotro.common.Race) CharacterSex(delta.games.lotro.common.CharacterSex) CharacterFile(delta.games.lotro.character.CharacterFile) CharacterClass(delta.games.lotro.common.CharacterClass)

Example 2 with CharacterClass

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

the class QuestsCompletionStats method loadQuestIdentifiers.

private void loadQuestIdentifiers() {
    QuestsManager qm = QuestsManager.getInstance();
    QuestsIndex index = qm.getIndex();
    if (index != null) {
        QuestCategory category = index.getCategory(_category);
        if (category != null) {
            QuestSummary[] summaries = category.getQuests();
            for (QuestSummary summary : summaries) {
                int id = summary.getIdentifier();
                QuestDescription q = qm.getQuest(id);
                if (q != null) {
                    boolean useIt = true;
                    if (USE_CLASS_RESTRICTIONS) {
                        List<String> classes = q.getRequiredClasses();
                        if ((classes != null) && (classes.size() > 0)) {
                            CharacterClass cClass = _character.getCharacterClass();
                            String className = cClass.getKey();
                            if (classes.contains(className)) {
                                useIt = true;
                            } else {
                                String key = q.getKey();
                                if (_logger.isInfoEnabled()) {
                                    _logger.info("Ignored quest [" + key + "]. Class=" + className + ", Required:" + classes);
                                }
                                useIt = false;
                            }
                        }
                    }
                    if (USE_RACE_RESTRICTIONS) {
                        List<String> races = q.getRequiredRaces();
                        if ((races != null) && (races.size() > 0)) {
                            Race cRace = _character.getRace();
                            String raceName = cRace.getLabel();
                            if (races.contains(raceName)) {
                                useIt = true;
                            } else {
                                String key = q.getKey();
                                if (_logger.isInfoEnabled()) {
                                    _logger.info("Ignored quest [" + key + "]. Race=" + raceName + ", Required:" + races);
                                }
                                useIt = false;
                            }
                        }
                    }
                    if (!USE_INSTANCES) {
                        boolean instanced = q.isInstanced();
                        if (instanced) {
                            useIt = false;
                        }
                    }
                    if (useIt) {
                        _expectedIds.add(Integer.valueOf(id));
                    }
                }
            }
            _nbExpectedQuests = _expectedIds.size();
        }
    }
}
Also used : QuestDescription(delta.games.lotro.lore.quests.QuestDescription) QuestsManager(delta.games.lotro.lore.quests.QuestsManager) Race(delta.games.lotro.common.Race) QuestsIndex(delta.games.lotro.lore.quests.index.QuestsIndex) QuestCategory(delta.games.lotro.lore.quests.index.QuestCategory) QuestSummary(delta.games.lotro.lore.quests.index.QuestSummary) CharacterClass(delta.games.lotro.common.CharacterClass)

Example 3 with CharacterClass

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

the class TraitPointsRegistryXMLParser method parsePoint.

/**
 * Build a trait point from an XML tag.
 * @param pointTag Point tag.
 * @return A trait point.
 */
public TraitPoint parsePoint(Element pointTag) {
    TraitPoint ret = null;
    NamedNodeMap attrs = pointTag.getAttributes();
    // Identifier
    String id = DOMParsingTools.getStringAttribute(attrs, TraitPointsRegistryXMLConstants.TRAIT_POINT_ID_ATTR, null);
    if (id != null) {
        ret = new TraitPoint(id);
        // Label
        String label = DOMParsingTools.getStringAttribute(attrs, TraitPointsRegistryXMLConstants.TRAIT_POINT_LABEL_ATTR, null);
        if (label != null) {
            ret.setLabel(label);
        }
        // Category
        String category = DOMParsingTools.getStringAttribute(attrs, TraitPointsRegistryXMLConstants.TRAIT_POINT_CATEGORY_ATTR, null);
        if (category != null) {
            ret.setCategory(category);
        }
        // Required class
        String requiredClassesStr = DOMParsingTools.getStringAttribute(attrs, TraitPointsRegistryXMLConstants.TRAIT_POINT_REQUIRED_CLASSES_ATTR, null);
        if (requiredClassesStr != null) {
            String[] requiredClasses = requiredClassesStr.split(",");
            for (String requiredClass : requiredClasses) {
                CharacterClass characterClass = CharacterClass.getByKey(requiredClass);
                ret.addRequiredClass(characterClass);
            }
        }
    }
    return ret;
}
Also used : TraitPoint(delta.games.lotro.stats.traitPoints.TraitPoint) NamedNodeMap(org.w3c.dom.NamedNodeMap) CharacterClass(delta.games.lotro.common.CharacterClass)

Example 4 with CharacterClass

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

the class CharacterMainAttrsEditionPanelController method set.

/**
 * Write data to UI gadgets.
 */
public void set() {
    getPanel();
    // Class icon
    CharacterClass cClass = _toon.getCharacterClass();
    ImageIcon classIcon = LotroIconsManager.getClassIcon(cClass, LotroIconsManager.COMPACT_SIZE);
    _classIcon.setIcon(classIcon);
    // Character icon
    updateSexDisplay();
    // Name
    _name.setText(_toon.getName());
    // Level
    _level.selectItem(Integer.valueOf(_toon.getLevel()));
    // Date
    Long timestamp = _toon.getDate();
    _date.setDate(timestamp);
    // Short description
    _shortDescription.setText(_toon.getShortDescription());
}
Also used : ImageIcon(javax.swing.ImageIcon) CharacterClass(delta.games.lotro.common.CharacterClass)

Example 5 with CharacterClass

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

the class EssencesSummaryPanelController method updateStatsPanel.

private void updateStatsPanel() {
    // Raw
    BasicStatsSet raw = _summary.getStats();
    updateStatsPanel(_rawStatsPanel, raw);
    // Cumulated
    DerivatedStatsContributionsMgr derivedStatsMgr = new DerivatedStatsContributionsMgr();
    CharacterClass characterClass = _toon.getCharacterClass();
    BasicStatsSet derivated = derivedStatsMgr.getContribution(characterClass, raw);
    BasicStatsSet cumulated = new BasicStatsSet();
    cumulated.addStats(raw);
    cumulated.addStats(derivated);
    updateStatsPanel(_cumulatedStatsPanel, cumulated);
}
Also used : DerivatedStatsContributionsMgr(delta.games.lotro.character.stats.base.DerivatedStatsContributionsMgr) 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