diff --git a/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java b/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java index e8001fee6cc..d98059645c9 100644 --- a/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java +++ b/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java @@ -81,7 +81,7 @@ public class PlayAreaPanel extends javax.swing.JPanel { private JCheckBoxMenuItem allowViewHandCardsMenuItem; private JCheckBoxMenuItem holdPriorityMenuItem; - public static final int PANEL_HEIGHT = 242; + public static final int PANEL_HEIGHT = 263; public static final int PANEL_HEIGHT_SMALL = 190; /** diff --git a/Mage.Client/src/main/java/mage/client/game/PlayerPanelExt.java b/Mage.Client/src/main/java/mage/client/game/PlayerPanelExt.java index fc494cdbe26..1ce935228f2 100644 --- a/Mage.Client/src/main/java/mage/client/game/PlayerPanelExt.java +++ b/Mage.Client/src/main/java/mage/client/game/PlayerPanelExt.java @@ -106,8 +106,8 @@ public class PlayerPanelExt extends javax.swing.JPanel { private static final String DEFAULT_AVATAR_PATH = "/avatars/" + DEFAULT_AVATAR_ID + ".jpg"; private static final int PANEL_WIDTH = 94; - private static final int PANEL_HEIGHT = 242; - private static final int PANEL_HEIGHT_SMALL = 212; + private static final int PANEL_HEIGHT = 262; + private static final int PANEL_HEIGHT_SMALL = 232; private static final int MANA_LABEL_SIZE_HORIZONTAL = 20; private static final Border GREEN_BORDER = new LineBorder(Color.green, 3); @@ -193,6 +193,8 @@ public class PlayerPanelExt extends javax.swing.JPanel { } lifeLabel.setText(Integer.toString(playerLife)); poisonLabel.setText(Integer.toString(player.getCounters().getCount(CounterType.POISON))); + energyLabel.setText(Integer.toString(player.getCounters().getCount(CounterType.ENERGY))); + experienceLabel.setText(Integer.toString(player.getCounters().getCount(CounterType.EXPERIENCE))); handLabel.setText(Integer.toString(player.getHandCount())); int libraryCards = player.getLibraryCount(); if (libraryCards > 99) { @@ -380,6 +382,8 @@ public class PlayerPanelExt extends javax.swing.JPanel { lifeLabel = new JLabel(); handLabel = new JLabel(); poisonLabel = new JLabel(); + energyLabel = new JLabel(); + experienceLabel = new JLabel(); graveLabel = new JLabel(); libraryLabel = new JLabel(); setOpaque(false); @@ -454,7 +458,7 @@ public class PlayerPanelExt extends javax.swing.JPanel { } }); - // Grave count and open graveyard button + // Grave count and open graveyard button r = new Rectangle(21, 21); graveLabel.setToolTipText("Card Types: 0"); Image imageGrave = ImageHelper.getImageFromResources("/info/grave.png"); @@ -501,8 +505,8 @@ public class PlayerPanelExt extends javax.swing.JPanel { }); zonesPanel = new JPanel(); - zonesPanel.setPreferredSize(new Dimension(100, 20)); - zonesPanel.setSize(100, 20); + zonesPanel.setPreferredSize(new Dimension(100, 60)); + zonesPanel.setSize(100, 60); zonesPanel.setLayout(null); zonesPanel.setOpaque(false); @@ -524,6 +528,40 @@ public class PlayerPanelExt extends javax.swing.JPanel { cheat.setBounds(28, 0, 25, 21); zonesPanel.add(cheat); + energyExperiencePanel = new JPanel(); + energyExperiencePanel.setPreferredSize(new Dimension(100, 20)); + energyExperiencePanel.setSize(100, 20); + energyExperiencePanel.setLayout(null); + energyExperiencePanel.setOpaque(false); + + // Energy count + energyLabel.setText("0"); + r = new Rectangle(18, 18); + energyLabel.setToolTipText("Energy"); + Image imageEnergy = ImageHelper.getImageFromResources("/info/energy.png"); + BufferedImage resizedEnergy = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(imageEnergy, BufferedImage.TYPE_INT_ARGB), r); + energy = new ImagePanel(resizedEnergy, ImagePanel.ACTUAL); + energy.setToolTipText("Energy"); + energy.setOpaque(false); + // Experience count + experienceLabel.setText("0"); + r = new Rectangle(18, 18); + experienceLabel.setToolTipText("Experience"); + Image imageExperience = ImageHelper.getImageFromResources("/info/experience.png"); + BufferedImage resizedExperience = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(imageExperience, BufferedImage.TYPE_INT_ARGB), r); + experience = new ImagePanel(resizedExperience, ImagePanel.ACTUAL); + experience.setToolTipText("Experience"); + experience.setOpaque(false); + + energy.setBounds(5, 22, 21, 21); + zonesPanel.add(energy); + energyLabel.setBounds(27, 22, 21, 21); + zonesPanel.add(energyLabel); + experience.setBounds(48, 22, 21, 21); + zonesPanel.add(experience); + experienceLabel.setBounds(69, 22, 21, 21); + zonesPanel.add(experienceLabel); + btnPlayer = new JButton(); btnPlayer.setText("Player"); btnPlayer.setVisible(false); @@ -895,6 +933,8 @@ public class PlayerPanelExt extends javax.swing.JPanel { private JButton btnPlayer; private ImagePanel life; private ImagePanel poison; + private ImagePanel energy; + private ImagePanel experience; private ImagePanel hand; private HoverButton grave; private HoverButton library; @@ -906,6 +946,8 @@ public class PlayerPanelExt extends javax.swing.JPanel { private JLabel handLabel; private JLabel libraryLabel; private JLabel poisonLabel; + private JLabel energyLabel; + private JLabel experienceLabel; private JLabel graveLabel; private JLabel exileLabel; private boolean changedFontLibrary; @@ -914,6 +956,7 @@ public class PlayerPanelExt extends javax.swing.JPanel { private boolean changedFontExile; private JPanel zonesPanel; + private JPanel energyExperiencePanel; private HoverButton exileZone; private HoverButton commandZone; private HoverButton enchantPlayerViewZone; diff --git a/Mage.Client/src/main/resources/info/energy.png b/Mage.Client/src/main/resources/info/energy.png new file mode 100644 index 00000000000..5cdfba5dc49 Binary files /dev/null and b/Mage.Client/src/main/resources/info/energy.png differ diff --git a/Mage.Client/src/main/resources/info/experience.png b/Mage.Client/src/main/resources/info/experience.png new file mode 100644 index 00000000000..180ef0f47a9 Binary files /dev/null and b/Mage.Client/src/main/resources/info/experience.png differ diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ChampionsDrake.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ChampionsDrake.java index 61c44ebdd8a..1fcbecd2d86 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ChampionsDrake.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ChampionsDrake.java @@ -36,12 +36,11 @@ import mage.abilities.condition.common.PermanentHasCounterCondition; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.counters.CounterType; -import mage.filter.common.FilterCreaturePermanent; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.common.SimpleStaticAbility; import mage.constants.Zone; - +import mage.filter.common.FilterControlledCreaturePermanent; /** * @@ -64,7 +63,7 @@ public class ChampionsDrake extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Champion's Drake gets +3/+3 as long as you control a creature with three or more level counters on it. - ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new BoostSourceEffect(3, 3, Duration.WhileOnBattlefield), new PermanentHasCounterCondition(CounterType.LEVEL, 2, new FilterCreaturePermanent(), PermanentHasCounterCondition.CountType.MORE_THAN), rule); + ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new BoostSourceEffect(3, 3, Duration.WhileOnBattlefield), new PermanentHasCounterCondition(CounterType.LEVEL, 2, new FilterControlledCreaturePermanent(), PermanentHasCounterCondition.CountType.MORE_THAN), rule); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); } diff --git a/Mage/src/main/java/mage/abilities/condition/common/PermanentHasCounterCondition.java b/Mage/src/main/java/mage/abilities/condition/common/PermanentHasCounterCondition.java index b20f5d4b77c..16d45219dc1 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/PermanentHasCounterCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/PermanentHasCounterCondition.java @@ -41,9 +41,10 @@ import java.util.List; */ public class PermanentHasCounterCondition implements Condition { - public static enum CountType {MORE_THAN, FEWER_THAN, EQUAL_TO} + public static enum CountType { + MORE_THAN, FEWER_THAN, EQUAL_TO + }; - ; private CounterType counterType; private int amount; private FilterPermanent filter; @@ -62,30 +63,26 @@ public class PermanentHasCounterCondition implements Condition { @Override public boolean apply(Game game, Ability source) { - boolean conditionApplies = false; - List permanents = game.getBattlefield().getAllActivePermanents(this.filter, source.getControllerId(), game); + List permanents = game.getBattlefield().getActivePermanents(this.filter, source.getControllerId(), game); for (Permanent permanent : permanents) { switch (this.type) { case FEWER_THAN: if (permanent.getCounters(game).getCount(this.counterType) < this.amount) { - conditionApplies = true; - break; + return true; } break; case MORE_THAN: if (permanent.getCounters(game).getCount(this.counterType) > this.amount) { - conditionApplies = true; - break; + return true; } break; case EQUAL_TO: if (permanent.getCounters(game).getCount(this.counterType) == this.amount) { - conditionApplies = true; - break; + return true; } break; } } - return conditionApplies; + return false; } }