Search in sources :

Example 21 with BasicStatsSet

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

the class VirtueIconController method buildToolTip.

private String buildToolTip(VirtueId virtueId, int tier) {
    VirtuesContributionsMgr virtuesMgr = VirtuesContributionsMgr.get();
    BasicStatsSet stats = virtuesMgr.getContribution(virtueId, tier);
    StringBuilder sb = new StringBuilder();
    sb.append(virtueId.name()).append(EndOfLine.NATIVE_EOL);
    for (STAT stat : stats.getStats()) {
        String name = stat.getName();
        String value = stats.getStat(stat).toString();
        sb.append(name).append(": ").append(value).append(EndOfLine.NATIVE_EOL);
    }
    String text = sb.toString().trim();
    String html = "<html>" + text.replace(EndOfLine.NATIVE_EOL, "<br>") + "</html>";
    return html;
}
Also used : STAT(delta.games.lotro.character.stats.STAT) BasicStatsSet(delta.games.lotro.character.stats.BasicStatsSet) VirtuesContributionsMgr(delta.games.lotro.character.stats.virtues.VirtuesContributionsMgr)

Example 22 with BasicStatsSet

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

the class MainTestStatContribsChart method doIt.

private void doIt(CharacterData data) {
    StatsContributionsManager contribs = new StatsContributionsManager(data.getCharacterClass());
    CharacterStatsComputer statsComputer = new CharacterStatsComputer(contribs);
    BasicStatsSet stats = statsComputer.getStats(data);
    System.out.println(stats);
    contribs.setResolveIndirectContributions(true);
    contribs.compute();
    JPanel panel = GuiFactory.buildBackgroundPanel(new BorderLayout());
    JTabbedPane tabs = GuiFactory.buildTabbedPane();
    panel.add(tabs, BorderLayout.CENTER);
    for (STAT stat : STAT.values()) {
        ContribsByStat contribsForStat = contribs.getContribs(stat);
        if (contribsForStat != null) {
            StatContribsChartPanelController chartController = new StatContribsChartPanelController();
            chartController.setContributions(contribsForStat);
            JPanel statPanel = chartController.getPanel();
            tabs.add(stat.getName(), statPanel);
        }
    }
    DefaultWindowController w = new DefaultWindowController();
    w.getFrame().add(panel);
    w.getFrame().pack();
    w.show();
}
Also used : JPanel(javax.swing.JPanel) STAT(delta.games.lotro.character.stats.STAT) ContribsByStat(delta.games.lotro.character.stats.contribs.ContribsByStat) BorderLayout(java.awt.BorderLayout) StatsContributionsManager(delta.games.lotro.character.stats.contribs.StatsContributionsManager) CharacterStatsComputer(delta.games.lotro.character.stats.CharacterStatsComputer) DefaultWindowController(delta.common.ui.swing.windows.DefaultWindowController) JTabbedPane(javax.swing.JTabbedPane) BasicStatsSet(delta.games.lotro.character.stats.BasicStatsSet)

Example 23 with BasicStatsSet

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

the class MainTestCharacterStatsSummaryPanelController method main.

/**
 * Basic main method for test.
 * @param args Not used.
 */
public static void main(String[] args) {
    CharacterGenerationTools tools = new CharacterGenerationTools();
    CharacterGeneratorMeva mevaGenerator = new CharacterGeneratorMeva(tools);
    CharacterData meva = mevaGenerator.buildCharacter();
    CharacterStatsComputer statsComputer = new CharacterStatsComputer();
    BasicStatsSet stats = statsComputer.getStats(meva);
    meva.getStats().setStats(stats);
    CharacterStatsSummaryPanelController panelCtrl = new CharacterStatsSummaryPanelController(null, meva);
    JFrame frame = new JFrame();
    frame.add(panelCtrl.getPanel());
    frame.pack();
    frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    frame.setVisible(true);
}
Also used : CharacterData(delta.games.lotro.character.CharacterData) CharacterGeneratorMeva(delta.games.lotro.character.stats.CharacterGeneratorMeva) CharacterStatsComputer(delta.games.lotro.character.stats.CharacterStatsComputer) JFrame(javax.swing.JFrame) BasicStatsSet(delta.games.lotro.character.stats.BasicStatsSet) CharacterGenerationTools(delta.games.lotro.character.stats.CharacterGenerationTools)

Example 24 with BasicStatsSet

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

the class MainTestStatsEditionPanelController method doIt.

private void doIt() {
    JFrame frame = new JFrame();
    BasicStatsSet stats = buildStats();
    JPanel panel = buildPanel(stats);
    frame.add(panel);
    frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    frame.pack();
    frame.setVisible(true);
}
Also used : JPanel(javax.swing.JPanel) JFrame(javax.swing.JFrame) BasicStatsSet(delta.games.lotro.character.stats.BasicStatsSet)

Example 25 with BasicStatsSet

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

the class MainTestStatCurveChart method doIt.

private void doIt(CharacterData data) {
    // Load toon stats
    CharacterGenerationTools tools = new CharacterGenerationTools();
    CharacterGeneratorGiswald generator = new CharacterGeneratorGiswald(tools);
    CharacterData c = generator.buildCharacter();
    List<StatCurvesChartConfiguration> configs = new ArrayList<StatCurvesChartConfiguration>();
    StatCurvesConfigurationFactory factory = new StatCurvesConfigurationFactory(c.getCharacterClass());
    configs.add(factory.buildPhysicalDamageChart());
    configs.add(factory.buildTacticalDamageChart());
    configs.add(factory.buildCriticalsChart());
    configs.add(factory.buildFinesseChart());
    configs.add(factory.buildHealingChart());
    configs.add(factory.buildIncomingHealingChart());
    configs.add(factory.buildBlockChart());
    configs.add(factory.buildParryChart());
    configs.add(factory.buildEvadeChart());
    configs.add(factory.buildResistanceChart());
    configs.add(factory.buildCriticalDefenceChart());
    configs.add(factory.buildPhysicalMitigationChart());
    configs.add(factory.buildTacticalMitigationChart());
    configs.add(factory.buildOrcCraftFellWroughtMitigationChart());
    CharacterStatsComputer statsComputer = new CharacterStatsComputer();
    BasicStatsSet stats = statsComputer.getStats(c);
    c.getStats().setStats(stats);
    int level = c.getLevel();
    for (StatCurvesChartConfiguration config : configs) {
        config.setLevel(level);
        config.setMaxRating(config.getAutoMaxRating());
        StatCurvesPanelController controller = new StatCurvesPanelController(config);
        controller.update(c);
        JPanel statPanel = controller.getPanel();
        DefaultWindowController w = new DefaultWindowController();
        w.getFrame().add(statPanel);
        w.getFrame().pack();
        w.show();
    }
}
Also used : JPanel(javax.swing.JPanel) DefaultWindowController(delta.common.ui.swing.windows.DefaultWindowController) ArrayList(java.util.ArrayList) CharacterGeneratorGiswald(delta.games.lotro.character.stats.CharacterGeneratorGiswald) BasicStatsSet(delta.games.lotro.character.stats.BasicStatsSet) CharacterData(delta.games.lotro.character.CharacterData) CharacterStatsComputer(delta.games.lotro.character.stats.CharacterStatsComputer) CharacterGenerationTools(delta.games.lotro.character.stats.CharacterGenerationTools)

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