Search in sources :

Example 1 with BasicStatsSet

use of delta.games.lotro.character.stats.BasicStatsSet in project lotro-companion by dmorcellet.

the class MainTestDetailedCharacterStatsPanelController method doIt.

private void doIt() {
    CharacterData meva = loadCharacter("meva");
    CharacterData giswald = loadCharacter("giswald");
    BasicStatsSet stats = giswald.getStats();
    BasicStatsSet reference = meva.getStats();
    DetailedCharacterStatsPanelController panelCtrl = new DetailedCharacterStatsPanelController(null);
    JPanel panel = panelCtrl.getPanel();
    panelCtrl.setStats(reference, stats);
    JFrame frame = new JFrame();
    frame.add(panel);
    frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    frame.pack();
    frame.setVisible(true);
}
Also used : JPanel(javax.swing.JPanel) CharacterData(delta.games.lotro.character.CharacterData) JFrame(javax.swing.JFrame) BasicStatsSet(delta.games.lotro.character.stats.BasicStatsSet) DetailedCharacterStatsPanelController(delta.games.lotro.gui.character.stats.details.DetailedCharacterStatsPanelController)

Example 2 with BasicStatsSet

use of delta.games.lotro.character.stats.BasicStatsSet in project lotro-companion by dmorcellet.

the class MainTestStatsEditionPanelController method buildStats.

private BasicStatsSet buildStats() {
    BasicStatsSet stats = new BasicStatsSet();
    stats.setStat(STAT.AGILITY, 224);
    stats.setStat(STAT.PHYSICAL_MASTERY, 1180);
    stats.setStat(STAT.DEVASTATE_MAGNITUDE_PERCENTAGE, 2.5f);
    stats.setStat(STAT.AUDACITY, 132);
    stats.setStat(STAT.MORALE, 12);
    return stats;
}
Also used : BasicStatsSet(delta.games.lotro.character.stats.BasicStatsSet)

Example 3 with BasicStatsSet

use of delta.games.lotro.character.stats.BasicStatsSet in project lotro-companion by dmorcellet.

the class ItemChoiceTableController method buildStatColumn.

private TableColumnController<Item, FixedDecimalsInteger> buildStatColumn(final STAT stat) {
    CellDataProvider<Item, FixedDecimalsInteger> statCell = new CellDataProvider<Item, FixedDecimalsInteger>() {

        @Override
        public FixedDecimalsInteger getData(Item item) {
            BasicStatsSet stats = item.getStats();
            FixedDecimalsInteger value = stats.getStat(stat);
            return value;
        }
    };
    TableColumnController<Item, FixedDecimalsInteger> statColumn = new TableColumnController<Item, FixedDecimalsInteger>(stat.name(), stat.getName(), FixedDecimalsInteger.class, statCell);
    statColumn.setWidthSpecs(55, 55, 50);
    return statColumn;
}
Also used : Item(delta.games.lotro.lore.items.Item) FixedDecimalsInteger(delta.games.lotro.utils.FixedDecimalsInteger) TableColumnController(delta.common.ui.swing.tables.TableColumnController) CellDataProvider(delta.common.ui.swing.tables.CellDataProvider) BasicStatsSet(delta.games.lotro.character.stats.BasicStatsSet)

Example 4 with BasicStatsSet

use of delta.games.lotro.character.stats.BasicStatsSet in project lotro-companion by dmorcellet.

the class ItemEditionPanelController method getItem.

/**
 * Get the current value of the edited item.
 * @return An item.
 */
public Item getItem() {
    // Name
    _item.setName(_name.getText());
    // Slot
    _item.setEquipmentLocation(_slot.getSelectedItem());
    // Stats
    BasicStatsSet stats = _item.getStats();
    stats.clear();
    stats.setStats(_stats.getStats());
    // Item level
    _item.setItemLevel(_itemLevel.getSelectedItem());
    // Minimum level
    _item.setMinLevel(_minLevel.getSelectedItem());
    // Description
    _item.setDescription(_description.getText());
    // Birth name
    _item.setBirthName(_birthName.getText());
    // Crafter name
    _item.setCrafterName(_crafterName.getText());
    // User comments
    String userComments = _userComments.getText();
    if (userComments.length() > 0) {
        _item.setProperty(ItemConstants.USER_COMMENT, userComments);
    } else {
        _item.removeProperty(ItemConstants.USER_COMMENT);
    }
    // Binding
    _item.setBinding(_binding.getSelectedItem());
    // Unicity
    _item.setUnique(_unique.isSelected());
    // Durability
    _item.setDurability(_durability.getValue());
    // Sturdiness
    _item.setSturdiness(_sturdiness.getSelectedItem());
    // Stack max
    _item.setStackMax(_stackMax.getValue());
    // Quality
    _item.setQuality(_quality.getSelectedItem());
    // Essences
    List<Item> selectedEssences = _essencesEditor.getEssences();
    EssencesSet essences = null;
    if (selectedEssences.size() > 0) {
        essences = new EssencesSet(selectedEssences.size());
        for (int i = 0; i < selectedEssences.size(); i++) {
            essences.setEssence(i, selectedEssences.get(i));
        }
    }
    _item.setEssences(essences);
    // Armour specifics
    if (_item instanceof Armour) {
        Armour armour = (Armour) _item;
        Integer armourValue = _armourValue.getValue();
        if (armourValue != null) {
            armour.setArmourValue(armourValue.intValue());
        }
        armour.setArmourType(_armourType.getSelectedItem());
    }
    // Weapon specifics
    if (_item instanceof Weapon) {
        Weapon weapon = (Weapon) _item;
        Integer minDamage = _minDamage.getValue();
        if (minDamage != null) {
            weapon.setMinDamage(minDamage.intValue());
        }
        Integer maxDamage = _maxDamage.getValue();
        if (maxDamage != null) {
            weapon.setMaxDamage(maxDamage.intValue());
        }
        Float dps = _dps.getValue();
        if (dps != null) {
            weapon.setDPS(dps.floatValue());
        }
        weapon.setDamageType(_damageType.getSelectedItem());
        weapon.setWeaponType(_weaponType.getSelectedItem());
    }
    // Legendary specifics
    if (_item instanceof Legendary) {
        Legendary legendary = (Legendary) _item;
        _relicsEditor.getData(legendary.getLegendaryAttrs());
    }
    return _item;
}
Also used : Item(delta.games.lotro.lore.items.Item) Armour(delta.games.lotro.lore.items.Armour) Legendary(delta.games.lotro.lore.items.legendary.Legendary) EssencesSet(delta.games.lotro.lore.items.essences.EssencesSet) BasicStatsSet(delta.games.lotro.character.stats.BasicStatsSet) Weapon(delta.games.lotro.lore.items.Weapon)

Example 5 with BasicStatsSet

use of delta.games.lotro.character.stats.BasicStatsSet in project lotro-companion by dmorcellet.

the class CharacterStatsSummaryPanelController method update.

/**
 * Update contents.
 */
public void update() {
    STAT[] stats = STAT.values();
    int nbStats = stats.length;
    for (int i = 0; i < nbStats; i++) {
        String statValue = "";
        if (_toon != null) {
            BasicStatsSet characterStats = _toon.getStats();
            FixedDecimalsInteger value = characterStats.getStat(stats[i]);
            if (value != null) {
                statValue = String.valueOf(value.intValue());
            } else {
                statValue = "-";
            }
        }
        if (_statValues[i] != null) {
            _statValues[i].setText(statValue);
        }
    }
    DetailedCharacterStatsWindowController detailsStatsController = getDetailsController();
    if (detailsStatsController != null) {
        detailsStatsController.update();
    }
    StatContribsWindowController contribsController = getContribsController();
    if (contribsController != null) {
        contribsController.update();
    }
}
Also used : STAT(delta.games.lotro.character.stats.STAT) StatContribsWindowController(delta.games.lotro.gui.character.stats.contribs.StatContribsWindowController) FixedDecimalsInteger(delta.games.lotro.utils.FixedDecimalsInteger) DetailedCharacterStatsWindowController(delta.games.lotro.gui.character.stats.details.DetailedCharacterStatsWindowController) BasicStatsSet(delta.games.lotro.character.stats.BasicStatsSet)

Aggregations

BasicStatsSet (delta.games.lotro.character.stats.BasicStatsSet)38 FixedDecimalsInteger (delta.games.lotro.utils.FixedDecimalsInteger)13 STAT (delta.games.lotro.character.stats.STAT)12 Item (delta.games.lotro.lore.items.Item)11 Armour (delta.games.lotro.lore.items.Armour)9 CharacterClass (delta.games.lotro.common.CharacterClass)7 EquipmentLocation (delta.games.lotro.lore.items.EquipmentLocation)6 CharacterData (delta.games.lotro.character.CharacterData)5 CharacterStatsComputer (delta.games.lotro.character.stats.CharacterStatsComputer)4 SlicesBasedItemStatsProvider (delta.games.lotro.lore.items.stats.SlicesBasedItemStatsProvider)4 JPanel (javax.swing.JPanel)4 CharacterEquipment (delta.games.lotro.character.CharacterEquipment)3 EQUIMENT_SLOT (delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT)3 ArmourType (delta.games.lotro.lore.items.ArmourType)3 ItemQuality (delta.games.lotro.lore.items.ItemQuality)3 Weapon (delta.games.lotro.lore.items.Weapon)3 ArrayList (java.util.ArrayList)3 JFrame (javax.swing.JFrame)3 Element (net.htmlparser.jericho.Element)3 DefaultWindowController (delta.common.ui.swing.windows.DefaultWindowController)2