Merge branch 'master' of https://github.com/magefree/mage
|
@ -230,9 +230,10 @@ public class ChatPanel 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) + "<br/>"));
|
||||
|
||||
text.append(getColoredText(textColor, ManaSymbols.replaceSymbolsWithHTML(message, ManaSymbols.Type.PAY)));
|
||||
this.txtConversation.append(text.toString());
|
||||
this.txtConversation.requestFocusInWindow();
|
||||
this.txtMessage.requestFocusInWindow();
|
||||
}
|
||||
|
||||
private String getColoredText(String color, String text) {
|
||||
|
@ -279,10 +280,11 @@ public class ChatPanel extends javax.swing.JPanel {
|
|||
public void useExtendedView(VIEW_MODE extendedViewMode) {
|
||||
this.extendedViewMode = extendedViewMode;
|
||||
this.txtConversation.setExtBackgroundColor(new Color(0, 0, 0, 100));
|
||||
this.txtConversation.setBackground(new Color(0, 0, 0, 0));
|
||||
this.txtConversation.setForeground(new Color(255, 255, 255));
|
||||
this.jScrollPaneTxt.setOpaque(false);
|
||||
this.jScrollPaneTxt.getViewport().setOpaque(false);
|
||||
// this.txtConversation.setBackground(new Color(0, 0, 0, 0));
|
||||
// this.txtConversation.setForeground(new Color(255, 255, 255));
|
||||
this.txtConversation.setSelectionColor(Color.LIGHT_GRAY);
|
||||
this.jScrollPaneTxt.setOpaque(!chatType.equals(ChatType.TABLES));
|
||||
this.jScrollPaneTxt.getViewport().setOpaque(!chatType.equals(ChatType.TABLES));
|
||||
}
|
||||
|
||||
public void setSplitDividerLocation(int location) {
|
||||
|
@ -308,8 +310,11 @@ public class ChatPanel extends javax.swing.JPanel {
|
|||
this.players = roomUserInfo.getUsersView().toArray(new UsersView[0]);
|
||||
JTableHeader th = jTablePlayers.getTableHeader();
|
||||
TableColumnModel tcm = th.getColumnModel();
|
||||
tcm.getColumn(0).setHeaderValue(new StringBuilder("Players").append(" (").append(this.players.length).append(")").toString());
|
||||
tcm.getColumn(2).setHeaderValue(new StringBuilder("Games").append(" (").append(roomUserInfo.getNumberActiveGames()).append(")").toString());
|
||||
tcm.getColumn(0).setHeaderValue("Players (" + this.players.length + ")");
|
||||
tcm.getColumn(2).setHeaderValue(
|
||||
"Games " + roomUserInfo.getNumberActiveGames() +
|
||||
(roomUserInfo.getNumberActiveGames() != roomUserInfo.getNumberGameThreads() ? " (T:" + roomUserInfo.getNumberGameThreads():" (") +
|
||||
" limit: " + roomUserInfo.getNumberMaxGames() + ")");
|
||||
th.repaint();
|
||||
this.fireTableDataChanged();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,16 @@
|
|||
package mage.client.components;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import static javafx.scene.paint.Color.color;
|
||||
import javax.swing.JEditorPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JTextPane;
|
||||
import javax.swing.text.AttributeSet;
|
||||
import javax.swing.text.SimpleAttributeSet;
|
||||
import javax.swing.text.StyleConstants;
|
||||
import javax.swing.text.StyleContext;
|
||||
import javax.swing.text.html.HTMLDocument;
|
||||
import javax.swing.text.html.HTMLEditorKit;
|
||||
|
||||
|
@ -10,14 +19,14 @@ import javax.swing.text.html.HTMLEditorKit;
|
|||
*
|
||||
* @author nantuko
|
||||
*/
|
||||
public class ColorPane extends JTextPane {
|
||||
public class ColorPane extends JEditorPane {
|
||||
|
||||
HTMLEditorKit kit = new HTMLEditorKit();
|
||||
HTMLDocument doc = new HTMLDocument();
|
||||
HTMLDocument doc = new HTMLDocument();
|
||||
|
||||
public ColorPane() {
|
||||
this.setEditorKit(kit);
|
||||
this.setDocument(doc);
|
||||
this.setDocument(doc);
|
||||
}
|
||||
/**
|
||||
* This method solves the known issue with Nimbus LAF background transparency and background color.
|
||||
|
@ -36,26 +45,14 @@ public class ColorPane extends JTextPane {
|
|||
super.setText(string); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
public void append(String s) {
|
||||
public void append(String text) {
|
||||
try {
|
||||
setEditable(true);
|
||||
kit.insertHTML(doc, doc.getLength(), s, 0, 0, null);
|
||||
kit.insertHTML(doc, doc.getLength(), text, 0, 0, null);
|
||||
setEditable(false);
|
||||
int len = getDocument().getLength();
|
||||
setCaretPosition(len);
|
||||
setEditable(false);
|
||||
|
||||
//
|
||||
//
|
||||
// StyleContext sc = StyleContext.getDefaultStyleContext();
|
||||
// AttributeSet aset = sc.addAttribute(SimpleAttributeSet.EMPTY, StyleConstants.Foreground, color);
|
||||
//
|
||||
// int len = getDocument().getLength();
|
||||
//
|
||||
// setCaretPosition(len);
|
||||
// setCharacterAttributes(aset, false);
|
||||
// replaceSelection(s);
|
||||
//
|
||||
//
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ public class JoinTableDialog extends MageDialog {
|
|||
this.tableId = tableId;
|
||||
this.isTournament = isTournament;
|
||||
this.newPlayerPanel.setPlayerName(MageFrame.getSession().getUserName());
|
||||
this.newPlayerPanel.showDeckElements(isLimited);
|
||||
this.newPlayerPanel.showDeckElements(!isLimited);
|
||||
this.setModal(true);
|
||||
this.setLocation(100, 100);
|
||||
this.setVisible(true);
|
||||
|
|
|
@ -212,21 +212,26 @@
|
|||
<Component class="javax.swing.JLabel" name="lbTimeLimit">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Time Limit:"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="The time a player has for the whole match. If a player runs out of time during a game, he loses the complete match. "/>
|
||||
</Properties>
|
||||
<BindingProperties>
|
||||
<BindingProperty name="labelFor" source="cbTimeLimit" target="lbTimeLimit" targetPath="labelFor" updateStrategy="0" immediately="false"/>
|
||||
</BindingProperties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="cbTimeLimit">
|
||||
<Properties>
|
||||
<Property name="toolTipText" type="java.lang.String" value="The time a player has for the whole match. If a player runs out of time during a game, he loses the complete match. "/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblPassword">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Password:"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="Players have to enter the password to be able to join this table."/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="txtPassword">
|
||||
<Properties>
|
||||
<Property name="toolTipText" type="java.lang.String" value="Players have to enter this password to be able to enter the created table."/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="Players have to enter the password to be able to join this table."/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblTournamentType">
|
||||
|
@ -284,6 +289,9 @@
|
|||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnNumWins">
|
||||
<Properties>
|
||||
<Property name="toolTipText" type="java.lang.String" value="To win a match a player has to win this number of games."/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnNumWinsnumPlayersChanged"/>
|
||||
</Events>
|
||||
|
@ -311,9 +319,13 @@
|
|||
<Component class="javax.swing.JLabel" name="lblNumRounds">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Number of Swiss Rounds:"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="<html>The number of rounds the swiss tournament has in total.<br>
The tournaments ends after that number of rounds or<br> 
if there are less than two players left in the tournament."/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnNumRounds">
|
||||
<Properties>
|
||||
<Property name="toolTipText" type="java.lang.String" value="<html>The number of rounds the swiss tournament has in total.<br>
The tournaments ends after that number of rounds or<br> 
if there are less than two players left in the tournament."/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnNumRoundsnumPlayersChanged"/>
|
||||
</Events>
|
||||
|
@ -403,6 +415,7 @@
|
|||
<Component class="javax.swing.JCheckBox" name="cbAllowSpectators">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Allow spectators"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="Allow other players to watch the games of this table."/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblPlayer1">
|
||||
|
|
|
@ -170,13 +170,17 @@ public class NewTournamentDialog extends MageDialog {
|
|||
lblName.setText("Name:");
|
||||
|
||||
lbTimeLimit.setText("Time Limit:");
|
||||
lbTimeLimit.setToolTipText("The time a player has for the whole match. If a player runs out of time during a game, he loses the complete match. ");
|
||||
|
||||
org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, cbTimeLimit, org.jdesktop.beansbinding.ObjectProperty.create(), lbTimeLimit, org.jdesktop.beansbinding.BeanProperty.create("labelFor"));
|
||||
bindingGroup.addBinding(binding);
|
||||
|
||||
lblPassword.setText("Password:");
|
||||
cbTimeLimit.setToolTipText("The time a player has for the whole match. If a player runs out of time during a game, he loses the complete match. ");
|
||||
|
||||
txtPassword.setToolTipText("Players have to enter this password to be able to enter the created table.");
|
||||
lblPassword.setText("Password:");
|
||||
lblPassword.setToolTipText("Players have to enter the password to be able to join this table.");
|
||||
|
||||
txtPassword.setToolTipText("Players have to enter the password to be able to join this table.");
|
||||
|
||||
lblTournamentType.setText("Tournament Type:");
|
||||
|
||||
|
@ -205,6 +209,7 @@ public class NewTournamentDialog extends MageDialog {
|
|||
|
||||
lblNumWins.setText("Wins:");
|
||||
|
||||
spnNumWins.setToolTipText("To win a match a player has to win this number of games.");
|
||||
spnNumWins.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnNumWinsnumPlayersChanged(evt);
|
||||
|
@ -221,7 +226,9 @@ public class NewTournamentDialog extends MageDialog {
|
|||
});
|
||||
|
||||
lblNumRounds.setText("Number of Swiss Rounds:");
|
||||
lblNumRounds.setToolTipText("<html>The number of rounds the swiss tournament has in total.<br>\nThe tournaments ends after that number of rounds or<br> \nif there are less than two players left in the tournament.");
|
||||
|
||||
spnNumRounds.setToolTipText("<html>The number of rounds the swiss tournament has in total.<br>\nThe tournaments ends after that number of rounds or<br> \nif there are less than two players left in the tournament.");
|
||||
spnNumRounds.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnNumRoundsnumPlayersChanged(evt);
|
||||
|
@ -272,6 +279,7 @@ public class NewTournamentDialog extends MageDialog {
|
|||
);
|
||||
|
||||
cbAllowSpectators.setText("Allow spectators");
|
||||
cbAllowSpectators.setToolTipText("Allow other players to watch the games of this table.");
|
||||
|
||||
lblPlayer1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
|
||||
lblPlayer1.setText("Player 1 (You)");
|
||||
|
|
|
@ -65,6 +65,7 @@ import java.util.*;
|
|||
import java.util.List;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import mage.constants.PlayerAction;
|
||||
|
||||
/**
|
||||
|
@ -213,14 +214,14 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
logger.fatal("popupContainer error:", ex);
|
||||
}
|
||||
jPanel2.remove(bigCard);
|
||||
this.bigCard = null;
|
||||
this.bigCard = null;
|
||||
}
|
||||
|
||||
private void saveDividerLocations() {
|
||||
// save panel sizes and divider locations.
|
||||
Rectangle rec = MageFrame.getDesktop().getBounds();
|
||||
StringBuilder sb = new StringBuilder(Double.toString(rec.getWidth())).append("x").append(Double.toString(rec.getHeight()));
|
||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_MAGE_PANEL_LAST_SIZE, sb.toString());
|
||||
String sb = Double.toString(rec.getWidth()) + "x" + Double.toString(rec.getHeight());
|
||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_MAGE_PANEL_LAST_SIZE, sb);
|
||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_GAMEPANEL_DIVIDER_LOCATION_0, Integer.toString(this.jSplitPane0.getDividerLocation()));
|
||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_GAMEPANEL_DIVIDER_LOCATION_1, Integer.toString(this.jSplitPane1.getDividerLocation()));
|
||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_GAMEPANEL_DIVIDER_LOCATION_2, Integer.toString(this.jSplitPane2.getDividerLocation()));
|
||||
|
@ -230,9 +231,9 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
Rectangle rec = MageFrame.getDesktop().getBounds();
|
||||
if (rec != null) {
|
||||
String size = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_MAGE_PANEL_LAST_SIZE, null);
|
||||
StringBuilder sb = new StringBuilder(Double.toString(rec.getWidth())).append("x").append(Double.toString(rec.getHeight()));
|
||||
String sb = Double.toString(rec.getWidth()) + "x" + Double.toString(rec.getHeight());
|
||||
// use divider positions only if screen size is the same as it was the time the settings were saved
|
||||
if (size != null && size.equals(sb.toString())) {
|
||||
if (size != null && size.equals(sb)) {
|
||||
|
||||
String location = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAMEPANEL_DIVIDER_LOCATION_0, null);
|
||||
if (location != null && jSplitPane0 != null) {
|
||||
|
@ -260,8 +261,8 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
bigCard.setMaximumSize(bbDimension);
|
||||
bigCard.setMinimumSize(bbDimension);
|
||||
bigCard.setPreferredSize(bbDimension);
|
||||
pnlGameInfo.revalidate();
|
||||
pnlGameInfo.repaint();
|
||||
pnlShortCuts.revalidate();
|
||||
pnlShortCuts.repaint();
|
||||
//this.handContainer.sizeHand(0.8, smallMode);
|
||||
for (PlayAreaPanel p: players.values()) {
|
||||
p.sizePlayer(smallMode);
|
||||
|
@ -275,8 +276,8 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
bigCard.setMaximumSize(bbDimension);
|
||||
bigCard.setMinimumSize(bbDimension);
|
||||
bigCard.setPreferredSize(bbDimension);
|
||||
pnlGameInfo.revalidate();
|
||||
pnlGameInfo.repaint();
|
||||
pnlShortCuts.revalidate();
|
||||
pnlShortCuts.repaint();
|
||||
this.handContainer.sizeHand(1, smallMode);
|
||||
for (PlayAreaPanel p: players.values()) {
|
||||
p.sizePlayer(smallMode);
|
||||
|
@ -300,11 +301,19 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
this.feedbackPanel.init(gameId);
|
||||
this.feedbackPanel.clear();
|
||||
this.abilityPicker.init(session, gameId);
|
||||
|
||||
this.btnConcede.setVisible(true);
|
||||
this.btnEndTurn.setVisible(true);
|
||||
this.btnSwitchHands.setVisible(false);
|
||||
this.pnlReplay.setVisible(false);
|
||||
this.btnStopWatching.setVisible(false);
|
||||
this.btnSwitchHands.setVisible(false);
|
||||
this.btnCancelSkip.setVisible(true);
|
||||
|
||||
this.btnSkipToNextTurn.setVisible(true);
|
||||
this.btnSkipToEndTurn.setVisible(true);
|
||||
this.btnSkipToNextMain.setVisible(true);
|
||||
this.btnSkipToYourTurn.setVisible(true);
|
||||
|
||||
this.pnlReplay.setVisible(false);
|
||||
|
||||
this.gameChatPanel.clear();
|
||||
this.gameChatPanel.connect(session.getGameChatId(gameId));
|
||||
if (!session.joinGame(gameId)) {
|
||||
|
@ -320,10 +329,18 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
MageFrame.addGame(gameId, this);
|
||||
this.feedbackPanel.init(gameId);
|
||||
this.feedbackPanel.clear();
|
||||
|
||||
this.btnConcede.setVisible(false);
|
||||
this.btnEndTurn.setVisible(false);
|
||||
this.btnSwitchHands.setVisible(false);
|
||||
this.btnStopWatching.setVisible(true);
|
||||
this.btnSwitchHands.setVisible(false);
|
||||
this.btnCancelSkip.setVisible(false);
|
||||
|
||||
this.btnSkipToNextTurn.setVisible(false);
|
||||
this.btnSkipToEndTurn.setVisible(false);
|
||||
this.btnSkipToNextMain.setVisible(false);
|
||||
this.btnSkipToYourTurn.setVisible(false);
|
||||
|
||||
|
||||
this.pnlReplay.setVisible(false);
|
||||
this.gameChatPanel.clear();
|
||||
this.gameChatPanel.connect(session.getGameChatId(gameId));
|
||||
|
@ -343,7 +360,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
this.feedbackPanel.init(gameId);
|
||||
this.feedbackPanel.clear();
|
||||
this.btnConcede.setVisible(false);
|
||||
this.btnEndTurn.setVisible(false);
|
||||
this.btnSkipToNextTurn.setVisible(false);
|
||||
this.btnSwitchHands.setVisible(false);
|
||||
this.btnStopWatching.setVisible(false);
|
||||
this.pnlReplay.setVisible(true);
|
||||
|
@ -489,7 +506,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
if (previous != visible) {
|
||||
btnSwitchHands.setVisible(visible);
|
||||
if (visible) {
|
||||
JOptionPane.showMessageDialog(null, "You control other player's turn. \nUse \"Switch Hand\" on the bottom to switch between cards in different hands.");
|
||||
JOptionPane.showMessageDialog(null, "You control other player's turn. \nUse \"Switch Hand\" button to switch between cards in different hands.");
|
||||
} else {
|
||||
JOptionPane.showMessageDialog(null, "You lost control on other player's turn.");
|
||||
}
|
||||
|
@ -809,7 +826,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
jSplitPane0 = new javax.swing.JSplitPane();
|
||||
jPanel2 = new javax.swing.JPanel();
|
||||
jPanel3 = new javax.swing.JPanel();
|
||||
pnlGameInfo = new javax.swing.JPanel();
|
||||
pnlShortCuts = new javax.swing.JPanel();
|
||||
lblPhase = new javax.swing.JLabel();
|
||||
txtPhase = new javax.swing.JLabel();
|
||||
lblStep = new javax.swing.JLabel();
|
||||
|
@ -821,10 +838,18 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
txtPriority = new javax.swing.JLabel();
|
||||
lblPriority = new javax.swing.JLabel();
|
||||
feedbackPanel = new mage.client.game.FeedbackPanel();
|
||||
|
||||
btnCancelSkip = new javax.swing.JButton(); // F3
|
||||
btnSkipToNextTurn = new javax.swing.JButton(); // F4
|
||||
btnSkipToEndTurn = new javax.swing.JButton(); // F5
|
||||
btnSkipToNextMain = new javax.swing.JButton(); // F7
|
||||
btnSkipToYourTurn = new javax.swing.JButton(); // F9
|
||||
|
||||
btnConcede = new javax.swing.JButton();
|
||||
btnEndTurn = new javax.swing.JButton();
|
||||
btnSwitchHands = new javax.swing.JButton();
|
||||
|
||||
btnStopWatching = new javax.swing.JButton();
|
||||
|
||||
bigCard = new mage.client.cards.BigCard();
|
||||
stack = new mage.client.cards.Cards();
|
||||
pnlReplay = new javax.swing.JPanel();
|
||||
|
@ -861,8 +886,8 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
|
||||
restoreDividerLocations();
|
||||
|
||||
pnlGameInfo.setOpaque(false);
|
||||
|
||||
pnlShortCuts.setOpaque(false);
|
||||
pnlShortCuts.setPreferredSize(new Dimension(400, 60));
|
||||
lblPhase.setLabelFor(txtPhase);
|
||||
lblPhase.setText("Phase:");
|
||||
|
||||
|
@ -898,33 +923,50 @@ 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(0, 0, 0)));
|
||||
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));
|
||||
|
||||
btnConcede.setText("Concede");
|
||||
btnConcede.setToolTipText("Concede the current game");
|
||||
btnConcede.setFocusable(false);
|
||||
btnConcede.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent evt) {
|
||||
btnConcedeActionPerformed(null);
|
||||
}
|
||||
});
|
||||
|
||||
btnEndTurn.setText("End Turn (F4)");
|
||||
btnEndTurn.setToolTipText("End This Turn");
|
||||
btnEndTurn.setFocusable(false);
|
||||
btnEndTurn.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent evt) {
|
||||
btnEndTurnActionPerformed(null);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
int c = JComponent.WHEN_IN_FOCUSED_WINDOW;
|
||||
|
||||
KeyStroke ks3 = KeyStroke.getKeyStroke(KeyEvent.VK_F3, 0);
|
||||
this.getInputMap(c).put(ks3, "F3_PRESS");
|
||||
this.getActionMap().put("F3_PRESS", new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent actionEvent) {
|
||||
restorePriorityActionPerformed(actionEvent);
|
||||
}
|
||||
});
|
||||
|
||||
btnCancelSkip.setContentAreaFilled(false);
|
||||
btnCancelSkip.setBorder(new EmptyBorder(0,0,0,0));
|
||||
btnCancelSkip.setIcon(new ImageIcon(ImageManagerImpl.getInstance().getCancelSkipButtonImage()));
|
||||
btnCancelSkip.setToolTipText("Cancel all skip actions (F3).");
|
||||
btnCancelSkip.setFocusable(false);
|
||||
btnCancelSkip.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent evt) {
|
||||
if (evt.getButton() == MouseEvent.BUTTON1) {
|
||||
restorePriorityActionPerformed(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
btnSkipToNextTurn.setContentAreaFilled(false);
|
||||
btnSkipToNextTurn.setBorder(new EmptyBorder(0,0,0,0));
|
||||
btnSkipToNextTurn.setIcon(new ImageIcon(ImageManagerImpl.getInstance().getSkipNextTurnButtonImage()));
|
||||
btnSkipToNextTurn.setToolTipText("Skip to next turn (F4).");
|
||||
btnSkipToNextTurn.setFocusable(false);
|
||||
btnSkipToNextTurn.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent evt) {
|
||||
if (evt.getButton() == MouseEvent.BUTTON1) {
|
||||
btnEndTurnActionPerformed(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
KeyStroke ks = KeyStroke.getKeyStroke(KeyEvent.VK_F4, 0);
|
||||
this.getInputMap(c).put(ks, "F4_PRESS");
|
||||
|
@ -935,6 +977,20 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
}
|
||||
});
|
||||
|
||||
btnSkipToEndTurn.setContentAreaFilled(false);
|
||||
btnSkipToEndTurn.setBorder(new EmptyBorder(0,0,0,0));
|
||||
btnSkipToEndTurn.setIcon(new ImageIcon(ImageManagerImpl.getInstance().getSkipEndTurnButtonImage()));
|
||||
btnSkipToEndTurn.setToolTipText("Skip to (opponents/next) end of turn step (F5) - adjust using preferences.");
|
||||
btnSkipToEndTurn.setFocusable(false);
|
||||
btnSkipToEndTurn.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent evt) {
|
||||
if (evt.getButton() == MouseEvent.BUTTON1) {
|
||||
btnUntilEndOfTurnActionPerformed(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ks = KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0);
|
||||
this.getInputMap(c).put(ks, "F5_PRESS");
|
||||
this.getActionMap().put("F5_PRESS", new AbstractAction() {
|
||||
|
@ -944,6 +1000,20 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
}
|
||||
});
|
||||
|
||||
btnSkipToNextMain.setContentAreaFilled(false);
|
||||
btnSkipToNextMain.setBorder(new EmptyBorder(0,0,0,0));
|
||||
btnSkipToNextMain.setIcon(new ImageIcon(ImageManagerImpl.getInstance().getSkipMainButtonImage()));
|
||||
btnSkipToNextMain.setToolTipText("Skip to (your) next main phase (F7) - adjust using preferences.");
|
||||
btnSkipToNextMain.setFocusable(false);
|
||||
btnSkipToNextMain.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent evt) {
|
||||
if (evt.getButton() == MouseEvent.BUTTON1) {
|
||||
btnUntilNextMainPhaseActionPerformed(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ks = KeyStroke.getKeyStroke(KeyEvent.VK_F7, 0);
|
||||
this.getInputMap(c).put(ks, "F7_PRESS");
|
||||
this.getActionMap().put("F7_PRESS", new AbstractAction() {
|
||||
|
@ -953,6 +1023,20 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
}
|
||||
});
|
||||
|
||||
btnSkipToYourTurn.setContentAreaFilled(false);
|
||||
btnSkipToYourTurn.setBorder(new EmptyBorder(0,0,0,0));
|
||||
btnSkipToYourTurn.setIcon(new ImageIcon(ImageManagerImpl.getInstance().getSkipYourNextTurnButtonImage()));
|
||||
btnSkipToYourTurn.setToolTipText("Skip to your next turn (F9).");
|
||||
btnSkipToYourTurn.setFocusable(false);
|
||||
btnSkipToYourTurn.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent evt) {
|
||||
if (evt.getButton() == MouseEvent.BUTTON1) {
|
||||
btnPassPriorityUntilNextYourTurnActionPerformed(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
KeyStroke ks9 = KeyStroke.getKeyStroke(KeyEvent.VK_F9, 0);
|
||||
this.getInputMap(c).put(ks9, "F9_PRESS");
|
||||
this.getActionMap().put("F9_PRESS", new AbstractAction() {
|
||||
|
@ -961,6 +1045,21 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
btnPassPriorityUntilNextYourTurnActionPerformed(actionEvent);
|
||||
}
|
||||
});
|
||||
|
||||
btnConcede.setContentAreaFilled(false);
|
||||
btnConcede.setBorder(new EmptyBorder(0,0,0,0));
|
||||
btnConcede.setIcon(new ImageIcon(ImageManagerImpl.getInstance().getConcedeButtonImage()));
|
||||
btnConcede.setToolTipText("Concede the current game.");
|
||||
btnConcede.setFocusable(false);
|
||||
btnConcede.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent evt) {
|
||||
if (evt.getButton() == MouseEvent.BUTTON1) {
|
||||
btnConcedeActionPerformed(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
KeyStroke ks2 = KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0);
|
||||
this.getInputMap(c).put(ks2, "F2_PRESS");
|
||||
|
@ -973,15 +1072,6 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
}
|
||||
});
|
||||
|
||||
KeyStroke ks3 = KeyStroke.getKeyStroke(KeyEvent.VK_F3, 0);
|
||||
this.getInputMap(c).put(ks3, "F3_PRESS");
|
||||
this.getActionMap().put("F3_PRESS", new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent actionEvent) {
|
||||
restorePriorityActionPerformed(actionEvent);
|
||||
}
|
||||
});
|
||||
|
||||
KeyStroke ksAltE = KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.ALT_MASK);
|
||||
this.getInputMap(c).put(ksAltE, "ENLARGE");
|
||||
this.getActionMap().put("ENLARGE", new AbstractAction() {
|
||||
|
@ -1047,20 +1137,31 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
btnSwitchHands.setText("Switch Hands");
|
||||
btnSwitchHands.setContentAreaFilled(false);
|
||||
btnSwitchHands.setBorder(new EmptyBorder(0,0,0,0));
|
||||
btnSwitchHands.setIcon(new ImageIcon(ImageManagerImpl.getInstance().getSwitchHandsButtonImage()));
|
||||
btnSwitchHands.setFocusable(false);
|
||||
btnSwitchHands.setToolTipText("Switch between your hand cards and hand cards of controlled players.");
|
||||
btnSwitchHands.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent evt) {
|
||||
btnSwitchHandActionPerformed(null);
|
||||
if (evt.getButton() == MouseEvent.BUTTON1) {
|
||||
btnSwitchHandActionPerformed(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
btnStopWatching.setText("Stop Watching");
|
||||
btnStopWatching.addActionListener(new java.awt.event.ActionListener() {
|
||||
btnStopWatching.setContentAreaFilled(false);
|
||||
btnStopWatching.setBorder(new EmptyBorder(0,0,0,0));
|
||||
btnStopWatching.setIcon(new ImageIcon(ImageManagerImpl.getInstance().getStopWatchButtonImage()));
|
||||
btnStopWatching.setFocusable(false);
|
||||
btnSwitchHands.setToolTipText("Stop watching this game.");
|
||||
btnStopWatching.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
btnStopWatchingActionPerformed(evt);
|
||||
public void mouseClicked(MouseEvent evt) {
|
||||
if (evt.getButton() == MouseEvent.BUTTON1) {
|
||||
btnStopWatchingActionPerformed(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -1133,31 +1234,32 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
);
|
||||
|
||||
// Game info panel (buttons on the right panel)
|
||||
javax.swing.GroupLayout gl_pnlGameInfo = new javax.swing.GroupLayout(pnlGameInfo);
|
||||
pnlGameInfo.setLayout(gl_pnlGameInfo);
|
||||
gl_pnlGameInfo.setHorizontalGroup(
|
||||
gl_pnlGameInfo.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(gl_pnlGameInfo.createSequentialGroup()
|
||||
.addGap(10, 10, 10)
|
||||
.addComponent(btnConcede)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(btnEndTurn)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
javax.swing.GroupLayout gl_pnlShortCuts = new javax.swing.GroupLayout(pnlShortCuts);
|
||||
pnlShortCuts.setLayout(gl_pnlShortCuts);
|
||||
gl_pnlShortCuts.setHorizontalGroup(gl_pnlShortCuts.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(gl_pnlShortCuts.createSequentialGroup()
|
||||
.addComponent(btnSkipToNextTurn)
|
||||
.addComponent(btnSkipToEndTurn)
|
||||
.addComponent(btnSkipToNextMain)
|
||||
.addComponent(btnSkipToYourTurn)
|
||||
)
|
||||
.addGroup(gl_pnlShortCuts.createSequentialGroup()
|
||||
.addComponent(btnSwitchHands)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(btnCancelSkip)
|
||||
.addComponent(btnConcede)
|
||||
.addComponent(btnStopWatching)
|
||||
.addContainerGap(62, Short.MAX_VALUE))
|
||||
)
|
||||
//.addComponent(bigCard, javax.swing.GroupLayout.DEFAULT_SIZE, 256, Short.MAX_VALUE)
|
||||
//.addComponent(feedbackPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 256, Short.MAX_VALUE)
|
||||
//.addComponent(stack, javax.swing.GroupLayout.DEFAULT_SIZE, 256, Short.MAX_VALUE)
|
||||
.addGroup(gl_pnlGameInfo.createSequentialGroup()
|
||||
|
||||
.addGroup(gl_pnlShortCuts.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(pnlReplay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap(51, Short.MAX_VALUE))
|
||||
);
|
||||
gl_pnlGameInfo.setVerticalGroup(
|
||||
gl_pnlGameInfo.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(gl_pnlGameInfo.createSequentialGroup()
|
||||
gl_pnlShortCuts.setVerticalGroup(gl_pnlShortCuts.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(gl_pnlShortCuts.createSequentialGroup()
|
||||
//.addComponent(bigCard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
//.addGap(1, 1, 1)
|
||||
//.addComponent(feedbackPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
|
@ -1165,11 +1267,20 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 164, Short.MAX_VALUE)
|
||||
.addComponent(pnlReplay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(gl_pnlGameInfo.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(btnConcede)
|
||||
.addComponent(btnEndTurn)
|
||||
|
||||
.addGroup(gl_pnlShortCuts.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(btnSkipToNextTurn)
|
||||
.addComponent(btnSkipToEndTurn)
|
||||
.addComponent(btnSkipToNextMain)
|
||||
.addComponent(btnSkipToYourTurn)
|
||||
)
|
||||
.addGroup(gl_pnlShortCuts.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(btnSwitchHands)
|
||||
.addComponent(btnStopWatching)))
|
||||
.addComponent(btnCancelSkip)
|
||||
.addComponent(btnConcede)
|
||||
.addComponent(btnStopWatching)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
pnlBattlefield.setLayout(new java.awt.GridBagLayout());
|
||||
|
@ -1178,7 +1289,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
jPhases.setBackground(new Color(0, 0, 0, 0));
|
||||
jPhases.setLayout(null);
|
||||
jPhases.setPreferredSize(new Dimension(X_PHASE_WIDTH, 450));
|
||||
|
||||
|
||||
MouseAdapter phasesMouseAdapter = new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent evt) {
|
||||
|
@ -1229,16 +1340,17 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
gl_jPanel3.setHorizontalGroup(
|
||||
gl_jPanel3.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_jPanel3.createSequentialGroup()
|
||||
//.addComponent(pnlGameInfo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
//.addGap(0)
|
||||
// .addGap(0)
|
||||
.addGroup(gl_jPanel3.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_jPanel3.createSequentialGroup()
|
||||
.addGroup(gl_jPanel3.createParallelGroup(Alignment.LEADING)
|
||||
.addComponent(helper, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(handContainer, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(helper, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.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(stack, 400, 400, 400)
|
||||
|
||||
)
|
||||
.addGap(0)
|
||||
//.addComponent(jPhases, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
|
@ -1257,7 +1369,8 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
//.addPreferredGap(ComponentPlacement.RELATED)
|
||||
.addGroup(gl_jPanel3.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_jPanel3.createSequentialGroup()
|
||||
.addGap(75)
|
||||
.addComponent(pnlShortCuts, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(0)
|
||||
.addComponent(stack, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
)
|
||||
.addGroup(gl_jPanel3.createSequentialGroup()
|
||||
|
@ -1284,14 +1397,6 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
gbl.setConstraints( bigCard, gbc );
|
||||
jPanel2.add( bigCard );
|
||||
|
||||
GridBagConstraints gbc2 = new GridBagConstraints();
|
||||
gbc2.fill = GridBagConstraints.NONE;
|
||||
gbc2.gridx = 0; gbc2.gridy = GridBagConstraints.RELATIVE;
|
||||
gbc2.gridwidth = 1; gbc2.gridheight = 1; //size 1/5
|
||||
gbc2.weightx = 0.0; gbc2.weighty = 0.0;
|
||||
gbl.setConstraints( pnlGameInfo, gbc2 );
|
||||
jPanel2.add( pnlGameInfo );
|
||||
|
||||
jPanel2.setOpaque(false);
|
||||
|
||||
// game pane and chat/log pane
|
||||
|
@ -1315,15 +1420,30 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
for (MouseListener ml :this.getMouseListeners()) {
|
||||
this.removeMouseListener(ml);
|
||||
}
|
||||
for (MouseListener ml :this.btnCancelSkip.getMouseListeners()) {
|
||||
this.btnCancelSkip.removeMouseListener(ml);
|
||||
}
|
||||
for (MouseListener ml :this.btnConcede.getMouseListeners()) {
|
||||
this.btnConcede.removeMouseListener(ml);
|
||||
}
|
||||
for (MouseListener ml :this.btnEndTurn.getMouseListeners()) {
|
||||
this.btnEndTurn.removeMouseListener(ml);
|
||||
for (MouseListener ml :this.btnSkipToYourTurn.getMouseListeners()) {
|
||||
this.btnSkipToYourTurn.removeMouseListener(ml);
|
||||
}
|
||||
for (MouseListener ml :this.btnSkipToEndTurn.getMouseListeners()) {
|
||||
this.btnSkipToEndTurn.removeMouseListener(ml);
|
||||
}
|
||||
for (MouseListener ml :this.btnSkipToNextMain.getMouseListeners()) {
|
||||
this.btnSkipToNextMain.removeMouseListener(ml);
|
||||
}
|
||||
for (MouseListener ml :this.btnSkipToNextTurn.getMouseListeners()) {
|
||||
this.btnSkipToNextTurn.removeMouseListener(ml);
|
||||
}
|
||||
for (MouseListener ml :this.btnSwitchHands.getMouseListeners()) {
|
||||
this.btnSwitchHands.removeMouseListener(ml);
|
||||
}
|
||||
for (MouseListener ml :this.btnStopWatching.getMouseListeners()) {
|
||||
this.btnStopWatching.removeMouseListener(ml);
|
||||
}
|
||||
for (MouseListener ml :this.jPhases.getMouseListeners()) {
|
||||
this.jPhases.removeMouseListener(ml);
|
||||
}
|
||||
|
@ -1336,9 +1456,6 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
for (ActionListener al :this.btnPlay.getActionListeners()) {
|
||||
this.btnPlay.removeActionListener(al);
|
||||
}
|
||||
for (ActionListener al :this.btnStopWatching.getActionListeners()) {
|
||||
this.btnStopWatching.removeActionListener(al);
|
||||
}
|
||||
for (ActionListener al :this.btnStopReplay.getActionListeners()) {
|
||||
this.btnStopReplay.removeActionListener(al);
|
||||
}
|
||||
|
@ -1378,25 +1495,25 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
}
|
||||
|
||||
private void btnEndTurnActionPerformed(java.awt.event.ActionEvent evt) {
|
||||
if (feedbackPanel != null && FeedbackMode.SELECT.equals(feedbackPanel.getMode())) {
|
||||
if (feedbackPanel != null) {
|
||||
session.sendPlayerAction(PlayerAction.PASS_PRIORITY_UNTIL_NEXT_TURN, gameId);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnUntilEndOfTurnActionPerformed(java.awt.event.ActionEvent evt) {
|
||||
if (feedbackPanel != null && FeedbackMode.SELECT.equals(feedbackPanel.getMode())) {
|
||||
if (feedbackPanel != null) {
|
||||
session.sendPlayerAction(PlayerAction.PASS_PRIORITY_UNTIL_TURN_END_STEP, gameId);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnUntilNextMainPhaseActionPerformed(java.awt.event.ActionEvent evt) {
|
||||
if (feedbackPanel != null && FeedbackMode.SELECT.equals(feedbackPanel.getMode())) {
|
||||
if (feedbackPanel != null) {
|
||||
session.sendPlayerAction(PlayerAction.PASS_PRIORITY_UNTIL_NEXT_MAIN_PHASE, gameId);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnPassPriorityUntilNextYourTurnActionPerformed(java.awt.event.ActionEvent evt) {
|
||||
if (feedbackPanel != null && FeedbackMode.SELECT.equals(feedbackPanel.getMode())) {
|
||||
if (feedbackPanel != null) {
|
||||
session.sendPlayerAction(PlayerAction.PASS_PRIORITY_UNTIL_MY_NEXT_TURN, gameId);
|
||||
}
|
||||
}
|
||||
|
@ -1511,15 +1628,25 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
|
||||
private mage.client.components.ability.AbilityPicker abilityPicker;
|
||||
private mage.client.cards.BigCard bigCard;
|
||||
|
||||
// private JPanel cancelSkipPanel;
|
||||
private javax.swing.JButton btnCancelSkip;
|
||||
private javax.swing.JButton btnSkipToNextTurn; // F4
|
||||
private javax.swing.JButton btnSkipToEndTurn; // F5
|
||||
private javax.swing.JButton btnSkipToNextMain; // F7
|
||||
private javax.swing.JButton btnSkipToYourTurn; // F9
|
||||
|
||||
private javax.swing.JButton btnConcede;
|
||||
private javax.swing.JButton btnEndTurn;
|
||||
private javax.swing.JButton btnSwitchHands;
|
||||
|
||||
private javax.swing.JButton btnNextPlay;
|
||||
private javax.swing.JButton btnPlay;
|
||||
private javax.swing.JButton btnPreviousPlay;
|
||||
private javax.swing.JButton btnSkipForward;
|
||||
private javax.swing.JButton btnStopReplay;
|
||||
|
||||
private javax.swing.JButton btnStopWatching;
|
||||
|
||||
private mage.client.chat.ChatPanel gameChatPanel;
|
||||
private mage.client.game.FeedbackPanel feedbackPanel;
|
||||
private mage.client.chat.ChatPanel userChatPanel;
|
||||
|
@ -1533,7 +1660,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
private javax.swing.JLabel lblStep;
|
||||
private javax.swing.JLabel lblTurn;
|
||||
private javax.swing.JPanel pnlBattlefield;
|
||||
private javax.swing.JPanel pnlGameInfo;
|
||||
private javax.swing.JPanel pnlShortCuts;
|
||||
private javax.swing.JPanel pnlReplay;
|
||||
private javax.swing.JLabel txtActivePlayer;
|
||||
private javax.swing.JLabel txtPhase;
|
||||
|
|
|
@ -83,7 +83,6 @@ import mage.remote.Session;
|
|||
import mage.view.MatchView;
|
||||
import mage.view.RoomUsersView;
|
||||
import mage.view.TableView;
|
||||
import mage.view.UsersView;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
|
@ -252,8 +251,8 @@ public class TablesPanel extends javax.swing.JPanel {
|
|||
private void saveDividerLocations() {
|
||||
// save panel sizes and divider locations.
|
||||
Rectangle rec = MageFrame.getDesktop().getBounds();
|
||||
StringBuilder sb = new StringBuilder(Double.toString(rec.getWidth())).append("x").append(Double.toString(rec.getHeight()));
|
||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_MAGE_PANEL_LAST_SIZE, sb.toString());
|
||||
String sb = Double.toString(rec.getWidth()) + "x" + Double.toString(rec.getHeight());
|
||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_MAGE_PANEL_LAST_SIZE, sb);
|
||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_TABLES_DIVIDER_LOCATION_1, Integer.toString(this.jSplitPane1.getDividerLocation()));
|
||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_TABLES_DIVIDER_LOCATION_2, Integer.toString(this.jSplitPane2.getDividerLocation()));
|
||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_TABLES_DIVIDER_LOCATION_3, Integer.toString(chatPanel.getSplitDividerLocation()));
|
||||
|
@ -263,9 +262,9 @@ public class TablesPanel extends javax.swing.JPanel {
|
|||
Rectangle rec = MageFrame.getDesktop().getBounds();
|
||||
if (rec != null) {
|
||||
String size = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_MAGE_PANEL_LAST_SIZE, null);
|
||||
StringBuilder sb = new StringBuilder(Double.toString(rec.getWidth())).append("x").append(Double.toString(rec.getHeight()));
|
||||
String sb = Double.toString(rec.getWidth()) + "x" + Double.toString(rec.getHeight());
|
||||
// use divider positions only if screen size is the same as it was the time the settings were saved
|
||||
if (size != null && size.equals(sb.toString())) {
|
||||
if (size != null && size.equals(sb)) {
|
||||
String location = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_TABLES_DIVIDER_LOCATION_1, null);
|
||||
if (location != null && jSplitPane1 != null) {
|
||||
jSplitPane1.setDividerLocation(Integer.parseInt(location));
|
||||
|
|
|
@ -213,18 +213,19 @@ public class TournamentPanel extends javax.swing.JPanel {
|
|||
}
|
||||
switch (tournament.getTournamentState()) {
|
||||
case "Constructing":
|
||||
String constructionTime = "";
|
||||
String timeLeft = "";
|
||||
if (tournament.getStepStartTime() != null) {
|
||||
constructionTime = Format.getDuration(tournament.getConstructionTime() - (tournament.getServerTime().getTime() - tournament.getStepStartTime().getTime())/1000);
|
||||
timeLeft = Format.getDuration(tournament.getConstructionTime() - (tournament.getServerTime().getTime() - tournament.getStepStartTime().getTime())/1000);
|
||||
}
|
||||
txtTournamentState.setText(new StringBuilder(tournament.getTournamentState()).append(" (").append(constructionTime).append(")").toString());
|
||||
txtTournamentState.setText(new StringBuilder(tournament.getTournamentState()).append(" (").append(timeLeft).append(")").toString());
|
||||
break;
|
||||
case "Dueling":
|
||||
String duelingTime = "";
|
||||
case "Drafting":
|
||||
String usedTime = "";
|
||||
if (tournament.getStepStartTime() != null) {
|
||||
duelingTime = Format.getDuration((tournament.getServerTime().getTime() - tournament.getStepStartTime().getTime())/1000);
|
||||
usedTime = Format.getDuration((tournament.getServerTime().getTime() - tournament.getStepStartTime().getTime())/1000);
|
||||
}
|
||||
txtTournamentState.setText(new StringBuilder(tournament.getTournamentState()).append(" (").append(duelingTime).append(")").toString());
|
||||
txtTournamentState.setText(tournament.getTournamentState() + " (" + usedTime + ") " + tournament.getRunningInfo());
|
||||
break;
|
||||
default:
|
||||
txtTournamentState.setText(tournament.getTournamentState());
|
||||
|
|
|
@ -342,6 +342,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
|||
typeButton.setLocation(2, 2);
|
||||
typeButton.setSize(25, 25);
|
||||
|
||||
|
||||
iconPanel.setVisible(true);
|
||||
typeButton.setIcon(new ImageIcon(bufferedImage));
|
||||
if (toolTipText != null) {
|
||||
|
|
|
@ -30,5 +30,15 @@ public interface ImageManager {
|
|||
Image getDlgNextButtonImage();
|
||||
Image getDlgActiveNextButtonImage();
|
||||
|
||||
Image getSwitchHandsButtonImage();
|
||||
Image getStopWatchButtonImage();
|
||||
Image getConcedeButtonImage();
|
||||
Image getCancelSkipButtonImage();
|
||||
Image getSkipNextTurnButtonImage();
|
||||
Image getSkipEndTurnButtonImage();
|
||||
Image getSkipMainButtonImage();
|
||||
Image getSkipYourNextTurnButtonImage();
|
||||
|
||||
|
||||
Image getPhaseImage(String phase);
|
||||
}
|
||||
|
|
|
@ -237,9 +237,73 @@ public class ImageManagerImpl implements ImageManager {
|
|||
return imageDlgActiveNextButton;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Image getConcedeButtonImage() {
|
||||
if (imageConcedeButton == null) {
|
||||
imageConcedeButton = getBufferedImageFromResource("/buttons/concede.png");
|
||||
}
|
||||
return imageConcedeButton;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Image getSwitchHandsButtonImage() {
|
||||
if (imageSwitchHandsButton == null) {
|
||||
imageSwitchHandsButton = getBufferedImageFromResource("/buttons/switch_hands.png");
|
||||
}
|
||||
return imageSwitchHandsButton;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Image getStopWatchButtonImage() {
|
||||
if (imageStopWatchingButton == null) {
|
||||
imageStopWatchingButton = getBufferedImageFromResource("/buttons/stop_watching.png");
|
||||
}
|
||||
return imageStopWatchingButton;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Image getCancelSkipButtonImage() {
|
||||
if (imageCancelSkipButton == null) {
|
||||
imageCancelSkipButton = getBufferedImageFromResource("/buttons/cancel_skip.png");
|
||||
}
|
||||
return imageCancelSkipButton;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Image getSkipNextTurnButtonImage() {
|
||||
if (imageSkipNextTurnButton == null) {
|
||||
imageSkipNextTurnButton = getBufferedImageFromResource("/buttons/skip_turn.png");
|
||||
}
|
||||
return imageSkipNextTurnButton;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Image getSkipEndTurnButtonImage() {
|
||||
if (imageSkipToEndTurnButton == null) {
|
||||
imageSkipToEndTurnButton = getBufferedImageFromResource("/buttons/skip_to_end.png");
|
||||
}
|
||||
return imageSkipToEndTurnButton;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Image getSkipMainButtonImage() {
|
||||
if (imageSkipToMainButton == null) {
|
||||
imageSkipToMainButton = getBufferedImageFromResource("/buttons/skip_to_main.png");
|
||||
}
|
||||
return imageSkipToMainButton;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Image getSkipYourNextTurnButtonImage() {
|
||||
if (imageSkipYourNextTurnButton == null) {
|
||||
imageSkipYourNextTurnButton = getBufferedImageFromResource("/buttons/skip_all.png");
|
||||
}
|
||||
return imageSkipYourNextTurnButton;
|
||||
}
|
||||
|
||||
protected static Image getImageFromResourceTransparent(String path, Color mask, Rectangle rec) {
|
||||
BufferedImage image = null;
|
||||
Image imageCardTransparent = null;
|
||||
BufferedImage image;
|
||||
Image imageCardTransparent;
|
||||
Image resized = null;
|
||||
|
||||
URL imageURL = ImageManager.class.getResource(path);
|
||||
|
@ -317,5 +381,14 @@ public class ImageManagerImpl implements ImageManager {
|
|||
private static BufferedImage imageDlgNextButton;
|
||||
private static BufferedImage imageDlgActiveNextButton;
|
||||
|
||||
private static BufferedImage imageCancelSkipButton;
|
||||
private static BufferedImage imageSwitchHandsButton;
|
||||
private static BufferedImage imageStopWatchingButton;
|
||||
private static BufferedImage imageConcedeButton;
|
||||
private static BufferedImage imageSkipNextTurnButton;
|
||||
private static BufferedImage imageSkipToEndTurnButton;
|
||||
private static BufferedImage imageSkipToMainButton;
|
||||
private static BufferedImage imageSkipYourNextTurnButton;
|
||||
|
||||
private static Map<String, Image> phasesImages;
|
||||
}
|
||||
|
|
BIN
Mage.Client/src/main/resources/buttons/cancel_skip.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
Mage.Client/src/main/resources/buttons/concede.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
Mage.Client/src/main/resources/buttons/skip_all.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
Mage.Client/src/main/resources/buttons/skip_to_end.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
Mage.Client/src/main/resources/buttons/skip_to_main.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
Mage.Client/src/main/resources/buttons/skip_turn.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
Mage.Client/src/main/resources/buttons/stop_watching.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
Mage.Client/src/main/resources/buttons/switch_hands.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
|
@ -39,12 +39,16 @@ public class RoomUsersView implements Serializable {
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final int numberActiveGames;
|
||||
private final int numberGameThreads;
|
||||
private final int numberMaxGames;
|
||||
|
||||
private final List<UsersView> usersView;
|
||||
|
||||
public RoomUsersView(List<UsersView> usersView, int numberActiveGames) {
|
||||
public RoomUsersView(List<UsersView> usersView, int numberActiveGames, int numberGameThreads, int numberMaxGames) {
|
||||
|
||||
this.numberActiveGames = numberActiveGames;
|
||||
this.numberGameThreads = numberGameThreads;
|
||||
this.numberMaxGames = numberMaxGames;
|
||||
|
||||
this.usersView = usersView;
|
||||
}
|
||||
|
@ -53,6 +57,14 @@ public class RoomUsersView implements Serializable {
|
|||
return numberActiveGames;
|
||||
}
|
||||
|
||||
public int getNumberGameThreads() {
|
||||
return numberGameThreads;
|
||||
}
|
||||
|
||||
public int getNumberMaxGames() {
|
||||
return numberMaxGames;
|
||||
}
|
||||
|
||||
public List<UsersView> getUsersView() {
|
||||
return usersView;
|
||||
}
|
||||
|
|
|
@ -57,6 +57,7 @@ public class TournamentView implements Serializable {
|
|||
|
||||
private final List<RoundView> rounds = new ArrayList<>();
|
||||
private final List<TournamentPlayerView> players = new ArrayList<>();
|
||||
private final String runningInfo;
|
||||
|
||||
public TournamentView(Tournament tournament) {
|
||||
|
||||
|
@ -77,6 +78,11 @@ public class TournamentView implements Serializable {
|
|||
serverTime = new Date();
|
||||
tournamentState = tournament.getTournamentState();
|
||||
|
||||
if (tournament.getTournamentState().equals("Drafting") && tournament.getDraft() != null) {
|
||||
runningInfo = "booster/card: " + tournament.getDraft().getBoosterNum() +"/" + (tournament.getDraft().getCardNum() -1);
|
||||
} else {
|
||||
runningInfo = "";
|
||||
}
|
||||
for (TournamentPlayer player: tournament.getPlayers()) {
|
||||
players.add(new TournamentPlayerView(player));
|
||||
}
|
||||
|
@ -132,5 +138,9 @@ public class TournamentView implements Serializable {
|
|||
public Date getServerTime() {
|
||||
return serverTime;
|
||||
}
|
||||
|
||||
public String getRunningInfo() {
|
||||
return runningInfo;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ public class BoosterDraftEliminationTournament extends TournamentSingleEliminati
|
|||
}
|
||||
|
||||
protected void draft() {
|
||||
Draft draft = new BoosterDraft((DraftOptions) options.getLimitedOptions(), getSets());
|
||||
draft = new BoosterDraft((DraftOptions) options.getLimitedOptions(), getSets());
|
||||
for (TournamentPlayer player: players.values()) {
|
||||
draft.addPlayer(player.getPlayer());
|
||||
player.setState(TournamentPlayerState.DRAFTING);
|
||||
|
|
|
@ -249,7 +249,7 @@ public class TableController {
|
|||
return false;
|
||||
}
|
||||
// check password
|
||||
if (!table.getMatch().getOptions().getPassword().isEmpty()) {
|
||||
if (!table.getMatch().getOptions().getPassword().isEmpty() && playerType.equals("Human")) {
|
||||
if (!table.getMatch().getOptions().getPassword().equals(password)) {
|
||||
user.showUserMessage("Join Table", "Wrong password.");
|
||||
return false;
|
||||
|
@ -608,10 +608,9 @@ public class TableController {
|
|||
|
||||
|
||||
// log about game started
|
||||
logger.info("GAME started [" + match.getName() +"] "+ creator + " - " + opponent.toString());
|
||||
logger.info("GAME started " + match.getGame().getId() + " [" + match.getName() +"] "+ creator + " - " + opponent.toString());
|
||||
logger.debug("- matchId: " + match.getId() + " [" + match.getName() + "]");
|
||||
if (match.getGame() != null) {
|
||||
logger.debug("- gameId: " + match.getGame().getId());
|
||||
logger.debug("- chatId: " + GameManager.getInstance().getChatId(match.getGame().getId()));
|
||||
} else {
|
||||
logger.debug("- no valid game object");
|
||||
|
|
|
@ -149,19 +149,9 @@ public class DraftController {
|
|||
return false;
|
||||
}
|
||||
|
||||
private synchronized void startDraft() {
|
||||
for (final Entry<UUID, DraftSession> entry: draftSessions.entrySet()) {
|
||||
if (!entry.getValue().init()) {
|
||||
logger.fatal("Unable to initialize client for playerId " + entry.getKey());
|
||||
//TODO: generate client error message
|
||||
return;
|
||||
}
|
||||
}
|
||||
draft.start();
|
||||
}
|
||||
|
||||
private void checkStart() {
|
||||
if (allJoined()) {
|
||||
private synchronized void checkStart() {
|
||||
if (!draft.isStarted() && allJoined()) {
|
||||
draft.setStarted();
|
||||
ThreadExecutor.getInstance().getCallExecutor().execute(
|
||||
new Runnable() {
|
||||
@Override
|
||||
|
@ -172,6 +162,17 @@ public class DraftController {
|
|||
}
|
||||
}
|
||||
|
||||
private void startDraft() {
|
||||
for (final Entry<UUID, DraftSession> entry: draftSessions.entrySet()) {
|
||||
if (!entry.getValue().init()) {
|
||||
logger.fatal("Unable to initialize client for playerId " + entry.getKey());
|
||||
//TODO: generate client error message
|
||||
return;
|
||||
}
|
||||
}
|
||||
draft.start();
|
||||
}
|
||||
|
||||
private boolean allJoined() {
|
||||
if (!draft.allJoined()) {
|
||||
return false;
|
||||
|
|
|
@ -129,7 +129,11 @@ public class GamesRoomImpl extends RoomImpl implements GamesRoom, Serializable {
|
|||
|
||||
Collections.sort(users, new UserNameSorter());
|
||||
List<RoomUsersView> roomUserInfo = new ArrayList<>();
|
||||
roomUserInfo.add(new RoomUsersView(users, GameManager.getInstance().getNumberActiveGames()));
|
||||
roomUserInfo.add(new RoomUsersView(users,
|
||||
GameManager.getInstance().getNumberActiveGames(),
|
||||
ThreadExecutor.getInstance().getActiveThreads(ThreadExecutor.getInstance().getGameExecutor()),
|
||||
ConfigSettings.getInstance().getMaxGameThreads()
|
||||
));
|
||||
roomUsersView = roomUserInfo;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ public class ReplayManager {
|
|||
|
||||
private ReplayManager() {}
|
||||
|
||||
private final ConcurrentHashMap<String, ReplaySession> replaySessions = new ConcurrentHashMap<String, ReplaySession>();
|
||||
private final ConcurrentHashMap<String, ReplaySession> replaySessions = new ConcurrentHashMap<>();
|
||||
|
||||
public void replayGame(UUID gameId, UUID userId) {
|
||||
ReplaySession replaySession = new ReplaySession(gameId, userId);
|
||||
|
|
|
@ -37,6 +37,7 @@ public class SystemUtil {
|
|||
* 3b. Parse next line (go to 2.), If EOF go to 4.<br/>
|
||||
* 4. Log message to all players that cards were added (to prevent unfair play).<br/>
|
||||
* 5. Exit<br/>
|
||||
* @param game
|
||||
*/
|
||||
public static void addCardsForTesting(Game game) {
|
||||
try {
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.continious.BoostSourceEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilitySourceEffect;
|
||||
|
@ -73,11 +73,11 @@ public class BantSureblade extends CardImpl {
|
|||
// As long as you control another multicolored permanent, Bant Sureblade gets +1/+1 and has first strike.
|
||||
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(
|
||||
new BoostSourceEffect(1,1, Duration.WhileOnBattlefield),
|
||||
new ControlsPermanentCondition(filter),
|
||||
new PermanentsOnTheBattlefieldCondition(filter),
|
||||
"As long as you control another multicolored permanent, {this} gets +1/+1"));
|
||||
ability.addEffect(new ConditionalContinousEffect(
|
||||
new GainAbilitySourceEffect(FirstStrikeAbility.getInstance()),
|
||||
new ControlsPermanentCondition(filter),
|
||||
new PermanentsOnTheBattlefieldCondition(filter),
|
||||
"and has first strike"));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.continious.BoostSourceEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilitySourceEffect;
|
||||
|
@ -73,11 +73,11 @@ public class EsperStormblade extends CardImpl {
|
|||
// As long as you control another multicolored permanent, Esper Stormblade gets +1/+1 and has flying.
|
||||
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(
|
||||
new BoostSourceEffect(1,1, Duration.WhileOnBattlefield),
|
||||
new ControlsPermanentCondition(filter),
|
||||
new PermanentsOnTheBattlefieldCondition(filter),
|
||||
"As long as you control another multicolored permanent, {this} gets +1/+1"));
|
||||
ability.addEffect(new ConditionalContinousEffect(
|
||||
new GainAbilitySourceEffect(FlyingAbility.getInstance()),
|
||||
new ControlsPermanentCondition(filter),
|
||||
new PermanentsOnTheBattlefieldCondition(filter),
|
||||
"and has flying"));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.continious.BoostSourceEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilitySourceEffect;
|
||||
|
@ -73,11 +73,11 @@ public class GrixisGrimblade extends CardImpl {
|
|||
// As long as you control another multicolored permanent, Grixis Grimblade gets +1/+1 and has deathtouch.
|
||||
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(
|
||||
new BoostSourceEffect(1,1, Duration.WhileOnBattlefield),
|
||||
new ControlsPermanentCondition(filter),
|
||||
new PermanentsOnTheBattlefieldCondition(filter),
|
||||
"As long as you control another multicolored permanent, {this} gets +1/+1"));
|
||||
ability.addEffect(new ConditionalContinousEffect(
|
||||
new GainAbilitySourceEffect(DeathtouchAbility.getInstance()),
|
||||
new ControlsPermanentCondition(filter),
|
||||
new PermanentsOnTheBattlefieldCondition(filter),
|
||||
"and has deathtouch"));
|
||||
this.addAbility(ability);
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.continious.BoostSourceEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilitySourceEffect;
|
||||
|
@ -73,11 +73,11 @@ public class JundHackblade extends CardImpl {
|
|||
// As long as you control another multicolored permanent, Jund Hackblade gets +1/+1 and has haste.
|
||||
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(
|
||||
new BoostSourceEffect(1,1, Duration.WhileOnBattlefield),
|
||||
new ControlsPermanentCondition(filter),
|
||||
new PermanentsOnTheBattlefieldCondition(filter),
|
||||
"As long as you control another multicolored permanent, {this} gets +1/+1"));
|
||||
ability.addEffect(new ConditionalContinousEffect(
|
||||
new GainAbilitySourceEffect(HasteAbility.getInstance()),
|
||||
new ControlsPermanentCondition(filter),
|
||||
new PermanentsOnTheBattlefieldCondition(filter),
|
||||
"and has haste"));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.continious.BoostSourceEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilitySourceEffect;
|
||||
|
@ -73,11 +73,11 @@ public class NayaHushblade extends CardImpl {
|
|||
// As long as you control another multicolored permanent, Naya Hushblade gets +1/+1 and has shroud.
|
||||
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(
|
||||
new BoostSourceEffect(1,1, Duration.WhileOnBattlefield),
|
||||
new ControlsPermanentCondition(filter),
|
||||
new PermanentsOnTheBattlefieldCondition(filter),
|
||||
"As long as you control another multicolored permanent, Naya Hushblade gets +1/+1"));
|
||||
ability.addEffect(new ConditionalContinousEffect(
|
||||
new GainAbilitySourceEffect(ShroudAbility.getInstance()),
|
||||
new ControlsPermanentCondition(filter),
|
||||
new PermanentsOnTheBattlefieldCondition(filter),
|
||||
" and has shroud"));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ public class BanishingStroke extends CardImpl {
|
|||
this.getSpellAbility().addTarget(new TargetPermanent(filter));
|
||||
|
||||
// Miracle {W}
|
||||
this.addAbility(new MiracleAbility(new ManaCostsImpl("{W}")));
|
||||
this.addAbility(new MiracleAbility(this, new ManaCostsImpl("{W}")));
|
||||
}
|
||||
|
||||
public BanishingStroke(final BanishingStroke card) {
|
||||
|
|
|
@ -58,7 +58,7 @@ public class BlessingsOfNature extends CardImpl {
|
|||
this.getSpellAbility().addEffect(new BlessingsOfNatureEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(4));
|
||||
|
||||
this.addAbility(new MiracleAbility(new ManaCostsImpl("{G}")));
|
||||
this.addAbility(new MiracleAbility(this, new ManaCostsImpl("{G}")));
|
||||
}
|
||||
|
||||
public BlessingsOfNature(final BlessingsOfNature card) {
|
||||
|
|
|
@ -61,7 +61,7 @@ public class BonfireOfTheDamned extends CardImpl {
|
|||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
|
||||
// Miracle {X}{R}
|
||||
this.addAbility(new MiracleAbility(new ManaCostsImpl("{X}{R}")));
|
||||
this.addAbility(new MiracleAbility(this, new ManaCostsImpl("{X}{R}")));
|
||||
}
|
||||
|
||||
public BonfireOfTheDamned(final BonfireOfTheDamned card) {
|
||||
|
|
|
@ -58,7 +58,7 @@ public class DevastationTide extends CardImpl {
|
|||
this.getSpellAbility().addEffect(new DevastationTideEffect());
|
||||
|
||||
// Miracle {1}{U}
|
||||
this.addAbility(new MiracleAbility(new ManaCostsImpl("{1}{U}")));
|
||||
this.addAbility(new MiracleAbility(this, new ManaCostsImpl("{1}{U}")));
|
||||
}
|
||||
|
||||
public DevastationTide(final DevastationTide card) {
|
||||
|
|
|
@ -55,7 +55,7 @@ public class EntreatTheAngels extends CardImpl {
|
|||
this.getSpellAbility().addEffect(new CreateTokenEffect(new AngelToken(), new ManacostVariableValue()));
|
||||
|
||||
// Miracle {X}{W}{W}
|
||||
this.addAbility(new MiracleAbility(new ManaCostsImpl("{X}{W}{W}")));
|
||||
this.addAbility(new MiracleAbility(this, new ManaCostsImpl("{X}{W}{W}")));
|
||||
}
|
||||
|
||||
public EntreatTheAngels(final EntreatTheAngels card) {
|
||||
|
|
|
@ -55,6 +55,8 @@ public class RainOfThorns extends CardImpl {
|
|||
// Choose one or more - Destroy target artifact; destroy target enchantment; and/or destroy target land.
|
||||
this.getSpellAbility().addEffect(new DestroyTargetEffect());
|
||||
this.getSpellAbility().addTarget(new TargetArtifactPermanent());
|
||||
this.getSpellAbility().getModes().setMaxModes(1);
|
||||
this.getSpellAbility().getModes().setMaxModes(3);
|
||||
|
||||
Mode mode1 = new Mode();
|
||||
mode1.getEffects().add(new DestroyTargetEffect());
|
||||
|
@ -65,24 +67,6 @@ public class RainOfThorns extends CardImpl {
|
|||
mode2.getEffects().add(new DestroyTargetEffect());
|
||||
mode2.getTargets().add(new TargetPermanent(new FilterLandPermanent()));
|
||||
this.getSpellAbility().addMode(mode2);
|
||||
|
||||
Mode mode3 = new Mode();
|
||||
mode3.getEffects().add(new DestroyTargetEffect("Destroy target artifact, then destroy target enchantment"));
|
||||
mode3.getTargets().add(new TargetArtifactPermanent());
|
||||
mode3.getTargets().add(new TargetPermanent(new FilterEnchantment()));
|
||||
this.getSpellAbility().addMode(mode3);
|
||||
|
||||
Mode mode4 = new Mode();
|
||||
mode4.getEffects().add(new DestroyTargetEffect("Destroy target artifact, then destroy target land"));
|
||||
mode4.getTargets().add(new TargetArtifactPermanent());
|
||||
mode4.getTargets().add(new TargetPermanent(new FilterLandPermanent()));
|
||||
this.getSpellAbility().addMode(mode4);
|
||||
|
||||
Mode mode5 = new Mode();
|
||||
mode5.getEffects().add(new DestroyTargetEffect("Destroy target enchantment, then destroy target land"));
|
||||
mode5.getTargets().add(new TargetPermanent(new FilterEnchantment()));
|
||||
mode5.getTargets().add(new TargetPermanent(new FilterLandPermanent()));
|
||||
this.getSpellAbility().addMode(mode5);
|
||||
}
|
||||
|
||||
public RainOfThorns(final RainOfThorns card) {
|
||||
|
|
|
@ -55,7 +55,8 @@ public class ReforgeTheSoul extends CardImpl {
|
|||
// Each player discards his or her hand, then draws seven cards.
|
||||
this.getSpellAbility().addEffect(new ReforgeTheSoulEffect());
|
||||
|
||||
this.addAbility(new MiracleAbility(new ManaCostsImpl("{1}{R}")));
|
||||
// Miracle {1}{R}
|
||||
this.addAbility(new MiracleAbility(this, new ManaCostsImpl("{1}{R}")));
|
||||
}
|
||||
|
||||
public ReforgeTheSoul(final ReforgeTheSoul card) {
|
||||
|
|
|
@ -65,7 +65,8 @@ public class RevengeOfTheHunted extends CardImpl {
|
|||
effect.setText("and all creatures able to block it this turn do so");
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
|
||||
this.addAbility(new MiracleAbility(new ManaCostsImpl("{G}")));
|
||||
// Miracle {G}
|
||||
this.addAbility(new MiracleAbility(this, new ManaCostsImpl("{G}")));
|
||||
}
|
||||
|
||||
public RevengeOfTheHunted(final RevengeOfTheHunted card) {
|
||||
|
|
|
@ -33,7 +33,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
|
@ -62,7 +62,7 @@ public class ScrollOfAvacyn extends CardImpl {
|
|||
// {1}, Sacrifice Scroll of Avacyn: Draw a card. If you control an Angel, you gain 5 life.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new GenericManaCost(1));
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
ability.addEffect(new ConditionalOneShotEffect(new GainLifeEffect(5), new ControlsPermanentCondition(filter), "If you control an Angel, you gain 5 life"));
|
||||
ability.addEffect(new ConditionalOneShotEffect(new GainLifeEffect(5), new PermanentsOnTheBattlefieldCondition(filter), "If you control an Angel, you gain 5 life"));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
|
@ -63,7 +63,7 @@ public class ScrollOfGriselbrand extends CardImpl {
|
|||
// {1}, Sacrifice Scroll of Griselbrand: Target opponent discards a card. If you control a Demon, that player loses 3 life.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DiscardTargetEffect(1), new GenericManaCost(1));
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
ability.addEffect(new ConditionalOneShotEffect(new LoseLifeTargetEffect(3), new ControlsPermanentCondition(filter), "If you control a Demon, that player loses 3 life"));
|
||||
ability.addEffect(new ConditionalOneShotEffect(new LoseLifeTargetEffect(3), new PermanentsOnTheBattlefieldCondition(filter), "If you control a Demon, that player loses 3 life"));
|
||||
ability.addTarget(new TargetOpponent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ public class TemporalMastery extends CardImpl {
|
|||
this.getSpellAbility().addEffect(ExileSpellEffect.getInstance());
|
||||
|
||||
// Miracle {1}{U}
|
||||
this.addAbility(new MiracleAbility(new ManaCostsImpl("{1}{U}")));
|
||||
this.addAbility(new MiracleAbility(this, new ManaCostsImpl("{1}{U}")));
|
||||
}
|
||||
|
||||
public TemporalMastery(final TemporalMastery card) {
|
||||
|
|
|
@ -58,7 +58,7 @@ public class Terminus extends CardImpl {
|
|||
// Put all creatures on the bottom of their owners' libraries.
|
||||
this.getSpellAbility().addEffect(new TerminusEffect());
|
||||
|
||||
this.addAbility(new MiracleAbility(new ManaCostsImpl("{W}")));
|
||||
this.addAbility(new MiracleAbility(this, new ManaCostsImpl("{W}")));
|
||||
}
|
||||
|
||||
public Terminus(final Terminus card) {
|
||||
|
|
|
@ -52,7 +52,8 @@ public class ThunderousWrath extends CardImpl {
|
|||
this.getSpellAbility().addEffect(new DamageTargetEffect(5));
|
||||
this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
|
||||
|
||||
this.addAbility(new MiracleAbility(new ManaCostsImpl("{R}")));
|
||||
// Miracle {R}
|
||||
this.addAbility(new MiracleAbility(this, new ManaCostsImpl("{R}")));
|
||||
}
|
||||
|
||||
public ThunderousWrath(final ThunderousWrath card) {
|
||||
|
|
|
@ -54,7 +54,7 @@ public class Vanishment extends CardImpl {
|
|||
this.getSpellAbility().addTarget(new TargetNonlandPermanent());
|
||||
|
||||
// Miracle {U}
|
||||
this.addAbility(new MiracleAbility(new ManaCostsImpl("{U}")));
|
||||
this.addAbility(new MiracleAbility(this, new ManaCostsImpl("{U}")));
|
||||
}
|
||||
|
||||
public Vanishment(final Vanishment card) {
|
||||
|
|
|
@ -29,7 +29,7 @@ package mage.sets.betrayersofkamigawa;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.costs.common.ExileFromGraveCost;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
|
@ -70,7 +70,7 @@ public class HorobisWhisper extends CardImpl {
|
|||
|
||||
// If you control a Swamp, destroy target nonblack creature.
|
||||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new DestroyTargetEffect(),
|
||||
new ControlsPermanentCondition(filterCondition),"If you control a Swamp, destroy target nonblack creature"));
|
||||
new PermanentsOnTheBattlefieldCondition(filterCondition),"If you control a Swamp, destroy target nonblack creature"));
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filterTarget) );
|
||||
|
||||
// Splice onto Arcane-Exile four cards from your graveyard.
|
||||
|
|
|
@ -37,7 +37,7 @@ import mage.constants.Zone;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
import mage.abilities.effects.common.continious.ControlEnchantedEffect;
|
||||
|
@ -79,7 +79,7 @@ public class MarkOfTheOni extends CardImpl {
|
|||
this.addAbility(new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD,
|
||||
new SacrificeSourceEffect(),
|
||||
TargetController.ANY,
|
||||
new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 1),
|
||||
new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.FEWER_THAN, 1),
|
||||
false));
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardControllerEffect;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
|
@ -71,7 +71,7 @@ public class GutwrencherOni extends CardImpl {
|
|||
// At the beginning of your upkeep, discard a card if you don't control an Ogre.
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new ConditionalOneShotEffect(
|
||||
new DiscardControllerEffect(1),
|
||||
new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.EQUAL_TO, 0),
|
||||
new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.EQUAL_TO, 0),
|
||||
"discard a card if you don't control an Ogre"), TargetController.YOU, false));
|
||||
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ import mage.constants.Duration;
|
|||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.continious.BoostSourceEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilitySourceEffect;
|
||||
|
@ -72,9 +72,9 @@ public class KondasHatamoto extends CardImpl{
|
|||
|
||||
this.addAbility(new BushidoAbility(1));
|
||||
|
||||
ConditionalContinousEffect effect1 = new ConditionalContinousEffect(new BoostSourceEffect(1, 2, Duration.WhileOnBattlefield), new ControlsPermanentCondition(filter), rule1);
|
||||
ConditionalContinousEffect effect1 = new ConditionalContinousEffect(new BoostSourceEffect(1, 2, Duration.WhileOnBattlefield), new PermanentsOnTheBattlefieldCondition(filter), rule1);
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect1));
|
||||
ConditionalContinousEffect effect2 = new ConditionalContinousEffect(new GainAbilitySourceEffect(VigilanceAbility.getInstance()), new ControlsPermanentCondition(filter), rule2);
|
||||
ConditionalContinousEffect effect2 = new ConditionalContinousEffect(new GainAbilitySourceEffect(VigilanceAbility.getInstance()), new PermanentsOnTheBattlefieldCondition(filter), rule2);
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect2));
|
||||
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ class BlockTappedEffect extends AsThoughEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
Permanent permanent = game.getPermanent(sourceId);
|
||||
if (permanent != null && permanent.getControllerId().equals(source.getControllerId())) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ import mage.constants.Zone;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
|
@ -75,7 +75,7 @@ public class OrochiEggwatcher extends CardImpl {
|
|||
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SnakeToken()),new ManaCostsImpl("{2}{G}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addEffect(new ConditionalOneShotEffect(new FlipSourceEffect(new ShidakoBroodmistress()),
|
||||
new ControlsPermanentCondition(new FilterControlledCreaturePermanent(),ControlsPermanentCondition.CountType.MORE_THAN, 9),"If you control ten or more creatures, flip {this}"));
|
||||
new PermanentsOnTheBattlefieldCondition(new FilterControlledCreaturePermanent(),PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 9),"If you control ten or more creatures, flip {this}"));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ import java.util.UUID;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.common.CantBlockAbility;
|
||||
import mage.abilities.costs.mana.ColoredManaCost;
|
||||
import mage.abilities.decorator.ConditionalGainActivatedAbility;
|
||||
|
@ -68,11 +68,11 @@ public class VillainousOgre extends CardImpl {
|
|||
this.addAbility(new CantBlockAbility());
|
||||
|
||||
// As long as you control a Demon, Villainous Ogre has "{B}: Regenerate Villainous Ogre.
|
||||
this.addAbility( new ConditionalGainActivatedAbility(
|
||||
this.addAbility(new ConditionalGainActivatedAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new RegenerateSourceEffect(),
|
||||
new ColoredManaCost(ColoredManaSymbol.B),
|
||||
new ControlsPermanentCondition(filter),
|
||||
new PermanentsOnTheBattlefieldCondition(filter),
|
||||
rule));
|
||||
}
|
||||
|
||||
|
|
79
Mage.Sets/src/mage/sets/commander/ChampionsHelm.java
Normal file
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* 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.commander;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.EquippedHasSupertypeCondition;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.continious.BoostEquippedEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilityAttachedEffect;
|
||||
import mage.abilities.keyword.EquipAbility;
|
||||
import mage.abilities.keyword.HexproofAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.AttachmentType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class ChampionsHelm extends CardImpl {
|
||||
|
||||
private static final String staticText = "As long as equipped creature is legendary, it has hexproof";
|
||||
|
||||
public ChampionsHelm(UUID ownerId) {
|
||||
super(ownerId, 244, "Champion's Helm", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||
this.expansionSetCode = "CMD";
|
||||
this.subtype.add("Equipment");
|
||||
|
||||
// Equipped creature gets +2/+2.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2)));
|
||||
|
||||
// As long as equipped creature is legendary, it has hexproof.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(
|
||||
new GainAbilityAttachedEffect(HexproofAbility.getInstance(), AttachmentType.EQUIPMENT),
|
||||
new EquippedHasSupertypeCondition("Legendary"), staticText)));
|
||||
|
||||
// Equip {1}
|
||||
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(1)));
|
||||
}
|
||||
|
||||
public ChampionsHelm(final ChampionsHelm card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChampionsHelm copy() {
|
||||
return new ChampionsHelm(this);
|
||||
}
|
||||
}
|
|
@ -31,8 +31,8 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition.CountType;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -75,12 +75,12 @@ public class DuergarHedgeMage extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// When Duergar Hedge-Mage enters the battlefield, if you control two or more Mountains, you may destroy target artifact.
|
||||
Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), true), new ControlsPermanentCondition(filter, CountType.MORE_THAN, 1), rule1);
|
||||
Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), true), new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1), rule1);
|
||||
ability.addTarget(new TargetArtifactPermanent());
|
||||
this.addAbility(ability);
|
||||
|
||||
// When Duergar Hedge-Mage enters the battlefield, if you control two or more Plains, you may destroy target enchantment.
|
||||
Ability ability2 = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), true), new ControlsPermanentCondition(filter2, CountType.MORE_THAN, 1), rule2);
|
||||
Ability ability2 = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), true), new PermanentsOnTheBattlefieldCondition(filter2, CountType.MORE_THAN, 1), rule2);
|
||||
ability2.addTarget(new TargetPermanent(filter3));
|
||||
this.addAbility(ability2);
|
||||
|
||||
|
|
|
@ -31,8 +31,8 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition.CountType;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
|
@ -77,11 +77,11 @@ public class GwyllionHedgeMage extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// When Gwyllion Hedge-Mage enters the battlefield, if you control two or more Plains, you may put a 1/1 white Kithkin Soldier creature token onto the battlefield.
|
||||
Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new KithkinToken()), true), new ControlsPermanentCondition(filter, CountType.MORE_THAN, 1), rule1);
|
||||
Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new KithkinToken()), true), new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1), rule1);
|
||||
this.addAbility(ability);
|
||||
|
||||
// When Gwyllion Hedge-Mage enters the battlefield, if you control two or more Swamps, you may put a -1/-1 counter on target creature.
|
||||
Ability ability2 = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new AddCountersTargetEffect(CounterType.M1M1.createInstance()), true), new ControlsPermanentCondition(filter2, CountType.MORE_THAN, 1), rule2);
|
||||
Ability ability2 = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new AddCountersTargetEffect(CounterType.M1M1.createInstance()), true), new PermanentsOnTheBattlefieldCondition(filter2, CountType.MORE_THAN, 1), rule2);
|
||||
ability2.addTarget(new TargetPermanent(filter3));
|
||||
this.addAbility(ability2);
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
package mage.sets.commander;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.costs.AlternativeCostSourceAbility;
|
||||
import mage.abilities.costs.common.GainLifeOpponentCost;
|
||||
import mage.abilities.effects.common.continious.BoostTargetEffect;
|
||||
|
@ -59,7 +59,7 @@ public class Invigorate extends CardImpl {
|
|||
this.color.setGreen(true);
|
||||
|
||||
// If you control a Forest, rather than pay Invigorate's mana cost, you may have an opponent gain 3 life.
|
||||
this.addAbility(new AlternativeCostSourceAbility(new GainLifeOpponentCost(3), new ControlsPermanentCondition(filter)));
|
||||
this.addAbility(new AlternativeCostSourceAbility(new GainLifeOpponentCost(3), new PermanentsOnTheBattlefieldCondition(filter)));
|
||||
// Target creature gets +4/+4 until end of turn.
|
||||
this.getSpellAbility().addEffect(new BoostTargetEffect(4,4,Duration.EndOfTurn));
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.keyword.DeathtouchAbility;
|
||||
|
@ -62,7 +62,7 @@ public class Ophiomancer extends CardImpl {
|
|||
// At the beginning of each upkeep, if you control no Snakes, put a 1/1 black Snake creature token with deathtouch onto the battlefield.
|
||||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new OphiomancerSnakeToken()), TargetController.ANY, false),
|
||||
new ControlsPermanentCondition(new FilterCreaturePermanent("Snake", "no Snakes"), ControlsPermanentCondition.CountType.EQUAL_TO, 0),
|
||||
new PermanentsOnTheBattlefieldCondition(new FilterCreaturePermanent("Snake", "no Snakes"), PermanentsOnTheBattlefieldCondition.CountType.EQUAL_TO, 0),
|
||||
"At the beginning of each upkeep, if you control no Snakes, put a 1/1 black Snake creature token with deathtouch onto the battlefield."));
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ package mage.sets.commander2013;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
|
||||
|
@ -48,6 +49,7 @@ import mage.filter.common.FilterCreaturePermanent;
|
|||
import mage.filter.predicate.permanent.AnotherPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
|
@ -114,21 +116,26 @@ class RoonOfTheHiddenRealmEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
if (getTargetPointer().getFirst(game, source) != null) {
|
||||
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
Card card = game.getCard(getTargetPointer().getFirst(game, source));
|
||||
if (permanent != null) {
|
||||
if (permanent.moveToExile(source.getSourceId(), "Roon of the Hidden Realm", source.getSourceId(), game)) {
|
||||
if (card != null) {
|
||||
AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(card.getOwnerId());
|
||||
game.addDelayedTriggeredAbility(delayedAbility);
|
||||
return true;
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (controller != null && sourceObject != null) {
|
||||
if (getTargetPointer().getFirst(game, source) != null) {
|
||||
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
Card card = game.getCard(getTargetPointer().getFirst(game, source));
|
||||
if (permanent != null) {
|
||||
UUID exileId = UUID.randomUUID();
|
||||
if (controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getName(), source.getSourceId(), game, Zone.BATTLEFIELD)) {
|
||||
if (card != null) {
|
||||
AtEndOfTurnDelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(new ReturnFromExileEffect(exileId, Zone.BATTLEFIELD));
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(card.getOwnerId());
|
||||
game.addDelayedTriggeredAbility(delayedAbility);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ package mage.sets.commander2013;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.mana.ActivateIfConditionManaAbility;
|
||||
|
@ -56,7 +56,7 @@ public class TempleOfTheFalseGod extends CardImpl {
|
|||
Zone.BATTLEFIELD,
|
||||
new BasicManaEffect(Mana.ColorlessMana(2)),
|
||||
new TapSourceCost(),
|
||||
new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 4)));
|
||||
new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 4)));
|
||||
}
|
||||
|
||||
public TempleOfTheFalseGod(final TempleOfTheFalseGod card) {
|
||||
|
|
|
@ -34,7 +34,7 @@ import mage.constants.Rarity;
|
|||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilitySourceEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
|
@ -70,19 +70,17 @@ public class CliffrunnerBehemoth extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// Cliffrunner Behemoth has haste as long as you control a red permanent.
|
||||
this.addAbility(
|
||||
new SimpleStaticAbility(
|
||||
this.addAbility(new SimpleStaticAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new ConditionalContinousEffect(
|
||||
new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield),
|
||||
new ControlsPermanentCondition(redPermanentFilter), "{this} has haste as long as you control a red permanent")));
|
||||
new PermanentsOnTheBattlefieldCondition(redPermanentFilter), "{this} has haste as long as you control a red permanent")));
|
||||
// Cliffrunner Behemoth has lifelink as long as you control a white permanent.
|
||||
this.addAbility(
|
||||
new SimpleStaticAbility(
|
||||
this.addAbility(new SimpleStaticAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new ConditionalContinousEffect(
|
||||
new GainAbilitySourceEffect(LifelinkAbility.getInstance(), Duration.WhileOnBattlefield),
|
||||
new ControlsPermanentCondition(whitePermanentFilter), "{this} has lifelink as long as you control a white permanent")));
|
||||
new PermanentsOnTheBattlefieldCondition(whitePermanentFilter), "{this} has lifelink as long as you control a white permanent")));
|
||||
}
|
||||
|
||||
public CliffrunnerBehemoth(final CliffrunnerBehemoth card) {
|
||||
|
|
|
@ -34,7 +34,7 @@ import mage.constants.Rarity;
|
|||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.continious.BoostSourceEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilitySourceEffect;
|
||||
|
@ -67,18 +67,16 @@ public class EmberWeaver extends CardImpl {
|
|||
|
||||
this.addAbility(ReachAbility.getInstance());
|
||||
// As long as you control a red permanent, Ember Weaver gets +1/+0 and has first strike.
|
||||
this.addAbility(
|
||||
new SimpleStaticAbility(
|
||||
this.addAbility(new SimpleStaticAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new ConditionalContinousEffect(
|
||||
new BoostSourceEffect(1, 0, Duration.WhileOnBattlefield),
|
||||
new ControlsPermanentCondition(redPermanentFilter), "{this} gets +1/+0 as long as you control a red permanent")));
|
||||
this.addAbility(
|
||||
new SimpleStaticAbility(
|
||||
new PermanentsOnTheBattlefieldCondition(redPermanentFilter), "{this} gets +1/+0 as long as you control a red permanent")));
|
||||
this.addAbility(new SimpleStaticAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new ConditionalContinousEffect(
|
||||
new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.WhileOnBattlefield),
|
||||
new ControlsPermanentCondition(redPermanentFilter), "{this} has first strike as long as you control a red permanent")));
|
||||
new PermanentsOnTheBattlefieldCondition(redPermanentFilter), "{this} has first strike as long as you control a red permanent")));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ import mage.ObjectColor;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
|
@ -81,7 +81,7 @@ public class MirrorSigilSergeant extends CardImpl {
|
|||
|
||||
// At the beginning of your upkeep, if you control a blue permanent, you may put a token that's a copy of Mirror-Sigil Sergeant onto the battlefield.
|
||||
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new MirrorSigilSergeantEffect(), TargetController.YOU, true);
|
||||
this.addAbility(new ConditionalTriggeredAbility(ability, new ControlsPermanentCondition(filter), rule));
|
||||
this.addAbility(new ConditionalTriggeredAbility(ability, new PermanentsOnTheBattlefieldCondition(filter), rule));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ import mage.MageInt;
|
|||
import mage.ObjectColor;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -67,7 +67,7 @@ public class RhoxMeditant extends CardImpl {
|
|||
|
||||
// When Rhox Meditant enters the battlefield, if you control a green permanent, draw a card.
|
||||
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1), false);
|
||||
this.addAbility(new ConditionalTriggeredAbility(ability, new ControlsPermanentCondition(filter), rule));
|
||||
this.addAbility(new ConditionalTriggeredAbility(ability, new PermanentsOnTheBattlefieldCondition(filter), rule));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ import mage.MageInt;
|
|||
import mage.ObjectColor;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.ReturnToHandTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -69,7 +69,7 @@ public class SedraxisAlchemist extends CardImpl {
|
|||
// When Sedraxis Alchemist enters the battlefield, if you control a blue permanent, return target nonland permanent to its owner's hand.
|
||||
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), false);
|
||||
ability.addTarget(new TargetNonlandPermanent());
|
||||
this.addAbility(new ConditionalTriggeredAbility(ability, new ControlsPermanentCondition(filter), rule));
|
||||
this.addAbility(new ConditionalTriggeredAbility(ability, new PermanentsOnTheBattlefieldCondition(filter), rule));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import mage.constants.Zone;
|
|||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilitySourceEffect;
|
||||
import mage.abilities.keyword.DeathtouchAbility;
|
||||
|
@ -67,7 +67,7 @@ public class ToxicIguanar extends CardImpl {
|
|||
// Toxic Iguanar has deathtouch as long as you control a green permanent.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
|
||||
new ConditionalContinousEffect(new GainAbilitySourceEffect(DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield),
|
||||
new ControlsPermanentCondition(filter), "{this} has deathtouch as long as you control a green permanent")));
|
||||
new PermanentsOnTheBattlefieldCondition(filter), "{this} has deathtouch as long as you control a green permanent")));
|
||||
}
|
||||
|
||||
public ToxicIguanar(final ToxicIguanar card) {
|
||||
|
|
|
@ -33,7 +33,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -65,7 +65,7 @@ public class OpalLakeGatekeepers extends CardImpl {
|
|||
// When Opal Lake Gatekeepers enters the battlefield, if you control two or more Gates, you may draw a card.
|
||||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1)),
|
||||
new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 1),
|
||||
new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 1),
|
||||
"When Opal Lake Gatekeepers enters the battlefield, if you control two or more Gates, you may draw a card."));
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -65,7 +65,7 @@ public class SaruliGatekeepers extends CardImpl {
|
|||
// When Saruli Gatekeepers enters the battlefield, if you control two or more Gates, gain 7 life.
|
||||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
new EntersBattlefieldTriggeredAbility(new GainLifeEffect(7)),
|
||||
new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 1),
|
||||
new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 1),
|
||||
"When {this} enters the battlefield, if you control two or more Gates, gain 7 life."));
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ import mage.constants.TargetController;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.UntapTargetEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
|
||||
|
@ -78,7 +78,7 @@ public class SmeltWardGatekeepers extends CardImpl {
|
|||
// When Smelt-Ward Gatekeepers enters the battlefield, if you control two or more Gates, gain control of target creature an opponent controls until end of turn. Untap that creature. That creature gains haste until end of turn.
|
||||
Ability ability = new ConditionalTriggeredAbility(
|
||||
new EntersBattlefieldTriggeredAbility(new GainControlTargetEffect(Duration.EndOfTurn)),
|
||||
new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 1),
|
||||
new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 1),
|
||||
"When {this} enters the battlefield, if you control two or more Gates, gain control of target creature an opponent controls until end of turn. Untap that creature. That creature gains haste until end of turn.");
|
||||
ability.addEffect(new UntapTargetEffect());
|
||||
ability.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn));
|
||||
|
|
|
@ -33,7 +33,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -66,7 +66,7 @@ public class SunspireGatekeepers extends CardImpl {
|
|||
// When Sunspire Gatekeepers enter the battlefield, if you control two or more Gates, put a 2/2 white Knight creature token with vigilance onto the battlefield.
|
||||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new KnightToken())),
|
||||
new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 1),
|
||||
new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 1),
|
||||
"When {this} enter the battlefield, if you control two or more Gates, put a 2/2 white Knight creature token with vigilance onto the battlefield."));
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import mage.constants.TargetController;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -74,7 +74,7 @@ public class UbulSarGatekeepers extends CardImpl {
|
|||
// Whenever Ubul Sar Gatekeepers enters the battlefield, if you control two or more Gates, target creature an opponent controls gets -2/-2 until end of turn.
|
||||
Ability ability = new ConditionalTriggeredAbility(
|
||||
new EntersBattlefieldTriggeredAbility(new AddCountersTargetEffect(CounterType.M1M1.createInstance(2))),
|
||||
new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 1),
|
||||
new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 1),
|
||||
"Whenever {this} enters the battlefield, if you control two or more Gates, target creature an opponent controls gets -2/-2 until end of turn.");
|
||||
Target target = new TargetCreaturePermanent(targetFilter);
|
||||
ability.addTarget(target);
|
||||
|
|
|
@ -31,8 +31,8 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition.CountType;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.discard.DiscardTargetEffect;
|
||||
import mage.abilities.effects.common.PutOnLibraryTargetEffect;
|
||||
|
@ -74,12 +74,12 @@ public class HagHedgeMage extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// When Hag Hedge-Mage enters the battlefield, if you control two or more Swamps, you may have target player discard a card.
|
||||
Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new DiscardTargetEffect(1), true), new ControlsPermanentCondition(filter, CountType.MORE_THAN, 1), rule, true);
|
||||
Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new DiscardTargetEffect(1), true), new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1), rule, true);
|
||||
ability.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability);
|
||||
|
||||
// When Hag Hedge-Mage enters the battlefield, if you control two or more Forests, you may put target card from your graveyard on top of your library.
|
||||
Ability ability2 = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new PutOnLibraryTargetEffect(true), true), new ControlsPermanentCondition(filter2, CountType.MORE_THAN, 1), rule2, true);
|
||||
Ability ability2 = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new PutOnLibraryTargetEffect(true), true), new PermanentsOnTheBattlefieldCondition(filter2, CountType.MORE_THAN, 1), rule2, true);
|
||||
ability2.addTarget(new TargetCardInYourGraveyard());
|
||||
this.addAbility(ability2);
|
||||
}
|
||||
|
|
|
@ -31,8 +31,8 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition.CountType;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.TapTargetEffect;
|
||||
|
@ -75,12 +75,12 @@ public class NoggleHedgeMage extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// When Noggle Hedge-Mage enters the battlefield, if you control two or more Islands, you may tap two target permanents.
|
||||
Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new TapTargetEffect(), true), new ControlsPermanentCondition(filter, CountType.MORE_THAN, 1), rule, true);
|
||||
Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new TapTargetEffect(), true), new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1), rule, true);
|
||||
ability.addTarget(new TargetPermanent(2, new FilterPermanent()));
|
||||
this.addAbility(ability);
|
||||
|
||||
// When Noggle Hedge-Mage enters the battlefield, if you control two or more Mountains, you may have Noggle Hedge-Mage deal 2 damage to target player.
|
||||
Ability ability2 = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(2), true), new ControlsPermanentCondition(filter2, CountType.MORE_THAN, 1), rule2, true);
|
||||
Ability ability2 = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(2), true), new PermanentsOnTheBattlefieldCondition(filter2, CountType.MORE_THAN, 1), rule2, true);
|
||||
ability2.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability2);
|
||||
}
|
||||
|
|
|
@ -31,8 +31,8 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition.CountType;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.abilities.effects.common.ReturnToHandTargetEffect;
|
||||
|
@ -78,11 +78,11 @@ public class SelkieHedgeMage extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// When Selkie Hedge-Mage enters the battlefield, if you control two or more Forests, you may gain 3 life.
|
||||
Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(3), true), new ControlsPermanentCondition(filter, CountType.MORE_THAN, 1), rule1);
|
||||
Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(3), true), new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1), rule1);
|
||||
this.addAbility(ability);
|
||||
|
||||
// When Selkie Hedge-Mage enters the battlefield, if you control two or more Islands, you may return target tapped creature to its owner's hand.
|
||||
Ability ability2 = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), true), new ControlsPermanentCondition(filter2, CountType.MORE_THAN, 1), rule2);
|
||||
Ability ability2 = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), true), new PermanentsOnTheBattlefieldCondition(filter2, CountType.MORE_THAN, 1), rule2);
|
||||
ability2.addTarget(new TargetPermanent(filter3));
|
||||
this.addAbility(ability2);
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.StateTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SkipUntapOptionalAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.condition.common.SourceTappedCondition;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
|
@ -89,7 +89,7 @@ public class Seasinger extends CardImpl {
|
|||
// {tap}: Gain control of target creature whose controller controls an Island for as long as you control Seasinger and Seasinger remains tapped.
|
||||
ConditionalContinousEffect effect = new ConditionalContinousEffect(
|
||||
new GainControlTargetEffect(Duration.Custom),
|
||||
new ControlsPermanentCondition(seasinger, ControlsPermanentCondition.CountType.EQUAL_TO, 1, SourceTappedCondition.getInstance()), rule);
|
||||
new PermanentsOnTheBattlefieldCondition(seasinger, PermanentsOnTheBattlefieldCondition.CountType.EQUAL_TO, 1, SourceTappedCondition.getInstance()), rule);
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost());
|
||||
creatureWhoseControllerControlsIsland.add(new ControllerControlsIslandPredicate());
|
||||
ability.addTarget(new TargetCreaturePermanent(creatureWhoseControllerControlsIsland));
|
||||
|
|
|
@ -33,7 +33,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.effects.common.WinGameSourceControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.TargetController;
|
||||
|
@ -69,7 +69,7 @@ public class Biovisionary extends CardImpl {
|
|||
this.addAbility(new BeginningOfEndStepTriggeredAbility(
|
||||
Zone.BATTLEFIELD, new WinGameSourceControllerEffect(),
|
||||
TargetController.ANY,
|
||||
new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 3),
|
||||
new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 3),
|
||||
false));
|
||||
}
|
||||
|
||||
|
|
|
@ -92,10 +92,4 @@ public class ClanDefiance extends CardImpl {
|
|||
return new ClanDefiance(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getRules() {
|
||||
List<String> rules = new ArrayList<String>();
|
||||
rules.add("Choose one or more - Clan Defiance deals X damage to target creature with flying; Clan Defiance deals X damage to target creature without flying; and/or Clan Defiance deals X damage to target player.");
|
||||
return rules;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
|
@ -85,7 +85,7 @@ public class HellkiteTyrant extends CardImpl {
|
|||
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new WinGameSourceControllerEffect(), TargetController.YOU, false);
|
||||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
ability,
|
||||
new ControlsPermanentCondition(new FilterArtifactPermanent(), ControlsPermanentCondition.CountType.MORE_THAN,19),
|
||||
new PermanentsOnTheBattlefieldCondition(new FilterArtifactPermanent(), PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN,19),
|
||||
"At the beginning of your upkeep, if you control twenty or more artifacts, you win the game."));
|
||||
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ import mage.constants.Rarity;
|
|||
import mage.constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalRestrictionEffect;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
|
@ -81,7 +81,7 @@ public class WayOfTheThief extends CardImpl {
|
|||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Duration.WhileOnBattlefield)));
|
||||
|
||||
// Enchanted creature is unblockable as long as you control a Gate.
|
||||
Effect effect = new ConditionalRestrictionEffect(new UnblockableAttachedEffect(AttachmentType.AURA), new ControlsPermanentCondition(filter));
|
||||
Effect effect = new ConditionalRestrictionEffect(new UnblockableAttachedEffect(AttachmentType.AURA), new PermanentsOnTheBattlefieldCondition(filter));
|
||||
effect.setText(rule);
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ import mage.constants.Rarity;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilitySourceEffect;
|
||||
import mage.abilities.keyword.*;
|
||||
|
@ -69,9 +69,9 @@ public class AngelicOverseer extends CardImpl {
|
|||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// As long as you control a Human, Angelic Overseer has hexproof and is indestructible.
|
||||
ConditionalContinousEffect effect1 = new ConditionalContinousEffect(new GainAbilitySourceEffect(HexproofAbility.getInstance()), new ControlsPermanentCondition(filter), rule1);
|
||||
ConditionalContinousEffect effect1 = new ConditionalContinousEffect(new GainAbilitySourceEffect(HexproofAbility.getInstance()), new PermanentsOnTheBattlefieldCondition(filter), rule1);
|
||||
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect1);
|
||||
ConditionalContinousEffect effect2 = new ConditionalContinousEffect(new GainAbilitySourceEffect(IndestructibleAbility.getInstance()), new ControlsPermanentCondition(filter), rule2);
|
||||
ConditionalContinousEffect effect2 = new ConditionalContinousEffect(new GainAbilitySourceEffect(IndestructibleAbility.getInstance()), new PermanentsOnTheBattlefieldCondition(filter), rule2);
|
||||
ability.addEffect(effect2);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Rarity;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.TapSourceEffect;
|
||||
|
@ -60,7 +60,7 @@ public class ClifftopRetreat extends CardImpl {
|
|||
super(ownerId, 238, "Clifftop Retreat", Rarity.RARE, new CardType[]{CardType.LAND}, null);
|
||||
this.expansionSetCode = "ISD";
|
||||
|
||||
Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
|
||||
Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 0));
|
||||
String abilityText = "tap it unless you control a Mountain or a Plains";
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
|
||||
this.addAbility(new RedManaAbility());
|
||||
|
|
|
@ -32,7 +32,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Rarity;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.TapSourceEffect;
|
||||
|
@ -60,7 +60,7 @@ public class HinterlandHarbor extends CardImpl {
|
|||
super(ownerId, 241, "Hinterland Harbor", Rarity.RARE, new CardType[]{CardType.LAND}, null);
|
||||
this.expansionSetCode = "ISD";
|
||||
|
||||
Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
|
||||
Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 0));
|
||||
String abilityText = "tapped unless you control a Forest or an Island";
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
|
||||
this.addAbility(new GreenManaAbility());
|
||||
|
|
|
@ -32,7 +32,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Rarity;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.TapSourceEffect;
|
||||
|
@ -60,7 +60,7 @@ public class IsolatedChapel extends CardImpl {
|
|||
super(ownerId, 242, "Isolated Chapel", Rarity.RARE, new CardType[]{CardType.LAND}, null);
|
||||
this.expansionSetCode = "ISD";
|
||||
|
||||
Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
|
||||
Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 0));
|
||||
String abilityText = "tap it unless you control a Plains or a Swamp";
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
|
||||
this.addAbility(new WhiteManaAbility());
|
||||
|
|
|
@ -33,7 +33,7 @@ import mage.constants.*;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
|
@ -92,7 +92,7 @@ public class OliviaVoldaren extends CardImpl {
|
|||
this.addAbility(ability);
|
||||
|
||||
// {3}{B}{B}: Gain control of target Vampire for as long as you control Olivia Voldaren.
|
||||
ConditionalContinousEffect effect = new ConditionalContinousEffect(new GainControlTargetEffect(Duration.Custom), new ControlsPermanentCondition(filter2), rule);
|
||||
ConditionalContinousEffect effect = new ConditionalContinousEffect(new GainControlTargetEffect(Duration.Custom), new PermanentsOnTheBattlefieldCondition(filter2), rule);
|
||||
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{3}{B}{B}"));
|
||||
ability2.addTarget(new TargetCreaturePermanent(vampireFilter));
|
||||
this.addAbility(ability2);
|
||||
|
|
|
@ -32,7 +32,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Rarity;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.TapSourceEffect;
|
||||
|
@ -60,7 +60,7 @@ public class SulfurFalls extends CardImpl {
|
|||
super(ownerId, 248, "Sulfur Falls", Rarity.RARE, new CardType[]{CardType.LAND}, null);
|
||||
this.expansionSetCode = "ISD";
|
||||
|
||||
Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
|
||||
Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 0));
|
||||
String abilityText = "tap it unless you control a Island or a Mountain";
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
|
||||
this.addAbility(new BlueManaAbility());
|
||||
|
|
|
@ -32,7 +32,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Rarity;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.TapSourceEffect;
|
||||
|
@ -60,7 +60,7 @@ public class WoodlandCemetery extends CardImpl {
|
|||
super(ownerId, 249, "Woodland Cemetery", Rarity.RARE, new CardType[]{CardType.LAND}, null);
|
||||
this.expansionSetCode = "ISD";
|
||||
|
||||
Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
|
||||
Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 0));
|
||||
String abilityText = "tap it unless you control a Swamp or a Forest";
|
||||
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
|
||||
this.addAbility(new BlackManaAbility());
|
||||
|
|
|
@ -32,7 +32,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilityControlledEffect;
|
||||
|
@ -76,7 +76,7 @@ public class Anger extends CardImpl {
|
|||
ContinuousEffect effect = new GainAbilityControlledEffect(HasteAbility.getInstance(),
|
||||
Duration.WhileOnBattlefield, new FilterCreaturePermanent());
|
||||
ConditionalContinousEffect angerEffect = new ConditionalContinousEffect(effect,
|
||||
new ControlsPermanentCondition(filter), ruleText);
|
||||
new PermanentsOnTheBattlefieldCondition(filter), ruleText);
|
||||
this.addAbility(new SimpleStaticAbility(Zone.GRAVEYARD, angerEffect));
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilityControlledEffect;
|
||||
|
@ -76,7 +76,7 @@ public class Brawn extends CardImpl {
|
|||
ContinuousEffect effect = new GainAbilityControlledEffect(TrampleAbility.getInstance(),
|
||||
Duration.WhileOnBattlefield, new FilterCreaturePermanent());
|
||||
ConditionalContinousEffect brawnEffect = new ConditionalContinousEffect(effect,
|
||||
new ControlsPermanentCondition(filter), ruleText);
|
||||
new PermanentsOnTheBattlefieldCondition(filter), ruleText);
|
||||
this.addAbility(new SimpleStaticAbility(Zone.GRAVEYARD, brawnEffect));
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilityControlledEffect;
|
||||
|
@ -76,7 +76,7 @@ public class Filth extends CardImpl {
|
|||
ContinuousEffect effect = new GainAbilityControlledEffect(new SwampwalkAbility(),
|
||||
Duration.WhileOnBattlefield, new FilterCreaturePermanent());
|
||||
ConditionalContinousEffect filthEffect = new ConditionalContinousEffect(effect,
|
||||
new ControlsPermanentCondition(filter), ruleText);
|
||||
new PermanentsOnTheBattlefieldCondition(filter), ruleText);
|
||||
this.addAbility(new SimpleStaticAbility(Zone.GRAVEYARD, filthEffect));
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilityControlledEffect;
|
||||
|
@ -76,7 +76,7 @@ public class Valor extends CardImpl {
|
|||
ContinuousEffect effect = new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(),
|
||||
Duration.WhileOnBattlefield, new FilterCreaturePermanent());
|
||||
ConditionalContinousEffect valorEffect = new ConditionalContinousEffect(effect,
|
||||
new ControlsPermanentCondition(filter), ruleText);
|
||||
new PermanentsOnTheBattlefieldCondition(filter), ruleText);
|
||||
this.addAbility(new SimpleStaticAbility(Zone.GRAVEYARD, valorEffect));
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilityControlledEffect;
|
||||
|
@ -77,7 +77,7 @@ public class Wonder extends CardImpl {
|
|||
ContinuousEffect effect = new GainAbilityControlledEffect(FlyingAbility.getInstance(),
|
||||
Duration.WhileOnBattlefield, new FilterCreaturePermanent());
|
||||
ConditionalContinousEffect wonderEffect = new ConditionalContinousEffect(effect,
|
||||
new ControlsPermanentCondition(filter), ruleText);
|
||||
new PermanentsOnTheBattlefieldCondition(filter), ruleText);
|
||||
this.addAbility(new SimpleStaticAbility(Zone.GRAVEYARD, wonderEffect));
|
||||
}
|
||||
|
||||
|
|
|
@ -28,8 +28,8 @@
|
|||
package mage.sets.khansoftarkir;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.common.FerociousCondition;
|
||||
import mage.abilities.decorator.ConditionalRestrictionEffect;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DamageAllEffect;
|
||||
import mage.abilities.effects.common.combat.CantBlockAllEffect;
|
||||
|
@ -40,6 +40,7 @@ import mage.constants.Rarity;
|
|||
import mage.constants.TargetController;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -62,9 +63,7 @@ public class BarrageOfBoulders extends CardImpl {
|
|||
// Barrage of Boulders deals 1 damage to each creature you don't control.
|
||||
this.getSpellAbility().addEffect(new DamageAllEffect(1, filter));
|
||||
// Ferocious - If you control a creature with power 4 or greater, creatures can't block this turn
|
||||
Effect effect = new ConditionalRestrictionEffect(Duration.EndOfTurn,
|
||||
new CantBlockAllEffect(new FilterCreaturePermanent("creatures"), Duration.EndOfTurn),
|
||||
FerociousCondition.getInstance() , null);
|
||||
Effect effect = new BarrageOfBouldersCantBlockAllEffect(new FilterCreaturePermanent("creatures"), Duration.EndOfTurn);
|
||||
effect.setText("<br/><br/><i>Ferocious</i> - If you control a creature with power 4 or greater, creatures can't block this turn");
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
}
|
||||
|
@ -78,3 +77,27 @@ public class BarrageOfBoulders extends CardImpl {
|
|||
return new BarrageOfBoulders(this);
|
||||
}
|
||||
}
|
||||
|
||||
class BarrageOfBouldersCantBlockAllEffect extends CantBlockAllEffect {
|
||||
|
||||
public BarrageOfBouldersCantBlockAllEffect(FilterCreaturePermanent filter, Duration duration) {
|
||||
super(filter, duration);
|
||||
}
|
||||
|
||||
public BarrageOfBouldersCantBlockAllEffect(final BarrageOfBouldersCantBlockAllEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
if (!FerociousCondition.getInstance().apply(game, source)) {
|
||||
discard();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BarrageOfBouldersCantBlockAllEffect copy() {
|
||||
return new BarrageOfBouldersCantBlockAllEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -28,15 +28,17 @@
|
|||
package mage.sets.khansoftarkir;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.condition.common.FerociousCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.IntPlusDynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.target.common.TargetCreatureOrPlayer;
|
||||
|
||||
/**
|
||||
|
@ -52,17 +54,9 @@ public class CratersClaws extends CardImpl {
|
|||
this.color.setRed(true);
|
||||
|
||||
// Crater's Claws deals X damage to target creature or player.
|
||||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
|
||||
new DamageTargetEffect(new ManacostVariableValue()),
|
||||
new InvertCondition(FerociousCondition.getInstance()),
|
||||
"{this} deals X damage to target creature or player."));
|
||||
this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
|
||||
|
||||
// <i>Ferocious</i> - Crater's Claws deals X plus 2 damage to that creature or player instead if you control a creature with power 4 or greater.
|
||||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
|
||||
new DamageTargetEffect(new IntPlusDynamicValue(2, new ManacostVariableValue())),
|
||||
FerociousCondition.getInstance(),
|
||||
"<br><br><i>Ferocious</i> - Crater's Claws deals X plus 2 damage to that creature or player instead if you control a creature with power 4 or greater"));
|
||||
this.getSpellAbility().addEffect(new CratersClawsDamageTargetEffect(new ManacostVariableValue()));
|
||||
this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
|
||||
}
|
||||
|
||||
public CratersClaws(final CratersClaws card) {
|
||||
|
@ -74,3 +68,35 @@ public class CratersClaws extends CardImpl {
|
|||
return new CratersClaws(this);
|
||||
}
|
||||
}
|
||||
|
||||
class CratersClawsDamageTargetEffect extends DamageTargetEffect {
|
||||
|
||||
|
||||
public CratersClawsDamageTargetEffect(DynamicValue amount) {
|
||||
super(amount, false);
|
||||
}
|
||||
|
||||
public CratersClawsDamageTargetEffect(final CratersClawsDamageTargetEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CratersClawsDamageTargetEffect copy() {
|
||||
return new CratersClawsDamageTargetEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
if (FerociousCondition.getInstance().apply(game, source)) {
|
||||
amount = new IntPlusDynamicValue(2, new ManacostVariableValue());
|
||||
}
|
||||
return super.apply(game, source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
return "{this} deals X damage to target creature or player." +
|
||||
"<br><br><i>Ferocious</i> - {this} deals X plus 2 damage to that creature or player instead if you control a creature with power 4 or greater";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -28,16 +28,15 @@
|
|||
package mage.sets.khansoftarkir;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.common.FerociousCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.dynamicvalue.IntPlusDynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -52,16 +51,8 @@ public class FeedTheClan extends CardImpl {
|
|||
this.color.setGreen(true);
|
||||
|
||||
// You gain 5 life.
|
||||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
|
||||
new GainLifeEffect(5),
|
||||
new InvertCondition(FerociousCondition.getInstance()),
|
||||
"You gain 5 life"));
|
||||
|
||||
// Ferocious - You gain 10 life instead if you control a creature with power 4 or greater.
|
||||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
|
||||
new GainLifeEffect(10),
|
||||
FerociousCondition.getInstance(),
|
||||
"<br><br><i>Ferocious</i> - You gain 10 life instead if you control a creature with power 4 or greater"));
|
||||
// Ferocious - You gain 10 life instead if you control a creature with power 4 or greater
|
||||
this.getSpellAbility().addEffect(new FeedTheClanEffect());
|
||||
|
||||
}
|
||||
|
||||
|
@ -74,3 +65,34 @@ public class FeedTheClan extends CardImpl {
|
|||
return new FeedTheClan(this);
|
||||
}
|
||||
}
|
||||
|
||||
class FeedTheClanEffect extends OneShotEffect {
|
||||
|
||||
public FeedTheClanEffect() {
|
||||
super(Outcome.GainLife);
|
||||
this.staticText = "You gain 5 life. <br><br><i>Ferocious</i> - You gain 10 life instead if you control a creature with power 4 or greater";
|
||||
}
|
||||
|
||||
public FeedTheClanEffect(final FeedTheClanEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FeedTheClanEffect copy() {
|
||||
return new FeedTheClanEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
if (FerociousCondition.getInstance().apply(game, source)) {
|
||||
controller.gainLife(10, game);
|
||||
} else {
|
||||
controller.gainLife(5, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,6 @@ import java.util.UUID;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.condition.common.FerociousCondition;
|
||||
import mage.abilities.decorator.ConditionalContinuousRuleModifyingEffect;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.SkipNextUntapTargetEffect;
|
||||
import mage.abilities.effects.common.TapTargetEffect;
|
||||
|
@ -59,9 +58,7 @@ public class IcyBlast extends CardImpl {
|
|||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1, new FilterCreaturePermanent(), false));
|
||||
|
||||
// <i>Ferocious</i> - If you control a creature with power 4 or greater, those creatures don't untap during their controllers' next untap steps.
|
||||
Effect effect = new ConditionalContinuousRuleModifyingEffect(
|
||||
new SkipNextUntapTargetEffect(),
|
||||
FerociousCondition.getInstance());
|
||||
Effect effect = new IcyBlastSkipNextUntapTargetEffect();
|
||||
effect.setText("<br/><br/><i>Ferocious</i> - If you control a creature with power 4 or greater, those creatures don't untap during their controllers' next untap steps");
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
}
|
||||
|
@ -85,3 +82,31 @@ public class IcyBlast extends CardImpl {
|
|||
return new IcyBlast(this);
|
||||
}
|
||||
}
|
||||
|
||||
class IcyBlastSkipNextUntapTargetEffect extends SkipNextUntapTargetEffect {
|
||||
|
||||
public IcyBlastSkipNextUntapTargetEffect() {
|
||||
super();
|
||||
}
|
||||
|
||||
public IcyBlastSkipNextUntapTargetEffect(final IcyBlastSkipNextUntapTargetEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IcyBlastSkipNextUntapTargetEffect copy() {
|
||||
return new IcyBlastSkipNextUntapTargetEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
if (!FerociousCondition.getInstance().apply(game, source)) {
|
||||
discard();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,15 +33,20 @@ import mage.abilities.common.SimpleStaticAbility;
|
|||
import mage.abilities.condition.LockedInCondition;
|
||||
import mage.abilities.condition.common.FerociousCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.combat.MustBeBlockedByAllTargetEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
|
||||
import mage.abilities.keyword.IndestructibleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
|
@ -57,13 +62,10 @@ public class RoarOfChallenge extends CardImpl {
|
|||
this.color.setGreen(true);
|
||||
|
||||
// All creatures able to block target creature this turn do so.
|
||||
this.getSpellAbility().addEffect(new MustBeBlockedByAllTargetEffect(Duration.EndOfTurn));
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
// <i>Ferocious</i> - That creature gains indestructible until end of turn if you control a creature with power 4 or greater.
|
||||
this.getSpellAbility().addEffect(new ConditionalContinousEffect(
|
||||
new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn),
|
||||
new LockedInCondition(FerociousCondition.getInstance()),
|
||||
"<br/><br/><i>Ferocious</i> - That creature gains indestructible until end of turn if you control a creature with power 4 or greater"));
|
||||
this.getSpellAbility().addEffect(new MustBeBlockedByAllTargetEffect(Duration.EndOfTurn));
|
||||
this.getSpellAbility().addEffect(new RoarOfChallengeEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
}
|
||||
|
||||
public RoarOfChallenge(final RoarOfChallenge card) {
|
||||
|
@ -75,3 +77,34 @@ public class RoarOfChallenge extends CardImpl {
|
|||
return new RoarOfChallenge(this);
|
||||
}
|
||||
}
|
||||
|
||||
class RoarOfChallengeEffect extends OneShotEffect {
|
||||
|
||||
public RoarOfChallengeEffect() {
|
||||
super(Outcome.AddAbility);
|
||||
this.staticText = "<br/><br/><i>Ferocious</i> - That creature gains indestructible until end of turn if you control a creature with power 4 or greater";
|
||||
}
|
||||
|
||||
public RoarOfChallengeEffect(final RoarOfChallengeEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RoarOfChallengeEffect copy() {
|
||||
return new RoarOfChallengeEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
if (FerociousCondition.getInstance().apply(game, source)) {
|
||||
ContinuousEffect effect = new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn);
|
||||
effect.setTargetPointer(getTargetPointer());
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
82
Mage.Sets/src/mage/sets/legends/ActiveVolcano.java
Normal file
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
* 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.ObjectColor;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.abilities.effects.common.ReturnToHandTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author emerald000
|
||||
*/
|
||||
public class ActiveVolcano extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filterBlue = new FilterPermanent("blue permanent");
|
||||
private static final FilterLandPermanent filterIsland = new FilterLandPermanent("Island");
|
||||
static {
|
||||
filterBlue.add(new ColorPredicate(ObjectColor.BLUE));
|
||||
filterIsland.add(new SubtypePredicate("Island"));
|
||||
}
|
||||
|
||||
public ActiveVolcano(UUID ownerId) {
|
||||
super(ownerId, 130, "Active Volcano", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}");
|
||||
this.expansionSetCode = "LEG";
|
||||
|
||||
this.color.setRed(true);
|
||||
|
||||
// Choose one - Destroy target blue permanent;
|
||||
this.getSpellAbility().addEffect(new DestroyTargetEffect());
|
||||
this.getSpellAbility().addTarget(new TargetPermanent(filterBlue));
|
||||
|
||||
// or return target Island to its owner's hand.
|
||||
Mode mode = new Mode();
|
||||
mode.getEffects().add(new ReturnToHandTargetEffect());
|
||||
mode.getTargets().add(new TargetPermanent(filterIsland));
|
||||
this.getSpellAbility().addMode(mode);
|
||||
}
|
||||
|
||||
public ActiveVolcano(final ActiveVolcano card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActiveVolcano copy() {
|
||||
return new ActiveVolcano(this);
|
||||
}
|
||||
}
|
|
@ -28,9 +28,6 @@
|
|||
package mage.sets.lorwyn;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
|
@ -38,7 +35,9 @@ import mage.abilities.costs.common.TapSourceCost;
|
|||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.FirstStrikeAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
|
@ -70,7 +69,7 @@ public class BrigidHeroOfKinsbaile extends CardImpl {
|
|||
// First strike
|
||||
this.addAbility(FirstStrikeAbility.getInstance());
|
||||
|
||||
// {tap}: Brigid, Hero of Kinsbaile deals 2 damage to each attacking or blocking creature target player controls.
|
||||
// {t}: Brigid, Hero of Kinsbaile deals 2 damage to each attacking or blocking creature target player controls.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BrigidHeroOfKinsbaileEffect(), new TapSourceCost());
|
||||
ability.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability);
|
||||
|
@ -114,7 +113,7 @@ class BrigidHeroOfKinsbaileEffect extends OneShotEffect {
|
|||
if (targetPlayer != null) {
|
||||
for (Permanent creature : game.getBattlefield().getActivePermanents(filter, targetPlayer.getId(), game)) {
|
||||
if (creature != null) {
|
||||
creature.damage(2, id, game, false, false);
|
||||
creature.damage(2, source.getSourceId(), game, false, true);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -30,7 +30,7 @@ package mage.sets.lorwyn;
|
|||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
|
@ -81,7 +81,7 @@ public class DauntlessDourbark extends CardImpl {
|
|||
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(amount, Duration.EndOfGame)));
|
||||
|
||||
// Dauntless Dourbark has trample as long as you control another Treefolk.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield), new ControlsPermanentCondition(filter2), rule)));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield), new PermanentsOnTheBattlefieldCondition(filter2), rule)));
|
||||
|
||||
}
|
||||
|
||||
|
|
52
Mage.Sets/src/mage/sets/lorwyn/GalepowderMage.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.lorwyn;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class GalepowderMage extends mage.sets.venservskoth.GalepowderMage {
|
||||
|
||||
public GalepowderMage(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 15;
|
||||
this.expansionSetCode = "LRW";
|
||||
}
|
||||
|
||||
public GalepowderMage(final GalepowderMage card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GalepowderMage copy() {
|
||||
return new GalepowderMage(this);
|
||||
}
|
||||
}
|