mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
Merge origin/master
This commit is contained in:
commit
a662acbc58
121 changed files with 5148 additions and 811 deletions
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-root</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.mage</groupId>
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
1 [C15:268] Sol Ring
|
||||
1 [C15:147] Curse of the Nightly Hunt
|
||||
1 [C15:148] Desolation Giant
|
||||
1 [C15:303] Secluded Steppe
|
||||
1 [C15:304] Secluded Steppe
|
||||
1 [C15:308] Smoldering Crater
|
||||
1 [C15:65] Crib Swap
|
||||
1 [C15:171] Warstorm Surge
|
||||
|
|
|
@ -574,7 +574,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
if (DownloadPictures.checkForNewCards(missingCards)) {
|
||||
LOGGER.info("Card images checking time: " + ((System.currentTimeMillis() - beforeCall) / 1000 + " seconds"));
|
||||
UserRequestMessage message = new UserRequestMessage("New images available", "Card images are missing (" + missingCards.size() + "). Do you want to download the images?"
|
||||
+ "<br><br><i>You can deactivate the image download check on apllication start in the preferences.</i>");
|
||||
+ "<br><br><i>You can deactivate the image download check on application start in the preferences.</i>");
|
||||
message.setButton1("No", null);
|
||||
message.setButton2("Yes", PlayerAction.CLIENT_DOWNLOAD_CARD_IMAGES);
|
||||
showUserRequestDialog(message);
|
||||
|
@ -1135,8 +1135,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
public void showUserRequestDialog(final UserRequestMessage userRequestMessage) {
|
||||
final UserRequestDialog userRequestDialog = new UserRequestDialog();
|
||||
userRequestDialog.setLocation(100, 100);
|
||||
desktopPane.add(userRequestDialog, JLayeredPane.MODAL_LAYER);
|
||||
// ui.addComponent(MageComponents.DESKTOP_PANE, userRequestDialog);
|
||||
desktopPane.add(userRequestDialog, JLayeredPane.POPUP_LAYER);
|
||||
if (SwingUtilities.isEventDispatchThread()) {
|
||||
userRequestDialog.showDialog(userRequestMessage);
|
||||
} else {
|
||||
|
@ -1371,38 +1370,21 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void showMessage(final String message
|
||||
) {
|
||||
if (SwingUtilities.isEventDispatchThread()) {
|
||||
JOptionPane.showMessageDialog(desktopPane, message);
|
||||
} else {
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
JOptionPane.showMessageDialog(desktopPane, message);
|
||||
}
|
||||
});
|
||||
}
|
||||
public void showMessage(String message) {
|
||||
final UserRequestMessage requestMessage = new UserRequestMessage("Message", message);
|
||||
requestMessage.setButton1("OK", null);
|
||||
MageFrame.getInstance().showUserRequestDialog(requestMessage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showError(final String message
|
||||
) {
|
||||
if (SwingUtilities.isEventDispatchThread()) {
|
||||
JOptionPane.showMessageDialog(desktopPane, message, "Error", JOptionPane.ERROR_MESSAGE);
|
||||
} else {
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
JOptionPane.showMessageDialog(desktopPane, message, "Error", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
});
|
||||
}
|
||||
public void showError(final String message) {
|
||||
final UserRequestMessage requestMessage = new UserRequestMessage("Error", message);
|
||||
requestMessage.setButton1("OK", null);
|
||||
MageFrame.getInstance().showUserRequestDialog(requestMessage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processCallback(ClientCallback callback
|
||||
) {
|
||||
public void processCallback(ClientCallback callback) {
|
||||
callbackClient.processCallback(callback);
|
||||
}
|
||||
|
||||
|
|
|
@ -39,11 +39,10 @@ import javax.swing.JLayeredPane;
|
|||
import javax.swing.JPanel;
|
||||
import javax.swing.JPopupMenu;
|
||||
import javax.swing.JScrollPane;
|
||||
import mage.cards.CardDimensions;
|
||||
import mage.cards.MageCard;
|
||||
import mage.client.plugins.impl.Plugins;
|
||||
import mage.client.util.Config;
|
||||
import mage.client.util.Event;
|
||||
import mage.client.util.GUISizeHelper;
|
||||
import mage.client.util.Listener;
|
||||
import mage.view.AbilityView;
|
||||
import mage.view.CardView;
|
||||
|
@ -59,6 +58,8 @@ public class CardArea extends JPanel implements MouseListener {
|
|||
private final javax.swing.JLayeredPane cardArea;
|
||||
private final javax.swing.JScrollPane scrollPane;
|
||||
private int yTextOffset;
|
||||
private Dimension cardDimension;
|
||||
private int verticalCardOffset;
|
||||
|
||||
/**
|
||||
* Create the panel.
|
||||
|
@ -68,7 +69,7 @@ public class CardArea extends JPanel implements MouseListener {
|
|||
|
||||
scrollPane = new JScrollPane();
|
||||
add(scrollPane, BorderLayout.CENTER);
|
||||
|
||||
setGUISize();
|
||||
cardArea = new JLayeredPane();
|
||||
scrollPane.setViewportView(cardArea);
|
||||
yTextOffset = 10;
|
||||
|
@ -84,7 +85,25 @@ public class CardArea extends JPanel implements MouseListener {
|
|||
}
|
||||
}
|
||||
|
||||
public void loadCards(CardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId) {
|
||||
public void changeGUISize() {
|
||||
setGUISize();
|
||||
for (Component component : cardArea.getComponents()) {
|
||||
if (component instanceof CardPanel) {
|
||||
((CardPanel) component).setBounds(0, 0, cardDimension.width, cardDimension.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setGUISize() {
|
||||
setCardDimension(GUISizeHelper.otherZonesCardDimension, GUISizeHelper.otherZonesCardVerticalOffset);
|
||||
}
|
||||
|
||||
public void setCardDimension(Dimension dimension, int verticalCardOffset) {
|
||||
this.cardDimension = dimension;
|
||||
this.verticalCardOffset = verticalCardOffset;
|
||||
}
|
||||
|
||||
public void loadCards(CardsView showCards, BigCard bigCard, UUID gameId) {
|
||||
this.reloaded = true;
|
||||
cardArea.removeAll();
|
||||
if (showCards != null && showCards.size() < 10) {
|
||||
|
@ -92,7 +111,7 @@ public class CardArea extends JPanel implements MouseListener {
|
|||
loadCardsFew(showCards, bigCard, gameId);
|
||||
} else {
|
||||
yTextOffset = 0;
|
||||
loadCardsMany(showCards, bigCard, gameId, dimension);
|
||||
loadCardsMany(showCards, bigCard, gameId);
|
||||
}
|
||||
cardArea.revalidate();
|
||||
|
||||
|
@ -100,11 +119,11 @@ public class CardArea extends JPanel implements MouseListener {
|
|||
this.repaint();
|
||||
}
|
||||
|
||||
public void loadCardsNarrow(CardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId) {
|
||||
public void loadCardsNarrow(CardsView showCards, BigCard bigCard, UUID gameId) {
|
||||
this.reloaded = true;
|
||||
cardArea.removeAll();
|
||||
yTextOffset = 0;
|
||||
loadCardsMany(showCards, bigCard, gameId, dimension);
|
||||
loadCardsMany(showCards, bigCard, gameId);
|
||||
cardArea.revalidate();
|
||||
|
||||
this.revalidate();
|
||||
|
@ -112,16 +131,15 @@ public class CardArea extends JPanel implements MouseListener {
|
|||
}
|
||||
|
||||
private void loadCardsFew(CardsView showCards, BigCard bigCard, UUID gameId) {
|
||||
Rectangle rectangle = new Rectangle(Config.dimensions.frameWidth, Config.dimensions.frameHeight);
|
||||
Dimension dimension = new Dimension(Config.dimensions.frameWidth, Config.dimensions.frameHeight);
|
||||
Rectangle rectangle = new Rectangle(cardDimension.width, cardDimension.height);
|
||||
for (CardView card : showCards.values()) {
|
||||
addCard(card, bigCard, gameId, rectangle, dimension, Config.dimensions);
|
||||
rectangle.translate(Config.dimensions.frameWidth, 0);
|
||||
addCard(card, bigCard, gameId, rectangle);
|
||||
rectangle.translate(cardDimension.width, 0);
|
||||
}
|
||||
cardArea.setPreferredSize(new Dimension(Config.dimensions.frameWidth * showCards.size(), Config.dimensions.frameHeight));
|
||||
cardArea.setPreferredSize(new Dimension(cardDimension.width * showCards.size(), cardDimension.height));
|
||||
}
|
||||
|
||||
private void addCard(CardView card, BigCard bigCard, UUID gameId, Rectangle rectangle, Dimension dimension, CardDimensions cardDimensions) {
|
||||
private void addCard(CardView card, BigCard bigCard, UUID gameId, Rectangle rectangle) {
|
||||
if (card instanceof AbilityView) {
|
||||
CardView tmp = ((AbilityView) card).getSourceCard();
|
||||
tmp.overrideRules(card.getRules());
|
||||
|
@ -130,37 +148,37 @@ public class CardArea extends JPanel implements MouseListener {
|
|||
tmp.setAbility(card); // cross-reference, required for ability picker
|
||||
card = tmp;
|
||||
}
|
||||
MageCard cardPanel = Plugins.getInstance().getMageCard(card, bigCard, dimension, gameId, true);
|
||||
MageCard cardPanel = Plugins.getInstance().getMageCard(card, bigCard, cardDimension, gameId, true);
|
||||
|
||||
cardPanel.setBounds(rectangle);
|
||||
cardPanel.addMouseListener(this);
|
||||
cardArea.add(cardPanel);
|
||||
cardArea.moveToFront(cardPanel);
|
||||
cardPanel.update(card);
|
||||
cardPanel.setCardBounds(rectangle.x, rectangle.y, cardDimensions.frameWidth, cardDimensions.frameHeight);
|
||||
cardPanel.setCardBounds(rectangle.x, rectangle.y, cardDimension.width, cardDimension.height);
|
||||
cardPanel.setTextOffset(yTextOffset);
|
||||
cardPanel.showCardTitle();
|
||||
}
|
||||
|
||||
private void loadCardsMany(CardsView showCards, BigCard bigCard, UUID gameId, CardDimensions cardDimensions) {
|
||||
private void loadCardsMany(CardsView showCards, BigCard bigCard, UUID gameId) {
|
||||
int rowsOfCards = 20;
|
||||
int columns = 1;
|
||||
if (showCards != null && showCards.size() > 0) {
|
||||
Rectangle rectangle = new Rectangle(cardDimensions.frameWidth, cardDimensions.frameHeight);
|
||||
Dimension dimension = new Dimension(cardDimensions.frameWidth, cardDimensions.frameHeight);
|
||||
Rectangle rectangle = new Rectangle(cardDimension.width, cardDimension.height);
|
||||
int count = 0;
|
||||
for (CardView card : showCards.values()) {
|
||||
addCard(card, bigCard, gameId, rectangle, dimension, cardDimensions);
|
||||
if (count >= 20) {
|
||||
rectangle.translate(cardDimensions.frameWidth, -400);
|
||||
addCard(card, bigCard, gameId, rectangle);
|
||||
if (count >= rowsOfCards) {
|
||||
rectangle.translate(cardDimension.width, -(rowsOfCards * verticalCardOffset));
|
||||
columns++;
|
||||
count = 0;
|
||||
} else {
|
||||
rectangle.translate(0, 20);
|
||||
rectangle.translate(0, verticalCardOffset);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
cardArea.setPreferredSize(new Dimension(cardDimensions.frameWidth * columns, cardDimensions.frameHeight + 400));
|
||||
cardArea.setPreferredSize(new Dimension(cardDimension.width * columns, cardDimension.height + (rowsOfCards * verticalCardOffset)));
|
||||
}
|
||||
|
||||
public boolean isReloaded() {
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
/*
|
||||
/*
|
||||
* CardGrid.java
|
||||
*
|
||||
* Created on 30-Mar-2010, 9:25:40 PM
|
||||
|
@ -50,8 +50,8 @@ import java.util.UUID;
|
|||
import mage.cards.MageCard;
|
||||
import mage.client.deckeditor.SortSetting;
|
||||
import mage.client.plugins.impl.Plugins;
|
||||
import mage.client.util.Config;
|
||||
import mage.client.util.Event;
|
||||
import mage.client.util.GUISizeHelper;
|
||||
import mage.client.util.Listener;
|
||||
import mage.utils.CardUtil;
|
||||
import mage.view.CardView;
|
||||
|
@ -126,7 +126,7 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener,
|
|||
|
||||
private void addCard(CardView card, BigCard bigCard, UUID gameId, boolean drawImage) {
|
||||
if (cardDimension == null) {
|
||||
cardDimension = new Dimension(Config.dimensions.frameWidth, Config.dimensions.frameHeight);
|
||||
cardDimension = GUISizeHelper.editorCardDimension;
|
||||
}
|
||||
MageCard cardImg = Plugins.getInstance().getMageCard(card, bigCard, cardDimension, gameId, drawImage);
|
||||
cards.put(card.getId(), cardImg);
|
||||
|
@ -139,11 +139,12 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener,
|
|||
@Override
|
||||
public void drawCards(SortSetting sortSetting) {
|
||||
int maxWidth = this.getParent().getWidth();
|
||||
int numColumns = maxWidth / Config.dimensions.frameWidth;
|
||||
int cardVerticalOffset = GUISizeHelper.editorCardOffsetSize;
|
||||
int numColumns = maxWidth / cardDimension.width;
|
||||
int curColumn = 0;
|
||||
int curRow = 0;
|
||||
if (cards.size() > 0) {
|
||||
Rectangle rectangle = new Rectangle(Config.dimensions.frameWidth, Config.dimensions.frameHeight);
|
||||
Rectangle rectangle = new Rectangle(cardDimension.width, cardDimension.height);
|
||||
List<MageCard> sortedCards = new ArrayList<>(cards.values());
|
||||
switch (sortSetting.getSortBy()) {
|
||||
case NAME:
|
||||
|
@ -202,16 +203,16 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener,
|
|||
}
|
||||
break;
|
||||
}
|
||||
rectangle.setLocation(curColumn * Config.dimensions.frameWidth, curRow * 20);
|
||||
rectangle.setLocation(curColumn * cardDimension.width, curRow * cardVerticalOffset);
|
||||
cardImg.setBounds(rectangle);
|
||||
cardImg.setCardBounds(rectangle.x, rectangle.y, Config.dimensions.frameWidth, Config.dimensions.frameHeight);
|
||||
cardImg.setCardBounds(rectangle.x, rectangle.y, cardDimension.width, cardDimension.height);
|
||||
moveToFront(cardImg);
|
||||
curRow++;
|
||||
lastCard = cardImg;
|
||||
} else {
|
||||
rectangle.setLocation(curColumn * Config.dimensions.frameWidth, curRow * 20);
|
||||
rectangle.setLocation(curColumn * cardDimension.width, curRow * cardVerticalOffset);
|
||||
cardImg.setBounds(rectangle);
|
||||
cardImg.setCardBounds(rectangle.x, rectangle.y, Config.dimensions.frameWidth, Config.dimensions.frameHeight);
|
||||
cardImg.setCardBounds(rectangle.x, rectangle.y, cardDimension.width, cardDimension.height);
|
||||
moveToFront(cardImg);
|
||||
curColumn++;
|
||||
if (curColumn == numColumns) {
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<Dimension value="[30, 30]"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="(!Beans.isDesignTime())?
(new Dimension(Config.dimensions.frameWidth, Config.dimensions.frameHeight))
:(new Dimension(600, 600))" type="code"/>
|
||||
<Connection code="(!Beans.isDesignTime())?
(GUISizeHelper.editorCardDimension)
:(new Dimension(600, 600))" type="code"/>
|
||||
</Property>
|
||||
<Property name="requestFocusEnabled" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
|
@ -261,7 +261,7 @@
|
|||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cbSortByActionPerformed"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<SortBy>"/>
|
||||
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value=""/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JToggleButton" name="jToggleListView">
|
||||
|
|
|
@ -70,7 +70,6 @@ import mage.client.util.CardViewColorIdentityComparator;
|
|||
import mage.client.util.CardViewCostComparator;
|
||||
import mage.client.util.CardViewNameComparator;
|
||||
import mage.client.util.CardViewRarityComparator;
|
||||
import mage.client.util.Config;
|
||||
import mage.client.util.Event;
|
||||
import mage.client.util.GUISizeHelper;
|
||||
import mage.client.util.Listener;
|
||||
|
@ -89,6 +88,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
|
|||
|
||||
protected CardEventSource cardEventSource = new CardEventSource();
|
||||
private Dimension cardDimension;
|
||||
private int rowHeight;
|
||||
private CardsView cards;
|
||||
private Map<UUID, MageCard> mageCards = new LinkedHashMap<>();
|
||||
protected BigCard bigCard;
|
||||
|
@ -144,6 +144,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
|
|||
|
||||
public void changeGUISize() {
|
||||
setGUISize();
|
||||
redrawCards();
|
||||
}
|
||||
|
||||
private void setGUISize() {
|
||||
|
@ -151,7 +152,8 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
|
|||
mainTable.getTableHeader().setPreferredSize(new Dimension(GUISizeHelper.tableHeaderHeight, GUISizeHelper.tableHeaderHeight));
|
||||
mainTable.setFont(GUISizeHelper.tableFont);
|
||||
mainTable.setRowHeight(GUISizeHelper.getTableRowHeight());
|
||||
|
||||
cardDimension = GUISizeHelper.editorCardDimension;
|
||||
rowHeight = GUISizeHelper.editorCardOffsetSize;
|
||||
}
|
||||
|
||||
private void makeTransparent() {
|
||||
|
@ -301,7 +303,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
|
|||
@Override
|
||||
public void drawCards(SortSetting sortSetting) {
|
||||
int maxWidth = this.getParent().getWidth();
|
||||
int numColumns = maxWidth / Config.dimensions.frameWidth;
|
||||
int numColumns = maxWidth / cardDimension.width;
|
||||
int curColumn = 0;
|
||||
int curRow = 0;
|
||||
int maxRow = 0;
|
||||
|
@ -325,7 +327,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
|
|||
}
|
||||
|
||||
if (cards != null && cards.size() > 0) {
|
||||
Rectangle rectangle = new Rectangle(Config.dimensions.frameWidth, Config.dimensions.frameHeight);
|
||||
Rectangle rectangle = new Rectangle(cardDimension.width, cardDimension.height);
|
||||
List<CardView> sortedCards = new ArrayList<>(cards.values());
|
||||
switch (sortSetting.getSortBy()) {
|
||||
case NAME:
|
||||
|
@ -361,13 +363,13 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
|
|||
curRow = 0;
|
||||
}
|
||||
}
|
||||
rectangle.setLocation(curColumn * Config.dimensions.frameWidth, curRow * 20);
|
||||
rectangle.setLocation(curColumn * cardDimension.width, curRow * rowHeight);
|
||||
setCardBounds(mageCards.get(card.getId()), rectangle);
|
||||
|
||||
curRow++;
|
||||
lastCard = card;
|
||||
} else {
|
||||
rectangle.setLocation(curColumn * Config.dimensions.frameWidth, curRow * 20);
|
||||
rectangle.setLocation(curColumn * cardDimension.width, curRow * rowHeight);
|
||||
setCardBounds(mageCards.get(card.getId()), rectangle);
|
||||
curColumn++;
|
||||
if (curColumn == numColumns) {
|
||||
|
@ -381,7 +383,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
|
|||
maxRow = Math.max(maxRow, curRow);
|
||||
maxColumn = Math.max(maxColumn, curColumn);
|
||||
updateCounts();
|
||||
cardArea.setPreferredSize(new Dimension((maxColumn + 1) * Config.dimensions.frameWidth, Config.dimensions.frameHeight + maxRow * 20));
|
||||
cardArea.setPreferredSize(new Dimension((maxColumn + 1) * cardDimension.width, cardDimension.height + maxRow * rowHeight));
|
||||
cardArea.revalidate();
|
||||
this.revalidate();
|
||||
this.repaint();
|
||||
|
@ -422,9 +424,6 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
|
|||
}
|
||||
|
||||
private MageCard addCard(CardView card, BigCard bigCard, UUID gameId) {
|
||||
if (cardDimension == null) {
|
||||
cardDimension = new Dimension(Config.dimensions.frameWidth, Config.dimensions.frameHeight);
|
||||
}
|
||||
MageCard cardImg = Plugins.getInstance().getMageCard(card, bigCard, cardDimension, gameId, true);
|
||||
cardArea.add(cardImg);
|
||||
cardImg.update(card);
|
||||
|
@ -434,7 +433,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
|
|||
|
||||
private void setCardBounds(MageCard card, Rectangle rectangle) {
|
||||
card.setBounds(rectangle);
|
||||
card.setCardBounds(rectangle.x, rectangle.y, Config.dimensions.frameWidth, Config.dimensions.frameHeight);
|
||||
card.setCardBounds(rectangle.x, rectangle.y, cardDimension.width, cardDimension.height);
|
||||
cardArea.moveToFront(card);
|
||||
}
|
||||
|
||||
|
@ -486,7 +485,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
|
|||
lblInstantCount = new javax.swing.JLabel();
|
||||
lblEnchantmentCount = new javax.swing.JLabel();
|
||||
chkPiles = new javax.swing.JCheckBox();
|
||||
cbSortBy = new javax.swing.JComboBox<SortBy>();
|
||||
cbSortBy = new javax.swing.JComboBox();
|
||||
jToggleListView = new javax.swing.JToggleButton();
|
||||
jToggleCardView = new javax.swing.JToggleButton();
|
||||
panelCardArea = new javax.swing.JScrollPane();
|
||||
|
@ -495,7 +494,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
|
|||
setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
|
||||
setMinimumSize(new java.awt.Dimension(30, 30));
|
||||
setPreferredSize((!Beans.isDesignTime())?
|
||||
(new Dimension(Config.dimensions.frameWidth, Config.dimensions.frameHeight))
|
||||
(GUISizeHelper.editorCardDimension)
|
||||
:(new Dimension(600, 600)));
|
||||
setRequestFocusEnabled(false);
|
||||
|
||||
|
@ -717,7 +716,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
|
|||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.ButtonGroup bgView;
|
||||
private javax.swing.JLayeredPane cardArea;
|
||||
private javax.swing.JComboBox<SortBy> cbSortBy;
|
||||
private javax.swing.JComboBox cbSortBy;
|
||||
private javax.swing.JCheckBox chkPiles;
|
||||
private javax.swing.JToggleButton jToggleCardView;
|
||||
private javax.swing.JToggleButton jToggleListView;
|
||||
|
|
|
@ -231,7 +231,7 @@ public class ChatPanelBasic extends javax.swing.JPanel {
|
|||
if (username != null && !username.isEmpty()) {
|
||||
text.append(getColoredText(userColor, username + userSeparator));
|
||||
}
|
||||
text.append(getColoredText(textColor, ManaSymbols.replaceSymbolsWithHTML(message, ManaSymbols.Type.PAY)));
|
||||
text.append(getColoredText(textColor, ManaSymbols.replaceSymbolsWithHTML(message, ManaSymbols.Type.CHAT)));
|
||||
this.txtConversation.append(text.toString());
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ public class ChatPanelSeparated extends ChatPanelBasic {
|
|||
if (username != null && !username.isEmpty()) {
|
||||
text.append(getColoredText(userColor, username + userSeparator));
|
||||
}
|
||||
text.append(getColoredText(textColor, ManaSymbols.replaceSymbolsWithHTML(message, ManaSymbols.Type.PAY)));
|
||||
text.append(getColoredText(textColor, ManaSymbols.replaceSymbolsWithHTML(message, ManaSymbols.Type.CHAT)));
|
||||
this.systemMessagesPane.append(text.toString());
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package mage.client.components;
|
|||
import java.awt.Color;
|
||||
import javax.swing.JEditorPane;
|
||||
import javax.swing.SwingUtilities;
|
||||
import mage.client.util.GUISizeHelper;
|
||||
import org.mage.card.arcane.ManaSymbols;
|
||||
import org.mage.card.arcane.UI;
|
||||
|
||||
|
@ -35,7 +36,7 @@ public class MageTextArea extends JEditorPane {
|
|||
final StringBuilder buffer = new StringBuilder(512);
|
||||
// Dialog is a java logical font family, so it should work on all systems
|
||||
buffer.append("<html><body style='font-family:Dialog;font-size:");
|
||||
buffer.append(16);
|
||||
buffer.append(GUISizeHelper.gameDialogAreaFontSizeBig);
|
||||
buffer.append("pt;margin:3px 3px 3px 3px;color: #FFFFFF'><b><center>");
|
||||
|
||||
// Don't know what it does (easy italc?) but it bugs with multiple #HTML color codes (LevelX2)
|
||||
|
@ -43,7 +44,7 @@ public class MageTextArea extends JEditorPane {
|
|||
//text = text.replaceAll("\\s*//\\s*", "<hr width='50%'>");
|
||||
text = text.replace("\r\n", "<div style='font-size:5pt'></div>");
|
||||
|
||||
final String basicText = ManaSymbols.replaceSymbolsWithHTML(text, ManaSymbols.Type.PAY);
|
||||
final String basicText = ManaSymbols.replaceSymbolsWithHTML(text, ManaSymbols.Type.DIALOG);
|
||||
if (text.length() > 0) {
|
||||
buffer.append(basicText);
|
||||
}
|
||||
|
@ -57,10 +58,9 @@ public class MageTextArea extends JEditorPane {
|
|||
MageTextArea.super.setText(promptText);
|
||||
// in case the text don't fit in the panel a tooltip with the text is added
|
||||
if (panelWidth > 0 && MageTextArea.this.getPreferredSize().getWidth() > panelWidth) {
|
||||
// String tooltip = promptText
|
||||
// .replace("color: #FFFFFF'>", "color: #111111'><p width='400'>")
|
||||
// .replace("</body>", "</p></body>");
|
||||
String tooltip = "<html><center><body style='font-family:Dialog;font-size:14;color: #FFFFFF'><p width='500'>" + basicText + "</p></body></html>";
|
||||
String tooltip = "<html><center><body style='font-family:Dialog;font-size:"
|
||||
+ GUISizeHelper.gameDialogAreaFontSizeBig
|
||||
+ ";color: #FFFFFF'><p width='500'>" + basicText + "</p></body></html>";
|
||||
MageTextArea.super.setToolTipText(tooltip);
|
||||
} else {
|
||||
MageTextArea.super.setToolTipText(null);
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
package mage.client.components.ability;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import javax.swing.*;
|
||||
import mage.client.util.ImageHelper;
|
||||
import mage.client.util.SettingsManager;
|
||||
import mage.client.util.gui.GuiDisplayUtil;
|
||||
|
@ -12,12 +17,6 @@ import org.jdesktop.swingx.JXPanel;
|
|||
import org.mage.card.arcane.ManaSymbols;
|
||||
import org.mage.card.arcane.UI;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Dialog for choosing abilities.
|
||||
*
|
||||
|
@ -48,8 +47,8 @@ public class AbilityPicker extends JXPanel implements MouseWheelListener {
|
|||
private static final String IMAGE_RIGHT_PATH = "/game/right.png";
|
||||
private static final String IMAGE_RIGHT_HOVERED_PATH = "/game/right_hovered.png";
|
||||
|
||||
private static Color SELECTED_COLOR = new Color(64,147,208);
|
||||
private static Color BORDER_COLOR = new Color(0,0,0,50);
|
||||
private static Color SELECTED_COLOR = new Color(64, 147, 208);
|
||||
private static Color BORDER_COLOR = new Color(0, 0, 0, 50);
|
||||
|
||||
private boolean selected = false;
|
||||
|
||||
|
@ -59,7 +58,7 @@ public class AbilityPicker extends JXPanel implements MouseWheelListener {
|
|||
|
||||
jScrollPane2.setOpaque(false);
|
||||
jScrollPane2.getViewport().setOpaque(false);
|
||||
UIManager.put( "ScrollBar.width", 17);
|
||||
UIManager.put("ScrollBar.width", 17);
|
||||
jScrollPane2.getHorizontalScrollBar().setUI(new MageScrollbarUI());
|
||||
jScrollPane2.getVerticalScrollBar().setUI(new MageScrollbarUI());
|
||||
}
|
||||
|
@ -67,13 +66,13 @@ public class AbilityPicker extends JXPanel implements MouseWheelListener {
|
|||
public AbilityPicker(List<Object> choices, String message) {
|
||||
this.choices = choices;
|
||||
setSize(DIALOG_WIDTH, DIALOG_HEIGHT);
|
||||
if (message!= null) {
|
||||
if (message != null) {
|
||||
this.message = message + " (single-click)";
|
||||
}
|
||||
initComponents();
|
||||
jScrollPane2.setOpaque(false);
|
||||
jScrollPane2.getViewport().setOpaque(false);
|
||||
UIManager.put( "ScrollBar.width", 17);
|
||||
UIManager.put("ScrollBar.width", 17);
|
||||
jScrollPane2.getHorizontalScrollBar().setUI(new MageScrollbarUI());
|
||||
jScrollPane2.getVerticalScrollBar().setUI(new MageScrollbarUI());
|
||||
}
|
||||
|
@ -84,7 +83,7 @@ public class AbilityPicker extends JXPanel implements MouseWheelListener {
|
|||
}
|
||||
|
||||
public void cleanUp() {
|
||||
for(MouseListener ml: this.getMouseListeners()) {
|
||||
for (MouseListener ml : this.getMouseListeners()) {
|
||||
this.removeMouseListener(ml);
|
||||
}
|
||||
}
|
||||
|
@ -93,7 +92,7 @@ public class AbilityPicker extends JXPanel implements MouseWheelListener {
|
|||
this.choices = new ArrayList<Object>();
|
||||
this.selected = true; // to stop previous modal
|
||||
|
||||
for (Map.Entry<UUID, String> choice: choices.getChoices().entrySet()) {
|
||||
for (Map.Entry<UUID, String> choice : choices.getChoices().entrySet()) {
|
||||
this.choices.add(new AbilityPickerAction(choice.getKey(), choice.getValue()));
|
||||
}
|
||||
this.choices.add(new AbilityPickerAction(null, "Cancel"));
|
||||
|
@ -186,28 +185,28 @@ public class AbilityPicker extends JXPanel implements MouseWheelListener {
|
|||
GroupLayout.TRAILING,
|
||||
layout.createSequentialGroup().addContainerGap().add(
|
||||
layout.createParallelGroup(GroupLayout.TRAILING).add(GroupLayout.LEADING, jScrollPane2, GroupLayout.DEFAULT_SIZE, 422, Short.MAX_VALUE).add(GroupLayout.LEADING,
|
||||
layout.createSequentialGroup().add(jLabel1).addPreferredGap(LayoutStyle.RELATED, 175, Short.MAX_VALUE).add(1, 1, 1)).add(
|
||||
GroupLayout.LEADING,
|
||||
layout.createSequentialGroup().add(layout.createParallelGroup(GroupLayout.LEADING)
|
||||
)
|
||||
.addPreferredGap(LayoutStyle.RELATED)
|
||||
.add(
|
||||
layout.createParallelGroup(GroupLayout.TRAILING)
|
||||
.add(
|
||||
GroupLayout.LEADING, layout.createParallelGroup(GroupLayout.LEADING))))).add(10, 10, 10)));
|
||||
layout.createSequentialGroup().add(jLabel1).addPreferredGap(LayoutStyle.RELATED, 175, Short.MAX_VALUE).add(1, 1, 1)).add(
|
||||
GroupLayout.LEADING,
|
||||
layout.createSequentialGroup().add(layout.createParallelGroup(GroupLayout.LEADING)
|
||||
)
|
||||
.addPreferredGap(LayoutStyle.RELATED)
|
||||
.add(
|
||||
layout.createParallelGroup(GroupLayout.TRAILING)
|
||||
.add(
|
||||
GroupLayout.LEADING, layout.createParallelGroup(GroupLayout.LEADING))))).add(10, 10, 10)));
|
||||
|
||||
layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.LEADING).add(
|
||||
layout.createSequentialGroup().add(
|
||||
layout.createParallelGroup(GroupLayout.LEADING).add(
|
||||
layout.createSequentialGroup().add(jLabel1, GroupLayout.PREFERRED_SIZE, 36, GroupLayout.PREFERRED_SIZE)
|
||||
.add(5, 5, 5)
|
||||
.add(
|
||||
layout.createParallelGroup(GroupLayout.BASELINE)
|
||||
)
|
||||
).add(layout.createSequentialGroup().add(8, 8, 8)))
|
||||
.addPreferredGap(LayoutStyle.RELATED).add(layout.createParallelGroup(GroupLayout.BASELINE)).addPreferredGap(LayoutStyle.RELATED).add(
|
||||
layout.createParallelGroup(GroupLayout.BASELINE)).addPreferredGap(LayoutStyle.RELATED).add(layout.createParallelGroup(GroupLayout.LEADING)).addPreferredGap(
|
||||
LayoutStyle.RELATED).add(jScrollPane2, GroupLayout.PREFERRED_SIZE, 180, GroupLayout.PREFERRED_SIZE).addContainerGap(23, Short.MAX_VALUE)));
|
||||
layout.createSequentialGroup().add(jLabel1, GroupLayout.PREFERRED_SIZE, 36, GroupLayout.PREFERRED_SIZE)
|
||||
.add(5, 5, 5)
|
||||
.add(
|
||||
layout.createParallelGroup(GroupLayout.BASELINE)
|
||||
)
|
||||
).add(layout.createSequentialGroup().add(8, 8, 8)))
|
||||
.addPreferredGap(LayoutStyle.RELATED).add(layout.createParallelGroup(GroupLayout.BASELINE)).addPreferredGap(LayoutStyle.RELATED).add(
|
||||
layout.createParallelGroup(GroupLayout.BASELINE)).addPreferredGap(LayoutStyle.RELATED).add(layout.createParallelGroup(GroupLayout.LEADING)).addPreferredGap(
|
||||
LayoutStyle.RELATED).add(jScrollPane2, GroupLayout.PREFERRED_SIZE, 180, GroupLayout.PREFERRED_SIZE).addContainerGap(23, Short.MAX_VALUE)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -217,27 +216,25 @@ public class AbilityPicker extends JXPanel implements MouseWheelListener {
|
|||
|
||||
if (notches < 0) {
|
||||
if (index > 0) {
|
||||
rows.setSelectedIndex(index-1);
|
||||
rows.repaint();
|
||||
}
|
||||
} else {
|
||||
if (index < choices.size() - 1) {
|
||||
rows.setSelectedIndex(index+1);
|
||||
rows.setSelectedIndex(index - 1);
|
||||
rows.repaint();
|
||||
}
|
||||
} else if (index < choices.size() - 1) {
|
||||
rows.setSelectedIndex(index + 1);
|
||||
rows.repaint();
|
||||
}
|
||||
}
|
||||
|
||||
private void objectMouseClicked(MouseEvent event) {
|
||||
int index = rows.getSelectedIndex();
|
||||
AbilityPickerAction action = (AbilityPickerAction)choices.get(index);
|
||||
AbilityPickerAction action = (AbilityPickerAction) choices.get(index);
|
||||
action.actionPerformed(null);
|
||||
}
|
||||
|
||||
public class ImageRenderer2 extends JEditorPane implements ListCellRenderer {
|
||||
|
||||
public final Map<String, String> cache = new HashMap<String, String>();
|
||||
|
||||
|
||||
@Override
|
||||
public Component getListCellRendererComponent(
|
||||
javax.swing.JList list,
|
||||
|
@ -252,7 +249,7 @@ public class AbilityPicker extends JXPanel implements MouseWheelListener {
|
|||
UI.setHTMLEditorKit(this);
|
||||
|
||||
setOpaque(false);
|
||||
setBackground(new Color(0,0,0,0));
|
||||
setBackground(new Color(0, 0, 0, 0));
|
||||
|
||||
String text = value.toString();
|
||||
|
||||
|
@ -298,17 +295,15 @@ public class AbilityPicker extends JXPanel implements MouseWheelListener {
|
|||
//text += "<br>";
|
||||
|
||||
if (text.length() > 0) {
|
||||
buffer.append(ManaSymbols.replaceSymbolsWithHTML(text, ManaSymbols.Type.PAY));
|
||||
buffer.append(ManaSymbols.replaceSymbolsWithHTML(text, ManaSymbols.Type.DIALOG));
|
||||
}
|
||||
|
||||
buffer.append("</b></body></html>");
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
class ImageRenderer extends DefaultListCellRenderer {
|
||||
|
||||
@Override
|
||||
|
@ -364,7 +359,6 @@ public class AbilityPicker extends JXPanel implements MouseWheelListener {
|
|||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
if (event instanceof MouseEvent) {
|
||||
MouseEvent e = (MouseEvent) event;
|
||||
MouseEvent m = SwingUtilities.convertMouseEvent((Component) e.getSource(), e, this);
|
||||
|
@ -457,14 +451,14 @@ public class AbilityPicker extends JXPanel implements MouseWheelListener {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return (String)getValue(Action.NAME);
|
||||
return (String) getValue(Action.NAME);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void cancel() {
|
||||
try {
|
||||
session.sendPlayerBoolean(gameId, false);
|
||||
session.sendPlayerBoolean(gameId, false);
|
||||
} catch (Exception e) {
|
||||
log.error("Couldn't cancel choose dialog: " + e, e);
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ import mage.client.cards.BigCard;
|
|||
import mage.client.cards.CardsList;
|
||||
import mage.client.constants.Constants.DeckEditorMode;
|
||||
import mage.client.util.Event;
|
||||
import mage.client.util.GUISizeHelper;
|
||||
import mage.client.util.Listener;
|
||||
import mage.view.CardsView;
|
||||
|
||||
|
@ -69,6 +70,7 @@ public class DeckArea extends javax.swing.JPanel {
|
|||
setGUISize();
|
||||
deckList.changeGUISize();
|
||||
sideboardList.changeGUISize();
|
||||
deckAreaSplitPane.setDividerSize(GUISizeHelper.dividerBarSize);
|
||||
}
|
||||
|
||||
private void setGUISize() {
|
||||
|
|
|
@ -81,7 +81,7 @@ import org.apache.log4j.Logger;
|
|||
*/
|
||||
public class DeckEditorPanel extends javax.swing.JPanel {
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(DeckEditorPanel.class);
|
||||
private static final Logger logger = Logger.getLogger(DeckEditorPanel.class);
|
||||
private final JFileChooser fcSelectDeck;
|
||||
private final JFileChooser fcImportDeck;
|
||||
private Deck deck = new Deck();
|
||||
|
@ -690,7 +690,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
|||
} catch (GameException ex) {
|
||||
JOptionPane.showMessageDialog(MageFrame.getDesktop(), ex.getMessage(), "Error loading deck", JOptionPane.ERROR_MESSAGE);
|
||||
} catch (Exception ex) {
|
||||
LOGGER.fatal(ex);
|
||||
logger.fatal(ex);
|
||||
} finally {
|
||||
setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
|
||||
}
|
||||
|
@ -722,7 +722,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
|||
setCursor(new Cursor(Cursor.WAIT_CURSOR));
|
||||
Sets.saveDeck(fileName, deck.getDeckCardLists());
|
||||
} catch (Exception ex) {
|
||||
LOGGER.fatal(ex);
|
||||
logger.fatal(ex);
|
||||
} finally {
|
||||
setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
|
||||
}
|
||||
|
@ -771,7 +771,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
|||
JOptionPane.showMessageDialog(MageFrame.getDesktop(), "Unknown deck format", "Error importing deck", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
LOGGER.fatal(ex);
|
||||
logger.fatal(ex);
|
||||
} finally {
|
||||
setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
|
||||
}
|
||||
|
@ -877,7 +877,7 @@ class ImportFilter extends FileFilter {
|
|||
|
||||
class UpdateDeckTask extends SwingWorker<Void, Void> {
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(UpdateDeckTask.class);
|
||||
private static final Logger logger = Logger.getLogger(UpdateDeckTask.class);
|
||||
private final Session session;
|
||||
private final UUID tableId;
|
||||
private final Deck deck;
|
||||
|
@ -902,7 +902,7 @@ class UpdateDeckTask extends SwingWorker<Void, Void> {
|
|||
try {
|
||||
get();
|
||||
} catch (InterruptedException | ExecutionException ex) {
|
||||
LOGGER.fatal("Update Matches Task error", ex);
|
||||
logger.fatal("Update Matches Task error", ex);
|
||||
} catch (CancellationException ex) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
|
@ -20,12 +20,11 @@
|
|||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.client.deckeditor.table;
|
||||
|
||||
import java.awt.Dimension;
|
||||
|
@ -69,7 +68,7 @@ import org.mage.card.arcane.UI;
|
|||
|
||||
/**
|
||||
* Table Model for card list.
|
||||
*
|
||||
*
|
||||
* @author nantuko
|
||||
*/
|
||||
public class TableModel extends AbstractTableModel implements ICardGrid {
|
||||
|
@ -89,18 +88,18 @@ public class TableModel extends AbstractTableModel implements ICardGrid {
|
|||
private boolean displayNoCopies = false;
|
||||
private UpdateCountsCallback updateCountsCallback;
|
||||
|
||||
private final String column[] = { "Qty", "Name", "Cost", "Color", "Type", "Stats", "Rarity", "Set" };
|
||||
private final String column[] = {"Qty", "Name", "Cost", "Color", "Type", "Stats", "Rarity", "Set"};
|
||||
|
||||
private SortSetting sortSetting;
|
||||
private int recentSortedColumn;
|
||||
private boolean recentAscending;
|
||||
|
||||
private boolean numberEditable;
|
||||
|
||||
|
||||
public TableModel() {
|
||||
this.numberEditable = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
this.clearCardEventListeners();
|
||||
this.clearCards();
|
||||
|
@ -173,9 +172,9 @@ public class TableModel extends AbstractTableModel implements ICardGrid {
|
|||
if (cv.getId().equals(entry.getValue().getId())) {
|
||||
if (count > 0) {
|
||||
// replace by another card with the same name+setCode
|
||||
String key1 = cv.getName()+cv.getExpansionSetCode()+cv.getCardNumber();
|
||||
String key1 = cv.getName() + cv.getExpansionSetCode() + cv.getCardNumber();
|
||||
for (CardView cardView : cards.values()) {
|
||||
String key2 = cardView.getName()+cardView.getExpansionSetCode()+cardView.getCardNumber();
|
||||
String key2 = cardView.getName() + cardView.getExpansionSetCode() + cardView.getCardNumber();
|
||||
if ((key1).equals(key2)) {
|
||||
view.set(j, cardView);
|
||||
break;
|
||||
|
@ -241,36 +240,36 @@ public class TableModel extends AbstractTableModel implements ICardGrid {
|
|||
private Object getColumn(Object obj, int column) {
|
||||
CardView c = (CardView) obj;
|
||||
switch (column) {
|
||||
case 0:
|
||||
if (displayNoCopies) {
|
||||
String key = c.getName() + c.getExpansionSetCode() + c.getCardNumber();
|
||||
Integer count = cardsNoCopies.get(key);
|
||||
return count != null ? count : "";
|
||||
}
|
||||
return "";
|
||||
case 1:
|
||||
return c.getName();
|
||||
case 2:
|
||||
String manaCost = "";
|
||||
for (String m : c.getManaCost()) {
|
||||
manaCost += m;
|
||||
}
|
||||
String castingCost = UI.getDisplayManaCost(manaCost);
|
||||
castingCost = ManaSymbols.replaceSymbolsWithHTML(castingCost, ManaSymbols.Type.PAY);
|
||||
return "<html>" + castingCost + "</html>";
|
||||
case 3:
|
||||
return CardHelper.getColor(c);
|
||||
case 4:
|
||||
return CardHelper.getType(c);
|
||||
case 5:
|
||||
return CardHelper.isCreature(c) ? c.getPower() + "/"
|
||||
+ c.getToughness() : "-";
|
||||
case 6:
|
||||
return c.getRarity().toString();
|
||||
case 7:
|
||||
return c.getExpansionSetCode();
|
||||
default:
|
||||
return "error";
|
||||
case 0:
|
||||
if (displayNoCopies) {
|
||||
String key = c.getName() + c.getExpansionSetCode() + c.getCardNumber();
|
||||
Integer count = cardsNoCopies.get(key);
|
||||
return count != null ? count : "";
|
||||
}
|
||||
return "";
|
||||
case 1:
|
||||
return c.getName();
|
||||
case 2:
|
||||
String manaCost = "";
|
||||
for (String m : c.getManaCost()) {
|
||||
manaCost += m;
|
||||
}
|
||||
String castingCost = UI.getDisplayManaCost(manaCost);
|
||||
castingCost = ManaSymbols.replaceSymbolsWithHTML(castingCost, ManaSymbols.Type.TABLE);
|
||||
return "<html>" + castingCost + "</html>";
|
||||
case 3:
|
||||
return CardHelper.getColor(c);
|
||||
case 4:
|
||||
return CardHelper.getType(c);
|
||||
case 5:
|
||||
return CardHelper.isCreature(c) ? c.getPower() + "/"
|
||||
+ c.getToughness() : "-";
|
||||
case 6:
|
||||
return c.getRarity().toString();
|
||||
case 7:
|
||||
return c.getExpansionSetCode();
|
||||
default:
|
||||
return "error";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -282,7 +281,7 @@ public class TableModel extends AbstractTableModel implements ICardGrid {
|
|||
cards.put(card.getId(), card);
|
||||
|
||||
if (displayNoCopies) {
|
||||
String key = card.getName()+card.getExpansionSetCode()+card.getCardNumber();
|
||||
String key = card.getName() + card.getExpansionSetCode() + card.getCardNumber();
|
||||
Integer count = 1;
|
||||
if (cardsNoCopies.containsKey(key)) {
|
||||
count = cardsNoCopies.get(key) + 1;
|
||||
|
@ -291,7 +290,7 @@ public class TableModel extends AbstractTableModel implements ICardGrid {
|
|||
}
|
||||
cardsNoCopies.put(key, count);
|
||||
} else {
|
||||
view.add(card);
|
||||
view.add(card);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -473,6 +472,5 @@ public class TableModel extends AbstractTableModel implements ICardGrid {
|
|||
}
|
||||
return super.isCellEditable(row, col); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
<Properties>
|
||||
<Property name="iconifiable" type="boolean" value="true"/>
|
||||
<Property name="resizable" type="boolean" value="true"/>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="new Dimension((int) Math.round(GUISizeHelper.otherZonesCardDimension.width * 1.3),
 (int) Math.round(GUISizeHelper.otherZonesCardDimension.height * 1.2))" type="code"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<SyntheticProperties>
|
||||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||
|
@ -23,22 +26,26 @@
|
|||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="cards" alignment="0" pref="163" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="cards" max="32767" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="cards" alignment="0" pref="67" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="cards" max="32767" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="mage.client.cards.Cards" name="cards">
|
||||
<Properties>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="new java.awt.Dimension(Config.dimensions.frameWidth, Config.dimensions.frameHeight + 25)" type="code"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_SerializeTo" type="java.lang.String" value="CardInfoWindowDialog_cards"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
*/
|
||||
package mage.client.dialog;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Point;
|
||||
import java.beans.PropertyVetoException;
|
||||
import java.util.UUID;
|
||||
|
@ -41,7 +42,6 @@ import javax.swing.SwingUtilities;
|
|||
import javax.swing.event.InternalFrameAdapter;
|
||||
import javax.swing.event.InternalFrameEvent;
|
||||
import mage.client.cards.BigCard;
|
||||
import mage.client.util.Config;
|
||||
import mage.client.util.GUISizeHelper;
|
||||
import mage.client.util.ImageHelper;
|
||||
import mage.client.util.SettingsManager;
|
||||
|
@ -108,6 +108,7 @@ public class CardInfoWindowDialog extends MageDialog {
|
|||
}
|
||||
this.setTitelBarToolTip(name);
|
||||
setGUISize();
|
||||
|
||||
}
|
||||
|
||||
public void cleanUp() {
|
||||
|
@ -211,21 +212,25 @@ public class CardInfoWindowDialog extends MageDialog {
|
|||
|
||||
setIconifiable(true);
|
||||
setResizable(true);
|
||||
setPreferredSize(new Dimension((int) Math.round(GUISizeHelper.otherZonesCardDimension.width * 1.3),
|
||||
(int) Math.round(GUISizeHelper.otherZonesCardDimension.height * 1.2)));
|
||||
|
||||
cards.setPreferredSize(new java.awt.Dimension(Config.dimensions.frameWidth, Config.dimensions.frameHeight + 25));
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(cards, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGap(0, 0, 0))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(cards, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGap(0, 0, 0))
|
||||
);
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(cards, javax.swing.GroupLayout.DEFAULT_SIZE, 163, Short.MAX_VALUE)
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(cards, javax.swing.GroupLayout.DEFAULT_SIZE, 67, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
pack();
|
||||
pack();
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
|
|
|
@ -36,7 +36,6 @@ import java.util.UUID;
|
|||
import javax.swing.JButton;
|
||||
import javax.swing.JLayeredPane;
|
||||
import javax.swing.JPanel;
|
||||
import mage.cards.CardDimensions;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.cards.BigCard;
|
||||
import mage.client.cards.CardArea;
|
||||
|
@ -110,10 +109,10 @@ public class PickPileDialog extends MageDialog {
|
|||
}
|
||||
}
|
||||
|
||||
public void loadCards(String name, CardsView pile1, CardsView pile2, BigCard bigCard, CardDimensions dimension, UUID gameId) {
|
||||
public void loadCards(String name, CardsView pile1, CardsView pile2, BigCard bigCard, UUID gameId) {
|
||||
this.title = name;
|
||||
this.pile1.loadCardsNarrow(pile1, bigCard, dimension, gameId);
|
||||
this.pile2.loadCardsNarrow(pile2, bigCard, dimension, gameId);
|
||||
this.pile1.loadCardsNarrow(pile1, bigCard, gameId);
|
||||
this.pile2.loadCardsNarrow(pile2, bigCard, gameId);
|
||||
|
||||
if (getParent() != MageFrame.getDesktop() /*|| this.isClosed*/) {
|
||||
MageFrame.getDesktop().add(this, JLayeredPane.MODAL_LAYER);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -71,6 +71,7 @@ import mage.players.net.UserGroup;
|
|||
import mage.players.net.UserSkipPrioritySteps;
|
||||
import mage.remote.Connection;
|
||||
import mage.remote.Connection.ProxyType;
|
||||
import mage.view.UserRequestMessage;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
|
@ -80,7 +81,7 @@ import org.apache.log4j.Logger;
|
|||
*/
|
||||
public class PreferencesDialog extends javax.swing.JDialog {
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(PreferencesDialog.class);
|
||||
private static final Logger logger = Logger.getLogger(PreferencesDialog.class);
|
||||
|
||||
public static final String KEY_SHOW_TOOLTIPS_DELAY = "showTooltipsDelay";
|
||||
public static final String KEY_SHOW_CARD_NAMES = "showCardNames";
|
||||
|
@ -95,7 +96,10 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
public static final String KEY_GUI_TABLE_FONT_SIZE = "guiTableFontSize";
|
||||
public static final String KEY_GUI_CHAT_FONT_SIZE = "guiChatFontSize";
|
||||
public static final String KEY_GUI_CARD_HAND_SIZE = "guiCardHandSize";
|
||||
public static final String KEY_GUI_SYMBOL_SIZE = "guiSymbolSize";
|
||||
public static final String KEY_GUI_CARD_EDITOR_SIZE = "guiCardEditorSize";
|
||||
public static final String KEY_GUI_CARD_OFFSET_SIZE = "guiCardOffsetSize";
|
||||
|
||||
public static final String KEY_GUI_STACK_WIDTH = "guiStackWidth";
|
||||
public static final String KEY_GUI_TOOLTIP_SIZE = "guiTooltipSize";
|
||||
public static final String KEY_GUI_DIALOG_FONT_SIZE = "guiDialogFontSize";
|
||||
public static final String KEY_GUI_FEEDBACK_AREA_SIZE = "guiFeedbackAreaSize";
|
||||
|
@ -373,6 +377,10 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
chatFontSizeLabel = new javax.swing.JLabel();
|
||||
sliderDialogFont = new javax.swing.JSlider();
|
||||
labelDialogFont = new javax.swing.JLabel();
|
||||
sliderEditorCardSize = new javax.swing.JSlider();
|
||||
labelEditorCardSize = new javax.swing.JLabel();
|
||||
sliderEditorCardOffset = new javax.swing.JSlider();
|
||||
labelEditorCardOffset = new javax.swing.JLabel();
|
||||
guiSizeGame = new javax.swing.JPanel();
|
||||
sliderCardSizeHand = new javax.swing.JSlider();
|
||||
labelCardSizeHand = new javax.swing.JLabel();
|
||||
|
@ -380,8 +388,8 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
labelCardSizeOtherZones = new javax.swing.JLabel();
|
||||
sliderCardSizeBattlefield = new javax.swing.JSlider();
|
||||
labelCardSizeBattlefield = new javax.swing.JLabel();
|
||||
sliderSymbolSize = new javax.swing.JSlider();
|
||||
labelSymbolSize = new javax.swing.JLabel();
|
||||
sliderStackWidth = new javax.swing.JSlider();
|
||||
labelStackWidth = new javax.swing.JLabel();
|
||||
sliderGameFeedbackArea = new javax.swing.JSlider();
|
||||
labelGameFeedback = new javax.swing.JLabel();
|
||||
sliderTooltipSize = new javax.swing.JSlider();
|
||||
|
@ -535,13 +543,11 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
main_cardLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(main_cardLayout.createSequentialGroup()
|
||||
.add(6, 6, 6)
|
||||
.add(main_cardLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(tooltipDelayLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.add(org.jdesktop.layout.GroupLayout.TRAILING, tooltipDelay, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.add(main_cardLayout.createSequentialGroup()
|
||||
.add(showCardName)
|
||||
.add(0, 0, Short.MAX_VALUE)))
|
||||
.addContainerGap())
|
||||
.add(main_cardLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
|
||||
.add(tooltipDelayLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 308, Short.MAX_VALUE)
|
||||
.add(org.jdesktop.layout.GroupLayout.LEADING, showCardName)
|
||||
.add(tooltipDelay, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addContainerGap(183, Short.MAX_VALUE))
|
||||
);
|
||||
main_cardLayout.setVerticalGroup(
|
||||
main_cardLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
|
@ -729,9 +735,20 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
|
||||
tabGuiSize.setMaximumSize(new java.awt.Dimension(527, 423));
|
||||
tabGuiSize.setMinimumSize(new java.awt.Dimension(527, 423));
|
||||
java.awt.GridBagLayout tabGuiSizeLayout = new java.awt.GridBagLayout();
|
||||
tabGuiSizeLayout.columnWidths = new int[] {0};
|
||||
tabGuiSizeLayout.rowHeights = new int[] {0, 20, 0};
|
||||
tabGuiSizeLayout.columnWeights = new double[] {1.0};
|
||||
tabGuiSizeLayout.rowWeights = new double[] {1.0, 0.0, 1.0};
|
||||
tabGuiSize.setLayout(tabGuiSizeLayout);
|
||||
|
||||
guiSizeBasic.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Size basic elements"));
|
||||
guiSizeBasic.setLayout(new java.awt.GridBagLayout());
|
||||
guiSizeBasic.setMinimumSize(new java.awt.Dimension(600, 180));
|
||||
guiSizeBasic.setPreferredSize(new java.awt.Dimension(600, 180));
|
||||
java.awt.GridBagLayout guiSizeBasicLayout = new java.awt.GridBagLayout();
|
||||
guiSizeBasicLayout.columnWeights = new double[] {1.0, 1.0, 1.0};
|
||||
guiSizeBasicLayout.rowWeights = new double[] {1.0, 0.2, 1.0, 0.2};
|
||||
guiSizeBasic.setLayout(guiSizeBasicLayout);
|
||||
|
||||
sliderFontSize.setMajorTickSpacing(5);
|
||||
sliderFontSize.setMaximum(50);
|
||||
|
@ -744,15 +761,19 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
sliderFontSize.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
sliderFontSize.setMinimumSize(new java.awt.Dimension(150, 40));
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
|
||||
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
|
||||
guiSizeBasic.add(sliderFontSize, gridBagConstraints);
|
||||
|
||||
fontSizeLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
fontSizeLabel.setText("Size of table font");
|
||||
fontSizeLabel.setText("Tables");
|
||||
fontSizeLabel.setToolTipText("<HTML>The size of the font used to display table text.");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.ipadx = 3;
|
||||
gridBagConstraints.ipady = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
|
@ -769,17 +790,19 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
sliderChatFontSize.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
sliderChatFontSize.setMinimumSize(new java.awt.Dimension(150, 40));
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 4;
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
|
||||
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
|
||||
guiSizeBasic.add(sliderChatFontSize, gridBagConstraints);
|
||||
|
||||
chatFontSizeLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
chatFontSizeLabel.setText("Size of chat font");
|
||||
chatFontSizeLabel.setText("Chat");
|
||||
chatFontSizeLabel.setToolTipText("<HTML>The size of the font used to display the chat text");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 4;
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.ipadx = 3;
|
||||
gridBagConstraints.ipady = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
|
@ -796,24 +819,97 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
sliderDialogFont.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
sliderDialogFont.setMinimumSize(new java.awt.Dimension(150, 40));
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
|
||||
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
|
||||
guiSizeBasic.add(sliderDialogFont, gridBagConstraints);
|
||||
|
||||
labelDialogFont.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
labelDialogFont.setText("Font size of messages and menues");
|
||||
labelDialogFont.setText("Messages and menues");
|
||||
labelDialogFont.setToolTipText("<HTML>The size of the font of messages and menues");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.ipadx = 3;
|
||||
gridBagConstraints.ipady = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
guiSizeBasic.add(labelDialogFont, gridBagConstraints);
|
||||
labelDialogFont.getAccessibleContext().setAccessibleDescription("<HTML>The size of the font used to display messages or menus.");
|
||||
|
||||
sliderEditorCardSize.setMajorTickSpacing(5);
|
||||
sliderEditorCardSize.setMaximum(50);
|
||||
sliderEditorCardSize.setMinimum(10);
|
||||
sliderEditorCardSize.setMinorTickSpacing(1);
|
||||
sliderEditorCardSize.setPaintLabels(true);
|
||||
sliderEditorCardSize.setPaintTicks(true);
|
||||
sliderEditorCardSize.setSnapToTicks(true);
|
||||
sliderEditorCardSize.setToolTipText("<HTML>The size of the card in editor and the picked zone of the draft panel");
|
||||
sliderEditorCardSize.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
sliderEditorCardSize.setMinimumSize(new java.awt.Dimension(150, 40));
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
|
||||
guiSizeBasic.add(sliderEditorCardSize, gridBagConstraints);
|
||||
|
||||
labelEditorCardSize.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
labelEditorCardSize.setText("Cards in editor and draft panel");
|
||||
labelEditorCardSize.setToolTipText("<HTML>The size of the card in editor and the picked zone of the draft panel\n");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.ipadx = 3;
|
||||
gridBagConstraints.ipady = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
guiSizeBasic.add(labelEditorCardSize, gridBagConstraints);
|
||||
|
||||
sliderEditorCardOffset.setMajorTickSpacing(5);
|
||||
sliderEditorCardOffset.setMaximum(50);
|
||||
sliderEditorCardOffset.setMinimum(10);
|
||||
sliderEditorCardOffset.setMinorTickSpacing(1);
|
||||
sliderEditorCardOffset.setPaintLabels(true);
|
||||
sliderEditorCardOffset.setPaintTicks(true);
|
||||
sliderEditorCardOffset.setSnapToTicks(true);
|
||||
sliderEditorCardOffset.setToolTipText("<HTML>The size of the card in editor and the picked zone of the draft panel");
|
||||
sliderEditorCardOffset.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
sliderEditorCardOffset.setMinimumSize(new java.awt.Dimension(150, 40));
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
|
||||
guiSizeBasic.add(sliderEditorCardOffset, gridBagConstraints);
|
||||
|
||||
labelEditorCardOffset.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
labelEditorCardOffset.setText("Card offset editor and draft");
|
||||
labelEditorCardOffset.setToolTipText("<HTML>The vertical offset of card images in editor areas\n");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.ipadx = 3;
|
||||
gridBagConstraints.ipady = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
guiSizeBasic.add(labelEditorCardOffset, gridBagConstraints);
|
||||
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
tabGuiSize.add(guiSizeBasic, gridBagConstraints);
|
||||
|
||||
guiSizeGame.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Size game elements"));
|
||||
guiSizeGame.setLayout(new java.awt.GridBagLayout());
|
||||
guiSizeGame.setMinimumSize(new java.awt.Dimension(600, 180));
|
||||
guiSizeGame.setPreferredSize(new java.awt.Dimension(600, 180));
|
||||
java.awt.GridBagLayout guiSizeGameLayout = new java.awt.GridBagLayout();
|
||||
guiSizeGameLayout.columnWeights = new double[] {1.0, 1.0, 1.0};
|
||||
guiSizeGameLayout.rowWeights = new double[] {1.0, 0.2, 1.0, 0.2};
|
||||
guiSizeGame.setLayout(guiSizeGameLayout);
|
||||
|
||||
sliderCardSizeHand.setMajorTickSpacing(5);
|
||||
sliderCardSizeHand.setMaximum(50);
|
||||
|
@ -822,20 +918,21 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
sliderCardSizeHand.setPaintLabels(true);
|
||||
sliderCardSizeHand.setPaintTicks(true);
|
||||
sliderCardSizeHand.setSnapToTicks(true);
|
||||
sliderCardSizeHand.setToolTipText("<HTML>The size of the card in hand");
|
||||
sliderCardSizeHand.setToolTipText("<HTML>The size of the card images in hand and on the stack");
|
||||
sliderCardSizeHand.setValue(14);
|
||||
sliderCardSizeHand.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
sliderCardSizeHand.setMinimumSize(new java.awt.Dimension(150, 40));
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
|
||||
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
|
||||
guiSizeGame.add(sliderCardSizeHand, gridBagConstraints);
|
||||
|
||||
labelCardSizeHand.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
labelCardSizeHand.setText("Size of hand cards");
|
||||
labelCardSizeHand.setToolTipText("<HTML>The size of the card in hand");
|
||||
labelCardSizeHand.setText("Hand cards and stack objects");
|
||||
labelCardSizeHand.setToolTipText("<HTML>The size of the card images in hand and on the stack");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 1;
|
||||
|
@ -855,17 +952,18 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
sliderCardSizeOtherZones.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
sliderCardSizeOtherZones.setMinimumSize(new java.awt.Dimension(150, 40));
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
|
||||
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
|
||||
guiSizeGame.add(sliderCardSizeOtherZones, gridBagConstraints);
|
||||
|
||||
labelCardSizeOtherZones.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
labelCardSizeOtherZones.setText("Size of other zone cards");
|
||||
labelCardSizeOtherZones.setText("Cards other zones");
|
||||
labelCardSizeOtherZones.setToolTipText("<HTML>The size of card in other game zone (e.g. graveyard, revealed cards etc.)");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.ipadx = 3;
|
||||
gridBagConstraints.ipady = 3;
|
||||
|
@ -883,49 +981,55 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
sliderCardSizeBattlefield.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
sliderCardSizeBattlefield.setMinimumSize(new java.awt.Dimension(150, 40));
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 4;
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
|
||||
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
|
||||
guiSizeGame.add(sliderCardSizeBattlefield, gridBagConstraints);
|
||||
|
||||
labelCardSizeBattlefield.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
labelCardSizeBattlefield.setText("Size of permanents");
|
||||
labelCardSizeBattlefield.setText("Permanents");
|
||||
labelCardSizeBattlefield.setToolTipText("<HTML>The maximum size of permanents on the battlefield");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 4;
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.ipadx = 3;
|
||||
gridBagConstraints.ipady = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
guiSizeGame.add(labelCardSizeBattlefield, gridBagConstraints);
|
||||
|
||||
sliderSymbolSize.setMajorTickSpacing(5);
|
||||
sliderSymbolSize.setMaximum(50);
|
||||
sliderSymbolSize.setMinimum(10);
|
||||
sliderSymbolSize.setMinorTickSpacing(1);
|
||||
sliderSymbolSize.setPaintLabels(true);
|
||||
sliderSymbolSize.setPaintTicks(true);
|
||||
sliderSymbolSize.setSnapToTicks(true);
|
||||
sliderSymbolSize.setToolTipText("<HTML>The size of symbols");
|
||||
sliderSymbolSize.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
sliderSymbolSize.setMinimumSize(new java.awt.Dimension(150, 40));
|
||||
sliderStackWidth.setMajorTickSpacing(20);
|
||||
sliderStackWidth.setMaximum(90);
|
||||
sliderStackWidth.setMinimum(10);
|
||||
sliderStackWidth.setMinorTickSpacing(5);
|
||||
sliderStackWidth.setPaintLabels(true);
|
||||
sliderStackWidth.setPaintTicks(true);
|
||||
sliderStackWidth.setSnapToTicks(true);
|
||||
sliderStackWidth.setToolTipText("<HTML>The % size of the stack object area in relation to the hand card area size.");
|
||||
sliderStackWidth.setValue(30);
|
||||
sliderStackWidth.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
sliderStackWidth.setMinimumSize(new java.awt.Dimension(150, 40));
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
|
||||
guiSizeGame.add(sliderStackWidth, gridBagConstraints);
|
||||
sliderStackWidth.getAccessibleContext().setAccessibleDescription("<HTML>The stack width in relation to the hand area width");
|
||||
|
||||
labelStackWidth.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
labelStackWidth.setText("Stack %width related to hand");
|
||||
labelStackWidth.setToolTipText("<HTML>The % size of the stack object area in relation to the hand card area size.");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
|
||||
guiSizeGame.add(sliderSymbolSize, gridBagConstraints);
|
||||
|
||||
labelSymbolSize.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
labelSymbolSize.setText("Symbol size");
|
||||
labelSymbolSize.setToolTipText("<HTML>The size of symbols");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.ipadx = 3;
|
||||
gridBagConstraints.ipady = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
guiSizeGame.add(labelSymbolSize, gridBagConstraints);
|
||||
guiSizeGame.add(labelStackWidth, gridBagConstraints);
|
||||
labelStackWidth.getAccessibleContext().setAccessibleDescription("<HTML>The stack width in relation to the hand area width");
|
||||
|
||||
sliderGameFeedbackArea.setMajorTickSpacing(5);
|
||||
sliderGameFeedbackArea.setMaximum(50);
|
||||
|
@ -938,17 +1042,19 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
sliderGameFeedbackArea.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
sliderGameFeedbackArea.setMinimumSize(new java.awt.Dimension(150, 40));
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
|
||||
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
|
||||
guiSizeGame.add(sliderGameFeedbackArea, gridBagConstraints);
|
||||
|
||||
labelGameFeedback.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
labelGameFeedback.setText("Size game feedback area");
|
||||
labelGameFeedback.setText("Dialog area");
|
||||
labelGameFeedback.setToolTipText("<HTML>The size of the game feedback area (buttons and messages above the hand area)");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.ipadx = 3;
|
||||
gridBagConstraints.ipady = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
|
@ -967,43 +1073,30 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
sliderTooltipSize.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
sliderTooltipSize.setMinimumSize(new java.awt.Dimension(150, 40));
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 4;
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
|
||||
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
|
||||
guiSizeGame.add(sliderTooltipSize, gridBagConstraints);
|
||||
|
||||
labelTooltipSize.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
labelTooltipSize.setText("Tooltip size");
|
||||
labelTooltipSize.setText("Tooltip window");
|
||||
labelTooltipSize.setToolTipText("<HTML>The size of the tooltip window for cards or permanents");
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 4;
|
||||
gridBagConstraints.gridy = 4;
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.ipadx = 3;
|
||||
gridBagConstraints.ipady = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
guiSizeGame.add(labelTooltipSize, gridBagConstraints);
|
||||
|
||||
org.jdesktop.layout.GroupLayout tabGuiSizeLayout = new org.jdesktop.layout.GroupLayout(tabGuiSize);
|
||||
tabGuiSize.setLayout(tabGuiSizeLayout);
|
||||
tabGuiSizeLayout.setHorizontalGroup(
|
||||
tabGuiSizeLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(tabGuiSizeLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.add(tabGuiSizeLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(guiSizeBasic, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 507, Short.MAX_VALUE)
|
||||
.add(guiSizeGame, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 507, Short.MAX_VALUE))
|
||||
.addContainerGap())
|
||||
);
|
||||
tabGuiSizeLayout.setVerticalGroup(
|
||||
tabGuiSizeLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(tabGuiSizeLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.add(guiSizeBasic, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 106, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(guiSizeGame, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 191, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap(109, Short.MAX_VALUE))
|
||||
);
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
|
||||
tabGuiSize.add(guiSizeGame, gridBagConstraints);
|
||||
|
||||
tabsPanel.addTab("GUI Size", tabGuiSize);
|
||||
|
||||
|
@ -1215,7 +1308,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.add(jLabelEndOfTurn)
|
||||
.add(checkBoxEndTurnOthers))
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
|
||||
.add(phases_stopSettings, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE)
|
||||
.add(phases_stopSettings, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 260, Short.MAX_VALUE)
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
|
@ -1994,15 +2087,15 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
tabAvatars.setLayout(tabAvatarsLayout);
|
||||
tabAvatarsLayout.setHorizontalGroup(
|
||||
tabAvatarsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(org.jdesktop.layout.GroupLayout.TRAILING, tabAvatarsLayout.createSequentialGroup()
|
||||
.add(avatarPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 527, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||
.add(0, 0, Short.MAX_VALUE))
|
||||
.add(tabAvatarsLayout.createSequentialGroup()
|
||||
.add(avatarPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 528, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||
.add(0, 1, Short.MAX_VALUE))
|
||||
);
|
||||
tabAvatarsLayout.setVerticalGroup(
|
||||
tabAvatarsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
.add(org.jdesktop.layout.GroupLayout.TRAILING, tabAvatarsLayout.createSequentialGroup()
|
||||
.add(avatarPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 423, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||
.add(0, 0, Short.MAX_VALUE))
|
||||
.add(tabAvatarsLayout.createSequentialGroup()
|
||||
.add(avatarPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 484, Short.MAX_VALUE)
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
tabsPanel.addTab("Avatars", tabAvatars);
|
||||
|
@ -2191,6 +2284,9 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
tabsPanel.addTab("Connection", tabConnection);
|
||||
|
||||
saveButton.setLabel("Save");
|
||||
saveButton.setMaximumSize(new java.awt.Dimension(100, 30));
|
||||
saveButton.setMinimumSize(new java.awt.Dimension(100, 30));
|
||||
saveButton.setPreferredSize(new java.awt.Dimension(100, 30));
|
||||
saveButton.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
|
||||
saveButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
|
@ -2199,6 +2295,9 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
});
|
||||
|
||||
exitButton.setLabel("Exit");
|
||||
exitButton.setMaximumSize(new java.awt.Dimension(100, 30));
|
||||
exitButton.setMinimumSize(new java.awt.Dimension(100, 30));
|
||||
exitButton.setPreferredSize(new java.awt.Dimension(100, 30));
|
||||
exitButton.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
|
||||
exitButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
|
@ -2216,7 +2315,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||
.add(exitButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 100, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||
.add(6, 6, 6))
|
||||
.add(tabsPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.add(tabsPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 535, Short.MAX_VALUE)
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||
|
@ -2224,8 +2323,8 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.add(tabsPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
|
||||
.add(saveButton)
|
||||
.add(exitButton))
|
||||
.add(saveButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 30, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||
.add(exitButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 30, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
|
@ -2262,8 +2361,16 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
save(prefs, dialog.sliderCardSizeHand, KEY_GUI_CARD_HAND_SIZE, "true", "false", UPDATE_CACHE_POLICY);
|
||||
sizeGUIChanged = true;
|
||||
}
|
||||
if (getCachedValue(KEY_GUI_SYMBOL_SIZE, 14) != dialog.sliderSymbolSize.getValue()) {
|
||||
save(prefs, dialog.sliderSymbolSize, KEY_GUI_SYMBOL_SIZE, "true", "false", UPDATE_CACHE_POLICY);
|
||||
if (getCachedValue(KEY_GUI_CARD_EDITOR_SIZE, 14) != dialog.sliderEditorCardSize.getValue()) {
|
||||
save(prefs, dialog.sliderEditorCardSize, KEY_GUI_CARD_EDITOR_SIZE, "true", "false", UPDATE_CACHE_POLICY);
|
||||
sizeGUIChanged = true;
|
||||
}
|
||||
if (getCachedValue(KEY_GUI_CARD_OFFSET_SIZE, 14) != dialog.sliderEditorCardOffset.getValue()) {
|
||||
save(prefs, dialog.sliderEditorCardOffset, KEY_GUI_CARD_OFFSET_SIZE, "true", "false", UPDATE_CACHE_POLICY);
|
||||
sizeGUIChanged = true;
|
||||
}
|
||||
if (getCachedValue(KEY_GUI_STACK_WIDTH, 30) != dialog.sliderStackWidth.getValue()) {
|
||||
save(prefs, dialog.sliderStackWidth, KEY_GUI_STACK_WIDTH, "true", "false", UPDATE_CACHE_POLICY);
|
||||
sizeGUIChanged = true;
|
||||
}
|
||||
if (getCachedValue(KEY_GUI_TOOLTIP_SIZE, 14) != dialog.sliderTooltipSize.getValue()) {
|
||||
|
@ -2359,8 +2466,10 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
|
||||
prefs.flush();
|
||||
} catch (BackingStoreException ex) {
|
||||
ex.printStackTrace();
|
||||
JOptionPane.showMessageDialog(null, "Error: couldn't save preferences. Please try once again.");
|
||||
logger.error("Error: couldn't save preferences", ex);
|
||||
UserRequestMessage message = new UserRequestMessage("Error", "Error: couldn't save preferences. Please try once again.");
|
||||
message.setButton1("OK", null);
|
||||
MageFrame.getInstance().showUserRequestDialog(message);
|
||||
}
|
||||
|
||||
dialog.setVisible(false);
|
||||
|
@ -2623,15 +2732,22 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
}//GEN-LAST:event_cbAutoOrderTriggerActionPerformed
|
||||
|
||||
private void showProxySettings() {
|
||||
if (cbProxyType.getSelectedItem() == Connection.ProxyType.SOCKS) {
|
||||
this.pnlProxy.setVisible(true);
|
||||
this.pnlProxySettings.setVisible(true);
|
||||
} else if (cbProxyType.getSelectedItem() == Connection.ProxyType.HTTP) {
|
||||
this.pnlProxy.setVisible(true);
|
||||
this.pnlProxySettings.setVisible(true);
|
||||
} else if (cbProxyType.getSelectedItem() == Connection.ProxyType.NONE) {
|
||||
this.pnlProxy.setVisible(false);
|
||||
this.pnlProxySettings.setVisible(false);
|
||||
Connection.ProxyType proxyType = (Connection.ProxyType) cbProxyType.getSelectedItem();
|
||||
switch (proxyType) {
|
||||
case SOCKS:
|
||||
this.pnlProxy.setVisible(true);
|
||||
this.pnlProxySettings.setVisible(true);
|
||||
break;
|
||||
case HTTP:
|
||||
this.pnlProxy.setVisible(true);
|
||||
this.pnlProxySettings.setVisible(true);
|
||||
break;
|
||||
case NONE:
|
||||
this.pnlProxy.setVisible(false);
|
||||
this.pnlProxySettings.setVisible(false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this.pack();
|
||||
this.repaint();
|
||||
|
@ -2657,7 +2773,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
connection.setProxyPassword(password);
|
||||
}
|
||||
} else {
|
||||
LOGGER.warn("host or\\and port are empty: host=" + host + ", port=" + port);
|
||||
logger.warn("host or\\and port are empty: host=" + host + ", port=" + port);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2759,7 +2875,9 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
load(prefs, dialog.sliderFontSize, KEY_GUI_TABLE_FONT_SIZE, "14");
|
||||
load(prefs, dialog.sliderChatFontSize, KEY_GUI_CHAT_FONT_SIZE, "14");
|
||||
load(prefs, dialog.sliderCardSizeHand, KEY_GUI_CARD_HAND_SIZE, "14");
|
||||
load(prefs, dialog.sliderSymbolSize, KEY_GUI_SYMBOL_SIZE, "14");
|
||||
load(prefs, dialog.sliderEditorCardSize, KEY_GUI_CARD_EDITOR_SIZE, "14");
|
||||
load(prefs, dialog.sliderEditorCardOffset, KEY_GUI_CARD_OFFSET_SIZE, "14");
|
||||
load(prefs, dialog.sliderStackWidth, KEY_GUI_STACK_WIDTH, "14");
|
||||
load(prefs, dialog.sliderDialogFont, KEY_GUI_DIALOG_FONT_SIZE, "14");
|
||||
load(prefs, dialog.sliderTooltipSize, KEY_GUI_TOOLTIP_SIZE, "14");
|
||||
load(prefs, dialog.sliderGameFeedbackArea, KEY_GUI_FEEDBACK_AREA_SIZE, "14");
|
||||
|
@ -2903,7 +3021,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
dialog.tabsPanel.setSelectedIndex(index);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("Error during open tab", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3083,7 +3201,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
addAvatar(jPanel32, 32, false, false);
|
||||
|
||||
} catch (Exception e) {
|
||||
LOGGER.error(e, e);
|
||||
logger.error(e, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3248,9 +3366,11 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
private javax.swing.JLabel labelCardSizeHand;
|
||||
private javax.swing.JLabel labelCardSizeOtherZones;
|
||||
private javax.swing.JLabel labelDialogFont;
|
||||
private javax.swing.JLabel labelEditorCardOffset;
|
||||
private javax.swing.JLabel labelEditorCardSize;
|
||||
private javax.swing.JLabel labelGameFeedback;
|
||||
private javax.swing.JLabel labelPreferedImageLanguage;
|
||||
private javax.swing.JLabel labelSymbolSize;
|
||||
private javax.swing.JLabel labelStackWidth;
|
||||
private javax.swing.JLabel labelTooltipSize;
|
||||
private javax.swing.JLabel lblProxyPassword;
|
||||
private javax.swing.JLabel lblProxyPort;
|
||||
|
@ -3277,9 +3397,11 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
private javax.swing.JSlider sliderCardSizeOtherZones;
|
||||
private javax.swing.JSlider sliderChatFontSize;
|
||||
private javax.swing.JSlider sliderDialogFont;
|
||||
private javax.swing.JSlider sliderEditorCardOffset;
|
||||
private javax.swing.JSlider sliderEditorCardSize;
|
||||
private javax.swing.JSlider sliderFontSize;
|
||||
private javax.swing.JSlider sliderGameFeedbackArea;
|
||||
private javax.swing.JSlider sliderSymbolSize;
|
||||
private javax.swing.JSlider sliderStackWidth;
|
||||
private javax.swing.JSlider sliderTooltipSize;
|
||||
private javax.swing.JPanel sounds_backgroundMusic;
|
||||
private javax.swing.JPanel sounds_clips;
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
/*
|
||||
/*
|
||||
* ShowCardsDialog.java
|
||||
*
|
||||
* Created on 3-Feb-2010, 8:59:11 PM
|
||||
|
@ -41,7 +41,6 @@ import java.util.UUID;
|
|||
import javax.swing.JLayeredPane;
|
||||
import javax.swing.JPopupMenu;
|
||||
import javax.swing.SwingUtilities;
|
||||
import mage.cards.CardDimensions;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.cards.BigCard;
|
||||
import mage.client.cards.CardArea;
|
||||
|
@ -69,6 +68,7 @@ public class ShowCardsDialog extends MageDialog {
|
|||
|
||||
this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
|
||||
initComponents();
|
||||
|
||||
this.setModal(false);
|
||||
|
||||
}
|
||||
|
@ -83,13 +83,23 @@ public class ShowCardsDialog extends MageDialog {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeGUISize() {
|
||||
setGUISize();
|
||||
cardArea.changeGUISize();
|
||||
}
|
||||
|
||||
private void setGUISize() {
|
||||
|
||||
}
|
||||
|
||||
public void loadCards(String name, CardsView showCards, BigCard bigCard,
|
||||
CardDimensions dimension, UUID gameId, boolean modal, Map<String, Serializable> options,
|
||||
UUID gameId, boolean modal, Map<String, Serializable> options,
|
||||
JPopupMenu popupMenu, Listener<Event> eventListener) {
|
||||
this.title = name;
|
||||
this.setTitelBarToolTip(name);
|
||||
cardArea.clearCardEventListeners();
|
||||
cardArea.loadCards(showCards, bigCard, dimension, gameId);
|
||||
cardArea.loadCards(showCards, bigCard, gameId);
|
||||
if (options != null) {
|
||||
if (options.containsKey("chosen")) {
|
||||
java.util.List<UUID> chosenCards = (java.util.List<UUID>) options.get("chosen");
|
||||
|
@ -145,7 +155,7 @@ public class ShowCardsDialog extends MageDialog {
|
|||
setResizable(true);
|
||||
getContentPane().setLayout(new java.awt.BorderLayout());
|
||||
getContentPane().add(cardArea, java.awt.BorderLayout.CENTER);
|
||||
|
||||
setGUISize();
|
||||
pack();
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<Properties>
|
||||
<Property name="resizable" type="boolean" value="true"/>
|
||||
<Property name="title" type="java.lang.String" value="UserRequestMessage"/>
|
||||
<Property name="modal" type="boolean" value="true"/>
|
||||
</Properties>
|
||||
<SyntheticProperties>
|
||||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||
|
@ -28,7 +29,6 @@
|
|||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="lblText" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<Component id="btn3" pref="0" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="btn2" pref="0" max="32767" attributes="0"/>
|
||||
|
@ -62,7 +62,7 @@
|
|||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
<Property name="text" type="java.lang.String" value="message to the user"/>
|
||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[400, 60]"/>
|
||||
<Dimension value="[1000, 500]"/>
|
||||
</Property>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[400, 60]"/>
|
||||
|
|
|
@ -126,10 +126,11 @@ public class UserRequestDialog extends MageDialog {
|
|||
|
||||
setResizable(true);
|
||||
setTitle("UserRequestMessage");
|
||||
setModal(true);
|
||||
|
||||
lblText.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
lblText.setText("message to the user");
|
||||
lblText.setMaximumSize(new java.awt.Dimension(400, 60));
|
||||
lblText.setMaximumSize(new java.awt.Dimension(1000, 500));
|
||||
lblText.setMinimumSize(new java.awt.Dimension(400, 60));
|
||||
lblText.setPreferredSize(new java.awt.Dimension(400, 60));
|
||||
|
||||
|
@ -172,7 +173,6 @@ public class UserRequestDialog extends MageDialog {
|
|||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(lblText, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addComponent(btn3, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(btn2, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)
|
||||
|
|
|
@ -72,6 +72,7 @@ public class DraftPane extends MagePane {
|
|||
@Override
|
||||
public void changeGUISize() {
|
||||
super.changeGUISize(); //To change body of generated methods, choose Tools | Templates.
|
||||
draftPanel1.changeGUISize();
|
||||
}
|
||||
|
||||
public void showDraft(UUID draftId) {
|
||||
|
|
|
@ -69,6 +69,7 @@ import mage.client.dialog.PreferencesDialog;
|
|||
import mage.client.plugins.impl.Plugins;
|
||||
import mage.client.util.CardsViewUtil;
|
||||
import mage.client.util.Event;
|
||||
import mage.client.util.GUISizeHelper;
|
||||
import mage.client.util.ImageHelper;
|
||||
import mage.client.util.Listener;
|
||||
import mage.client.util.audio.AudioManager;
|
||||
|
@ -177,7 +178,7 @@ public class DraftPanel extends javax.swing.JPanel {
|
|||
}
|
||||
|
||||
private void setGUISize() {
|
||||
|
||||
GUISizeHelper.changePopupMenuFont(popupMenuPickedArea);
|
||||
}
|
||||
|
||||
public synchronized void showDraft(UUID draftId) {
|
||||
|
|
|
@ -45,6 +45,7 @@ import mage.client.MageFrame;
|
|||
import mage.client.chat.ChatPanelBasic;
|
||||
import mage.client.components.MageTextArea;
|
||||
import mage.client.dialog.MageDialog;
|
||||
import mage.client.util.GUISizeHelper;
|
||||
import mage.client.util.audio.AudioManager;
|
||||
import mage.client.util.gui.ArrowBuilder;
|
||||
import static mage.constants.Constants.Option.ORIGINAL_ID;
|
||||
|
@ -171,8 +172,8 @@ public class FeedbackPanel extends javax.swing.JPanel {
|
|||
}
|
||||
}
|
||||
|
||||
protected String getSmallText(String text) {
|
||||
return "<div style='font-size:11pt'>" + text + "</div>";
|
||||
protected static String getSmallText(String text) {
|
||||
return "<div style='font-size:" + GUISizeHelper.gameDialogAreaFontSizeSmall + "pt'>" + text + "</div>";
|
||||
}
|
||||
|
||||
private void setSpecial(String text, boolean visible) {
|
||||
|
|
|
@ -71,6 +71,7 @@ import javax.swing.JOptionPane;
|
|||
import javax.swing.JPanel;
|
||||
import javax.swing.JPopupMenu;
|
||||
import javax.swing.KeyStroke;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.SwingWorker;
|
||||
import javax.swing.border.Border;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
|
@ -101,7 +102,6 @@ import mage.client.game.FeedbackPanel.FeedbackMode;
|
|||
import mage.client.plugins.adapters.MageActionCallback;
|
||||
import mage.client.plugins.impl.Plugins;
|
||||
import mage.client.util.CardsViewUtil;
|
||||
import mage.client.util.Config;
|
||||
import mage.client.util.Event;
|
||||
import mage.client.util.GUISizeHelper;
|
||||
import mage.client.util.GameManager;
|
||||
|
@ -155,7 +155,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
private static final Logger logger = Logger.getLogger(GamePanel.class);
|
||||
private static final String YOUR_HAND = "Your hand";
|
||||
private static final int X_PHASE_WIDTH = 55;
|
||||
private static final int STACK_MIN_CARDS_OFFSET_Y = 7;
|
||||
private static final int STACK_MIN_CARDS_OFFSET_Y = 7; // TODO: Size bui GUISize value
|
||||
|
||||
private static final String CMD_AUTO_ORDER_FIRST = "cmdAutoOrderFirst";
|
||||
private static final String CMD_AUTO_ORDER_LAST = "cmdAutoOrderLast";
|
||||
|
@ -194,6 +194,9 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
|
||||
private MageDialogState choiceWindowState;
|
||||
|
||||
private int feedbackAreaHeight;
|
||||
private boolean initComponents;
|
||||
|
||||
private enum PopUpMenuType {
|
||||
|
||||
TRIGGER_ORDER
|
||||
|
@ -205,18 +208,18 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
private JPopupMenu popupMenuTriggerOrder;
|
||||
|
||||
public GamePanel() {
|
||||
initComponents = true;
|
||||
initComponents();
|
||||
setGUISize();
|
||||
|
||||
initPopupMenuTriggerOrder();
|
||||
//this.add(popupMenuTriggerOrder);
|
||||
|
||||
setGUISize();
|
||||
|
||||
pickNumber = new PickNumberDialog();
|
||||
MageFrame.getDesktop().add(pickNumber, JLayeredPane.MODAL_LAYER);
|
||||
|
||||
this.feedbackPanel.setConnectedChatPanel(this.userChatPanel);
|
||||
|
||||
this.stack.setMinOffsetY(STACK_MIN_CARDS_OFFSET_Y);
|
||||
this.stackObjects.setMinOffsetY(STACK_MIN_CARDS_OFFSET_Y);
|
||||
|
||||
// Override layout (I can't edit generated code)
|
||||
this.setLayout(new BorderLayout());
|
||||
|
@ -228,7 +231,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
Map<String, JComponent> myUi = getUIComponents(jLayeredBackgroundPane);
|
||||
Plugins.getInstance().updateGamePanel(myUi);
|
||||
|
||||
// Enlarge jlayeredpane on resize
|
||||
// Enlarge jlayeredpane on resize of game panel
|
||||
addComponentListener(new ComponentAdapter() {
|
||||
@Override
|
||||
public void componentResized(ComponentEvent e) {
|
||||
|
@ -254,6 +257,29 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
|
||||
}
|
||||
});
|
||||
// Resize the width of the stack area if the size of the play area is chnaged
|
||||
ComponentAdapter componentAdapterPlayField = new ComponentAdapter() {
|
||||
@Override
|
||||
public void componentResized(ComponentEvent e) {
|
||||
Thread worker = new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!initComponents) {
|
||||
setGUISize();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
worker.start();
|
||||
|
||||
}
|
||||
};
|
||||
jPanel3.addComponentListener(componentAdapterPlayField);
|
||||
initComponents = false;
|
||||
}
|
||||
|
||||
private Map<String, JComponent> getUIComponents(JLayeredPane jLayeredPane) {
|
||||
|
@ -280,7 +306,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
this.removeListener();
|
||||
|
||||
this.handContainer.cleanUp();
|
||||
this.stack.cleanUp();
|
||||
this.stackObjects.cleanUp();
|
||||
for (Map.Entry<UUID, PlayAreaPanel> playAreaPanelEntry : players.entrySet()) {
|
||||
playAreaPanelEntry.getValue().CleanUp();
|
||||
}
|
||||
|
@ -327,16 +353,15 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
}
|
||||
|
||||
public void changeGUISize() {
|
||||
initComponents = true;
|
||||
setGUISize();
|
||||
stackObjects.changeGUISize();
|
||||
feedbackPanel.changeGUISize();
|
||||
handContainer.changeGUISize();
|
||||
for (PlayAreaPanel playAreaPanel : players.values()) {
|
||||
playAreaPanel.changeGUISize();
|
||||
}
|
||||
|
||||
stack.setPreferredSize(new java.awt.Dimension(Config.dimensions.frameWidth, Config.dimensions.frameHeight + 25));
|
||||
|
||||
feedbackPanel.changeGUISize();
|
||||
|
||||
for (CardInfoWindowDialog cardInfoWindowDialog : exiles.values()) {
|
||||
cardInfoWindowDialog.changeGUISize();
|
||||
}
|
||||
|
@ -349,12 +374,40 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
for (CardInfoWindowDialog cardInfoWindowDialog : graveyardWindows.values()) {
|
||||
cardInfoWindowDialog.changeGUISize();
|
||||
}
|
||||
for (ShowCardsDialog showCardsDialog : pickTarget) {
|
||||
showCardsDialog.changeGUISize();
|
||||
}
|
||||
|
||||
this.revalidate();
|
||||
this.repaint();
|
||||
initComponents = false;
|
||||
}
|
||||
|
||||
private void setGUISize() {
|
||||
jSplitPane0.setDividerSize(GUISizeHelper.dividerBarSize);
|
||||
jSplitPane1.setDividerSize(GUISizeHelper.dividerBarSize);
|
||||
jSplitPane2.setDividerSize(GUISizeHelper.dividerBarSize);
|
||||
|
||||
feedbackAreaHeight = GUISizeHelper.gameDialogAreaFontSizeBig + GUISizeHelper.gameDialogAreaFontSizeSmall + GUISizeHelper.gameDialogAreaButtonHigh + 60;
|
||||
helper.setPreferredSize(new Dimension(100, feedbackAreaHeight));
|
||||
stackObjects.setCardDimension(GUISizeHelper.handCardDimension);
|
||||
int newStackWidth = jPanel3.getWidth() * GUISizeHelper.stackWidth / 100;
|
||||
if (newStackWidth < 360) {
|
||||
newStackWidth = 360;
|
||||
}
|
||||
Dimension newDimension = new Dimension(jPanel3.getWidth() - newStackWidth, GUISizeHelper.handCardDimension.height + GUISizeHelper.scrollBarSize);
|
||||
handContainer.setPreferredSize(newDimension);
|
||||
handContainer.setMaximumSize(newDimension);
|
||||
newDimension = new Dimension(newStackWidth, STACK_MIN_CARDS_OFFSET_Y + GUISizeHelper.handCardDimension.height + GUISizeHelper.scrollBarSize);
|
||||
stackObjects.setPreferredSize(newDimension);
|
||||
stackObjects.setMinimumSize(newDimension);
|
||||
stackObjects.setMaximumSize(newDimension);
|
||||
newDimension = new Dimension(newStackWidth, (int) pnlShortCuts.getPreferredSize().getHeight());
|
||||
pnlShortCuts.setPreferredSize(newDimension);
|
||||
pnlShortCuts.setMinimumSize(newDimension);
|
||||
pnlShortCuts.setMaximumSize(newDimension);
|
||||
|
||||
GUISizeHelper.changePopupMenuFont(popupMenuTriggerOrder);
|
||||
}
|
||||
|
||||
private void saveDividerLocations() {
|
||||
|
@ -831,7 +884,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
}
|
||||
|
||||
private void displayStack(GameView game, BigCard bigCard, FeedbackPanel feedbackPanel, UUID gameId) {
|
||||
this.stack.loadCards(game.getStack(), bigCard, gameId, true);
|
||||
this.stackObjects.loadCards(game.getStack(), bigCard, gameId, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1075,7 +1128,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
// magenoxx: because of uncaught bug with saving state, rolling back and stack
|
||||
// undo is allowed only for empty stack
|
||||
controllingPlayer = !gameView.getPriorityPlayerName().equals(playerView.getName());
|
||||
if (playerView.getStatesSavedSize() > 0 && gameView.getStack().size() == 0) {
|
||||
if (playerView.getStatesSavedSize() > 0 && gameView.getStack().isEmpty()) {
|
||||
feedbackPanel.allowUndo(playerView.getStatesSavedSize());
|
||||
}
|
||||
break;
|
||||
|
@ -1097,8 +1150,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
if (controllingPlayer) {
|
||||
priorityPlayerText = " / priority " + gameView.getPriorityPlayerName();
|
||||
}
|
||||
String messageToDisplay = message + "<div style='font-size:11pt'>" + activePlayerText + " / " + gameView.getStep().toString() + priorityPlayerText + "</div>";
|
||||
|
||||
String messageToDisplay = message + FeedbackPanel.getSmallText(activePlayerText + " / " + gameView.getStep().toString() + priorityPlayerText);
|
||||
this.feedbackPanel.getFeedback(FeedbackMode.SELECT, messageToDisplay, gameView.getSpecial(), panelOptions, messageId);
|
||||
}
|
||||
|
||||
|
@ -1136,7 +1188,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
if (PopUpMenuType.TRIGGER_ORDER.equals(popupMenuType)) {
|
||||
popupMenu = popupMenuTriggerOrder;
|
||||
}
|
||||
showCards.loadCards(title, cards, bigCard, Config.dimensionsEnlarged, gameId, required, options, popupMenu, getShowCardsEventListener(showCards));
|
||||
showCards.loadCards(title, cards, bigCard, gameId, required, options, popupMenu, getShowCardsEventListener(showCards));
|
||||
return showCards;
|
||||
}
|
||||
|
||||
|
@ -1169,7 +1221,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
public void pickPile(String message, CardsView pile1, CardsView pile2) {
|
||||
hideAll();
|
||||
PickPileDialog pickPileDialog = new PickPileDialog();
|
||||
pickPileDialog.loadCards(message, pile1, pile2, bigCard, Config.dimensions, gameId);
|
||||
pickPileDialog.loadCards(message, pile1, pile2, bigCard, gameId);
|
||||
session.sendPlayerBoolean(gameId, pickPileDialog.isPickedPile1());
|
||||
pickPileDialog.cleanUp();
|
||||
pickPileDialog.removeDialog();
|
||||
|
@ -1222,7 +1274,6 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
btnStopWatching = new javax.swing.JButton();
|
||||
|
||||
bigCard = new mage.client.cards.BigCard();
|
||||
stack = new mage.client.cards.Cards();
|
||||
pnlReplay = new javax.swing.JPanel();
|
||||
btnStopReplay = new javax.swing.JButton();
|
||||
btnNextPlay = new javax.swing.JButton();
|
||||
|
@ -1241,9 +1292,13 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
gameChatPanel.setMinimumSize(new java.awt.Dimension(100, 48));
|
||||
jSplitPane2 = new javax.swing.JSplitPane();
|
||||
handContainer = new HandPanel();
|
||||
|
||||
handCards = new HashMap<>();
|
||||
|
||||
pnlShortCuts.setOpaque(false);
|
||||
pnlShortCuts.setPreferredSize(new Dimension(400, 72));
|
||||
|
||||
stackObjects = new mage.client.cards.Cards();
|
||||
|
||||
jSplitPane1.setBorder(null);
|
||||
jSplitPane1.setDividerSize(7);
|
||||
jSplitPane1.setResizeWeight(1.0);
|
||||
|
@ -1257,8 +1312,6 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
|
||||
restoreDividerLocations();
|
||||
|
||||
pnlShortCuts.setOpaque(false);
|
||||
pnlShortCuts.setPreferredSize(new Dimension(400, 72));
|
||||
lblPhase.setLabelFor(txtPhase);
|
||||
lblPhase.setText("Phase:");
|
||||
|
||||
|
@ -1294,10 +1347,10 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
lblPriority.setLabelFor(txtPriority);
|
||||
lblPriority.setText("Priority Player:");
|
||||
|
||||
feedbackPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(150, 50, 50), 2));
|
||||
feedbackPanel.setMaximumSize(new java.awt.Dimension(208, 121));
|
||||
feedbackPanel.setMinimumSize(new java.awt.Dimension(208, 121));
|
||||
|
||||
// feedbackPanel.setBorder(javax.swing.BorderFactory.createLineBorder(Color.MAGENTA, 5));
|
||||
// feedbackPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(150, 50, 50), 2));
|
||||
// feedbackPanel.setMaximumSize(new java.awt.Dimension(208, 121));
|
||||
// feedbackPanel.setMinimumSize(new java.awt.Dimension(208, 121));
|
||||
bigCard.setBorder(new LineBorder(Color.black, 1, true));
|
||||
|
||||
int c = JComponent.WHEN_IN_FOCUSED_WINDOW;
|
||||
|
@ -1558,7 +1611,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
}
|
||||
});
|
||||
|
||||
stack.setBackgroundColor(new Color(0, 0, 0, 0));
|
||||
stackObjects.setBackgroundColor(new Color(0, 0, 0, 40));
|
||||
|
||||
btnStopReplay.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/control_stop.png")));
|
||||
btnStopReplay.addActionListener(new java.awt.event.ActionListener() {
|
||||
|
@ -1709,7 +1762,8 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
jPhases.addMouseListener(phasesMouseAdapter);
|
||||
|
||||
pnlReplay.setOpaque(false);
|
||||
HelperPanel helper = new HelperPanel();
|
||||
helper = new HelperPanel();
|
||||
// helper.setBorder(new LineBorder(Color.MAGENTA, 2));
|
||||
helper.setPreferredSize(new Dimension(100, 90));
|
||||
feedbackPanel.setHelperPanel(helper);
|
||||
|
||||
|
@ -1739,8 +1793,8 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
.addComponent(handContainer, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
)
|
||||
.addGroup(gl_jPanel3.createParallelGroup(Alignment.LEADING)
|
||||
.addComponent(pnlShortCuts, 400, 400, 400)
|
||||
.addComponent(stack, 400, 400, 400)
|
||||
.addComponent(pnlShortCuts, 360, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(stackObjects, 360, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)
|
||||
)
|
||||
)
|
||||
.addGap(0)
|
||||
|
@ -1762,7 +1816,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
.addGroup(gl_jPanel3.createSequentialGroup()
|
||||
.addGap(2)
|
||||
.addComponent(pnlShortCuts, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(stack, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(stackObjects, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
)
|
||||
.addGroup(gl_jPanel3.createSequentialGroup()
|
||||
.addComponent(helper, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
|
@ -2159,6 +2213,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
|
||||
private mage.client.chat.ChatPanelBasic gameChatPanel;
|
||||
private mage.client.game.FeedbackPanel feedbackPanel;
|
||||
private HelperPanel helper;
|
||||
private mage.client.chat.ChatPanelBasic userChatPanel;
|
||||
private javax.swing.JPanel jPanel2;
|
||||
private javax.swing.JPanel jPanel3;
|
||||
|
@ -2179,7 +2234,8 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
private javax.swing.JLabel txtTurn;
|
||||
|
||||
private Map<String, CardsView> handCards;
|
||||
private mage.client.cards.Cards stack;
|
||||
|
||||
private mage.client.cards.Cards stackObjects;
|
||||
private HandPanel handContainer;
|
||||
|
||||
private javax.swing.JSplitPane jSplitPane2;
|
||||
|
|
|
@ -30,7 +30,7 @@ package mage.client.game;
|
|||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.GridBagLayout;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.Point;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
@ -69,10 +69,11 @@ public class HelperPanel extends JPanel {
|
|||
private javax.swing.JButton btnRight;
|
||||
private javax.swing.JButton btnSpecial;
|
||||
private javax.swing.JButton btnUndo;
|
||||
|
||||
//private javax.swing.JButton btnEndTurn;
|
||||
//private javax.swing.JButton btnStopTimer;
|
||||
|
||||
private MageTextArea textArea;
|
||||
JPanel buttonContainer;
|
||||
|
||||
private javax.swing.JButton linkLeft;
|
||||
private javax.swing.JButton linkRight;
|
||||
|
@ -113,57 +114,69 @@ public class HelperPanel extends JPanel {
|
|||
}
|
||||
|
||||
private void setGUISize() {
|
||||
for (Component comp : popupMenuAskNo.getComponents()) {
|
||||
if (comp instanceof JMenuItem) {
|
||||
comp.setFont(GUISizeHelper.menuFont);
|
||||
}
|
||||
}
|
||||
for (Component comp : popupMenuAskYes.getComponents()) {
|
||||
if (comp instanceof JMenuItem) {
|
||||
comp.setFont(GUISizeHelper.menuFont);
|
||||
buttonContainer.setPreferredSize(new Dimension(getWidth(), GUISizeHelper.gameDialogButtonHeight + 20));
|
||||
buttonContainer.setMinimumSize(new Dimension(160, GUISizeHelper.gameDialogButtonHeight + 20));
|
||||
buttonContainer.setMaximumSize(new Dimension(Integer.MAX_VALUE, GUISizeHelper.gameDialogButtonHeight + 20));
|
||||
|
||||
Dimension buttonDimension = new Dimension(GUISizeHelper.gameDialogButtonWidth, GUISizeHelper.gameDialogButtonHeight);
|
||||
btnLeft.setFont(GUISizeHelper.gameDialogAreaFont);
|
||||
btnRight.setFont(GUISizeHelper.gameDialogAreaFont);
|
||||
btnSpecial.setFont(GUISizeHelper.gameDialogAreaFont);
|
||||
btnUndo.setFont(GUISizeHelper.gameDialogAreaFont);
|
||||
|
||||
if (message != null) {
|
||||
int pos = this.message.indexOf("font-size:");
|
||||
if (pos > 0) {
|
||||
String newMessage = this.message.substring(0, pos + 10) + GUISizeHelper.gameDialogAreaFontSizeBig + this.message.substring(pos + 12);
|
||||
pos = this.message.indexOf("font-size:", pos + 10);
|
||||
if (pos > 0) {
|
||||
newMessage = this.message.substring(0, pos + 10) + GUISizeHelper.gameDialogAreaFontSizeSmall + this.message.substring(pos + 12);
|
||||
}
|
||||
setBasicMessage(newMessage);
|
||||
}
|
||||
}
|
||||
|
||||
GUISizeHelper.changePopupMenuFont(popupMenuAskNo);
|
||||
GUISizeHelper.changePopupMenuFont(popupMenuAskYes);
|
||||
revalidate();
|
||||
repaint();
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
initPopupMenuTriggerOrder();
|
||||
setBackground(new Color(0, 0, 0, 100));
|
||||
//setLayout(new GridBagLayout());
|
||||
setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
|
||||
// setBorder(new LineBorder(Color.WHITE, 1));
|
||||
|
||||
setOpaque(false);
|
||||
|
||||
JPanel container = new JPanel();
|
||||
|
||||
container.setPreferredSize(new Dimension(100, 30));
|
||||
container.setMinimumSize(new Dimension(20, 20));
|
||||
container.setMaximumSize(new Dimension(2000, 100));
|
||||
container.setLayout(new GridBagLayout());
|
||||
container.setOpaque(false);
|
||||
|
||||
JPanel jPanel = new JPanel();
|
||||
|
||||
textArea = new MageTextArea();
|
||||
// textArea.setBorder(new LineBorder(Color.GREEN, 1));
|
||||
textArea.setText("<Empty>");
|
||||
add(textArea);
|
||||
|
||||
jPanel.setOpaque(false);
|
||||
jPanel.setBackground(new Color(0, 0, 0, 80));
|
||||
jPanel.add(textArea);
|
||||
add(jPanel);
|
||||
buttonContainer = new JPanel();
|
||||
// buttonContainer.setBorder(new LineBorder(Color.RED, 1));
|
||||
buttonContainer.setLayout(new FlowLayout(FlowLayout.CENTER, 15, 0));
|
||||
buttonContainer.setOpaque(false);
|
||||
add(buttonContainer);
|
||||
|
||||
add(container);
|
||||
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
|
||||
|
||||
btnSpecial = new JButton("Special");
|
||||
btnSpecial.setVisible(false);
|
||||
container.add(btnSpecial);
|
||||
buttonContainer.add(btnSpecial);
|
||||
|
||||
btnLeft = new JButton("OK");
|
||||
btnLeft.setVisible(false);
|
||||
container.add(btnLeft);
|
||||
buttonContainer.add(btnLeft);
|
||||
|
||||
btnRight = new JButton("Cancel");
|
||||
btnRight.setVisible(false);
|
||||
container.add(btnRight);
|
||||
buttonContainer.add(btnRight);
|
||||
|
||||
btnUndo = new JButton("Undo");
|
||||
btnUndo.setVisible(false);
|
||||
container.add(btnUndo);
|
||||
buttonContainer.add(btnUndo);
|
||||
|
||||
MouseListener checkPopupAdapter = new MouseAdapter() {
|
||||
@Override
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
package mage.client.game;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
@ -148,17 +147,7 @@ public class PlayAreaPanel extends javax.swing.JPanel {
|
|||
}
|
||||
|
||||
private void setGUISize() {
|
||||
for (Component comp : popupMenu.getComponents()) {
|
||||
if (comp instanceof JMenuItem) {
|
||||
comp.setFont(GUISizeHelper.menuFont);
|
||||
if (comp instanceof JMenu) {
|
||||
comp.setFont(GUISizeHelper.menuFont);
|
||||
for (Component subComp : ((JMenu) comp).getMenuComponents()) {
|
||||
subComp.setFont(GUISizeHelper.menuFont);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
GUISizeHelper.changePopupMenuFont(popupMenu);
|
||||
}
|
||||
|
||||
private void addPopupMenuPlayer(boolean allowRequestToShowHandCards) {
|
||||
|
@ -531,8 +520,8 @@ public class PlayAreaPanel extends javax.swing.JPanel {
|
|||
this.playerPanel.init(gameId, player.getPlayerId(), bigCard, priorityTime);
|
||||
this.battlefieldPanel.init(gameId, bigCard);
|
||||
this.gameId = gameId;
|
||||
this.playerId = player.getPlayerId();
|
||||
if (MageFrame.getSession().isTestMode()) {
|
||||
this.playerId = player.getPlayerId();
|
||||
this.btnCheat.setVisible(true);
|
||||
} else {
|
||||
this.btnCheat.setVisible(false);
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
/*
|
||||
/*
|
||||
* CombatGroup.java
|
||||
*
|
||||
* Created on Feb 10, 2010, 3:36:55 PM
|
||||
|
@ -37,6 +37,7 @@ package mage.client.unusedFiles;
|
|||
import java.util.UUID;
|
||||
import mage.client.cards.BigCard;
|
||||
import mage.client.util.Config;
|
||||
import mage.client.util.GUISizeHelper;
|
||||
import mage.view.CombatGroupView;
|
||||
|
||||
/**
|
||||
|
@ -63,10 +64,12 @@ public class CombatGroup extends javax.swing.JPanel {
|
|||
|
||||
public void update(CombatGroupView combatGroup) {
|
||||
this.lblDefender.setText(combatGroup.getDefenderName());
|
||||
attackers.setCardDimension(GUISizeHelper.otherZonesCardDimension);
|
||||
this.attackers.loadCards(combatGroup.getAttackers(), bigCard, gameId, true);
|
||||
// attackers.setPreferredSize(new Dimension(Config.dimensions.frameWidth + 6, Config.dimensions.frameHeight + 6));
|
||||
|
||||
blockers.setCardDimension(GUISizeHelper.otherZonesCardDimension);
|
||||
this.blockers.loadCards(combatGroup.getBlockers(), bigCard, gameId, true);
|
||||
// blockers.setPreferredSize(new Dimension(Config.dimensions.frameWidth + 6, Config.dimensions.frameHeight + 6));
|
||||
|
||||
this.attackers.setVisible(true);
|
||||
this.blockers.setVisible(true);
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
/*
|
||||
/*
|
||||
* PlayerPanel.java
|
||||
*
|
||||
* Created on Nov 18, 2009, 3:01:31 PM
|
||||
|
@ -39,7 +39,6 @@ import java.util.UUID;
|
|||
import mage.client.MageFrame;
|
||||
import mage.client.cards.BigCard;
|
||||
import mage.client.dialog.ShowCardsDialog;
|
||||
import mage.client.util.Config;
|
||||
import mage.remote.Session;
|
||||
import mage.view.PlayerView;
|
||||
|
||||
|
@ -200,7 +199,7 @@ public class PlayerPanel extends javax.swing.JPanel {
|
|||
if (graveyard == null) {
|
||||
graveyard = new ShowCardsDialog();
|
||||
}
|
||||
graveyard.loadCards(player.getName() + " graveyard", player.getGraveyard(), bigCard, Config.dimensions, gameId, false, null, null, null);
|
||||
graveyard.loadCards(player.getName() + " graveyard", player.getGraveyard(), bigCard, gameId, false, null, null, null);
|
||||
}//GEN-LAST:event_btnGraveActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
|
|
|
@ -5,8 +5,12 @@
|
|||
*/
|
||||
package mage.client.util;
|
||||
|
||||
import java.awt.Component;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Font;
|
||||
import javax.swing.JMenu;
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.JPopupMenu;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.dialog.PreferencesDialog;
|
||||
|
||||
|
@ -24,6 +28,9 @@ public class GUISizeHelper {
|
|||
public static String basicSymbolSize = "small";
|
||||
|
||||
public static int symbolCardSize = 15;
|
||||
public static int symbolTableSize = 15;
|
||||
public static int symbolChatSize = 15;
|
||||
public static int symbolDialogSize = 15;
|
||||
public static int symbolTooltipSize = 15;
|
||||
public static int symbolPaySize = 15;
|
||||
public static int symbolEditorSize = 15;
|
||||
|
@ -37,6 +44,7 @@ public class GUISizeHelper {
|
|||
public static int flagHeight;
|
||||
|
||||
public static int cardTooltipFontSize = 15;
|
||||
|
||||
public static Font chatFont = new java.awt.Font("Arial", 0, 12);
|
||||
public static Font tableFont = new java.awt.Font("Arial", 0, 12);
|
||||
public static Font balloonTooltipFont = new java.awt.Font("Arial", 0, 12);
|
||||
|
@ -44,13 +52,25 @@ public class GUISizeHelper {
|
|||
|
||||
public static Font gameRequestsFont = new java.awt.Font("Arial", 0, 12);
|
||||
|
||||
public static Font gameDialogAreaFontBig = new java.awt.Font("Arial", 0, 12);
|
||||
public static Font gameDialogAreaFontSmall = new java.awt.Font("Arial", 0, 12);
|
||||
public static int gameDialogAreaFontSizeBig = 16;
|
||||
public static int gameDialogAreaFontSizeTooltip = 14;
|
||||
public static int gameDialogAreaFontSizeSmall = 11;
|
||||
public static int gameDialogAreaButtonHigh = 16;
|
||||
public static Font gameDialogAreaFont = new java.awt.Font("Arial", 0, 12);
|
||||
public static int gameDialogButtonHeight;
|
||||
public static int gameDialogButtonWidth;
|
||||
|
||||
public static Dimension handCardDimension;
|
||||
public static int stackWidth;
|
||||
|
||||
public static Dimension otherZonesCardDimension;
|
||||
public static int otherZonesCardVerticalOffset;
|
||||
|
||||
public static Dimension battlefieldCardDimension;
|
||||
|
||||
public static Dimension editorCardDimension;
|
||||
public static int editorCardOffsetSize;
|
||||
|
||||
public static int getTableRowHeight() {
|
||||
int fontSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_TABLE_FONT_SIZE, 14);
|
||||
return fontSize + 6;
|
||||
|
@ -71,6 +91,7 @@ public class GUISizeHelper {
|
|||
tableFont = new java.awt.Font("Arial", 0, tableFontSize);
|
||||
tableRowHeight = tableFontSize + 4;
|
||||
tableHeaderHeight = tableFontSize + 10;
|
||||
symbolTableSize = tableFontSize;
|
||||
flagHeight = tableFontSize - 2;
|
||||
balloonTooltipFont = new Font("Arial", 0, tableFontSize);
|
||||
if (tableFontSize > 15) {
|
||||
|
@ -88,36 +109,55 @@ public class GUISizeHelper {
|
|||
menuFont = new Font("Arial", 0, dialogFontSize);
|
||||
gameRequestsFont = new Font("Arial", 0, dialogFontSize);
|
||||
|
||||
// used in the feedback area of the game panel
|
||||
int feedbackFontSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_FEEDBACK_AREA_SIZE, 14);
|
||||
gameDialogAreaFontSizeBig = feedbackFontSize;
|
||||
gameDialogAreaFontSizeTooltip = feedbackFontSize - 2;
|
||||
gameDialogAreaFontSizeSmall = (feedbackFontSize / 2) + 2;
|
||||
gameDialogAreaButtonHigh = feedbackFontSize;
|
||||
gameDialogAreaFont = new Font("Arial", 0, feedbackFontSize);
|
||||
gameDialogButtonHeight = feedbackFontSize + 6;
|
||||
gameDialogButtonWidth = feedbackFontSize * 2 + 40;
|
||||
symbolDialogSize = feedbackFontSize;
|
||||
|
||||
int chatFontSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_CHAT_FONT_SIZE, 14);
|
||||
chatFont = new java.awt.Font("Arial", 0, chatFontSize);
|
||||
symbolChatSize = chatFontSize;
|
||||
|
||||
int symbolSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_SYMBOL_SIZE, 14);
|
||||
// Set basic symbol size
|
||||
if (symbolSize < 25) {
|
||||
basicSymbolSize = "small";
|
||||
} else if (symbolSize < 45) {
|
||||
basicSymbolSize = "medium";
|
||||
} else {
|
||||
basicSymbolSize = "large";
|
||||
}
|
||||
if (symbolSize < 16) {
|
||||
symbolTooltipSize = 15;
|
||||
symbolPaySize = 15;
|
||||
symbolCardSize = 15;
|
||||
} else {
|
||||
symbolTooltipSize = symbolSize;
|
||||
symbolPaySize = symbolSize;
|
||||
symbolCardSize = symbolSize;
|
||||
}
|
||||
cardTooltipFontSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_TOOLTIP_SIZE, 14);
|
||||
symbolTooltipSize = cardTooltipFontSize;
|
||||
|
||||
int handCardSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_CARD_HAND_SIZE, 14);
|
||||
handCardDimension = new Dimension(CARD_IMAGE_WIDTH * handCardSize / 42, CARD_IMAGE_HEIGHT * handCardSize / 42);
|
||||
stackWidth = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_STACK_WIDTH, 30);
|
||||
|
||||
int otherZonesCardSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_CARD_OTHER_ZONES_SIZE, 14);
|
||||
otherZonesCardDimension = new Dimension(CARD_IMAGE_WIDTH * otherZonesCardSize / 42, CARD_IMAGE_HEIGHT * otherZonesCardSize / 42);
|
||||
if (otherZonesCardSize > 29) {
|
||||
otherZonesCardVerticalOffset = otherZonesCardDimension.height / 8;
|
||||
} else {
|
||||
otherZonesCardVerticalOffset = otherZonesCardDimension.height / 10;
|
||||
}
|
||||
|
||||
int battlefieldCardSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_CARD_BATTLEFIELD_SIZE, 14);
|
||||
battlefieldCardDimension = new Dimension(CARD_IMAGE_WIDTH * battlefieldCardSize / 42, CARD_IMAGE_HEIGHT * battlefieldCardSize / 42);
|
||||
|
||||
int editorCardSize = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_CARD_EDITOR_SIZE, 14);
|
||||
editorCardDimension = new Dimension(CARD_IMAGE_WIDTH * editorCardSize / 42, CARD_IMAGE_HEIGHT * editorCardSize / 42);
|
||||
editorCardOffsetSize = 2 * PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GUI_CARD_OFFSET_SIZE, 14) - 10;
|
||||
}
|
||||
|
||||
public static void changePopupMenuFont(JPopupMenu popupMenu) {
|
||||
for (Component comp : popupMenu.getComponents()) {
|
||||
if (comp instanceof JMenuItem) {
|
||||
comp.setFont(GUISizeHelper.menuFont);
|
||||
if (comp instanceof JMenu) {
|
||||
comp.setFont(GUISizeHelper.menuFont);
|
||||
for (Component subComp : ((JMenu) comp).getMenuComponents()) {
|
||||
subComp.setFont(GUISizeHelper.menuFont);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -195,7 +195,7 @@ public class GuiDisplayUtil {
|
|||
manaCost += m;
|
||||
}
|
||||
String castingCost = UI.getDisplayManaCost(manaCost);
|
||||
castingCost = ManaSymbols.replaceSymbolsWithHTML(castingCost, ManaSymbols.Type.CARD);
|
||||
castingCost = ManaSymbols.replaceSymbolsWithHTML(castingCost, ManaSymbols.Type.TOOLTIP);
|
||||
|
||||
int symbolCount = 0;
|
||||
int offset = 0;
|
||||
|
@ -224,27 +224,28 @@ public class GuiDisplayUtil {
|
|||
buffer.append(" [").append(card.getId().toString().substring(0, 3)).append("]");
|
||||
}
|
||||
buffer.append("</b></td><td align='right' valign='top' style='width:");
|
||||
buffer.append(symbolCount * GUISizeHelper.symbolTooltipSize + 1);
|
||||
buffer.append(symbolCount * GUISizeHelper.cardTooltipFontSize);
|
||||
buffer.append("px'>");
|
||||
if (!card.isSplitCard()) {
|
||||
buffer.append(castingCost);
|
||||
}
|
||||
buffer.append("</td></tr></table>");
|
||||
buffer.append("<table cellspacing=0 cellpadding=0 border=0 width='100%'><tr><td style='margin-left: 1px'>");
|
||||
String imageSize = " width=" + GUISizeHelper.cardTooltipFontSize + " height=" + GUISizeHelper.cardTooltipFontSize + ">";
|
||||
if (card.getColor().isWhite()) {
|
||||
buffer.append("<img src='").append(getResourcePath("card/color_ind_white.png")).append("' alt='W'>");
|
||||
buffer.append("<img src='").append(getResourcePath("card/color_ind_white.png")).append("' alt='W' ").append(imageSize);
|
||||
}
|
||||
if (card.getColor().isBlue()) {
|
||||
buffer.append("<img src='").append(getResourcePath("card/color_ind_blue.png")).append("' alt='U'>");
|
||||
buffer.append("<img src='").append(getResourcePath("card/color_ind_blue.png")).append("' alt='U' ").append(imageSize);
|
||||
}
|
||||
if (card.getColor().isBlack()) {
|
||||
buffer.append("<img src='").append(getResourcePath("card/color_ind_black.png")).append("' alt='B'>");
|
||||
buffer.append("<img src='").append(getResourcePath("card/color_ind_black.png")).append("' alt='B' ").append(imageSize);
|
||||
}
|
||||
if (card.getColor().isRed()) {
|
||||
buffer.append("<img src='").append(getResourcePath("card/color_ind_red.png")).append("' alt='R'>");
|
||||
buffer.append("<img src='").append(getResourcePath("card/color_ind_red.png")).append("' alt='R' ").append(imageSize);
|
||||
}
|
||||
if (card.getColor().isGreen()) {
|
||||
buffer.append("<img src='").append(getResourcePath("card/color_ind_green.png")).append("' alt='G'>");
|
||||
buffer.append("<img src='").append(getResourcePath("card/color_ind_green.png")).append("' alt='G' ").append(imageSize);
|
||||
}
|
||||
if (!card.getColor().isColorless()) {
|
||||
buffer.append(" ");
|
||||
|
@ -273,7 +274,7 @@ public class GuiDisplayUtil {
|
|||
rarity = card.getRarity().getCode();
|
||||
}
|
||||
if (card.getExpansionSetCode() != null) {
|
||||
buffer.append(ManaSymbols.replaceSetCodeWithHTML(card.getExpansionSetCode().toUpperCase(), rarity));
|
||||
buffer.append(ManaSymbols.replaceSetCodeWithHTML(card.getExpansionSetCode().toUpperCase(), rarity, GUISizeHelper.symbolTooltipSize));
|
||||
}
|
||||
buffer.append("</td></tr></table>");
|
||||
|
||||
|
@ -338,13 +339,9 @@ public class GuiDisplayUtil {
|
|||
|
||||
String legal = rule.toString();
|
||||
if (legal.length() > 0) {
|
||||
// this 2 replaces were only done with the empty string, is it any longer needed? (LevelX2)
|
||||
// legal = legal.replaceAll("#([^#]+)#", "<i>$1</i>");
|
||||
// legal = legal.replaceAll("\\s*//\\s*", "<hr width='50%'>");
|
||||
// legal = legal.replace("\r\n", "<div style='font-size:5pt'></div>");
|
||||
legal = legal.replaceAll("\\{this\\}", card.getName().isEmpty() ? "this" : card.getName());
|
||||
legal = legal.replaceAll("\\{source\\}", card.getName().isEmpty() ? "this" : card.getName());
|
||||
buffer.append(ManaSymbols.replaceSymbolsWithHTML(legal, ManaSymbols.Type.CARD));
|
||||
buffer.append(ManaSymbols.replaceSymbolsWithHTML(legal, ManaSymbols.Type.TOOLTIP));
|
||||
}
|
||||
|
||||
buffer.append("<br></body></html>");
|
||||
|
|
|
@ -18,7 +18,7 @@ public class UpdateMemUsageTask extends SwingWorker<Void, Float> {
|
|||
|
||||
private final JLabel jLabelToDisplayInfo;
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(UpdateMemUsageTask.class);
|
||||
private static final Logger logger = Logger.getLogger(UpdateMemUsageTask.class);
|
||||
|
||||
public UpdateMemUsageTask(JLabel jLabelToDisplayInfo) {
|
||||
this.jLabelToDisplayInfo = jLabelToDisplayInfo;
|
||||
|
@ -51,7 +51,7 @@ public class UpdateMemUsageTask extends SwingWorker<Void, Float> {
|
|||
try {
|
||||
get();
|
||||
} catch (InterruptedException | ExecutionException ex) {
|
||||
LOGGER.fatal("Update Memory Usage error", ex);
|
||||
logger.fatal("Update Memory Usage error", ex);
|
||||
} catch (CancellationException ex) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import java.awt.image.BufferedImage;
|
|||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.UUID;
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.ImageIcon;
|
||||
|
@ -124,6 +125,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
|||
private boolean displayEnabled = true;
|
||||
private boolean isAnimationPanel;
|
||||
public int cardXOffset, cardYOffset, cardWidth, cardHeight;
|
||||
private int symbolWidth;
|
||||
|
||||
private boolean isSelected;
|
||||
private boolean isPlayable;
|
||||
|
@ -530,15 +532,26 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
|||
|
||||
if (showCastingCost && !isAnimationPanel && cardWidth < 200 && cardWidth > 60) {
|
||||
String manaCost = ManaSymbols.getStringManaCost(gameCard.getManaCost());
|
||||
int width = ManaSymbols.getWidth(manaCost);
|
||||
int width = getWidth(manaCost);
|
||||
if (hasImage) {
|
||||
ManaSymbols.draw(g, manaCost, cardXOffset + cardWidth - width - 5, cardYOffset + 5);
|
||||
ManaSymbols.draw(g, manaCost, cardXOffset + cardWidth - width - 5, cardYOffset + 5, symbolWidth);
|
||||
} else {
|
||||
ManaSymbols.draw(g, manaCost, cardXOffset + 8, cardHeight - 9);
|
||||
ManaSymbols.draw(g, manaCost, cardXOffset + 8, cardHeight - 9, symbolWidth);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int getWidth(String manaCost) {
|
||||
int width = 0;
|
||||
manaCost = manaCost.replace("\\", "");
|
||||
StringTokenizer tok = new StringTokenizer(manaCost, " ");
|
||||
while (tok.hasMoreTokens()) {
|
||||
tok.nextToken();
|
||||
width += symbolWidth;
|
||||
}
|
||||
return width;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doLayout() {
|
||||
int borderSize = Math.round(cardWidth * BLACK_BORDER_SIZE);
|
||||
|
@ -622,6 +635,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
|||
@Override
|
||||
public final void setCardBounds(int x, int y, int cardWidth, int cardHeight) {
|
||||
this.cardWidth = cardWidth;
|
||||
this.symbolWidth = cardWidth / 7;
|
||||
this.cardHeight = cardHeight;
|
||||
if (this.isPermanent) {
|
||||
int rotCenterX = Math.round(cardWidth / 2f);
|
||||
|
|
|
@ -23,46 +23,21 @@ import org.mage.plugins.card.constants.Constants;
|
|||
public class ManaSymbols {
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(ManaSymbols.class);
|
||||
private static final Map<String, BufferedImage> MANA_IMAGES = new HashMap<>();
|
||||
private static final Map<String, Image> SET_IMAGES = new HashMap<>();
|
||||
private static final Map<String, Dimension> SET_IMAGES_EXIST = new HashMap<>();
|
||||
private static final Map<Integer, Map<String, BufferedImage>> manaImages = new HashMap<>();
|
||||
private static boolean smallSymbolsFound = false;
|
||||
private static boolean mediumSymbolsFound = false;
|
||||
|
||||
private static final Map<String, Image> setImages = new HashMap<>();
|
||||
private static final Map<String, Dimension> setImagesExist = new HashMap<>();
|
||||
private static final Pattern REPLACE_SYMBOLS_PATTERN = Pattern.compile("\\{([^}/]*)/?([^}]*)\\}");
|
||||
private static String cachedPath;
|
||||
private static final String[] symbols = new String[]{"0", "1", "10", "11", "12", "15", "16", "2", "3", "4", "5", "6", "7", "8", "9", "B", "BG",
|
||||
"BR", "G", "GU", "GW", "R", "RG", "RW", "S", "T", "U", "UB", "UR", "W", "WB", "WU",
|
||||
"WP", "UP", "BP", "RP", "GP", "X", "C"};
|
||||
|
||||
public static void loadImages() {
|
||||
String[] symbols = new String[]{"0", "1", "10", "11", "12", "15", "16", "2", "3", "4", "5", "6", "7", "8", "9", "B", "BG",
|
||||
"BR", "G", "GU", "GW", "R", "RG", "RW", "S", "T", "U", "UB", "UR", "W", "WB", "WU",
|
||||
"WP", "UP", "BP", "RP", "GP", "X", "C"};
|
||||
|
||||
MANA_IMAGES.clear();
|
||||
SET_IMAGES.clear();
|
||||
SET_IMAGES_EXIST.clear();
|
||||
|
||||
for (String symbol : symbols) {
|
||||
String resourcePath = Constants.RESOURCE_PATH_MANA_SMALL;
|
||||
switch (GUISizeHelper.basicSymbolSize) {
|
||||
case "medium":
|
||||
resourcePath = Constants.RESOURCE_PATH_MANA_SMALL;
|
||||
break;
|
||||
case "large":
|
||||
resourcePath = Constants.RESOURCE_PATH_MANA_LARGE;
|
||||
break;
|
||||
}
|
||||
File file = new File(getSymbolsPath() + resourcePath + "/" + symbol + ".jpg");
|
||||
try {
|
||||
if (GUISizeHelper.symbolPaySize != 15) {
|
||||
BufferedImage notResized = ImageIO.read(file);
|
||||
MANA_IMAGES.put(symbol, notResized);
|
||||
} else {
|
||||
Rectangle r = new Rectangle(GUISizeHelper.symbolPaySize, GUISizeHelper.symbolPaySize);
|
||||
Image image = UI.getImageIcon(file.getAbsolutePath()).getImage();
|
||||
BufferedImage resized = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB), r);
|
||||
MANA_IMAGES.put(symbol, resized);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Error for symbol:" + symbol);
|
||||
}
|
||||
}
|
||||
smallSymbolsFound = loadSymbolsImages(15);
|
||||
mediumSymbolsFound = loadSymbolsImages(25);
|
||||
|
||||
List<String> setCodes = ExpansionRepository.instance.getSetCodes();
|
||||
if (setCodes == null) {
|
||||
|
@ -80,10 +55,10 @@ public class ManaSymbols {
|
|||
if (h > 0) {
|
||||
Rectangle r = new Rectangle(21, (int) (h * 21.0f / width));
|
||||
BufferedImage resized = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB), r);
|
||||
SET_IMAGES.put(set, resized);
|
||||
setImages.put(set, resized);
|
||||
}
|
||||
} else {
|
||||
SET_IMAGES.put(set, image);
|
||||
setImages.put(set, image);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
|
@ -136,12 +111,43 @@ public class ManaSymbols {
|
|||
Image image = UI.getImageIcon(file.getAbsolutePath()).getImage();
|
||||
int width = image.getWidth(null);
|
||||
int height = image.getHeight(null);
|
||||
SET_IMAGES_EXIST.put(set, new Dimension(width, height));
|
||||
setImagesExist.put(set, new Dimension(width, height));
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean loadSymbolsImages(int size) {
|
||||
boolean fileErrors = false;
|
||||
HashMap<String, BufferedImage> sizedSymbols = new HashMap<>();
|
||||
for (String symbol : symbols) {
|
||||
String resourcePath = Constants.RESOURCE_PATH_MANA_SMALL;
|
||||
if (size > 25) {
|
||||
resourcePath = Constants.RESOURCE_PATH_MANA_LARGE;
|
||||
} else if (size > 15) {
|
||||
resourcePath = Constants.RESOURCE_PATH_MANA_MEDIUM;
|
||||
}
|
||||
File file = new File(getSymbolsPath() + resourcePath + "/" + symbol + ".jpg");
|
||||
try {
|
||||
|
||||
if (size == 15 || size == 25) {
|
||||
BufferedImage notResized = ImageIO.read(file);
|
||||
sizedSymbols.put(symbol, notResized);
|
||||
} else {
|
||||
Rectangle r = new Rectangle(size, size);
|
||||
Image image = UI.getImageIcon(file.getAbsolutePath()).getImage();
|
||||
BufferedImage resized = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB), r);
|
||||
sizedSymbols.put(symbol, resized);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Error for symbol:" + symbol);
|
||||
fileErrors = true;
|
||||
}
|
||||
}
|
||||
manaImages.put(size, sizedSymbols);
|
||||
return !fileErrors;
|
||||
}
|
||||
|
||||
private static String getSymbolsPath() {
|
||||
return getSymbolsPath(false);
|
||||
}
|
||||
|
@ -170,7 +176,11 @@ public class ManaSymbols {
|
|||
return path;
|
||||
}
|
||||
|
||||
public static void draw(Graphics g, String manaCost, int x, int y) {
|
||||
public static void draw(Graphics g, String manaCost, int x, int y, int symbolWidth) {
|
||||
if (!manaImages.containsKey(symbolWidth)) {
|
||||
loadSymbolsImages(symbolWidth);
|
||||
}
|
||||
Map<String, BufferedImage> sizedSymbols = manaImages.get(symbolWidth);
|
||||
if (manaCost.length() == 0) {
|
||||
return;
|
||||
}
|
||||
|
@ -179,13 +189,14 @@ public class ManaSymbols {
|
|||
StringTokenizer tok = new StringTokenizer(manaCost, " ");
|
||||
while (tok.hasMoreTokens()) {
|
||||
String symbol = tok.nextToken().substring(0);
|
||||
Image image = MANA_IMAGES.get(symbol);
|
||||
// Check and load symbol in the width
|
||||
Image image = sizedSymbols.get(symbol);
|
||||
if (image == null) {
|
||||
//log.error("Symbol not recognized \"" + symbol + "\" in mana cost: " + manaCost);
|
||||
continue;
|
||||
}
|
||||
g.drawImage(image, x, y, null);
|
||||
x += GUISizeHelper.symbolPaySize;
|
||||
x += symbolWidth;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -197,74 +208,75 @@ public class ManaSymbols {
|
|||
return sb.toString().replace("{", "").replace("}", " ").trim();
|
||||
}
|
||||
|
||||
public static int getWidth(String manaCost) {
|
||||
int width = 0;
|
||||
manaCost = manaCost.replace("\\", "");
|
||||
StringTokenizer tok = new StringTokenizer(manaCost, " ");
|
||||
while (tok.hasMoreTokens()) {
|
||||
tok.nextToken();
|
||||
width += GUISizeHelper.symbolPaySize;
|
||||
}
|
||||
return width;
|
||||
}
|
||||
|
||||
public enum Type {
|
||||
CARD,
|
||||
TABLE,
|
||||
CHAT,
|
||||
DIALOG,
|
||||
TOOLTIP,
|
||||
EDITOR,
|
||||
PAY
|
||||
}
|
||||
|
||||
public static synchronized String replaceSymbolsWithHTML(String value, Type type) {
|
||||
value = value.replace("{source}", "|source|");
|
||||
value = value.replace("{this}", "|this|");
|
||||
String replaced = value;
|
||||
|
||||
if (!MANA_IMAGES.isEmpty()) {
|
||||
int symbolSize;
|
||||
switch (type) {
|
||||
case TOOLTIP:
|
||||
symbolSize = GUISizeHelper.symbolTooltipSize;
|
||||
break;
|
||||
case CARD:
|
||||
symbolSize = GUISizeHelper.symbolCardSize;
|
||||
break;
|
||||
case PAY:
|
||||
symbolSize = GUISizeHelper.symbolPaySize;
|
||||
break;
|
||||
case EDITOR:
|
||||
symbolSize = GUISizeHelper.symbolEditorSize;
|
||||
break;
|
||||
default:
|
||||
symbolSize = 11;
|
||||
break;
|
||||
}
|
||||
boolean symbolFilesFound;
|
||||
int symbolSize;
|
||||
switch (type) {
|
||||
case TABLE:
|
||||
symbolSize = GUISizeHelper.symbolTableSize;
|
||||
break;
|
||||
case CHAT:
|
||||
symbolSize = GUISizeHelper.symbolChatSize;
|
||||
break;
|
||||
case DIALOG:
|
||||
symbolSize = GUISizeHelper.symbolDialogSize;
|
||||
break;
|
||||
case TOOLTIP:
|
||||
symbolSize = GUISizeHelper.symbolTooltipSize;
|
||||
break;
|
||||
default:
|
||||
symbolSize = 11;
|
||||
break;
|
||||
}
|
||||
String resourcePath = "small";
|
||||
symbolFilesFound = smallSymbolsFound;
|
||||
if (symbolSize > 25) {
|
||||
resourcePath = "large";
|
||||
} else if (symbolSize > 15) {
|
||||
resourcePath = "medium";
|
||||
symbolFilesFound = mediumSymbolsFound;
|
||||
}
|
||||
if (symbolFilesFound) {
|
||||
replaced = REPLACE_SYMBOLS_PATTERN.matcher(value).replaceAll("<img src='file:" + getSymbolsPath(true)
|
||||
+ "/symbols/" + GUISizeHelper.basicSymbolSize + "/$1$2.jpg' alt='$1$2' width="
|
||||
+ "/symbols/" + resourcePath + "/$1$2.jpg' alt='$1$2' width="
|
||||
+ symbolSize + " height=" + symbolSize + ">");
|
||||
|
||||
}
|
||||
replaced = replaced.replace("|source|", "{source}");
|
||||
replaced = replaced.replace("|this|", "{this}");
|
||||
return replaced;
|
||||
}
|
||||
|
||||
public static String replaceSetCodeWithHTML(String set, String rarity) {
|
||||
public static String replaceSetCodeWithHTML(String set, String rarity, int size) {
|
||||
String _set = set;
|
||||
if (SET_IMAGES_EXIST.containsKey(_set)) {
|
||||
Integer width = SET_IMAGES_EXIST.get(_set).width;
|
||||
Integer height = SET_IMAGES_EXIST.get(_set).height;
|
||||
return "<img src='file:" + getSymbolsPath() + "/sets/small/" + _set + "-" + rarity + ".png' alt='" + rarity + " ' width=" + width + " height=" + height + ">";
|
||||
if (setImagesExist.containsKey(_set)) {
|
||||
int factor = size / 15 + 1;
|
||||
Integer width = setImagesExist.get(_set).width * factor;
|
||||
Integer height = setImagesExist.get(_set).height * factor;
|
||||
return "<img src='file:" + getSymbolsPath() + "/sets/small/" + _set + "-" + rarity + ".png' alt='" + rarity + "' height='" + height + "' width='" + width + "' >";
|
||||
} else {
|
||||
return set;
|
||||
}
|
||||
}
|
||||
|
||||
public static Image getSetSymbolImage(String set) {
|
||||
return SET_IMAGES.get(set);
|
||||
return setImages.get(set);
|
||||
}
|
||||
|
||||
public static BufferedImage getSizedManaSymbol(String symbol) {
|
||||
return MANA_IMAGES.get(symbol);
|
||||
if (!manaImages.containsKey(GUISizeHelper.symbolDialogSize)) {
|
||||
loadSymbolsImages(GUISizeHelper.symbolDialogSize);
|
||||
}
|
||||
Map<String, BufferedImage> sizedSymbols = manaImages.get(GUISizeHelper.symbolDialogSize);
|
||||
return sizedSymbols.get(symbol);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,8 +47,8 @@ public class CardInfoPaneImpl extends JEditorPane implements CardInfoPane {
|
|||
}
|
||||
|
||||
private void setGUISize() {
|
||||
addWidth = 20 * GUISizeHelper.cardTooltipFontSize;
|
||||
addHeight = 12 * GUISizeHelper.cardTooltipFontSize;
|
||||
addWidth = 20 * GUISizeHelper.cardTooltipFontSize - 50;
|
||||
addHeight = 12 * GUISizeHelper.cardTooltipFontSize - 20;
|
||||
setSize = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-root</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mage-common</artifactId>
|
||||
|
|
|
@ -40,8 +40,8 @@ public class MageVersion implements Serializable, Comparable<MageVersion> {
|
|||
*/
|
||||
public final static int MAGE_VERSION_MAJOR = 1;
|
||||
public final static int MAGE_VERSION_MINOR = 4;
|
||||
public final static int MAGE_VERSION_PATCH = 8;
|
||||
public final static String MAGE_VERSION_MINOR_PATCH = "v1";
|
||||
public final static int MAGE_VERSION_PATCH = 9;
|
||||
public final static String MAGE_VERSION_MINOR_PATCH = "v0";
|
||||
public final static String MAGE_VERSION_INFO = "";
|
||||
|
||||
private final int major;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-plugins</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mage-counter-plugin</artifactId>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-root</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mage-plugins</artifactId>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-root</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.mage</groupId>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-server-plugins</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mage-deck-constructed</artifactId>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-server-plugins</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mage-deck-limited</artifactId>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-server-plugins</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mage-game-commanderduel</artifactId>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-server-plugins</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mage-game-commanderfreeforall</artifactId>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-server-plugins</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mage-game-freeforall</artifactId>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-server-plugins</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mage-game-momirduel</artifactId>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-server-plugins</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mage-game-tinyleadersduel</artifactId>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-server-plugins</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mage-game-twoplayerduel</artifactId>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-server-plugins</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mage-player-ai-draftbot</artifactId>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-server-plugins</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mage-player-ai-ma</artifactId>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-server-plugins</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mage-player-ai</artifactId>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-server-plugins</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mage-player-ai-mcts</artifactId>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-server-plugins</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mage-player-aiminimax</artifactId>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-server-plugins</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mage-player-human</artifactId>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-server-plugins</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mage-tournament-boosterdraft</artifactId>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-server-plugins</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mage-tournament-constructed</artifactId>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-server-plugins</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mage-tournament-sealed</artifactId>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-root</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mage-server-plugins</artifactId>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-root</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mage-server</artifactId>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-root</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.mage</groupId>
|
||||
|
|
|
@ -200,7 +200,7 @@ class IllusionistsGambitRestrictionEffect extends RestrictionEffect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canAttack(UUID defenderId, Ability source, Game game) {
|
||||
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game) {
|
||||
if (defenderId.equals(source.getControllerId())) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.keyword.FlashAbility;
|
||||
import mage.abilities.keyword.TransformAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
|
@ -122,6 +123,10 @@ class ContainmentPriestReplacementEffect extends ReplacementEffectImpl {
|
|||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (((ZoneChangeEvent) event).getToZone() == Zone.BATTLEFIELD) {
|
||||
Card card = game.getCard(event.getTargetId());
|
||||
Object entersTransformed = game.getState().getValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + event.getTargetId());
|
||||
if (entersTransformed instanceof Boolean && (Boolean) entersTransformed && card.getSecondCardFace() != null) {
|
||||
card = card.getSecondCardFace();
|
||||
}
|
||||
if (card.getCardType().contains(CardType.CREATURE)) { // TODO: Bestow Card cast as Enchantment probably not handled correctly
|
||||
CreatureWasCastWatcher watcher = (CreatureWasCastWatcher) game.getState().getWatchers().get("CreatureWasCast");
|
||||
if (watcher != null && !watcher.wasCreatureCastThisTurn(event.getTargetId())) {
|
||||
|
|
|
@ -32,15 +32,12 @@ import mage.MageInt;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.CreateTokenTargetEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.token.SpiritWhiteToken;
|
||||
import mage.game.permanent.token.ElfToken;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.players.Player;
|
||||
|
@ -58,7 +55,6 @@ public class SylvanOffering extends CardImpl {
|
|||
super(ownerId, 48, "Sylvan Offering", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{G}");
|
||||
this.expansionSetCode = "C14";
|
||||
|
||||
|
||||
// Choose an opponent. You and that player each put an X/X green Treefolk creature token onto the battlefield.
|
||||
this.getSpellAbility().addEffect(new SylvanOfferingEffect1());
|
||||
// Choose an opponent. You and that player each put X 1/1 green Elf Warrior creature tokens onto the battlefield.
|
||||
|
@ -101,9 +97,10 @@ class SylvanOfferingEffect1 extends OneShotEffect {
|
|||
if (opponent != null) {
|
||||
int xValue = source.getManaCostsToPay().getX();
|
||||
Effect effect = new CreateTokenTargetEffect(new SylvanOfferingTreefolkToken(xValue));
|
||||
effect.setTargetPointer(new FixedTarget(controller.getId()));
|
||||
effect.apply(game, source);
|
||||
effect.setTargetPointer(new FixedTarget(opponent.getId()));
|
||||
effect.apply(game, source);
|
||||
new CreateTokenTargetEffect(new SylvanOfferingTreefolkToken(xValue)).apply(game, source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -127,12 +124,12 @@ class SylvanOfferingTreefolkToken extends Token {
|
|||
|
||||
class SylvanOfferingEffect2 extends OneShotEffect {
|
||||
|
||||
SylvanOfferingEffect2() {
|
||||
SylvanOfferingEffect2() {
|
||||
super(Outcome.Sacrifice);
|
||||
this.staticText = "<br>Choose an opponent. You and that player each put X 1/1 green Elf Warrior creature tokens onto the battlefield";
|
||||
}
|
||||
|
||||
SylvanOfferingEffect2(final SylvanOfferingEffect2 effect) {
|
||||
SylvanOfferingEffect2(final SylvanOfferingEffect2 effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
@ -151,9 +148,10 @@ class SylvanOfferingEffect2 extends OneShotEffect {
|
|||
if (opponent != null) {
|
||||
int xValue = source.getManaCostsToPay().getX();
|
||||
Effect effect = new CreateTokenTargetEffect(new ElfToken(), xValue);
|
||||
effect.setTargetPointer(new FixedTarget(controller.getId()));
|
||||
effect.apply(game, source);
|
||||
effect.setTargetPointer(new FixedTarget(opponent.getId()));
|
||||
effect.apply(game, source);
|
||||
new CreateTokenEffect(new ElfToken(), xValue).apply(game, source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
99
Mage.Sets/src/mage/sets/exodus/Plaguebearer.java
Normal file
99
Mage.Sets/src/mage/sets/exodus/Plaguebearer.java
Normal file
|
@ -0,0 +1,99 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.exodus;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.target.Target;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author spjspj
|
||||
*/
|
||||
public class Plaguebearer extends CardImpl {
|
||||
|
||||
private final UUID originalId;
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK)));
|
||||
}
|
||||
|
||||
public Plaguebearer(UUID ownerId) {
|
||||
super(ownerId, 71, "Plaguebearer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{B}");
|
||||
this.expansionSetCode = "EXO";
|
||||
this.subtype.add("Zombie");
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// {X}{X}{B}: Destroy target nonblack creature with converted mana cost X.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{X}{X}{B}"));
|
||||
ability.addTarget(new TargetPermanent(filter));
|
||||
originalId = ability.getOriginalId();
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
if (ability.getOriginalId().equals(originalId)) {
|
||||
int xValue = ability.getManaCostsToPay().getX();
|
||||
ability.getTargets().clear();
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent(new StringBuilder("nonblack creature with converted mana cost ").append(xValue).toString());
|
||||
filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, xValue));
|
||||
filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK)));
|
||||
Target target = new TargetPermanent(filter);
|
||||
ability.addTarget(target);
|
||||
}
|
||||
}
|
||||
|
||||
public Plaguebearer(final Plaguebearer card) {
|
||||
super(card);
|
||||
this.originalId = card.originalId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plaguebearer copy() {
|
||||
return new Plaguebearer(this);
|
||||
}
|
||||
}
|
|
@ -92,7 +92,7 @@ class SilentArbiterAttackRestrictionEffect extends RestrictionEffect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canAttack(UUID defenderId, Ability source, Game game) {
|
||||
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game) {
|
||||
return game.getCombat().getAttackers().isEmpty();
|
||||
}
|
||||
}
|
||||
|
|
52
Mage.Sets/src/mage/sets/fourthedition/EnergyTap.java
Normal file
52
Mage.Sets/src/mage/sets/fourthedition/EnergyTap.java
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.fourthedition;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author spjspj
|
||||
*/
|
||||
public class EnergyTap extends mage.sets.legends.EnergyTap {
|
||||
|
||||
public EnergyTap(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 69;
|
||||
this.expansionSetCode = "4ED";
|
||||
}
|
||||
|
||||
public EnergyTap(final EnergyTap card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnergyTap copy() {
|
||||
return new EnergyTap(this);
|
||||
}
|
||||
}
|
102
Mage.Sets/src/mage/sets/futuresight/StormEntity.java
Normal file
102
Mage.Sets/src/mage/sets/futuresight/StormEntity.java
Normal file
|
@ -0,0 +1,102 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.futuresight;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.watchers.common.CastSpellLastTurnWatcher;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Quercitron
|
||||
*/
|
||||
public class StormEntity extends CardImpl {
|
||||
|
||||
public StormEntity(UUID ownerId) {
|
||||
super(ownerId, 122, "Storm Entity", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}");
|
||||
this.expansionSetCode = "FUT";
|
||||
this.subtype.add("Elemental");
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Haste
|
||||
this.addAbility(HasteAbility.getInstance());
|
||||
// Storm Entity enters the battlefield with a +1/+1 counter on it for each other spell cast this turn.
|
||||
this.addAbility(new EntersBattlefieldAbility(
|
||||
new AddCountersSourceEffect(
|
||||
CounterType.P1P1.createInstance(),
|
||||
new OtherSpellsCastThisTurnCount(),
|
||||
true),
|
||||
"with a +1/+1 counter on it for each other spell cast this turn"));
|
||||
}
|
||||
|
||||
public StormEntity(final StormEntity card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StormEntity copy() {
|
||||
return new StormEntity(this);
|
||||
}
|
||||
}
|
||||
|
||||
class OtherSpellsCastThisTurnCount implements DynamicValue {
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get("CastSpellLastTurnWatcher");
|
||||
return watcher.getAmountOfSpellsAllPlayersCastOnCurrentTurn() - 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicValue copy() {
|
||||
return new OtherSpellsCastThisTurnCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "X";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "other spell cast this turn";
|
||||
}
|
||||
|
||||
}
|
|
@ -97,7 +97,7 @@ class EssenceOfTheWildEffect extends ReplacementEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Permanent sourceObject = ((EntersTheBattlefieldEvent) event).getTarget();
|
||||
Permanent sourceObject = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||
if (sourceObject != null) {
|
||||
game.addEffect(new CopyEffect(Duration.Custom, sourceObject, event.getTargetId()), source);
|
||||
}
|
||||
|
|
146
Mage.Sets/src/mage/sets/invasion/DuelingGrounds.java
Normal file
146
Mage.Sets/src/mage/sets/invasion/DuelingGrounds.java
Normal file
|
@ -0,0 +1,146 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.invasion;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.RestrictionEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.watchers.common.AttackedThisTurnWatcher;
|
||||
import mage.watchers.common.BlockedThisTurnWatcher;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Quercitron
|
||||
*/
|
||||
public class DuelingGrounds extends CardImpl {
|
||||
|
||||
public DuelingGrounds(UUID ownerId) {
|
||||
super(ownerId, 245, "Dueling Grounds", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}{W}");
|
||||
this.expansionSetCode = "INV";
|
||||
|
||||
// No more than one creature can attack each turn.
|
||||
this.addAbility(
|
||||
new SimpleStaticAbility(Zone.BATTLEFIELD, new NoMoreThanOneCreatureCanAttackEachTurnEffect()),
|
||||
new AttackedThisTurnWatcher());
|
||||
|
||||
// No more than one creature can block each turn.
|
||||
this.addAbility(
|
||||
new SimpleStaticAbility(Zone.BATTLEFIELD, new NoMoreThanOneCreatureCanBlockEachTurnEffect()),
|
||||
new BlockedThisTurnWatcher());
|
||||
}
|
||||
|
||||
public DuelingGrounds(final DuelingGrounds card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DuelingGrounds copy() {
|
||||
return new DuelingGrounds(this);
|
||||
}
|
||||
}
|
||||
|
||||
class NoMoreThanOneCreatureCanAttackEachTurnEffect extends RestrictionEffect {
|
||||
|
||||
public NoMoreThanOneCreatureCanAttackEachTurnEffect() {
|
||||
super(Duration.WhileOnBattlefield);
|
||||
}
|
||||
|
||||
public NoMoreThanOneCreatureCanAttackEachTurnEffect(final NoMoreThanOneCreatureCanAttackEachTurnEffect effect) {
|
||||
super(effect);
|
||||
this.staticText = "No more than one creature can attack each turn";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContinuousEffect copy() {
|
||||
return new NoMoreThanOneCreatureCanAttackEachTurnEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game) {
|
||||
if (!game.getCombat().getAttackers().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
AttackedThisTurnWatcher watcher = (AttackedThisTurnWatcher) game.getState().getWatchers().get("AttackedThisTurn");
|
||||
Set<UUID> attackedThisTurnCreatures = watcher.getAttackedThisTurnCreatures();
|
||||
return attackedThisTurnCreatures.isEmpty()
|
||||
|| (attackedThisTurnCreatures.size() == 1 && attackedThisTurnCreatures.contains(attacker.getId()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class NoMoreThanOneCreatureCanBlockEachTurnEffect extends RestrictionEffect {
|
||||
|
||||
public NoMoreThanOneCreatureCanBlockEachTurnEffect() {
|
||||
super(Duration.WhileOnBattlefield);
|
||||
this.staticText = "No more than one creature can block each turn";
|
||||
}
|
||||
|
||||
public NoMoreThanOneCreatureCanBlockEachTurnEffect(final NoMoreThanOneCreatureCanBlockEachTurnEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContinuousEffect copy() {
|
||||
return new NoMoreThanOneCreatureCanBlockEachTurnEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) {
|
||||
if (!game.getCombat().getBlockers().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
BlockedThisTurnWatcher watcher = (BlockedThisTurnWatcher) game.getState().getWatchers().get("BlockedThisTurn");
|
||||
Set<MageObjectReference> blockedThisTurnCreatures = watcher.getBlockedThisTurnCreatures();
|
||||
MageObjectReference blockerReference = new MageObjectReference(blocker.getId(), blocker.getZoneChangeCounter(game), game);
|
||||
return blockedThisTurnCreatures.isEmpty()
|
||||
|| (blockedThisTurnCreatures.size() == 1 && blockedThisTurnCreatures.contains(blockerReference));
|
||||
}
|
||||
|
||||
}
|
110
Mage.Sets/src/mage/sets/legends/EnergyTap.java
Normal file
110
Mage.Sets/src/mage/sets/legends/EnergyTap.java
Normal file
|
@ -0,0 +1,110 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.legends;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.permanent.TappedPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author spjspj
|
||||
*/
|
||||
public class EnergyTap extends CardImpl {
|
||||
|
||||
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped creature you crontrol");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.not(new TappedPredicate()));
|
||||
}
|
||||
|
||||
public EnergyTap(UUID ownerId) {
|
||||
super(ownerId, 54, "Energy Tap", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{U}");
|
||||
this.expansionSetCode = "LEG";
|
||||
|
||||
// Tap target untapped creature you control. If you do, add X mana of {C} to your mana pool, where X is that creature's converted mana cost.
|
||||
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent(filter));
|
||||
this.getSpellAbility().addEffect(new EnergyTapEffect());
|
||||
}
|
||||
|
||||
public EnergyTap(final EnergyTap card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnergyTap copy() {
|
||||
return new EnergyTap(this);
|
||||
}
|
||||
}
|
||||
|
||||
class EnergyTapEffect extends OneShotEffect {
|
||||
|
||||
EnergyTapEffect() {
|
||||
super(Outcome.PutManaInPool);
|
||||
this.staticText = "Tap target untapped creature you control. If you do, add X mana of {C} to your mana pool, where X is that creature's converted mana cost";
|
||||
}
|
||||
|
||||
EnergyTapEffect(final EnergyTapEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnergyTapEffect copy() {
|
||||
return new EnergyTapEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean applied = false;
|
||||
Permanent targetCreature = game.getPermanent(targetPointer.getFirst(game, source));
|
||||
if (targetCreature != null) {
|
||||
applied = targetCreature.tap(game);
|
||||
if (applied) {
|
||||
player.getManaPool().addMana(new Mana(0, 0, 0, 0, 0, 0, 0, targetCreature.getManaCost().convertedManaCost()), game, source);
|
||||
}
|
||||
}
|
||||
return applied;
|
||||
}
|
||||
}
|
|
@ -90,7 +90,7 @@ class GoblinGoonCantAttackEffect extends RestrictionEffect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canAttack(UUID defenderId, Ability source, Game game) {
|
||||
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game) {
|
||||
UUID defendingPlayerId;
|
||||
Player defender = game.getPlayer(defenderId);
|
||||
if (defender == null) {
|
||||
|
|
|
@ -63,12 +63,12 @@ public class MageRingNetwork extends CardImpl {
|
|||
new ManaCostsImpl("{1}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
this.addAbility(ability);
|
||||
// {T}, Remove X storage counters from Mage-Ring Network: Add {x} to your mana pool.
|
||||
// {T}, Remove any number of storage counters from Mage-Ring Network: Add {C} to your mana pool for each storage counter removed this way.
|
||||
ability = new DynamicManaAbility(
|
||||
Mana.ColorlessMana(1),
|
||||
new RemovedCountersForCostValue(),
|
||||
new TapSourceCost(),
|
||||
"Add {X} to your mana pool",
|
||||
"Add {C} to your mana pool for each storage counter removed this way",
|
||||
true, new CountersCount(CounterType.STORAGE));
|
||||
ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance(),
|
||||
"Remove X storage counters from {this}"));
|
||||
|
|
54
Mage.Sets/src/mage/sets/masterseditioniii/GaeasTouch.java
Normal file
54
Mage.Sets/src/mage/sets/masterseditioniii/GaeasTouch.java
Normal file
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.masterseditioniii;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.Rarity;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author spjspj
|
||||
*/
|
||||
public class GaeasTouch extends mage.sets.thedark.GaeasTouch {
|
||||
|
||||
public GaeasTouch(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 120;
|
||||
this.expansionSetCode = "ME3";
|
||||
this.rarity = Rarity.UNCOMMON;
|
||||
}
|
||||
|
||||
public GaeasTouch(final GaeasTouch card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GaeasTouch copy() {
|
||||
return new GaeasTouch(this);
|
||||
}
|
||||
}
|
|
@ -91,7 +91,7 @@ class ChainedThroatseekerCantAttackEffect extends RestrictionEffect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canAttack(UUID defenderId, Ability source, Game game) {
|
||||
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game) {
|
||||
Player targetPlayer = game.getPlayer(defenderId);
|
||||
if (targetPlayer != null) {
|
||||
if (targetPlayer.getCounters().containsKey(CounterType.POISON)) {
|
||||
|
|
|
@ -38,6 +38,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.AnotherPredicate;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
|
@ -46,6 +47,12 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
*/
|
||||
public class JoragaAuxiliary extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("other target creatures");
|
||||
|
||||
static {
|
||||
filter.add(new AnotherPredicate());
|
||||
}
|
||||
|
||||
public JoragaAuxiliary(UUID ownerId) {
|
||||
super(ownerId, 154, "Joraga Auxiliary", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}{W}");
|
||||
this.expansionSetCode = "OGW";
|
||||
|
@ -55,9 +62,9 @@ public class JoragaAuxiliary extends CardImpl {
|
|||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// {4}{G}{W}: Support 2.
|
||||
// {4}{G}{W}: Support 2. (Put a +1/+1 counter on each of up to two other target creatures.)
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SupportEffect(this, 2, true), new ManaCostsImpl("{4}{G}{W}"));
|
||||
ability.addTarget(new TargetCreaturePermanent(0, 2, new FilterCreaturePermanent("target creatures"), false));
|
||||
ability.addTarget(new TargetCreaturePermanent(0, 2, filter, false));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
118
Mage.Sets/src/mage/sets/onslaught/DawningPurist.java
Normal file
118
Mage.Sets/src/mage/sets/onslaught/DawningPurist.java
Normal file
|
@ -0,0 +1,118 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.onslaught;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.abilities.keyword.MorphAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterEnchantmentPermanent;
|
||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.DamagedPlayerEvent;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author djbrez
|
||||
*/
|
||||
public class DawningPurist extends CardImpl {
|
||||
|
||||
public DawningPurist(UUID ownerId) {
|
||||
super(ownerId, 22, "Dawning Purist", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}");
|
||||
this.expansionSetCode = "ONS";
|
||||
this.subtype.add("Human");
|
||||
this.subtype.add("Cleric");
|
||||
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Whenever Dawning Purist deals combat damage to a player, you may destroy target enchantment that player controls.
|
||||
this.addAbility(new DawningPuristTriggeredAbility());
|
||||
|
||||
// Morph {1}{W}
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl("{1}{W}")));
|
||||
}
|
||||
|
||||
public DawningPurist(final DawningPurist card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DawningPurist copy() {
|
||||
return new DawningPurist(this);
|
||||
}
|
||||
}
|
||||
|
||||
class DawningPuristTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
DawningPuristTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new DestroyTargetEffect(), true);
|
||||
}
|
||||
|
||||
DawningPuristTriggeredAbility(final DawningPuristTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public DawningPuristTriggeredAbility copy() {
|
||||
return new DawningPuristTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
|
||||
if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) {
|
||||
FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent("enchantment that player controls");
|
||||
filter.add(new ControllerIdPredicate(event.getPlayerId()));
|
||||
filter.setMessage("enchantment controlled by " + game.getPlayer(event.getTargetId()).getLogName());
|
||||
|
||||
this.getTargets().clear();
|
||||
this.addTarget(new TargetPermanent(filter));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public String getRule() {
|
||||
return "Whenever {this} deals combat damage to a player, you may destroy target enchantment that player controls.";
|
||||
}
|
||||
}
|
73
Mage.Sets/src/mage/sets/onslaught/WirewoodPride.java
Normal file
73
Mage.Sets/src/mage/sets/onslaught/WirewoodPride.java
Normal file
|
@ -0,0 +1,73 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.onslaught;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author djbrez
|
||||
*/
|
||||
public class WirewoodPride extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent elfCount = new FilterCreaturePermanent("Elves");
|
||||
static {
|
||||
elfCount.add(new SubtypePredicate("Elf"));
|
||||
}
|
||||
|
||||
public WirewoodPride(UUID ownerId) {
|
||||
super(ownerId, 303, "Wirewood Pride", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}");
|
||||
this.expansionSetCode = "ONS";
|
||||
|
||||
// Target creature gets +X/+X until end of turn, where X is the number of Elves on the battlefield.
|
||||
PermanentsOnBattlefieldCount amount = new PermanentsOnBattlefieldCount(elfCount);
|
||||
Effect effect = new BoostTargetEffect(amount, amount, Duration.EndOfTurn, true);
|
||||
effect.setText("Target creature gets +X/+X until end of turn, where X is the number of Elves on the battlefield");
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
}
|
||||
|
||||
public WirewoodPride(final WirewoodPride card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WirewoodPride copy() {
|
||||
return new WirewoodPride(this);
|
||||
}
|
||||
}
|
|
@ -57,7 +57,7 @@ import mage.game.permanent.Permanent;
|
|||
*/
|
||||
public class LeoninArbiter extends CardImpl {
|
||||
|
||||
private static final String keyString = "_ignoreEffectForTurn";
|
||||
private static final String KEY_STRING = "_ignoreEffectForTurn";
|
||||
|
||||
public LeoninArbiter(UUID ownerId) {
|
||||
super(ownerId, 14, "Leonin Arbiter", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}");
|
||||
|
@ -69,10 +69,10 @@ public class LeoninArbiter extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// Players can't search libraries.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new LeoninArbiterCantSearchEffect(keyString)));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new LeoninArbiterCantSearchEffect(KEY_STRING)));
|
||||
|
||||
// Any player may pay {2} for that player to ignore this effect until end of turn.
|
||||
this.addAbility(new LeoninArbiterSpecialAction(keyString));
|
||||
this.addAbility(new LeoninArbiterSpecialAction(KEY_STRING));
|
||||
}
|
||||
|
||||
public LeoninArbiter(final LeoninArbiter card) {
|
||||
|
@ -132,7 +132,7 @@ class LeoninArbiterIgnoreEffect extends OneShotEffect {
|
|||
// Using a Map.Entry since there is no pair class
|
||||
long zoneChangeCount = permanent.getZoneChangeCounter(game);
|
||||
long turnNum = game.getTurnNum();
|
||||
Long activationState = zoneChangeCount << 32 | turnNum & 0xFFFFFFFFL;
|
||||
Long activationState = zoneChangeCount << 32 | turnNum & 0xFFFFFFFFL;
|
||||
|
||||
Map.Entry<Long, Set<UUID>> turnIgnoringPlayersPair = (Map.Entry<Long, Set<UUID>>) game.getState().getValue(key);
|
||||
if (turnIgnoringPlayersPair == null || !activationState.equals(turnIgnoringPlayersPair.getKey())) {
|
||||
|
@ -169,13 +169,13 @@ class LeoninArbiterCantSearchEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
boolean applies = true;
|
||||
boolean applies = true;
|
||||
String key = permanent.getId() + keyString;
|
||||
Map.Entry<Long, Set<UUID>> turnIgnoringPlayersPair = (Map.Entry<Long, Set<UUID>>) game.getState().getValue(key);
|
||||
if (turnIgnoringPlayersPair != null) {
|
||||
long zoneChangeCount = permanent.getZoneChangeCounter(game);
|
||||
long turnNum = game.getTurnNum();
|
||||
Long activationState = zoneChangeCount << 32 | turnNum & 0xFFFFFFFFL;
|
||||
Long activationState = zoneChangeCount << 32 | turnNum & 0xFFFFFFFFL;
|
||||
if (activationState.equals(turnIgnoringPlayersPair.getKey())) {
|
||||
applies = !turnIgnoringPlayersPair.getValue().contains(event.getPlayerId());
|
||||
}
|
||||
|
|
|
@ -71,20 +71,20 @@ public class PemminsAura extends CardImpl {
|
|||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
|
||||
|
||||
// {U}: Untap enchanted creature.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapEnchantedEffect(), new ManaCostsImpl("{U}")));
|
||||
|
||||
|
||||
// {U}: Enchanted creature gains flying until end of turn.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(),
|
||||
AttachmentType.AURA, Duration.EndOfTurn), new ManaCostsImpl("{U}")));
|
||||
|
||||
AttachmentType.AURA, Duration.EndOfTurn), new ManaCostsImpl("{U}")));
|
||||
|
||||
// {U}: Enchanted creature gains shroud until end of turn.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ShroudAbility.getInstance(),
|
||||
AttachmentType.AURA, Duration.EndOfTurn), new ManaCostsImpl("{U}")));
|
||||
|
||||
AttachmentType.AURA, Duration.EndOfTurn), new ManaCostsImpl("{U}")));
|
||||
|
||||
// {1}: Enchanted creature gets +1/-1 or -1/+1 until end of turn.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new PemminsAuraBoostEnchantedEffect(), new ManaCostsImpl("U")));
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new PemminsAuraBoostEnchantedEffect(), new ManaCostsImpl("{1}")));
|
||||
}
|
||||
|
||||
public PemminsAura(final PemminsAura card) {
|
||||
|
@ -121,7 +121,7 @@ class PemminsAuraBoostEnchantedEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent enchantment = game.getPermanent(source.getSourceId());
|
||||
Permanent creature = game.getPermanent(enchantment.getAttachedTo());
|
||||
if (controller != null && creature != null) {
|
||||
if (controller != null && creature != null) {
|
||||
Choice choice = new ChoiceImpl(true);
|
||||
choice.setMessage("Select how to boost");
|
||||
choice.getChoices().add(CHOICE_1);
|
||||
|
@ -141,4 +141,4 @@ class PemminsAuraBoostEnchantedEffect extends OneShotEffect {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
125
Mage.Sets/src/mage/sets/thedark/GaeasTouch.java
Normal file
125
Mage.Sets/src/mage/sets/thedark/GaeasTouch.java
Normal file
|
@ -0,0 +1,125 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.thedark;
|
||||
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.Rarity;
|
||||
import mage.Mana;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.LimitedTimesPerTurnActivatedAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TimingRule;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author spjspj
|
||||
*/
|
||||
public class GaeasTouch extends CardImpl {
|
||||
|
||||
public GaeasTouch(UUID ownerId) {
|
||||
super(ownerId, 40, "Gaea's Touch", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{G}{G}");
|
||||
this.expansionSetCode = "DRK";
|
||||
|
||||
// You may put a basic Forest card from your hand onto the battlefield. Activate this ability only any time you could cast a sorcery and only once each turn.
|
||||
LimitedTimesPerTurnActivatedAbility ability = new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new PutBasicForestOnBattlefieldEffect(), new GenericManaCost(0), 1);
|
||||
ability.setTiming(TimingRule.SORCERY);
|
||||
addAbility(ability);
|
||||
|
||||
// Sacrifice Gaea's Touch: Add {G}{G} to your mana pool.
|
||||
addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.GreenMana(2), new SacrificeSourceCost()));
|
||||
}
|
||||
|
||||
public GaeasTouch(final GaeasTouch card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GaeasTouch copy() {
|
||||
return new GaeasTouch(this);
|
||||
}
|
||||
}
|
||||
|
||||
class PutBasicForestOnBattlefieldEffect extends OneShotEffect {
|
||||
|
||||
private static final FilterCard filter = new FilterCard("basic Forest card");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.and(new CardTypePredicate(CardType.LAND), new SupertypePredicate("Basic")));
|
||||
filter.add(new SubtypePredicate("Forest"));
|
||||
}
|
||||
|
||||
private static final String choiceText = "Put a basic Forest card from your hand onto the battlefield?";
|
||||
|
||||
public PutBasicForestOnBattlefieldEffect() {
|
||||
super(Outcome.PutLandInPlay);
|
||||
this.staticText = "put a basic Forest card from your hand onto the battlefield";
|
||||
}
|
||||
|
||||
public PutBasicForestOnBattlefieldEffect(final PutBasicForestOnBattlefieldEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PutBasicForestOnBattlefieldEffect copy() {
|
||||
return new PutBasicForestOnBattlefieldEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null || !player.chooseUse(Outcome.PutLandInPlay, choiceText, source, game)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
TargetCardInHand target = new TargetCardInHand(filter);
|
||||
if (player.choose(Outcome.PutLandInPlay, target, source.getSourceId(), game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -92,7 +92,7 @@ class TeferisMoatRestrictionEffect extends RestrictionEffect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canAttack(UUID defenderId, Ability source, Game game) {
|
||||
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game) {
|
||||
return !defenderId.equals(source.getControllerId());
|
||||
}
|
||||
|
||||
|
@ -100,4 +100,4 @@ class TeferisMoatRestrictionEffect extends RestrictionEffect {
|
|||
public TeferisMoatRestrictionEffect copy() {
|
||||
return new TeferisMoatRestrictionEffect(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
116
Mage.Sets/src/mage/sets/urzasdestiny/BubblingMuck.java
Normal file
116
Mage.Sets/src/mage/sets/urzasdestiny/BubblingMuck.java
Normal file
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.urzasdestiny;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.AddManaToManaPoolTargetControllerEffect;
|
||||
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
|
||||
import mage.abilities.mana.DelayedTriggeredManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ColoredManaSymbol;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author spjspj
|
||||
*/
|
||||
public class BubblingMuck extends CardImpl {
|
||||
|
||||
public BubblingMuck(UUID ownerId) {
|
||||
super(ownerId, 54, "Bubbling Muck", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{B}");
|
||||
this.expansionSetCode = "UDS";
|
||||
|
||||
// Until end of turn, whenever a player taps a Swamp for mana, that player adds {B} to his or her mana pool.
|
||||
this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new BubblingMuckTriggeredAbility()));
|
||||
}
|
||||
|
||||
public BubblingMuck(final BubblingMuck card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BubblingMuck copy() {
|
||||
return new BubblingMuck(this);
|
||||
}
|
||||
}
|
||||
|
||||
class BubblingMuckTriggeredAbility extends DelayedTriggeredManaAbility {
|
||||
|
||||
private static final FilterLandPermanent filter = new FilterLandPermanent("Swamp");
|
||||
|
||||
static {
|
||||
filter.add(new SubtypePredicate("Swamp"));
|
||||
}
|
||||
|
||||
public BubblingMuckTriggeredAbility() {
|
||||
super(new AddManaToManaPoolTargetControllerEffect(new Mana(ColoredManaSymbol.B), "his or her"), Duration.EndOfTurn, false);
|
||||
this.usesStack = false;
|
||||
}
|
||||
|
||||
public BubblingMuckTriggeredAbility(BubblingMuckTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == EventType.TAPPED_FOR_MANA;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent land = game.getPermanent(event.getTargetId());
|
||||
if (land != null && filter.match(land, game)) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(land.getControllerId()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BubblingMuckTriggeredAbility copy() {
|
||||
return new BubblingMuckTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Until end of turn, whenever a player taps a Swamp for mana, that player adds {B} to his or her mana pool";
|
||||
}
|
||||
}
|
|
@ -70,8 +70,10 @@ public class GildedDrake extends CardImpl {
|
|||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
// When Gilded Drake enters the battlefield, exchange control of Gilded Drake and up to one target creature an opponent controls. If you don't make an exchange, sacrifice Gilded Drake. This ability can't be countered except by spells and abilities.
|
||||
// When Gilded Drake enters the battlefield, exchange control of Gilded Drake and up to one target creature an opponent controls. If you don't make an exchange, sacrifice Gilded Drake.
|
||||
// This ability can't be countered except by spells and abilities.
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new GildedDrakeEffect());
|
||||
ability.setCanFizzle(false);
|
||||
ability.addTarget(new TargetCreaturePermanent(0, 1, filter, false));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
@ -117,13 +117,13 @@ class MarchesaTheBlackRoseTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD
|
||||
&& ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) {
|
||||
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
|
||||
Permanent permanent = ((ZoneChangeEvent) event).getTarget();
|
||||
if (permanent != null
|
||||
&& permanent.getControllerId().equals(this.getControllerId())
|
||||
&& permanent.getCardType().contains(CardType.CREATURE)
|
||||
&& permanent.getCounters().getCount(CounterType.P1P1) > 0) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId(), permanent.getZoneChangeCounter(game) + 1));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-root</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.mage</groupId>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-root</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mage-tests</artifactId>
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package org.mage.test.cards.asthough;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class SpendOtherManaTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* Mycosynth Lattice doesn't work for floating mana with activated abillites
|
||||
* I was trying to activate Sydri, Galvanic Genius with a floating {C}
|
||||
* targeting a mountain when I clicked on the <> icon it wouldn't spend the
|
||||
* mana.
|
||||
*/
|
||||
@Test
|
||||
public void testColorlessCanBeUsed() {
|
||||
// All permanents are artifacts in addition to their other types.
|
||||
// All cards that aren't on the battlefield, spells, and permanents are colorless.
|
||||
// Players may spend mana as though it were mana of any color.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mycosynth Lattice");
|
||||
|
||||
// {U}: Target noncreature artifact becomes an artifact creature with power and toughness each equal to its converted mana cost until end of turn.
|
||||
// {W}{B}: Target artifact creature gains deathtouch and lifelink until end of turn.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Sydri, Galvanic Genius");
|
||||
//{T}: Add {C} to your mana pool. ( represents colorless mana.)
|
||||
// {1}, {T}: Add one mana of any color to your mana pool.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Unknown Shores");
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain");
|
||||
|
||||
activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {C} to your mana pool");
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{U}: Target noncreature artifact becomes an artifact creature with power and toughness", "Mountain");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertTapped("Unknown Shores", true);
|
||||
|
||||
assertPermanentCount(playerB, "Mountain", 0);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package org.mage.test.cards.continuous;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class BoostAllTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* Verdeloth the Ancient pump effect affect it self. Printed "Other"
|
||||
*/
|
||||
@Test
|
||||
public void testBoostWithOther() {
|
||||
// Kicker {X}
|
||||
// Saproling creatures and other Treefolk creatures get +1/+1.
|
||||
// When Verdeloth the Ancient enters the battlefield, if it was kicked, put X 1/1 green Saproling creature tokens onto the battlefield.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Verdeloth the Ancient", 1); // 4/7
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Heartwood Treefolk", 1); // 3/4
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Heartwood Treefolk", 1); // 3/4
|
||||
|
||||
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertPowerToughness(playerA, "Verdeloth the Ancient", 4, 7);
|
||||
assertPowerToughness(playerA, "Heartwood Treefolk", 4, 5);
|
||||
assertPowerToughness(playerA, "Heartwood Treefolk", 4, 5);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -35,7 +35,8 @@ public class ExchangeControlTest extends CardTestPlayerBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests switching control for two creature on one side (both creatures are under the same player's control)
|
||||
* Tests switching control for two creature on one side (both creatures are
|
||||
* under the same player's control)
|
||||
*
|
||||
* Also tests "7/1/2012: You don't have to control either target."
|
||||
*/
|
||||
|
@ -61,8 +62,8 @@ public class ExchangeControlTest extends CardTestPlayerBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests:
|
||||
* 7/1/2012: If one of the target creatures is an illegal target when Switcheroo resolves, the exchange won't happen.
|
||||
* Tests: 7/1/2012: If one of the target creatures is an illegal target when
|
||||
* Switcheroo resolves, the exchange won't happen.
|
||||
*
|
||||
* Targets opponent's creature
|
||||
*/
|
||||
|
@ -90,10 +91,10 @@ public class ExchangeControlTest extends CardTestPlayerBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests:
|
||||
* 7/1/2012: If one of the target creatures is an illegal target when Switcheroo resolves, the exchange won't happen.
|
||||
* Tests: 7/1/2012: If one of the target creatures is an illegal target when
|
||||
* Switcheroo resolves, the exchange won't happen.
|
||||
*
|
||||
* Targets its own creature.
|
||||
* Targets its own creature.
|
||||
*/
|
||||
@Test
|
||||
public void testOneTargetBecomesIllegal2() {
|
||||
|
@ -119,8 +120,8 @@ public class ExchangeControlTest extends CardTestPlayerBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* First gain control by Act of Treason.
|
||||
* Then exchange control with other opponent's creature.
|
||||
* First gain control by Act of Treason. Then exchange control with other
|
||||
* opponent's creature.
|
||||
*
|
||||
* Finally second creature should stay under ours control permanently.
|
||||
*/
|
||||
|
@ -183,9 +184,10 @@ public class ExchangeControlTest extends CardTestPlayerBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* An control exchanged creature gets an copy effect from
|
||||
* an creature with an activated ability to the by exchange controlled creature.
|
||||
* Check that the activated ability is controlled by the new controller of the copy target.
|
||||
* An control exchanged creature gets an copy effect from an creature with
|
||||
* an activated ability to the by exchange controlled creature. Check that
|
||||
* the activated ability is controlled by the new controller of the copy
|
||||
* target.
|
||||
*/
|
||||
@Test
|
||||
public void testExchangeAnCopyEffect() {
|
||||
|
@ -208,7 +210,7 @@ public class ExchangeControlTest extends CardTestPlayerBase {
|
|||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Gilded Drake");
|
||||
addTarget(playerA, "Silvercoat Lion");
|
||||
// Let your Silvercoat Lion now be a copy of the Manta Riders
|
||||
castSpell(1, PhaseStep.BEGIN_COMBAT, playerA, "Polymorphous Rush","Silvercoat Lion");
|
||||
castSpell(1, PhaseStep.BEGIN_COMBAT, playerA, "Polymorphous Rush", "Silvercoat Lion");
|
||||
addTarget(playerA, "Manta Riders");
|
||||
|
||||
// now use the activated ability to make the "Silvercoat Lions" (that became Mana Riders) flying
|
||||
|
@ -229,10 +231,43 @@ public class ExchangeControlTest extends CardTestPlayerBase {
|
|||
|
||||
assertPermanentCount(playerB, "Manta Riders", 1);
|
||||
assertPermanentCount(playerA, "Manta Riders", 1);
|
||||
|
||||
|
||||
Permanent controlledMantas = getPermanent("Manta Riders", playerA.getId());
|
||||
Assert.assertTrue("Manta Riders should have flying ability", controlledMantas.getAbilities().contains(FlyingAbility.getInstance()));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gilded Drake doesn't get sacrificed if the creature its ability targets
|
||||
* is invalid when it enters the battlefield
|
||||
*/
|
||||
@Test
|
||||
public void testDrakeSacrificedIfNoExchangeHappens() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 6);
|
||||
// Gilded Drake {1}{U} Creature - Drake
|
||||
// Flying
|
||||
// When Gilded Drake enters the battlefield, exchange control of Gilded Drake and up to one target
|
||||
// creature an opponent controls. If you don't make an exchange, sacrifice Gilded Drake. This ability
|
||||
// can't be countered except by spells and abilities. (This effect lasts indefinitely.)
|
||||
addCard(Zone.HAND, playerA, "Gilded Drake");
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain");
|
||||
addCard(Zone.HAND, playerB, "Lightning Bolt");
|
||||
|
||||
// exchange control between Gilded Drake and Silvercoat Lion
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Gilded Drake");
|
||||
addTarget(playerA, "Silvercoat Lion");
|
||||
|
||||
// Destroy Silvercoat Lion before the exchange resolves so the Drake has to be sacrificed
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Silvercoat Lion", "When");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerB, "Lightning Bolt", 1);
|
||||
assertGraveyardCount(playerB, "Silvercoat Lion", 1);
|
||||
assertGraveyardCount(playerA, "Gilded Drake", 1);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,4 +72,25 @@ public class EldraziMimicTest extends CardTestPlayerBase {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Eldrazi Mimic ability to change it's health and power on another
|
||||
* creatures entering the battlefield doesn't work after update.
|
||||
*/
|
||||
@Test
|
||||
public void testNormalCopy() {
|
||||
addCard(Zone.HAND, playerA, "Composite Golem", 1); // 4/4
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 6);
|
||||
// Whenever another colorless creature enters the battlefield under your control, you may have the base power and toughness of Eldrazi Mimic
|
||||
// become that creature's power and toughness until end of turn.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Eldrazi Mimic", 1); // 2/1
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Composite Golem");
|
||||
setChoice(playerA, "Yes");
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertPowerToughness(playerA, "Composite Golem", 4, 4);
|
||||
assertPowerToughness(playerA, "Eldrazi Mimic", 4, 4);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package org.mage.test.cards.copy;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.Filter;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class EssenceOfTheWildtest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* Essence of the Wild does not seem to correctly apply its copy effect to
|
||||
* your creatures. Upon entering the battlefield the other creatures had a
|
||||
* small symbol at the top right of their card to view the original card -
|
||||
* however, both 'sides' showed only the same, original card.
|
||||
* Power/Toughness and other abilities were also still those of the original
|
||||
* cards.
|
||||
*
|
||||
* Note: This was observed in a deck controlled by the computer when testing
|
||||
* other decks.
|
||||
*
|
||||
*/
|
||||
@Test
|
||||
public void testCreatureCast() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
|
||||
// Creatures you control enter the battlefield as a copy of Essence of the Wild.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Essence of the Wild"); // 6/6
|
||||
addCard(Zone.HAND, playerA, "Silvercoat Lion");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Essence of the Wild", 2);
|
||||
assertPowerToughness(playerA, "Essence of the Wild", 6, 6, Filter.ComparisonScope.All);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -69,4 +69,34 @@ public class JaceTest extends CardTestPlayerBase {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* I know it's been a bit a rules question recently but I believe flip
|
||||
* planeswalkers shouldn't be exiled by Containment priest when flipping as
|
||||
* happens when using xmage (at least with Jace).
|
||||
*/
|
||||
@Test
|
||||
public void testContainmentPriestWithFlipPlaneswalker() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 4);
|
||||
addCard(Zone.GRAVEYARD, playerA, "Mountain", 4);
|
||||
|
||||
// {T}: Draw a card, then discard a card. If there are five or more cards in your graveyard,
|
||||
// exile Jace, Vryn's Prodigy, then return him to the battefield transformed under his owner's control.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Jace, Vryn's Prodigy", 1); // {2}{R} - 3/2
|
||||
addCard(Zone.HAND, playerA, "Pillarfield Ox", 1);
|
||||
|
||||
// Flash
|
||||
// If a nontoken creature would enter the battlefield and it wasn't cast, exile it instead.
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Containment Priest", 1); // {2}{U}{U}
|
||||
|
||||
activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Draw a card");
|
||||
setChoice(playerA, "Pillarfield Ox");
|
||||
|
||||
setStopAt(3, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerA, "Pillarfield Ox", 1);
|
||||
assertExileCount("Jace, Vryn's Prodigy", 0);
|
||||
assertPermanentCount(playerA, "Jace, Telepath Unbound", 1);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,4 +90,47 @@ public class DrawTriggeredTest extends CardTestPlayerBase {
|
|||
assertHandCount(playerA, 4); // 2 * 2 from Sphinx = 4
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* two consecrated sphinxes do not work properly, only gives one player
|
||||
* additional draw
|
||||
*
|
||||
*/
|
||||
@Test
|
||||
public void TwoConsecratedSphinxDifferentPlayers() {
|
||||
// Flying
|
||||
// Whenever an opponent draws a card, you may draw two cards.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Consecrated Sphinx", 1);
|
||||
|
||||
// Flying
|
||||
// Whenever an opponent draws a card, you may draw two cards.
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Consecrated Sphinx", 1);
|
||||
|
||||
setChoice(playerA, "Yes");
|
||||
setChoice(playerA, "No");
|
||||
setChoice(playerA, "No");
|
||||
|
||||
setChoice(playerB, "Yes");
|
||||
setChoice(playerB, "No");
|
||||
setStopAt(2, PhaseStep.PRECOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertHandCount(playerB, 3); // 1 from start of turn 1 and 4 from Opponents draw of 2 cards
|
||||
assertHandCount(playerA, 2); // 2 from Sphinx triggered by the normal draw
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void TwoConsecratedSphinxSamePlayer() {
|
||||
// Flying
|
||||
// Whenever an opponent draws a card, you may draw two cards.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Consecrated Sphinx", 2);
|
||||
|
||||
setStopAt(2, PhaseStep.PRECOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertHandCount(playerB, 1); // 1 from start of turn 1 and 4 from Opponents draw of 2 cards
|
||||
assertHandCount(playerA, 4); // 2 from Sphinx triggered by the normal draw
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package org.mage.test.cards.triggers;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class HeartbeatOfSpringTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* Heartbeat of Spring does not function on urza's
|
||||
*/
|
||||
@Test
|
||||
public void testWorksForUrzasLand() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
|
||||
// {T}: Add {C} to your mana pool. If you control an Urza's Power-Plant and an Urza's Tower, add {C}{C} to your mana pool instead.
|
||||
addCard(Zone.HAND, playerA, "Urza's Mine", 1);
|
||||
// Whenever a player taps a land for mana, that player adds one mana to his or her mana pool of any type that land produced.
|
||||
addCard(Zone.HAND, playerA, "Heartbeat of Spring"); // {2}{G}
|
||||
// Whenever a player casts a white spell, you may gain 1 life.
|
||||
addCard(Zone.HAND, playerA, "Angel's Feather"); // {2}
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Heartbeat of Spring");
|
||||
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Urza's Mine");
|
||||
|
||||
activateManaAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{T}:");
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Angel's Feather");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Heartbeat of Spring", 1);
|
||||
assertPermanentCount(playerA, "Angel's Feather", 1);
|
||||
}
|
||||
}
|
|
@ -59,7 +59,7 @@ public class ReturnToBattlefieldEffectsTest extends CardTestPlayerBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* That that the creature with a +1/+1 counter returns
|
||||
* Test that the creature with a +1/+1 counter returns
|
||||
*/
|
||||
@Test
|
||||
public void testMarchesatheBlackRose() {
|
||||
|
|
|
@ -393,6 +393,7 @@ public class TestPlayer implements Player {
|
|||
command = command.substring(command.indexOf("manaActivate:") + 13);
|
||||
String[] groups = command.split("\\$");
|
||||
List<MageObject> manaObjects = computerPlayer.getAvailableManaProducers(game);
|
||||
|
||||
for (MageObject mageObject : manaObjects) {
|
||||
if (mageObject instanceof Permanent) {
|
||||
for (Ability manaAbility : ((Permanent) mageObject).getAbilities(game).getAvailableManaAbilities(Zone.BATTLEFIELD, game)) {
|
||||
|
|
|
@ -321,7 +321,7 @@ public class ManaOptionsTest extends CardTestPlayerBase {
|
|||
public void testMageRingNetwork2() {
|
||||
// {T}: Add {C} to your mana pool.
|
||||
// {T}, {1} : Put a storage counter on Mage-Ring Network.
|
||||
// {T}, Remove X storage counters from Mage-Ring Network: Add {X} to your mana pool.
|
||||
// {T}, Remove any number of storage counters from Mage-Ring Network: Add {C} to your mana pool for each storage counter removed this way.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mage-Ring Network", 1);
|
||||
addCounters(1, PhaseStep.UPKEEP, playerA, "Mage-Ring Network", CounterType.STORAGE, 4);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
|
||||
|
@ -332,9 +332,8 @@ public class ManaOptionsTest extends CardTestPlayerBase {
|
|||
|
||||
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
|
||||
|
||||
Assert.assertEquals("mana variations don't fit", 2, manaOptions.size());
|
||||
Assert.assertEquals("{C}{W}{B}", getManaOption(0, manaOptions));
|
||||
Assert.assertEquals("{4}{W}{B}", getManaOption(1, manaOptions));
|
||||
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
|
||||
Assert.assertEquals("{C}{C}{C}{C}{W}{B}", getManaOption(0, manaOptions));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>mage-root</artifactId>
|
||||
<groupId>org.mage</groupId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>org.mage</groupId>
|
||||
<artifactId>mage-root</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.9</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mage</artifactId>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue