This commit is contained in:
Lymia Aluysia 2016-09-25 14:09:42 -05:00
commit 207cb04dbc
No known key found for this signature in database
GPG key ID: DB2E204C989251F7
6 changed files with 59 additions and 20 deletions

View file

@ -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;
/**

View file

@ -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;

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View file

@ -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));
}

View file

@ -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<Permanent> permanents = game.getBattlefield().getAllActivePermanents(this.filter, source.getControllerId(), game);
List<Permanent> 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;
}
}