This commit is contained in:
Nicolas 2013-04-01 19:05:08 +02:00
commit bb0415dc1f
44 changed files with 231 additions and 101 deletions

View file

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-root</artifactId> <artifactId>mage-root</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
</parent> </parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>

View file

@ -44,5 +44,13 @@
</includes> </includes>
<outputDirectory>/</outputDirectory> <outputDirectory>/</outputDirectory>
</fileSet> </fileSet>
<fileSet>
<filtered>false</filtered>
<directory>plugins/sounds/</directory>
<includes>
<include>*.wav</include>
</includes>
<outputDirectory>plugins/sounds/</outputDirectory>
</fileSet>
</fileSets> </fileSets>
</assembly> </assembly>

View file

@ -119,7 +119,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
private static Preferences prefs = Preferences.userNodeForPackage(MageFrame.class); private static Preferences prefs = Preferences.userNodeForPackage(MageFrame.class);
private JLabel title; private JLabel title;
private Rectangle titleRectangle; private Rectangle titleRectangle;
private static final MageVersion version = new MageVersion(1, 0, 1, ""); private static final MageVersion version = new MageVersion(1, 0, 2, "dev");
private UUID clientId; private UUID clientId;
private static MagePane activeFrame; private static MagePane activeFrame;
private static boolean liteMode = false; private static boolean liteMode = false;

View file

@ -100,6 +100,11 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
jScrollPane1.getViewport().setOpaque(false); jScrollPane1.getViewport().setOpaque(false);
cbSortBy.setModel(new DefaultComboBoxModel(SortBy.values())); cbSortBy.setModel(new DefaultComboBoxModel(SortBy.values()));
jTextFieldSearch.addActionListener(searchAction); jTextFieldSearch.addActionListener(searchAction);
// make the components more readable
tbColor.setBackground(new Color(250, 250, 250, 150));
tbColor.setOpaque(true); // false = transparent
tbTypes.setBackground(new Color(250, 250, 250, 150));
tbTypes.setOpaque(true); // false = transparent
} }
public void initListViewComponents() { public void initListViewComponents() {

View file

@ -447,9 +447,9 @@ public final class GamePanel extends javax.swing.JPanel {
} else { } else {
this.txtPhase.setText(""); this.txtPhase.setText("");
} }
updatePhases(game.getStep());
if (game.getStep() != null) { if (game.getStep() != null) {
updatePhases(game.getStep());
this.txtStep.setText(game.getStep().toString()); this.txtStep.setText(game.getStep().toString());
} }
else { else {
@ -491,12 +491,7 @@ public final class GamePanel extends javax.swing.JPanel {
CombatManager.getInstance().hideCombat(gameId); CombatManager.getInstance().hideCombat(gameId);
} }
System.out.println("Size: " + game.getStatesSavedSize());
if (game.getStatesSavedSize() > 0) {
feedbackPanel.allowUndo(game.getStatesSavedSize());
} else {
feedbackPanel.disableUndo(); feedbackPanel.disableUndo();
}
this.revalidate(); this.revalidate();
this.repaint(); this.repaint();
@ -608,6 +603,11 @@ public final class GamePanel extends javax.swing.JPanel {
options.put("your_turn", true); options.put("your_turn", true);
messageToDisplay = message + " <div style='font-size:11pt'>Your turn</div>"; messageToDisplay = message + " <div style='font-size:11pt'>Your turn</div>";
} }
// magenoxx: because of uncaught bug with saving state, rolling back and stack
// undo is allowed only for empty stack
if (playerView.getStatesSavedSize() > 0 && gameView.getStack().size() == 0) {
feedbackPanel.allowUndo(playerView.getStatesSavedSize());
}
break; break;
} }
} }

View file

@ -600,7 +600,7 @@ private void chkShowCompletedActionPerformed(java.awt.event.ActionEvent evt) {//
} }
class TableTableModel extends AbstractTableModel { class TableTableModel extends AbstractTableModel {
private String[] columnNames = new String[]{"Match Name", "Owner", "Game Type", "Deck Type", "Info", "Status", "Created", "Action"}; private String[] columnNames = new String[]{"Match Name", "Owner / Players", "Game Type", "Deck Type", "Info", "Status", "Created", "Action"};
private TableView[] tables = new TableView[0]; private TableView[] tables = new TableView[0];
private static final DateFormat timeFormatter = SimpleDateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT); private static final DateFormat timeFormatter = SimpleDateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-root</artifactId> <artifactId>mage-root</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
</parent> </parent>
<artifactId>mage-common</artifactId> <artifactId>mage-common</artifactId>

View file

@ -74,17 +74,10 @@ public class GameView implements Serializable {
private String priorityPlayerName = ""; private String priorityPlayerName = "";
private int turn; private int turn;
private boolean special = false; private boolean special = false;
private int statesSavedSize;
public GameView(GameState state, Game game) { public GameView(GameState state, Game game) {
for (Player player: state.getPlayers().values()) { for (Player player: state.getPlayers().values()) {
players.add(new PlayerView(player, state, game)); players.add(new PlayerView(player, state, game));
if (player.getStoredBookmark() > 0) {
if (this.statesSavedSize > 0) {
throw new IllegalStateException("This shouldn't happen");
}
this.statesSavedSize = player.getStoredBookmark();
}
} }
for (StackObject stackObject: state.getStack()) { for (StackObject stackObject: state.getStack()) {
if (stackObject instanceof StackAbility) { if (stackObject instanceof StackAbility) {
@ -260,8 +253,4 @@ public class GameView implements Serializable {
public boolean getSpecial() { public boolean getSpecial() {
return special; return special;
} }
public int getStatesSavedSize() {
return statesSavedSize;
}
} }

View file

@ -62,6 +62,7 @@ public class PlayerView implements Serializable {
private UserDataView userDataView; private UserDataView userDataView;
private List<EmblemView> emblemList = new ArrayList<EmblemView>(); private List<EmblemView> emblemList = new ArrayList<EmblemView>();
private List<UUID> attachments = new ArrayList<UUID>(); private List<UUID> attachments = new ArrayList<UUID>();
private int statesSavedSize;
public PlayerView(Player player, GameState state, Game game) { public PlayerView(Player player, GameState state, Game game) {
this.playerId = player.getId(); this.playerId = player.getId();
@ -105,6 +106,8 @@ public class PlayerView implements Serializable {
if (player.getAttachments() != null) { if (player.getAttachments() != null) {
attachments.addAll(player.getAttachments()); attachments.addAll(player.getAttachments());
} }
this.statesSavedSize = player.getStoredBookmark();
} }
private boolean showInBattlefield(Permanent permanent, GameState state) { private boolean showInBattlefield(Permanent permanent, GameState state) {
@ -184,4 +187,8 @@ public class PlayerView implements Serializable {
public boolean hasAttachments() { public boolean hasAttachments() {
return attachments != null && attachments.size() > 0; return attachments != null && attachments.size() > 0;
} }
public int getStatesSavedSize() {
return statesSavedSize;
}
} }

View file

@ -37,6 +37,8 @@ import mage.Constants.TableState;
import mage.game.Game; import mage.game.Game;
import mage.game.Seat; import mage.game.Seat;
import mage.game.Table; import mage.game.Table;
import mage.game.match.MatchPlayer;
import mage.game.tournament.TournamentPlayer;
/** /**
* *
@ -74,7 +76,21 @@ public class TableView implements Serializable {
for (Game game: table.getMatch().getGames()) { for (Game game: table.getMatch().getGames()) {
games.add(game.getId()); games.add(game.getId());
} }
StringBuilder sb = new StringBuilder();
for(MatchPlayer matchPlayer: table.getMatch().getPlayers()) {
if (!matchPlayer.getPlayer().getName().equals(table.getControllerName())) {
sb.append(", ").append(matchPlayer.getPlayer().getName());
}
}
this.controllerName += sb.toString();
} else { } else {
StringBuilder sb1 = new StringBuilder();
for (TournamentPlayer tp: table.getTournament().getPlayers()) {
if (!tp.getPlayer().getName().equals(table.getControllerName())) {
sb1.append(", ").append(tp.getPlayer().getName());
}
}
this.controllerName += sb1.toString();
StringBuilder sb = new StringBuilder("Seats: ").append(table.getTournament().getPlayers().size()).append("/").append(table.getNumberOfSeats()); StringBuilder sb = new StringBuilder("Seats: ").append(table.getTournament().getPlayers().size()).append("/").append(table.getNumberOfSeats());
if (table.getState().equals(TableState.DUELING)) { if (table.getState().equals(TableState.DUELING)) {
sb.append(" - Running round: ").append(table.getTournament().getRounds().size()); sb.append(" - Running round: ").append(table.getTournament().getRounds().size());

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-plugins</artifactId> <artifactId>mage-plugins</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
</parent> </parent>
<artifactId>mage-counter-plugin</artifactId> <artifactId>mage-counter-plugin</artifactId>

View file

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-plugins</artifactId> <artifactId>mage-plugins</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
</parent> </parent>
<artifactId>mage-theme-plugin</artifactId> <artifactId>mage-theme-plugin</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-root</artifactId> <artifactId>mage-root</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
</parent> </parent>
<artifactId>mage-plugins</artifactId> <artifactId>mage-plugins</artifactId>

View file

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-root</artifactId> <artifactId>mage-root</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
</parent> </parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>

View file

@ -57,7 +57,7 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
private static Session session; private static Session session;
private ConnectDialog connectDialog; private ConnectDialog connectDialog;
private static Preferences prefs = Preferences.userNodeForPackage(ConsoleFrame.class); private static Preferences prefs = Preferences.userNodeForPackage(ConsoleFrame.class);
private static final MageVersion version = new MageVersion(1, 0, 1, ""); private static final MageVersion version = new MageVersion(1, 0, 2, "dev");
/** /**
* @return the session * @return the session

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
</parent> </parent>
<artifactId>mage-deck-constructed</artifactId> <artifactId>mage-deck-constructed</artifactId>

View file

@ -56,5 +56,12 @@ public class Extended extends Constructed {
setCodes.add(set.getCode()); setCodes.add(set.getCode());
} }
} }
banned.add("Jace, the Mind Sculptor");
banned.add("Mental Misstep");
banned.add("Ponder");
banned.add("Preordain");
banned.add("Stoneforge Mystic");
} }
} }

View file

@ -0,0 +1,86 @@
/*
* Copyright 2011 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.deck;
import java.util.Date;
import mage.Constants.SetType;
import mage.cards.ExpansionSet;
import mage.cards.Sets;
import mage.cards.decks.Constructed;
import mage.sets.EighthEdition;
/**
*
* @author LevelX2
*/
public class Modern extends Constructed {
public Modern() {
super("Constructed - Modern");
Date cutoff = EighthEdition.getInstance().getReleaseDate();
for (ExpansionSet set: Sets.getInstance().values()) {
if ((set.getReleaseDate().after(cutoff) || set.getReleaseDate().equals(cutoff)) && set.getSetType() != SetType.REPRINT) {
setCodes.add(set.getCode());
}
}
banned.add("Ancestral Vision");
banned.add("Ancient Den");
banned.add("Bitterblossom");
banned.add("Blazing Shoal");
banned.add("Bloodbraid Elf"); // (banned effective February 1, 2013)
banned.add("Chrome Mox");
banned.add("Cloudpost");
banned.add("Dark Depths");
banned.add("Dread Return");
banned.add("Glimpse of Nature");
banned.add("Golgari Grave-Troll");
banned.add("Great Furnace");
banned.add("Green Sun's Zenith");
banned.add("Hypergenesis");
banned.add("Jace, the Mind Sculptor");
banned.add("Mental Misstep");
banned.add("Ponder");
banned.add("Preordain");
banned.add("Punishing Fire");
banned.add("Rite of Flame");
banned.add("Seat of the Synod");
banned.add("Seething Song"); // (banned effective February 1, 2013)
banned.add("Sensei's Divining Top");
banned.add("Stoneforge Mystic");
banned.add("Skullclamp");
banned.add("Sword of the Meek");
banned.add("Tree of Tales");
banned.add("Umezawa's Jitte");
banned.add("Vault of Whispers");
banned.add("Wild Nacatl");
}
}

View file

@ -56,7 +56,5 @@ public class Standard extends Constructed {
setCodes.add(set.getCode()); setCodes.add(set.getCode());
} }
} }
banned.add("Jace, the Mind Sculptor");
banned.add("Stoneforge Mystic");
} }
} }

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
</parent> </parent>
<artifactId>mage-deck-limited</artifactId> <artifactId>mage-deck-limited</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
</parent> </parent>
<artifactId>mage-game-commanderduel</artifactId> <artifactId>mage-game-commanderduel</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
</parent> </parent>
<artifactId>mage-game-freeforall</artifactId> <artifactId>mage-game-freeforall</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
</parent> </parent>
<artifactId>mage-game-twoplayerduel</artifactId> <artifactId>mage-game-twoplayerduel</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
</parent> </parent>
<artifactId>mage-player-ai-draftbot</artifactId> <artifactId>mage-player-ai-draftbot</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
</parent> </parent>
<artifactId>mage-player-ai-ma</artifactId> <artifactId>mage-player-ai-ma</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
</parent> </parent>
<artifactId>mage-player-ai</artifactId> <artifactId>mage-player-ai</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
</parent> </parent>
<artifactId>mage-player-ai-mcts</artifactId> <artifactId>mage-player-ai-mcts</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
</parent> </parent>
<artifactId>mage-player-aiminimax</artifactId> <artifactId>mage-player-aiminimax</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
</parent> </parent>
<artifactId>mage-player-human</artifactId> <artifactId>mage-player-human</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
</parent> </parent>
<artifactId>mage-tournament-boosterdraft</artifactId> <artifactId>mage-tournament-boosterdraft</artifactId>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
</parent> </parent>
<artifactId>mage-tournament-sealed</artifactId> <artifactId>mage-tournament-sealed</artifactId>

View file

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-root</artifactId> <artifactId>mage-root</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
</parent> </parent>
<artifactId>mage-server-plugins</artifactId> <artifactId>mage-server-plugins</artifactId>

View file

@ -19,8 +19,9 @@
<tournamentType name="Sealed Elimination" jar="mage-tournament-sealed.jar" className="mage.tournament.SealedEliminationTournament" typeName="mage.tournament.SealedEliminationTournamentType"/> <tournamentType name="Sealed Elimination" jar="mage-tournament-sealed.jar" className="mage.tournament.SealedEliminationTournament" typeName="mage.tournament.SealedEliminationTournamentType"/>
</tournamentTypes> </tournamentTypes>
<deckTypes> <deckTypes>
<deckType name="Constructed - Extended" jar="mage-deck-constructed.jar" className="mage.deck.Extended"/>
<deckType name="Constructed - Standard" jar="mage-deck-constructed.jar" className="mage.deck.Standard"/> <deckType name="Constructed - Standard" jar="mage-deck-constructed.jar" className="mage.deck.Standard"/>
<deckType name="Constructed - Extended" jar="mage-deck-constructed.jar" className="mage.deck.Extended"/>
<deckType name="Constructed - Modern" jar="mage-deck-constructed.jar" className="mage.deck.Modern"/>
<deckType name="Constructed - Vintage" jar="mage-deck-constructed.jar" className="mage.deck.Vintage"/> <deckType name="Constructed - Vintage" jar="mage-deck-constructed.jar" className="mage.deck.Vintage"/>
<deckType name="Block Constructed - Innistrad" jar="mage-deck-constructed.jar" className="mage.deck.InnistradBlock"/> <deckType name="Block Constructed - Innistrad" jar="mage-deck-constructed.jar" className="mage.deck.InnistradBlock"/>
<deckType name="Block Constructed - Kamigawa" jar="mage-deck-constructed.jar" className="mage.deck.KamigawaBlock"/> <deckType name="Block Constructed - Kamigawa" jar="mage-deck-constructed.jar" className="mage.deck.KamigawaBlock"/>

View file

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-root</artifactId> <artifactId>mage-root</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
</parent> </parent>
<artifactId>mage-server</artifactId> <artifactId>mage-server</artifactId>

View file

@ -73,7 +73,7 @@ public class Main {
private static final String testModeArg = "-testMode="; private static final String testModeArg = "-testMode=";
private static final String adminPasswordArg = "-adminPassword="; private static final String adminPasswordArg = "-adminPassword=";
private static final String pluginFolder = "plugins"; private static final String pluginFolder = "plugins";
private static MageVersion version = new MageVersion(1, 0, 1, ""); private static MageVersion version = new MageVersion(1, 0, 2, "dev");
public static PluginClassLoader classLoader = new PluginClassLoader(); public static PluginClassLoader classLoader = new PluginClassLoader();
public static TransporterServer server; public static TransporterServer server;

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-root</artifactId> <artifactId>mage-root</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
</parent> </parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>

View file

@ -135,7 +135,8 @@ class CarpetOfFlowersTriggeredAbility extends TriggeredAbilityImpl<CarpetOfFlowe
@Override @Override
public String getRule() { public String getRule() {
return "At the beginning of each of your main phases, if you haven't added mana to your mana pool with this ability this turn"; StringBuilder sb = new StringBuilder("At the beginning of each of your main phases, if you haven't added mana to your mana pool with this ability this turn");
return sb.append(super.getRule()).toString();
} }
} }

View file

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-root</artifactId> <artifactId>mage-root</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
</parent> </parent>
<artifactId>mage-tests</artifactId> <artifactId>mage-tests</artifactId>

View file

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>mage-root</artifactId> <artifactId>mage-root</artifactId>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<version>1.0.1</version> <version>1.0.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View file

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-root</artifactId> <artifactId>mage-root</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
</parent> </parent>
<artifactId>mage</artifactId> <artifactId>mage</artifactId>

View file

@ -40,7 +40,6 @@ import mage.abilities.effects.OneShotEffect;
import mage.game.Game; import mage.game.Game;
import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.EntersTheBattlefieldEvent;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
@ -98,7 +97,7 @@ public class EchoAbility extends TriggeredAbilityImpl<EchoAbility> {
@Override @Override
public String getRule() { public String getRule() {
return "Echo " + manaString + " (At the beginning of your upkeep, if this came under your control since the beginning of your last upkeep," + getEffects().getText(modes.getMode()) + ")"; return "Echo " + manaString + " <i>(At the beginning of your upkeep, if this came under your control since the beginning of your last upkeep," + getEffects().getText(modes.getMode()) + ")</i>";
} }
} }

View file

@ -44,6 +44,11 @@ import mage.abilities.costs.Cost;
* plays with that card revealed until that card leaves his or her hand, that ability * plays with that card revealed until that card leaves his or her hand, that ability
* resolves, or that ability otherwise leaves the stack. * resolves, or that ability otherwise leaves the stack.
* *
* You can cast a card for its miracle cost only as the miracle triggered ability resolves.
* If you don't want to cast it at that time (or you can't cast it, perhaps because
* there are no legal targets available), you won't be able to cast it later for the miracle cost.
*
*
* @author noxx * @author noxx
*/ */
public class MiracleAbility extends StaticAbility<MiracleAbility> { public class MiracleAbility extends StaticAbility<MiracleAbility> {

View file

@ -108,6 +108,7 @@ public class MiracleWatcher extends WatcherImpl<MiracleWatcher> {
controller.lookAtCards("Miracle", cards, game); controller.lookAtCards("Miracle", cards, game);
if (controller.chooseUse(Outcome.Benefit, "Use Miracle " + manaCostsToPay.getText() + "?", game)) { if (controller.chooseUse(Outcome.Benefit, "Use Miracle " + manaCostsToPay.getText() + "?", game)) {
controller.revealCards("Miracle", cards, game); controller.revealCards("Miracle", cards, game);
ManaCosts costRef = card.getSpellAbility().getManaCostsToPay(); ManaCosts costRef = card.getSpellAbility().getManaCostsToPay();
// replace with the new cost // replace with the new cost
costRef.clear(); costRef.clear();
@ -115,6 +116,13 @@ public class MiracleWatcher extends WatcherImpl<MiracleWatcher> {
costRef.add(manaCost); costRef.add(manaCost);
} }
controller.cast(card.getSpellAbility(), game, false); controller.cast(card.getSpellAbility(), game, false);
// Reset the casting costs (in case the player cancels cast and plays the card later)
costRef.clear();
for (ManaCost manaCost : card.getSpellAbility().getManaCosts()) {
costRef.add(manaCost);
}
break; break;
} }
} }

View file

@ -6,7 +6,7 @@
<groupId>org.mage</groupId> <groupId>org.mage</groupId>
<artifactId>mage-root</artifactId> <artifactId>mage-root</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>Mage Root</name> <name>Mage Root</name>
<description>Mage Root POM</description> <description>Mage Root POM</description>
@ -74,7 +74,7 @@
</repositories> </repositories>
<properties> <properties>
<mage-version>1.0.1</mage-version> <mage-version>1.0.2</mage-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<netbeans.hint.license>mage</netbeans.hint.license> <netbeans.hint.license>mage</netbeans.hint.license>
</properties> </properties>