From ae6139f859675f1a0c400e99bfc69f51056d9d59 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 10 Jun 2013 08:19:01 +0200 Subject: [PATCH 01/22] * The check if a card is legal to a format checks now if the card is legal if taken from other sets in case the set itself of the card is not legal normally (reprint). --- .../src/mage/deck/Modern.java | 2 +- Mage/src/mage/cards/decks/Constructed.java | 24 +++++++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Modern.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Modern.java index 92fa864145..a89d5dde68 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Modern.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Modern.java @@ -44,7 +44,7 @@ public class Modern extends Constructed { public Modern() { super("Constructed - Modern"); - Date cutoff = EighthEdition.getInstance().getReleaseDate(); + Date cutoff = EighthEdition.getInstance().getReleaseDate(); // 2003 / 07 / 28 for (ExpansionSet set: Sets.getInstance().values()) { if ((set.getReleaseDate().after(cutoff) || set.getReleaseDate().equals(cutoff)) && set.getSetType() != SetType.REPRINT) { setCodes.add(set.getCode()); diff --git a/Mage/src/mage/cards/decks/Constructed.java b/Mage/src/mage/cards/decks/Constructed.java index afa71832c5..624d9b582b 100644 --- a/Mage/src/mage/cards/decks/Constructed.java +++ b/Mage/src/mage/cards/decks/Constructed.java @@ -35,6 +35,8 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import mage.cards.Card; +import mage.cards.repository.CardInfo; +import mage.cards.repository.CardRepository; /** * @@ -99,7 +101,16 @@ public class Constructed extends DeckValidatorImpl { if (!setCodes.isEmpty()) { for (Card card: deck.getCards()) { if (!setCodes.contains(card.getExpansionSetCode())) { - if (!invalid.containsKey(card.getName())) { + // check if card is legal if taken from other set + boolean legal = false; + List cardInfos = CardRepository.instance.findCards(card.getName()); + for (CardInfo cardInfo: cardInfos) { + if (setCodes.contains(cardInfo.getSetCode())) { + legal = true; + break; + } + } + if (!legal && !invalid.containsKey(card.getName())) { invalid.put(card.getName(), "Invalid set: " + card.getExpansionSetCode()); valid = false; } @@ -107,7 +118,16 @@ public class Constructed extends DeckValidatorImpl { } for (Card card: deck.getSideboard()) { if (!setCodes.contains(card.getExpansionSetCode())) { - if (!invalid.containsKey(card.getName())) { + // check if card is legal if taken from other set + boolean legal = false; + List cardInfos = CardRepository.instance.findCards(card.getName()); + for (CardInfo cardInfo: cardInfos) { + if (setCodes.contains(cardInfo.getSetCode())) { + legal = true; + break; + } + } + if (!legal && !invalid.containsKey(card.getName())) { invalid.put(card.getName(), "Invalid set: " + card.getExpansionSetCode()); valid = false; } From aef53bc4ce083797819a3dfa37da3dc26efdd7d7 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 10 Jun 2013 12:38:38 +0200 Subject: [PATCH 02/22] * The list of open tables shows now the codes of boosters selected for sealed or draft tournaments in the deck type column. --- Mage.Common/src/mage/view/TableView.java | 3 ++- .../mage/server/tournament/TournamentFactory.java | 10 ++++++++++ Mage/src/mage/game/tournament/Tournament.java | 7 +++++++ Mage/src/mage/game/tournament/TournamentImpl.java | 11 +++++++++++ 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/Mage.Common/src/mage/view/TableView.java b/Mage.Common/src/mage/view/TableView.java index ca81f247d5..656900350c 100644 --- a/Mage.Common/src/mage/view/TableView.java +++ b/Mage.Common/src/mage/view/TableView.java @@ -65,7 +65,6 @@ public class TableView implements Serializable { this.tableName = table.getName(); this.controllerName = table.getControllerName(); this.createTime = table.getCreateTime(); - this.deckType = table.getDeckType(); this.tableState = table.getState(); this.isTournament = table.isTournament(); for (Seat seat: table.getSeats()) { @@ -83,6 +82,7 @@ public class TableView implements Serializable { } } this.controllerName += sb.toString(); + this.deckType = table.getDeckType(); } else { StringBuilder sb1 = new StringBuilder(); for (TournamentPlayer tp: table.getTournament().getPlayers()) { @@ -96,6 +96,7 @@ public class TableView implements Serializable { sb.append(" - Running round: ").append(table.getTournament().getRounds().size()); } this.additionalInfo = sb.toString(); + this.deckType = new StringBuilder(table.getDeckType()).append(" ").append(table.getTournament().getSetsFormatedShort()).toString(); } } diff --git a/Mage.Server/src/main/java/mage/server/tournament/TournamentFactory.java b/Mage.Server/src/main/java/mage/server/tournament/TournamentFactory.java index 0653106d4c..76ab8dd0d7 100644 --- a/Mage.Server/src/main/java/mage/server/tournament/TournamentFactory.java +++ b/Mage.Server/src/main/java/mage/server/tournament/TournamentFactory.java @@ -31,6 +31,7 @@ package mage.server.tournament; import java.lang.reflect.Constructor; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import mage.cards.Sets; @@ -65,9 +66,18 @@ public class TournamentFactory { try { con = tournaments.get(tournamentType).getConstructor(new Class[]{TournamentOptions.class}); tournament = con.newInstance(new Object[] {options}); + // transfer set information, create short info string for included sets + Map setInfo = new LinkedHashMap(); for (String setCode: options.getLimitedOptions().getSetCodes()) { tournament.getSets().add(Sets.findSet(setCode)); + int count = setInfo.containsKey(setCode) ? setInfo.get(setCode) : 0; + setInfo.put(setCode, count + 1); } + StringBuilder sb = new StringBuilder(); + for (Map.Entry entry:setInfo.entrySet()) { + sb.append(entry.getValue().toString()).append("x").append(entry.getKey()).append(" "); + } + tournament.setSetsFormatedShort(sb.toString()); } catch (Exception ex) { logger.fatal("TournamentFactory error ", ex); return null; diff --git a/Mage/src/mage/game/tournament/Tournament.java b/Mage/src/mage/game/tournament/Tournament.java index f63522f6a2..7ee116fbcb 100644 --- a/Mage/src/mage/game/tournament/Tournament.java +++ b/Mage/src/mage/game/tournament/Tournament.java @@ -50,6 +50,13 @@ public interface Tournament { Collection getPlayers(); Collection getRounds(); List getSets(); + + void setSetsFormatedShort(String setInfo); + /** + * Gives back a String that shows the included sets (e.g. "3xRTR" or "1xDGM 1xGTC 1xRTR") + * @return String + */ + String getSetsFormatedShort(); void submitDeck(UUID playerId, Deck deck); void updateDeck(UUID playerId, Deck deck); void autoSubmit(UUID playerId, Deck deck); diff --git a/Mage/src/mage/game/tournament/TournamentImpl.java b/Mage/src/mage/game/tournament/TournamentImpl.java index 7d80ebecab..7a8ff4c32b 100644 --- a/Mage/src/mage/game/tournament/TournamentImpl.java +++ b/Mage/src/mage/game/tournament/TournamentImpl.java @@ -53,6 +53,7 @@ public abstract class TournamentImpl implements Tournament { protected String matchName; protected TournamentOptions options; protected List sets = new ArrayList(); + protected String setsInfoShort; protected TableEventSource tableEventSource = new TableEventSource(); protected PlayerQueryEventSource playerQueryEventSource = new PlayerQueryEventSource(); @@ -100,6 +101,16 @@ public abstract class TournamentImpl implements Tournament { return sets; } + @Override + public void setSetsFormatedShort(String setsInfoShort) { + this.setsInfoShort = setsInfoShort; + } + + @Override + public String getSetsFormatedShort() { + return setsInfoShort; + } + @Override public void leave(UUID playerId) { if (players.containsKey(playerId)) { From dec8f24c687b2ee4cba06fc4208e35f5693822fb Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 10 Jun 2013 14:12:24 +0200 Subject: [PATCH 03/22] * The list of completed matches and tournaments shows now also columns with start and end time. --- .../java/mage/client/table/TablesPanel.java | 30 ++++++++++++------- Mage.Common/src/mage/view/MatchView.java | 18 +++++++++-- Mage/src/mage/game/match/Match.java | 4 +++ Mage/src/mage/game/match/MatchImpl.java | 16 ++++++++++ Mage/src/mage/game/tournament/Tournament.java | 4 +++ .../mage/game/tournament/TournamentImpl.java | 15 ++++++++++ 6 files changed, 75 insertions(+), 12 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/table/TablesPanel.java b/Mage.Client/src/main/java/mage/client/table/TablesPanel.java index a4c21530ee..3e20c20beb 100644 --- a/Mage.Client/src/main/java/mage/client/table/TablesPanel.java +++ b/Mage.Client/src/main/java/mage/client/table/TablesPanel.java @@ -122,7 +122,7 @@ public class TablesPanel extends javax.swing.JPanel { int modelRow = Integer.valueOf( e.getActionCommand() ); UUID tableId = (UUID)tableModel.getValueAt(modelRow, 10); UUID gameId = (UUID)tableModel.getValueAt(modelRow, 9); - String state = (String)tableModel.getValueAt(modelRow, 7); + String state = (String)tableModel.getValueAt(modelRow, TableTableModel.ACTION_COLUMN); boolean isTournament = (Boolean)tableModel.getValueAt(modelRow, 8); String owner = (String)tableModel.getValueAt(modelRow, 1); @@ -180,7 +180,7 @@ public class TablesPanel extends javax.swing.JPanel { public void actionPerformed(ActionEvent e) { int modelRow = Integer.valueOf( e.getActionCommand() ); - List games = (List)matchesModel.getValueAt(modelRow, 6); + List games = (List)matchesModel.getValueAt(modelRow, MatchesTableModel.ACTION_COLUMN); if (games.size() == 1) { session.replayGame(games.get(0)); } @@ -191,9 +191,9 @@ public class TablesPanel extends javax.swing.JPanel { }; - // adds buttons (don't delete this) - new ButtonColumn(tableTables, joinTable, 7); - new ButtonColumn(tableCompleted, replayMatch, 5); + // adds buttons to the table panel (don't delete this) + new ButtonColumn(tableTables, joinTable, TableTableModel.ACTION_COLUMN); + new ButtonColumn(tableCompleted, replayMatch, MatchesTableModel.ACTION_COLUMN); } public Map getUIComponents() { @@ -605,6 +605,9 @@ private void chkShowCompletedActionPerformed(java.awt.event.ActionEvent evt) {// } class TableTableModel extends AbstractTableModel { + + public static int ACTION_COLUMN = 7; // column the action is located (starting with 0) + private String[] columnNames = new String[]{"Match Name", "Owner / Players", "Game Type", "Deck Type", "Info", "Status", "Created", "Action"}; private TableView[] tables = new TableView[0]; private static final DateFormat timeFormatter = SimpleDateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT); @@ -706,7 +709,7 @@ class TableTableModel extends AbstractTableModel { @Override public boolean isCellEditable(int rowIndex, int columnIndex) { - if (columnIndex != 7) { + if (columnIndex != ACTION_COLUMN) { return false; } return true; @@ -807,9 +810,12 @@ class UpdatePlayersTask extends SwingWorker> { } class MatchesTableModel extends AbstractTableModel { - private String[] columnNames = new String[]{"Match Name", "Game Type", "Deck Type", "Players", "Result", "Action"}; + + public static int ACTION_COLUMN = 7; // column the action is located (starting with 0) + + private String[] columnNames = new String[]{"Match Name", "Game Type", "Deck Type", "Players", "Result", "Start Time", "End Time","Action"}; private MatchView[] matches = new MatchView[0]; - private static final DateFormat timeFormatter = SimpleDateFormat.getTimeInstance(SimpleDateFormat.SHORT); + private static final DateFormat timeFormatter = SimpleDateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT); public void loadData(Collection matches) throws MageRemoteException { this.matches = matches.toArray(new MatchView[0]); @@ -840,8 +846,12 @@ class MatchesTableModel extends AbstractTableModel { case 4: return matches[arg0].getResult(); case 5: - return "None"; + return timeFormatter.format(matches[arg0].getStartTime()); case 6: + return timeFormatter.format(matches[arg0].getEndTime()); + case 7: + return "None"; + case 8: return matches[arg0].getGames(); } return ""; @@ -865,7 +875,7 @@ class MatchesTableModel extends AbstractTableModel { @Override public boolean isCellEditable(int rowIndex, int columnIndex) { - if (columnIndex != 5) { + if (columnIndex != ACTION_COLUMN) { return false; } return true; diff --git a/Mage.Common/src/mage/view/MatchView.java b/Mage.Common/src/mage/view/MatchView.java index d81cb96435..c093248054 100644 --- a/Mage.Common/src/mage/view/MatchView.java +++ b/Mage.Common/src/mage/view/MatchView.java @@ -29,6 +29,7 @@ package mage.view; import java.io.Serializable; import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.UUID; import mage.game.Game; @@ -49,8 +50,11 @@ public class MatchView implements Serializable { private String deckType; private List games = new ArrayList(); - private String result; + private String result; private String players; + + private Date startTime; + private Date endTime; public MatchView(Match match) { this.matchId = match.getId(); @@ -68,7 +72,8 @@ public class MatchView implements Serializable { players = sb1.substring(0, sb1.length() - 2); result = sb2.substring(0, sb2.length() - 2); } - + this.startTime = match.getStartTime(); + this.endTime = match.getEndTime(); } // used for tournaments @@ -88,6 +93,8 @@ public class MatchView implements Serializable { sb2.append(tPlayer.getPlayer().getName()).append(": ").append(tPlayer.getResults()).append(" "); } this.result = sb2.toString(); + this.startTime = table.getTournament().getStartTime(); + this.endTime = table.getTournament().getEndTime(); } public UUID getMatchId() { @@ -118,4 +125,11 @@ public class MatchView implements Serializable { return players; } + public Date getStartTime() { + return startTime; + } + + public Date getEndTime() { + return endTime; + } } diff --git a/Mage/src/mage/game/match/Match.java b/Mage/src/mage/game/match/Match.java index f2f9b2df50..5fb3df7258 100644 --- a/Mage/src/mage/game/match/Match.java +++ b/Mage/src/mage/game/match/Match.java @@ -28,6 +28,7 @@ package mage.game.match; +import java.util.Date; import java.util.List; import java.util.UUID; import mage.cards.decks.Deck; @@ -71,4 +72,7 @@ public interface Match { void addTableEventListener(Listener listener); void fireSideboardEvent(UUID playerId, Deck deck); + // match times + Date getStartTime(); + Date getEndTime(); } diff --git a/Mage/src/mage/game/match/MatchImpl.java b/Mage/src/mage/game/match/MatchImpl.java index b8433e77e3..15a6a4c788 100644 --- a/Mage/src/mage/game/match/MatchImpl.java +++ b/Mage/src/mage/game/match/MatchImpl.java @@ -30,6 +30,7 @@ package mage.game.match; import java.util.ArrayList; import java.util.Collections; +import java.util.Date; import java.util.List; import java.util.Random; import java.util.UUID; @@ -56,8 +57,12 @@ public abstract class MatchImpl implements Match { protected TableEventSource tableEventSource = new TableEventSource(); + protected Date startTime; + protected Date endTime; + public MatchImpl(MatchOptions options) { this.options = options; + startTime = new Date(); } @Override @@ -114,6 +119,7 @@ public abstract class MatchImpl implements Match { public boolean isMatchOver() { for (MatchPlayer player: players) { if (player.getWins() >= options.getWinsNeeded()) { + endTime = new Date(); return true; } } @@ -255,5 +261,15 @@ public abstract class MatchImpl implements Match { sb.append("\nGame has started\n"); return sb.toString(); } + + @Override + public Date getStartTime() { + return startTime; + } + + @Override + public Date getEndTime() { + return endTime; + } } diff --git a/Mage/src/mage/game/tournament/Tournament.java b/Mage/src/mage/game/tournament/Tournament.java index 7ee116fbcb..74a92ca70c 100644 --- a/Mage/src/mage/game/tournament/Tournament.java +++ b/Mage/src/mage/game/tournament/Tournament.java @@ -29,6 +29,7 @@ package mage.game.tournament; import java.util.Collection; +import java.util.Date; import java.util.List; import java.util.UUID; import mage.cards.ExpansionSet; @@ -69,4 +70,7 @@ public interface Tournament { void addPlayerQueryEventListener(Listener listener); void fireConstructEvent(UUID playerId); + // tournament times + Date getStartTime(); + Date getEndTime(); } diff --git a/Mage/src/mage/game/tournament/TournamentImpl.java b/Mage/src/mage/game/tournament/TournamentImpl.java index 7a8ff4c32b..01f47bbd67 100644 --- a/Mage/src/mage/game/tournament/TournamentImpl.java +++ b/Mage/src/mage/game/tournament/TournamentImpl.java @@ -58,10 +58,14 @@ public abstract class TournamentImpl implements Tournament { protected TableEventSource tableEventSource = new TableEventSource(); protected PlayerQueryEventSource playerQueryEventSource = new PlayerQueryEventSource(); + protected Date startTime; + protected Date endTime; + private static final int CONSTRUCT_TIME = 600; public TournamentImpl(TournamentOptions options) { this.options = options; + startTime = new Date(); } @Override @@ -292,9 +296,20 @@ public abstract class TournamentImpl implements Tournament { } public void end() { + endTime = new Date(); tableEventSource.fireTableEvent(EventType.END); } protected abstract void runTournament(); + @Override + public Date getStartTime() { + return startTime; + } + + @Override + public Date getEndTime() { + return endTime; + } + } From bbf277f17e289385d13c2e8ee19e970279b7a7e6 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 10 Jun 2013 14:45:32 +0200 Subject: [PATCH 04/22] * Festering Goblin - Its ability to select a creature for the -1/-1 counter is now mandatory. --- Mage.Sets/src/mage/sets/planechase/FesteringGoblin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/planechase/FesteringGoblin.java b/Mage.Sets/src/mage/sets/planechase/FesteringGoblin.java index 03a875f55b..b50b055980 100644 --- a/Mage.Sets/src/mage/sets/planechase/FesteringGoblin.java +++ b/Mage.Sets/src/mage/sets/planechase/FesteringGoblin.java @@ -54,7 +54,7 @@ public class FesteringGoblin extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); Ability ability = new DiesTriggeredAbility(new BoostTargetEffect(-1, -1, Constants.Duration.EndOfTurn), false); - ability.addTarget(new TargetCreaturePermanent()); + ability.addTarget(new TargetCreaturePermanent(true)); this.addAbility(ability); } From 3dbdba32e9d9d86b5fbbe5c059df72c83ced7e98 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 10 Jun 2013 16:25:31 +0200 Subject: [PATCH 05/22] * Number of wins can be set for tournaments. * Current score of running matches is shown in the table list. --- .../client/dialog/NewTournamentDialog.form | 62 ++++++++++++------ .../client/dialog/NewTournamentDialog.java | 65 ++++++++++++++----- .../java/mage/client/table/TablesPanel.java | 28 ++++---- Mage.Common/src/mage/view/TableView.java | 19 +++++- Mage/src/mage/game/tournament/Tournament.java | 2 + .../mage/game/tournament/TournamentImpl.java | 5 ++ 6 files changed, 129 insertions(+), 52 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.form b/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.form index 033e6fe392..d405d6b5ae 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.form +++ b/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.form @@ -1,4 +1,4 @@ - +
@@ -26,7 +26,7 @@ - + @@ -41,9 +41,14 @@ - - - + + + + + + + + @@ -59,25 +64,34 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + - + - + - + @@ -152,7 +166,7 @@ - + @@ -160,7 +174,7 @@ - + @@ -269,5 +283,15 @@ + + + + + + + + + + diff --git a/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java b/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java index 1f458161dc..cd92ee7e6a 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java @@ -73,6 +73,7 @@ public class NewTournamentDialog extends MageDialog { public NewTournamentDialog() { initComponents(); txtName.setText("Tournament"); + this.spnNumWins.setModel(new SpinnerNumberModel(2, 1, 5, 1)); } public void showDialog(UUID roomId) { @@ -114,6 +115,8 @@ public class NewTournamentDialog extends MageDialog { pnlDraftOptions = new javax.swing.JPanel(); jLabel6 = new javax.swing.JLabel(); cbDraftTiming = new javax.swing.JComboBox(); + lblNumWins = new javax.swing.JLabel(); + spnNumWins = new javax.swing.JSpinner(); setTitle("New Tournament"); @@ -150,7 +153,7 @@ public class NewTournamentDialog extends MageDialog { pnlPacks.setLayout(new java.awt.GridLayout(0, 1, 2, 0)); - jLabel3.setFont(new java.awt.Font("Tahoma", 1, 11)); + jLabel3.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel3.setText("Player 1 (You)"); jLabel4.setText("Name:"); @@ -165,14 +168,14 @@ public class NewTournamentDialog extends MageDialog { jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(pnlOtherPlayers, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 563, Short.MAX_VALUE) + .addComponent(pnlOtherPlayers, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup() .addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 483, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup() .addComponent(jLabel4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(txtPlayer1Name, javax.swing.GroupLayout.DEFAULT_SIZE, 528, Short.MAX_VALUE))) + .addComponent(txtPlayer1Name))) .addContainerGap()) ); jPanel1Layout.setVerticalGroup( @@ -187,7 +190,7 @@ public class NewTournamentDialog extends MageDialog { .addComponent(pnlOtherPlayers, javax.swing.GroupLayout.DEFAULT_SIZE, 91, Short.MAX_VALUE)) ); - jLabel5.setFont(new java.awt.Font("Tahoma", 1, 11)); + jLabel5.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel5.setText("Packs"); lblName.setText("Name:"); @@ -214,6 +217,14 @@ public class NewTournamentDialog extends MageDialog { .addComponent(jLabel6)) ); + lblNumWins.setText("Wins"); + + spnNumWins.addChangeListener(new javax.swing.event.ChangeListener() { + public void stateChanged(javax.swing.event.ChangeEvent evt) { + spnNumWinsnumPlayersChanged(evt); + } + }); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( @@ -222,7 +233,7 @@ public class NewTournamentDialog extends MageDialog { .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(pnlPacks, javax.swing.GroupLayout.DEFAULT_SIZE, 563, Short.MAX_VALUE) + .addComponent(pnlPacks, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) @@ -235,9 +246,13 @@ public class NewTournamentDialog extends MageDialog { .addComponent(lblName) .addComponent(jLabel1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(txtName, javax.swing.GroupLayout.DEFAULT_SIZE, 470, Short.MAX_VALUE) - .addComponent(cbTournamentType, javax.swing.GroupLayout.Alignment.LEADING, 0, 470, Short.MAX_VALUE))) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(txtName) + .addComponent(cbTournamentType, 0, 420, Short.MAX_VALUE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(spnNumWins, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblNumWins))) .addGroup(layout.createSequentialGroup() .addComponent(btnOk) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) @@ -248,20 +263,26 @@ public class NewTournamentDialog extends MageDialog { layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(lblName)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel1) - .addComponent(cbTournamentType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblName)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel1) + .addComponent(cbTournamentType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(layout.createSequentialGroup() + .addComponent(lblNumWins) + .addGap(0, 0, 0) + .addComponent(spnNumWins, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(pnlPacks, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE) + .addComponent(pnlPacks, javax.swing.GroupLayout.DEFAULT_SIZE, 63, Short.MAX_VALUE) .addGap(11, 11, 11) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(spnNumPlayers, javax.swing.GroupLayout.DEFAULT_SIZE, 24, Short.MAX_VALUE) + .addComponent(spnNumPlayers, javax.swing.GroupLayout.DEFAULT_SIZE, 26, Short.MAX_VALUE) .addComponent(pnlDraftOptions, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) @@ -301,7 +322,7 @@ public class NewTournamentDialog extends MageDialog { } } tOptions.getMatchOptions().setDeckType("Limited"); - tOptions.getMatchOptions().setWinsNeeded(2); + tOptions.getMatchOptions().setWinsNeeded((Integer)this.spnNumWins.getValue()); tOptions.getMatchOptions().setAttackOption(MultiplayerAttackOption.LEFT); tOptions.getMatchOptions().setRange(RangeOfInfluence.ALL); tOptions.getMatchOptions().setLimited(true); @@ -340,6 +361,10 @@ public class NewTournamentDialog extends MageDialog { createPlayers(numPlayers); }//GEN-LAST:event_spnNumPlayersStateChanged + private void spnNumWinsnumPlayersChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spnNumWinsnumPlayersChanged + // TODO add your handling code here: + }//GEN-LAST:event_spnNumWinsnumPlayersChanged + private void setTournamentOptions() { TournamentTypeView tournamentType = (TournamentTypeView) cbTournamentType.getSelectedItem(); this.spnNumPlayers.setModel(new SpinnerNumberModel(tournamentType.getMinPlayers(), tournamentType.getMinPlayers(), tournamentType.getMaxPlayers(), 1)); @@ -366,6 +391,7 @@ public class NewTournamentDialog extends MageDialog { pnlPacks.add(pack); packs.add(pack); pack.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(java.awt.event.ActionEvent evt) { packActionPerformed(evt); } @@ -413,6 +439,7 @@ public class NewTournamentDialog extends MageDialog { for (TournamentPlayerPanel panel: players) { this.pnlOtherPlayers.add(panel); panel.getPlayerType().addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(java.awt.event.ActionEvent evt) { playerActionPerformed(evt); } @@ -457,10 +484,12 @@ public class NewTournamentDialog extends MageDialog { private javax.swing.JLabel jLabel6; private javax.swing.JPanel jPanel1; private javax.swing.JLabel lblName; + private javax.swing.JLabel lblNumWins; private javax.swing.JPanel pnlDraftOptions; private javax.swing.JPanel pnlOtherPlayers; private javax.swing.JPanel pnlPacks; private javax.swing.JSpinner spnNumPlayers; + private javax.swing.JSpinner spnNumWins; private javax.swing.JTextField txtName; private javax.swing.JTextField txtPlayer1Name; // End of variables declaration//GEN-END:variables diff --git a/Mage.Client/src/main/java/mage/client/table/TablesPanel.java b/Mage.Client/src/main/java/mage/client/table/TablesPanel.java index 3e20c20beb..82d040bf39 100644 --- a/Mage.Client/src/main/java/mage/client/table/TablesPanel.java +++ b/Mage.Client/src/main/java/mage/client/table/TablesPanel.java @@ -120,10 +120,10 @@ public class TablesPanel extends javax.swing.JPanel { public void actionPerformed(ActionEvent e) { int modelRow = Integer.valueOf( e.getActionCommand() ); - UUID tableId = (UUID)tableModel.getValueAt(modelRow, 10); - UUID gameId = (UUID)tableModel.getValueAt(modelRow, 9); + UUID tableId = (UUID)tableModel.getValueAt(modelRow, TableTableModel.ACTION_COLUMN + 3); + UUID gameId = (UUID)tableModel.getValueAt(modelRow, TableTableModel.ACTION_COLUMN + 2); String state = (String)tableModel.getValueAt(modelRow, TableTableModel.ACTION_COLUMN); - boolean isTournament = (Boolean)tableModel.getValueAt(modelRow, 8); + boolean isTournament = (Boolean)tableModel.getValueAt(modelRow, TableTableModel.ACTION_COLUMN + 1); String owner = (String)tableModel.getValueAt(modelRow, 1); if (state.equals("Join")) { @@ -606,9 +606,9 @@ private void chkShowCompletedActionPerformed(java.awt.event.ActionEvent evt) {// class TableTableModel extends AbstractTableModel { - public static int ACTION_COLUMN = 7; // column the action is located (starting with 0) + public static int ACTION_COLUMN = 8; // column the action is located (starting with 0) - private String[] columnNames = new String[]{"Match Name", "Owner / Players", "Game Type", "Deck Type", "Info", "Status", "Created", "Action"}; + private String[] columnNames = new String[]{"Match Name", "Owner / Players", "Game Type", "Wins", "Deck Type", "Info", "Status", "Created", "Action"}; private TableView[] tables = new TableView[0]; private static final DateFormat timeFormatter = SimpleDateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT); @@ -641,16 +641,18 @@ class TableTableModel extends AbstractTableModel { case 1: return tables[arg0].getControllerName(); case 2: - return tables[arg0].getGameType().toString(); + return tables[arg0].getGameType(); case 3: - return tables[arg0].getDeckType().toString(); + return Integer.toString(tables[arg0].getWins()); case 4: - return tables[arg0].getAdditionalInfo().toString(); + return tables[arg0].getDeckType(); case 5: - return tables[arg0].getTableState().toString(); + return tables[arg0].getAdditionalInfo(); case 6: - return timeFormatter.format(tables[arg0].getCreateTime()); + return tables[arg0].getTableState().toString(); case 7: + return timeFormatter.format(tables[arg0].getCreateTime()); + case 8: switch (tables[arg0].getTableState()) { case WAITING: String owner = tables[arg0].getControllerName(); @@ -678,14 +680,14 @@ class TableTableModel extends AbstractTableModel { default: return ""; } - case 8: - return tables[arg0].isTournament(); case 9: + return tables[arg0].isTournament(); + case 10: if (!tables[arg0].getGames().isEmpty()) { return tables[arg0].getGames().get(0); } return null; - case 10: + case 11: return tables[arg0].getTableId(); } return ""; diff --git a/Mage.Common/src/mage/view/TableView.java b/Mage.Common/src/mage/view/TableView.java index 656900350c..5d9ebdf686 100644 --- a/Mage.Common/src/mage/view/TableView.java +++ b/Mage.Common/src/mage/view/TableView.java @@ -49,6 +49,7 @@ public class TableView implements Serializable { private UUID tableId; private String gameType; + private int wins; private String deckType; private String tableName; private String controllerName; @@ -71,19 +72,30 @@ public class TableView implements Serializable { seats.add(new SeatView(seat)); } if (!table.isTournament()) { - this.additionalInfo = new StringBuilder("Wins: ").append(table.getMatch().getWinsNeeded()).toString(); + this.wins = table.getMatch().getWinsNeeded(); for (Game game: table.getMatch().getGames()) { games.add(game.getId()); } StringBuilder sb = new StringBuilder(); + StringBuilder sbScore = new StringBuilder("Score: "); for(MatchPlayer matchPlayer: table.getMatch().getPlayers()) { if (!matchPlayer.getPlayer().getName().equals(table.getControllerName())) { sb.append(", ").append(matchPlayer.getPlayer().getName()); + sbScore.append("-").append(matchPlayer.getWins()); + } else { + sbScore.insert(0,matchPlayer.getWins()).insert(0,"Score: "); } } this.controllerName += sb.toString(); this.deckType = table.getDeckType(); + if (table.getMatch().getGames().isEmpty()) { + this.additionalInfo = ""; + } else { + this.additionalInfo = sbScore.toString(); + } + } else { + this.wins = table.getTournament().getOptions().getMatchOptions().getWinsNeeded(); StringBuilder sb1 = new StringBuilder(); for (TournamentPlayer tp: table.getTournament().getPlayers()) { if (!tp.getPlayer().getName().equals(table.getControllerName())) { @@ -98,7 +110,6 @@ public class TableView implements Serializable { this.additionalInfo = sb.toString(); this.deckType = new StringBuilder(table.getDeckType()).append(" ").append(table.getTournament().getSetsFormatedShort()).toString(); } - } public UUID getTableId() { @@ -117,6 +128,10 @@ public class TableView implements Serializable { return gameType; } + public int getWins() { + return wins; + } + public String getDeckType() { return deckType; } diff --git a/Mage/src/mage/game/tournament/Tournament.java b/Mage/src/mage/game/tournament/Tournament.java index 74a92ca70c..ca37e5c8f5 100644 --- a/Mage/src/mage/game/tournament/Tournament.java +++ b/Mage/src/mage/game/tournament/Tournament.java @@ -70,6 +70,8 @@ public interface Tournament { void addPlayerQueryEventListener(Listener listener); void fireConstructEvent(UUID playerId); + TournamentOptions getOptions(); + // tournament times Date getStartTime(); Date getEndTime(); diff --git a/Mage/src/mage/game/tournament/TournamentImpl.java b/Mage/src/mage/game/tournament/TournamentImpl.java index 01f47bbd67..a25ab5b7a4 100644 --- a/Mage/src/mage/game/tournament/TournamentImpl.java +++ b/Mage/src/mage/game/tournament/TournamentImpl.java @@ -90,6 +90,11 @@ public abstract class TournamentImpl implements Tournament { } } + @Override + public TournamentOptions getOptions() { + return options; + } + @Override public Collection getPlayers() { return players.values(); From 4a0d3c513f13ef63e4546654a417865dd0bd068f Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 10 Jun 2013 17:00:21 +0200 Subject: [PATCH 06/22] [MMA} Added 3 cards. --- .../src/mage/sets/lorwyn/MarshFlitter.java | 52 +++++++ .../modernmasters/FeudkillersVerdict.java | 121 ++++++++++++++++ .../mage/sets/modernmasters/MarshFlitter.java | 100 ++++++++++++++ .../sets/modernmasters/StonehewerGiant.java | 130 ++++++++++++++++++ .../sets/morningtide/FeudkillersVerdict.java | 54 ++++++++ .../sets/morningtide/StonehewerGiant.java | 52 +++++++ 6 files changed, 509 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/lorwyn/MarshFlitter.java create mode 100644 Mage.Sets/src/mage/sets/modernmasters/FeudkillersVerdict.java create mode 100644 Mage.Sets/src/mage/sets/modernmasters/MarshFlitter.java create mode 100644 Mage.Sets/src/mage/sets/modernmasters/StonehewerGiant.java create mode 100644 Mage.Sets/src/mage/sets/morningtide/FeudkillersVerdict.java create mode 100644 Mage.Sets/src/mage/sets/morningtide/StonehewerGiant.java diff --git a/Mage.Sets/src/mage/sets/lorwyn/MarshFlitter.java b/Mage.Sets/src/mage/sets/lorwyn/MarshFlitter.java new file mode 100644 index 0000000000..3eef779cc3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/MarshFlitter.java @@ -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 MarshFlitter extends mage.sets.modernmasters.MarshFlitter { + + public MarshFlitter(UUID ownerId) { + super(ownerId); + this.cardNumber = 125; + this.expansionSetCode = "LRW"; + } + + public MarshFlitter(final MarshFlitter card) { + super(card); + } + + @Override + public MarshFlitter copy() { + return new MarshFlitter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/modernmasters/FeudkillersVerdict.java b/Mage.Sets/src/mage/sets/modernmasters/FeudkillersVerdict.java new file mode 100644 index 0000000000..a30716e316 --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/FeudkillersVerdict.java @@ -0,0 +1,121 @@ +/* + * 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.modernmasters; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.permanent.token.Token; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class FeudkillersVerdict extends CardImpl { + + public FeudkillersVerdict(UUID ownerId) { + super(ownerId, 15, "Feudkiller's Verdict", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{4}{W}{W}"); + this.expansionSetCode = "MMA"; + this.supertype.add("Tribal"); + this.subtype.add("Giant"); + + this.color.setWhite(true); + + // You gain 10 life. Then if you have more life than an opponent, put a 5/5 white Giant Warrior creature token onto the battlefield. + this.getSpellAbility().addEffect(new FeudkillersVerdictEffect()); + } + + public FeudkillersVerdict(final FeudkillersVerdict card) { + super(card); + } + + @Override + public FeudkillersVerdict copy() { + return new FeudkillersVerdict(this); + } +} + +class FeudkillersVerdictEffect extends OneShotEffect { + + public FeudkillersVerdictEffect() { + super(Outcome.Benefit); + this.staticText = "You gain 10 life. Then if you have more life than an opponent, put a 5/5 white Giant Warrior creature token onto the battlefield"; + } + + public FeudkillersVerdictEffect(final FeudkillersVerdictEffect effect) { + super(effect); + } + + @Override + public FeudkillersVerdictEffect copy() { + return new FeudkillersVerdictEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + controller.gainLife(10, game); + boolean moreLife = false; + for (UUID opponentId :game.getOpponents(source.getControllerId())) { + Player opponent = game.getPlayer(opponentId); + if (opponent != null) { + if (controller.getLife() > opponent.getLife()) { + moreLife = true; + break; + } + } + + } + if (moreLife) { + return new CreateTokenEffect(new GiantWarriorToken(), 1).apply(game, source); + } + return true; + } + return false; + } +} + +class GiantWarriorToken extends Token { + GiantWarriorToken() { + super("Warrior", "5/5 white Giant Warrior creature token"); + cardType.add(CardType.CREATURE); + color.setWhite(true); + subtype.add("Warrior"); + power = new MageInt(5); + toughness = new MageInt(5); + } +} diff --git a/Mage.Sets/src/mage/sets/modernmasters/MarshFlitter.java b/Mage.Sets/src/mage/sets/modernmasters/MarshFlitter.java new file mode 100644 index 0000000000..22f0b8e695 --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/MarshFlitter.java @@ -0,0 +1,100 @@ +/* + * 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.modernmasters; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.continious.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.permanent.token.Token; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LevelX2 + */ +public class MarshFlitter extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("a Goblin"); + static { + filter.add(new SubtypePredicate("Goblin")); + } + + public MarshFlitter(UUID ownerId) { + super(ownerId, 91, "Marsh Flitter", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "MMA"; + this.subtype.add("Faerie"); + this.subtype.add("Rogue"); + + this.color.setBlack(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Marsh Flitter enters the battlefield, put two 1/1 black Goblin Rogue creature tokens onto the battlefield. + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new BlackGoblinRogueToken(), 2), false)); + // Sacrifice a Goblin: Marsh Flitter becomes 3/3 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(3, 3, Duration.EndOfTurn), new SacrificeTargetCost(new TargetControlledPermanent(filter))); + this.addAbility(ability); + + } + + public MarshFlitter(final MarshFlitter card) { + super(card); + } + + @Override + public MarshFlitter copy() { + return new MarshFlitter(this); + } +} + +class BlackGoblinRogueToken extends Token { + BlackGoblinRogueToken() { + super("Goblin Rogue", "1/1 black Goblin Rogue creature tokens"); + cardType.add(CardType.CREATURE); + color.setBlack(true); + subtype.add("Goblin"); + subtype.add("Rogue"); + power = new MageInt(1); + toughness = new MageInt(1); + } +} diff --git a/Mage.Sets/src/mage/sets/modernmasters/StonehewerGiant.java b/Mage.Sets/src/mage/sets/modernmasters/StonehewerGiant.java new file mode 100644 index 0000000000..d868a6f77f --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/StonehewerGiant.java @@ -0,0 +1,130 @@ +/* + * 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.modernmasters; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCardInLibrary; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class StonehewerGiant extends CardImpl { + + public StonehewerGiant(UUID ownerId) { + super(ownerId, 31, "Stonehewer Giant", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); + this.expansionSetCode = "MMA"; + this.subtype.add("Giant"); + this.subtype.add("Warrior"); + + this.color.setWhite(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + // {1}{W}, {tap}: Search your library for an Equipment card and put it onto the battlefield. Attach it to a creature you control. Then shuffle your library. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new StonehewerGiantEffect(), new ManaCostsImpl("{1}{W}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + } + + public StonehewerGiant(final StonehewerGiant card) { + super(card); + } + + @Override + public StonehewerGiant copy() { + return new StonehewerGiant(this); + } +} + +class StonehewerGiantEffect extends OneShotEffect { + + public StonehewerGiantEffect() { + super(Outcome.PutCardInPlay); + this.staticText = "Search your library for an Equipment card and put it onto the battlefield. Attach it to a creature you control. Then shuffle your library"; + } + + public StonehewerGiantEffect(final StonehewerGiantEffect effect) { + super(effect); + } + + @Override + public StonehewerGiantEffect copy() { + return new StonehewerGiantEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + + FilterCard filter = new FilterCard("Equipment"); + filter.add(new SubtypePredicate("Equipment")); + TargetCardInLibrary target = new TargetCardInLibrary(filter); + if (player.searchLibrary(target, game)) { + Card card = player.getLibrary().getCard(target.getFirstTarget(), game); + if (card != null) { + card.putOntoBattlefield(game, Zone.LIBRARY, source.getId(), source.getControllerId()); + Permanent equipment = game.getPermanent(card.getId()); + + Target targetCreature = new TargetControlledCreaturePermanent(); + if (equipment != null && player.choose(Outcome.BoostCreature, targetCreature, source.getSourceId(), game)) { + Permanent permanent = game.getPermanent(targetCreature.getFirstTarget()); + permanent.addAttachment(equipment.getId(), game); + } + } + } + player.shuffleLibrary(game); + return true; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/morningtide/FeudkillersVerdict.java b/Mage.Sets/src/mage/sets/morningtide/FeudkillersVerdict.java new file mode 100644 index 0000000000..0f66e76c29 --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/FeudkillersVerdict.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.morningtide; + +import java.util.UUID; +import mage.Constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class FeudkillersVerdict extends mage.sets.modernmasters.FeudkillersVerdict { + + public FeudkillersVerdict(UUID ownerId) { + super(ownerId); + this.cardNumber = 9; + this.expansionSetCode = "MOR"; + this.rarity = Rarity.RARE; + } + + public FeudkillersVerdict(final FeudkillersVerdict card) { + super(card); + } + + @Override + public FeudkillersVerdict copy() { + return new FeudkillersVerdict(this); + } +} diff --git a/Mage.Sets/src/mage/sets/morningtide/StonehewerGiant.java b/Mage.Sets/src/mage/sets/morningtide/StonehewerGiant.java new file mode 100644 index 0000000000..544c5afcd2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/StonehewerGiant.java @@ -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.morningtide; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class StonehewerGiant extends mage.sets.modernmasters.StonehewerGiant { + + public StonehewerGiant(UUID ownerId) { + super(ownerId); + this.cardNumber = 24; + this.expansionSetCode = "MOR"; + } + + public StonehewerGiant(final StonehewerGiant card) { + super(card); + } + + @Override + public StonehewerGiant copy() { + return new StonehewerGiant(this); + } +} From d1fa497b28d2b6d14770cd012764903939dacb99 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 10 Jun 2013 17:16:15 +0200 Subject: [PATCH 07/22] * Elvish Piper - Removed double selection of target creature card. --- Mage.Sets/src/mage/sets/magic2010/ElvishPiper.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/Mage.Sets/src/mage/sets/magic2010/ElvishPiper.java b/Mage.Sets/src/mage/sets/magic2010/ElvishPiper.java index 610788af0b..2fc1cd2538 100644 --- a/Mage.Sets/src/mage/sets/magic2010/ElvishPiper.java +++ b/Mage.Sets/src/mage/sets/magic2010/ElvishPiper.java @@ -36,8 +36,6 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.cards.CardImpl; -import mage.filter.common.FilterCreatureCard; -import mage.target.common.TargetCardInHand; import java.util.UUID; @@ -62,7 +60,6 @@ public class ElvishPiper extends CardImpl { new PutCreatureOnBattlefieldEffect(), new ManaCostsImpl("{G}")); ability.addCost(new TapSourceCost()); - ability.addTarget(new TargetCardInHand(new FilterCreatureCard())); this.addAbility(ability); } From 786b59c923555632f9eda1478c4126babe341149 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 11 Jun 2013 00:14:48 +0200 Subject: [PATCH 08/22] * Master Transmuter - Fixed that the artifact from the hand had to be selected during casting instead correctly during resolving of Master Transmuter's activated ability. --- .../mage/sets/conflux/MasterTransmuter.java | 46 ++++++++++++++++++- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/conflux/MasterTransmuter.java b/Mage.Sets/src/mage/sets/conflux/MasterTransmuter.java index ef7c3c5870..12c4cde6d0 100644 --- a/Mage.Sets/src/mage/sets/conflux/MasterTransmuter.java +++ b/Mage.Sets/src/mage/sets/conflux/MasterTransmuter.java @@ -29,6 +29,7 @@ package mage.sets.conflux; import java.util.UUID; import mage.Constants.CardType; +import mage.Constants.Outcome; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; @@ -37,10 +38,15 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.ReturnToHandTargetCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.PutOntoBattlefieldTargetEffect; +import mage.cards.Card; import mage.cards.CardImpl; import mage.filter.common.FilterArtifactCard; import mage.filter.common.FilterControlledArtifactPermanent; +import mage.game.Game; +import mage.players.Player; +import mage.target.Target; import mage.target.common.TargetCardInHand; import mage.target.common.TargetControlledPermanent; @@ -61,10 +67,9 @@ public class MasterTransmuter extends CardImpl { this.toughness = new MageInt(2); // {U}, {tap}, Return an artifact you control to its owner's hand: You may put an artifact card from your hand onto the battlefield. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutOntoBattlefieldTargetEffect(false, true), new ManaCostsImpl("{U}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MasterTransmuterEffect(), new ManaCostsImpl("{U}")); ability.addCost(new TapSourceCost()); ability.addCost(new ReturnToHandTargetCost(new TargetControlledPermanent(new FilterControlledArtifactPermanent("an artifact")))); - ability.addTarget(new TargetCardInHand(new FilterArtifactCard("an artifact card from your hand"))); this.addAbility(ability); } @@ -78,3 +83,40 @@ public class MasterTransmuter extends CardImpl { return new MasterTransmuter(this); } } + +class MasterTransmuterEffect extends OneShotEffect { + + public MasterTransmuterEffect() { + super(Outcome.Benefit); + this.staticText = "You may put an artifact card from your hand onto the battlefield"; + } + + public MasterTransmuterEffect(final MasterTransmuterEffect effect) { + super(effect); + } + + @Override + public MasterTransmuterEffect copy() { + return new MasterTransmuterEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Target target = new TargetCardInHand(new FilterArtifactCard("an artifact card from your hand")); + target.setRequired(true); + if (target.canChoose(source.getSourceId(), source.getControllerId(), game) + && controller.chooseUse(outcome, "Put an artifact from your hand to battlefield??", game) + && controller.chooseTarget(outcome, target, source, game)) { + Card card = game.getCard(target.getFirstTarget()); + if (card != null) { + controller.getHand().remove(card); + return card.moveToZone(Zone.BATTLEFIELD, source.getId(), game, false); + } + } + } + + return false; + } +} From 29483d3f7caf0e45d0ad2d05a8422b24b8a57614 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 11 Jun 2013 00:15:37 +0200 Subject: [PATCH 09/22] * Goblin Assault - The created tokens have now haste. --- .../sets/shardsofalara/GoblinAssault.java | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/sets/shardsofalara/GoblinAssault.java b/Mage.Sets/src/mage/sets/shardsofalara/GoblinAssault.java index 5690d833e8..7cbfdc5f50 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/GoblinAssault.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/GoblinAssault.java @@ -32,17 +32,21 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Duration; import mage.Constants.Rarity; +import mage.Constants.TargetController; +import mage.MageInt; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.RequirementEffect; import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.game.permanent.token.GoblinToken; +import mage.game.permanent.token.Token; /** * @@ -57,7 +61,7 @@ public class GoblinAssault extends CardImpl { this.color.setRed(true); // At the beginning of your upkeep, put a 1/1 red Goblin creature token with haste onto the battlefield. - this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new GoblinToken()), Constants.TargetController.YOU, false)); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new GoblinAssaultToken()), TargetController.YOU, false)); // Goblin creatures attack each turn if able. this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GoblinAssaultEffect())); } @@ -112,4 +116,18 @@ class GoblinAssaultEffect extends RequirementEffect { return false; } -} \ No newline at end of file +} + +class GoblinAssaultToken extends Token { + + public GoblinAssaultToken() { + super("Goblin", "1/1 red Goblin creature token with haste"); + cardType.add(CardType.CREATURE); + subtype.add("Goblin"); + + color = ObjectColor.RED; + power = new MageInt(1); + toughness = new MageInt(1); + this.addAbility(HasteAbility.getInstance()); + } +} From bfcbe837edccef339f8ac43c03517115f5b06f5c Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 11 Jun 2013 00:16:55 +0200 Subject: [PATCH 10/22] * Haazda Snare Squad - Removed the uneccassary use check. --- Mage.Sets/src/mage/sets/dragonsmaze/HaazdaSnareSquad.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/HaazdaSnareSquad.java b/Mage.Sets/src/mage/sets/dragonsmaze/HaazdaSnareSquad.java index 63eaac94f6..46ddff14ea 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/HaazdaSnareSquad.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/HaazdaSnareSquad.java @@ -67,7 +67,7 @@ public class HaazdaSnareSquad extends CardImpl { this.toughness = new MageInt(4); // Whenever Haazda Snare Squad attacks you may pay {W}. If you do, tap target creature an opponent controls. - Ability ability = new AttacksTriggeredAbility(new DoIfCostPaid(new TapTargetEffect(""), new ManaCostsImpl("{W}")),true, + Ability ability = new AttacksTriggeredAbility(new DoIfCostPaid(new TapTargetEffect(""), new ManaCostsImpl("{W}")),false, "Whenever {this} attacks you may pay {W}. If you do, tap target creature an opponent controls."); Target target = new TargetCreaturePermanent(filter); target.setRequired(true); From 029bdc059d989f805be387deb759d25b19467cb5 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 11 Jun 2013 00:17:41 +0200 Subject: [PATCH 11/22] Fixed a bug of EntersBattlefieldAllTriggeredAbility that zone != battlefield did not work. --- .../abilities/common/EntersBattlefieldAllTriggeredAbility.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage/src/mage/abilities/common/EntersBattlefieldAllTriggeredAbility.java b/Mage/src/mage/abilities/common/EntersBattlefieldAllTriggeredAbility.java index 06fd69966e..030107bd5a 100644 --- a/Mage/src/mage/abilities/common/EntersBattlefieldAllTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/EntersBattlefieldAllTriggeredAbility.java @@ -79,7 +79,7 @@ public class EntersBattlefieldAllTriggeredAbility extends TriggeredAbilityImpl { } public EntersBattlefieldAllTriggeredAbility(Zone zone, Effect effect, FilterPermanent filter, boolean optional, boolean setTargetPointer, String rule, boolean controlled) { - super(Zone.BATTLEFIELD, effect, optional); + super(zone, effect, optional); this.filter = filter; this.rule = rule; this.controlled = controlled; From 43581bd015bef233b3bc7f288701824e725ef0d5 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 11 Jun 2013 00:18:00 +0200 Subject: [PATCH 12/22] [MMA] Added 5 cards. --- .../src/mage/sets/lorwyn/Peppersmoke.java | 52 +++++++++++ .../mage/sets/modernmasters/BruteForce.java | 52 +++++++++++ .../modernmasters/CitanulWoodreaders.java | 52 +++++++++++ .../sets/modernmasters/GiantDustwasp.java | 52 +++++++++++ .../mage/sets/modernmasters/Peppersmoke.java | 79 ++++++++++++++++ .../sets/modernmasters/ReachOfBranches.java | 89 +++++++++++++++++++ .../sets/morningtide/ReachOfBranches.java | 54 +++++++++++ .../src/mage/sets/planarchaos/BruteForce.java | 63 +++++++++++++ .../sets/planarchaos/CitanulWoodreaders.java | 73 +++++++++++++++ .../mage/sets/planarchaos/GiantDustwasp.java | 68 ++++++++++++++ 10 files changed, 634 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/lorwyn/Peppersmoke.java create mode 100644 Mage.Sets/src/mage/sets/modernmasters/BruteForce.java create mode 100644 Mage.Sets/src/mage/sets/modernmasters/CitanulWoodreaders.java create mode 100644 Mage.Sets/src/mage/sets/modernmasters/GiantDustwasp.java create mode 100644 Mage.Sets/src/mage/sets/modernmasters/Peppersmoke.java create mode 100644 Mage.Sets/src/mage/sets/modernmasters/ReachOfBranches.java create mode 100644 Mage.Sets/src/mage/sets/morningtide/ReachOfBranches.java create mode 100644 Mage.Sets/src/mage/sets/planarchaos/BruteForce.java create mode 100644 Mage.Sets/src/mage/sets/planarchaos/CitanulWoodreaders.java create mode 100644 Mage.Sets/src/mage/sets/planarchaos/GiantDustwasp.java diff --git a/Mage.Sets/src/mage/sets/lorwyn/Peppersmoke.java b/Mage.Sets/src/mage/sets/lorwyn/Peppersmoke.java new file mode 100644 index 0000000000..3c9c7b6f56 --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/Peppersmoke.java @@ -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 Peppersmoke extends mage.sets.modernmasters.Peppersmoke { + + public Peppersmoke(UUID ownerId) { + super(ownerId); + this.cardNumber = 134; + this.expansionSetCode = "LRW"; + } + + public Peppersmoke(final Peppersmoke card) { + super(card); + } + + @Override + public Peppersmoke copy() { + return new Peppersmoke(this); + } +} diff --git a/Mage.Sets/src/mage/sets/modernmasters/BruteForce.java b/Mage.Sets/src/mage/sets/modernmasters/BruteForce.java new file mode 100644 index 0000000000..b6b6c018b5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/BruteForce.java @@ -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.modernmasters; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class BruteForce extends mage.sets.planarchaos.BruteForce { + + public BruteForce(UUID ownerId) { + super(ownerId); + this.cardNumber = 107; + this.expansionSetCode = "MMA"; + } + + public BruteForce(final BruteForce card) { + super(card); + } + + @Override + public BruteForce copy() { + return new BruteForce(this); + } +} diff --git a/Mage.Sets/src/mage/sets/modernmasters/CitanulWoodreaders.java b/Mage.Sets/src/mage/sets/modernmasters/CitanulWoodreaders.java new file mode 100644 index 0000000000..891b2ada39 --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/CitanulWoodreaders.java @@ -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.modernmasters; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class CitanulWoodreaders extends mage.sets.planarchaos.CitanulWoodreaders { + + public CitanulWoodreaders(UUID ownerId) { + super(ownerId); + this.cardNumber = 140; + this.expansionSetCode = "MMA"; + } + + public CitanulWoodreaders(final CitanulWoodreaders card) { + super(card); + } + + @Override + public CitanulWoodreaders copy() { + return new CitanulWoodreaders(this); + } +} diff --git a/Mage.Sets/src/mage/sets/modernmasters/GiantDustwasp.java b/Mage.Sets/src/mage/sets/modernmasters/GiantDustwasp.java new file mode 100644 index 0000000000..0c5434703e --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/GiantDustwasp.java @@ -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.modernmasters; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class GiantDustwasp extends mage.sets.planarchaos.GiantDustwasp { + + public GiantDustwasp(UUID ownerId) { + super(ownerId); + this.cardNumber = 145; + this.expansionSetCode = "MMA"; + } + + public GiantDustwasp(final GiantDustwasp card) { + super(card); + } + + @Override + public GiantDustwasp copy() { + return new GiantDustwasp(this); + } +} diff --git a/Mage.Sets/src/mage/sets/modernmasters/Peppersmoke.java b/Mage.Sets/src/mage/sets/modernmasters/Peppersmoke.java new file mode 100644 index 0000000000..7526c6d767 --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/Peppersmoke.java @@ -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.modernmasters; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Rarity; +import mage.abilities.condition.common.ControlsPermanentCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.DrawCardControllerEffect; +import mage.abilities.effects.common.continious.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class Peppersmoke extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("If you control a Faerie,"); + static { + filter.add(new SubtypePredicate("Faerie")); + } + + public Peppersmoke(UUID ownerId) { + super(ownerId, 92, "Peppersmoke", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}"); + this.expansionSetCode = "MMA"; + this.supertype.add("Tribal"); + this.subtype.add("Faerie"); + + this.color.setBlack(true); + + // Target creature gets -1/-1 until end of turn. If you control a Faerie, draw a card. + this.getSpellAbility().addEffect(new BoostTargetEffect(-1,-1,Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(true)); + this.getSpellAbility().addEffect( + new ConditionalOneShotEffect(new DrawCardControllerEffect(1), + new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0), + "If you control a Faerie, draw a card")); + } + + public Peppersmoke(final Peppersmoke card) { + super(card); + } + + @Override + public Peppersmoke copy() { + return new Peppersmoke(this); + } +} diff --git a/Mage.Sets/src/mage/sets/modernmasters/ReachOfBranches.java b/Mage.Sets/src/mage/sets/modernmasters/ReachOfBranches.java new file mode 100644 index 0000000000..69cb1cbe63 --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/ReachOfBranches.java @@ -0,0 +1,89 @@ +/* + * 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.modernmasters; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect; +import mage.cards.CardImpl; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.permanent.token.Token; + +/** + * + * @author LevelX2 + */ +public class ReachOfBranches extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent("Forest"); + static { + filter.add(new SubtypePredicate("Forest")); + } + + public ReachOfBranches(UUID ownerId) { + super(ownerId, 158, "Reach of Branches", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{4}{G}"); + this.expansionSetCode = "MMA"; + this.supertype.add("Tribal"); + this.subtype.add("Treefolk"); + + this.color.setGreen(true); + + // Put a 2/5 green Treefolk Shaman creature token onto the battlefield. + this.getSpellAbility().addEffect(new CreateTokenEffect(new TreefolkShamanToken())); + // Whenever a Forest enters the battlefield under your control, you may return Reach of Branches from your graveyard to your hand. + this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(),filter, true, "", true)); + } + + public ReachOfBranches(final ReachOfBranches card) { + super(card); + } + + @Override + public ReachOfBranches copy() { + return new ReachOfBranches(this); + } +} + +class TreefolkShamanToken extends Token { + TreefolkShamanToken() { + super("Treefolk Shaman", "2/5 green Treefolk Shaman creature token"); + cardType.add(CardType.CREATURE); + color.setBlack(true); + subtype.add("Shaman"); + subtype.add("Rogue"); + power = new MageInt(2); + toughness = new MageInt(5); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/morningtide/ReachOfBranches.java b/Mage.Sets/src/mage/sets/morningtide/ReachOfBranches.java new file mode 100644 index 0000000000..f3b2f79871 --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/ReachOfBranches.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.morningtide; + +import java.util.UUID; +import mage.Constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class ReachOfBranches extends mage.sets.modernmasters.ReachOfBranches { + + public ReachOfBranches(UUID ownerId) { + super(ownerId); + this.cardNumber = 132; + this.expansionSetCode = "MOR"; + this.rarity = Rarity.RARE; + } + + public ReachOfBranches(final ReachOfBranches card) { + super(card); + } + + @Override + public ReachOfBranches copy() { + return new ReachOfBranches(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/BruteForce.java b/Mage.Sets/src/mage/sets/planarchaos/BruteForce.java new file mode 100644 index 0000000000..0ffa508ce1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/BruteForce.java @@ -0,0 +1,63 @@ +/* + * 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.planarchaos; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Rarity; +import mage.abilities.effects.common.continious.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class BruteForce extends CardImpl { + + public BruteForce(UUID ownerId) { + super(ownerId, 116, "Brute Force", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); + this.expansionSetCode = "PLC"; + + this.color.setRed(true); + + // Target creature gets +3/+3 until end of turn. + this.getSpellAbility().getEffects().add(new BoostTargetEffect(3,3, Duration.EndOfTurn)); + this.getSpellAbility().getTargets().add(new TargetCreaturePermanent(true)); + } + + public BruteForce(final BruteForce card) { + super(card); + } + + @Override + public BruteForce copy() { + return new BruteForce(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/CitanulWoodreaders.java b/Mage.Sets/src/mage/sets/planarchaos/CitanulWoodreaders.java new file mode 100644 index 0000000000..d4ba95d178 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/CitanulWoodreaders.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.common.KickedCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.DrawCardControllerEffect; +import mage.abilities.keyword.KickerAbility; +import mage.cards.CardImpl; + +/** + * + * @author LevelX2 + */ +public class CitanulWoodreaders extends CardImpl { + + public CitanulWoodreaders(UUID ownerId) { + super(ownerId, 125, "Citanul Woodreaders", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Human"); + this.subtype.add("Druid"); + + this.color.setGreen(true); + this.power = new MageInt(1); + this.toughness = new MageInt(4); + + // Kicker {2}{G} + this.addAbility(new KickerAbility("{2}{G}")); + // When Citanul Woodreaders enters the battlefield, if it was kicked, draw two cards. + this.addAbility(new ConditionalTriggeredAbility( + new EntersBattlefieldTriggeredAbility(new DrawCardControllerEffect(2)), + KickedCondition.getInstance(),"When Citanul Woodreaders enters the battlefield, if it was kicked, draw two cards.")); + } + + public CitanulWoodreaders(final CitanulWoodreaders card) { + super(card); + } + + @Override + public CitanulWoodreaders copy() { + return new CitanulWoodreaders(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/GiantDustwasp.java b/Mage.Sets/src/mage/sets/planarchaos/GiantDustwasp.java new file mode 100644 index 0000000000..43bc88b15b --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/GiantDustwasp.java @@ -0,0 +1,68 @@ +/* + * 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.planarchaos; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.SuspendAbility; +import mage.cards.CardImpl; + +/** + * + * @author LevelX2 + */ +public class GiantDustwasp extends CardImpl { + + public GiantDustwasp(UUID ownerId) { + super(ownerId, 129, "Giant Dustwasp", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Insect"); + + this.color.setGreen(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Suspend 4-{1}{G} + this.addAbility(new SuspendAbility(4, new ManaCostsImpl("{1}{G}"), this)); + } + + public GiantDustwasp(final GiantDustwasp card) { + super(card); + } + + @Override + public GiantDustwasp copy() { + return new GiantDustwasp(this); + } +} From 68fc9de5fc8dcf4f2e08f24f1877b001b99edc27 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 11 Jun 2013 17:19:37 +0200 Subject: [PATCH 13/22] Support of DynamicValues added to SacrificeAll effect. --- .../effects/common/SacrificeAllEffect.java | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/Mage/src/mage/abilities/effects/common/SacrificeAllEffect.java b/Mage/src/mage/abilities/effects/common/SacrificeAllEffect.java index 7e271bbcbf..87c60ff2a5 100644 --- a/Mage/src/mage/abilities/effects/common/SacrificeAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/SacrificeAllEffect.java @@ -28,18 +28,21 @@ package mage.abilities.effects.common; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; import mage.Constants.Outcome; import mage.abilities.Ability; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.OneShotEffect; import mage.filter.common.FilterControlledPermanent; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetControlledPermanent; +import mage.util.CardUtil; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; /** * @@ -47,18 +50,21 @@ import java.util.UUID; */ public class SacrificeAllEffect extends OneShotEffect { - protected int amount; + protected DynamicValue amount; protected FilterControlledPermanent filter; public SacrificeAllEffect(FilterControlledPermanent filter) { this(1, filter); } - public SacrificeAllEffect(int amount, FilterControlledPermanent filter) { + this(new StaticValue(amount), filter); + } + + public SacrificeAllEffect(DynamicValue amount, FilterControlledPermanent filter) { super(Outcome.Sacrifice); this.amount = amount; this.filter = filter; - setText(); + setText(); } public SacrificeAllEffect(final SacrificeAllEffect effect) { @@ -83,7 +89,7 @@ public class SacrificeAllEffect extends OneShotEffect { for (UUID playerId : controller.getInRange()) { Player player = game.getPlayer(playerId); if (player != null) { - int numTargets = Math.min(amount, game.getBattlefield().countAll(filter, player.getId(), game)); + int numTargets = Math.min(amount.calculate(game, source), game.getBattlefield().countAll(filter, player.getId(), game)); TargetControlledPermanent target = new TargetControlledPermanent(numTargets, numTargets, filter, false); if (target.canChoose(player.getId(), game)) { while (!target.isChosen()) { @@ -105,13 +111,13 @@ public class SacrificeAllEffect extends OneShotEffect { private void setText() { StringBuilder sb = new StringBuilder(); sb.append("Each players sacrifices "); - if (amount > 1) - sb.append(amount).append(" "); - else - sb.append("a "); + if (amount.toString().equals("X")) { + sb.append(amount.toString()).append(" "); + } else { + sb.append(CardUtil.numberToText(amount.toString())); + } sb.append(filter.getMessage()); staticText = sb.toString(); } - } From 8985d9b627ba5566aced113f011fbe00dffc0e20 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 11 Jun 2013 17:20:16 +0200 Subject: [PATCH 14/22] Changed wrong rules text of Elderwood Scion (internal). --- Mage.Sets/src/mage/sets/planechase2012/ElderwoodScion.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/planechase2012/ElderwoodScion.java b/Mage.Sets/src/mage/sets/planechase2012/ElderwoodScion.java index c29281c18f..b1a7c04688 100644 --- a/Mage.Sets/src/mage/sets/planechase2012/ElderwoodScion.java +++ b/Mage.Sets/src/mage/sets/planechase2012/ElderwoodScion.java @@ -85,7 +85,7 @@ public class ElderwoodScion extends CardImpl { class ElderwoodScionCostReductionEffect extends CostModificationEffectImpl { - private static final String effectText = "Spells your opponents cast that target Elderwood Scion cost {2} more to cast"; + private static final String effectText = "Spells you cast that target {this} cost {2} less to cast"; ElderwoodScionCostReductionEffect() { super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); @@ -128,7 +128,7 @@ class ElderwoodScionCostReductionEffect extends CostModificationEffectImpl { - private static final String effectText = "Spells you cast that target {this} cost {2} less to cast"; + private static final String effectText = "Spells your opponents cast that target Elderwood Scion cost {2} more to cast"; ElderwoodScionCostReductionEffect2() { super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); From 21e88c1ce3981ca35f5242d96fb8ca174fe7cd13 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 11 Jun 2013 17:22:06 +0200 Subject: [PATCH 15/22] ConditionalTriggeredAbility checks condition now as interveningIfClause. --- .../abilities/decorator/ConditionalTriggeredAbility.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Mage/src/mage/abilities/decorator/ConditionalTriggeredAbility.java b/Mage/src/mage/abilities/decorator/ConditionalTriggeredAbility.java index a7cf2a6ed5..81fc32573b 100644 --- a/Mage/src/mage/abilities/decorator/ConditionalTriggeredAbility.java +++ b/Mage/src/mage/abilities/decorator/ConditionalTriggeredAbility.java @@ -36,6 +36,11 @@ public class ConditionalTriggeredAbility extends TriggeredAbilityImpl Date: Tue, 11 Jun 2013 17:22:21 +0200 Subject: [PATCH 16/22] Minor formatting. --- Mage/src/mage/cards/CardsImpl.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Mage/src/mage/cards/CardsImpl.java b/Mage/src/mage/cards/CardsImpl.java index 8875f3256e..8d9e804ec8 100644 --- a/Mage/src/mage/cards/CardsImpl.java +++ b/Mage/src/mage/cards/CardsImpl.java @@ -87,15 +87,17 @@ public class CardsImpl extends LinkedHashSet implements Cards, Serializabl @Override public Card get(UUID cardId, Game game) { - if (this.contains(cardId)) + if (this.contains(cardId)) { return game.getCard(cardId); + } return null; } @Override public void remove(Card card) { - if (card == null) + if (card == null) { return; + } this.remove(card.getId()); } @@ -109,8 +111,9 @@ public class CardsImpl extends LinkedHashSet implements Cards, Serializabl @Override public Card getRandom(Game game) { - if (this.size() == 0) + if (this.size() == 0) { return null; + } UUID[] cards = this.toArray(new UUID[0]); return game.getCard(cards[rnd.nextInt(cards.length)]); } @@ -118,9 +121,10 @@ public class CardsImpl extends LinkedHashSet implements Cards, Serializabl @Override public int count(FilterCard filter, Game game) { int result = 0; - for (UUID card: this) { - if (filter.match(game.getCard(card), game)) + for (UUID cardId: this) { + if (filter.match(game.getCard(cardId), game)) { result++; + } } return result; } From 6a48fe993e6c64a812679958de9e7d74aba29cc7 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 11 Jun 2013 17:22:41 +0200 Subject: [PATCH 17/22] [MMA] added 4 cards. --- .../championsofkamigawa/PetalsOfInsight.java | 54 +++++++ .../src/mage/sets/darksteel/DeathCloud.java | 52 +++++++ .../dissension/GrandArbiterAugustinIV.java | 52 +++++++ .../mage/sets/modernmasters/DeathCloud.java | 70 +++++++++ .../modernmasters/GrandArbiterAugustinIV.java | 127 +++++++++++++++++ .../sets/modernmasters/NantukoShaman.java | 52 +++++++ .../sets/modernmasters/PetalsOfInsight.java | 133 ++++++++++++++++++ .../mage/sets/timespiral/NantukoShaman.java | 85 +++++++++++ 8 files changed, 625 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/championsofkamigawa/PetalsOfInsight.java create mode 100644 Mage.Sets/src/mage/sets/darksteel/DeathCloud.java create mode 100644 Mage.Sets/src/mage/sets/dissension/GrandArbiterAugustinIV.java create mode 100644 Mage.Sets/src/mage/sets/modernmasters/DeathCloud.java create mode 100644 Mage.Sets/src/mage/sets/modernmasters/GrandArbiterAugustinIV.java create mode 100644 Mage.Sets/src/mage/sets/modernmasters/NantukoShaman.java create mode 100644 Mage.Sets/src/mage/sets/modernmasters/PetalsOfInsight.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/NantukoShaman.java diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/PetalsOfInsight.java b/Mage.Sets/src/mage/sets/championsofkamigawa/PetalsOfInsight.java new file mode 100644 index 0000000000..b0670a1ff8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/PetalsOfInsight.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.championsofkamigawa; + +import java.util.UUID; +import mage.Constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class PetalsOfInsight extends mage.sets.modernmasters.PetalsOfInsight { + + public PetalsOfInsight(UUID ownerId) { + super(ownerId); + this.cardNumber = 79; + this.expansionSetCode = "CHK"; + this.rarity = Rarity.UNCOMMON; + } + + public PetalsOfInsight(final PetalsOfInsight card) { + super(card); + } + + @Override + public PetalsOfInsight copy() { + return new PetalsOfInsight(this); + } +} diff --git a/Mage.Sets/src/mage/sets/darksteel/DeathCloud.java b/Mage.Sets/src/mage/sets/darksteel/DeathCloud.java new file mode 100644 index 0000000000..4b44df31e7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/darksteel/DeathCloud.java @@ -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.darksteel; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class DeathCloud extends mage.sets.modernmasters.DeathCloud { + + public DeathCloud(UUID ownerId) { + super(ownerId); + this.cardNumber = 40; + this.expansionSetCode = "DST"; + } + + public DeathCloud(final DeathCloud card) { + super(card); + } + + @Override + public DeathCloud copy() { + return new DeathCloud(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/GrandArbiterAugustinIV.java b/Mage.Sets/src/mage/sets/dissension/GrandArbiterAugustinIV.java new file mode 100644 index 0000000000..18a5176569 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/GrandArbiterAugustinIV.java @@ -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.dissension; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class GrandArbiterAugustinIV extends mage.sets.modernmasters.GrandArbiterAugustinIV { + + public GrandArbiterAugustinIV(UUID ownerId) { + super(ownerId); + this.cardNumber = 112; + this.expansionSetCode = "DIS"; + } + + public GrandArbiterAugustinIV(final GrandArbiterAugustinIV card) { + super(card); + } + + @Override + public GrandArbiterAugustinIV copy() { + return new GrandArbiterAugustinIV(this); + } +} diff --git a/Mage.Sets/src/mage/sets/modernmasters/DeathCloud.java b/Mage.Sets/src/mage/sets/modernmasters/DeathCloud.java new file mode 100644 index 0000000000..3f40f83d26 --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/DeathCloud.java @@ -0,0 +1,70 @@ +/* + * 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.modernmasters; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.common.DiscardEachPlayerEffect; +import mage.abilities.effects.common.LoseLifePlayersEffect; +import mage.abilities.effects.common.SacrificeAllEffect; +import mage.cards.CardImpl; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterControlledLandPermanent; + +/** + * + * @author LevelX2 + */ +public class DeathCloud extends CardImpl { + + public DeathCloud(UUID ownerId) { + super(ownerId, 76, "Death Cloud", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{B}{B}{B}"); + this.expansionSetCode = "MMA"; + + this.color.setBlack(true); + + // Each player loses X life, discards X cards, sacrifices X creatures, then sacrifices X lands. + DynamicValue xValue = new ManacostVariableValue(); + this.getSpellAbility().addEffect(new LoseLifePlayersEffect(xValue)); + this.getSpellAbility().addEffect(new DiscardEachPlayerEffect(xValue, false)); + this.getSpellAbility().addEffect(new SacrificeAllEffect(xValue, new FilterControlledCreaturePermanent("creatures"))); + this.getSpellAbility().addEffect(new SacrificeAllEffect(xValue, new FilterControlledLandPermanent("lands"))); + } + + public DeathCloud(final DeathCloud card) { + super(card); + } + + @Override + public DeathCloud copy() { + return new DeathCloud(this); + } +} diff --git a/Mage.Sets/src/mage/sets/modernmasters/GrandArbiterAugustinIV.java b/Mage.Sets/src/mage/sets/modernmasters/GrandArbiterAugustinIV.java new file mode 100644 index 0000000000..a0af663b5f --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/GrandArbiterAugustinIV.java @@ -0,0 +1,127 @@ +/* + * 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.modernmasters; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.CostModificationEffectImpl; +import mage.abilities.effects.common.cost.SpellsCostReductionEffect; +import mage.cards.CardImpl; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.Game; +import mage.util.CardUtil; + +/** + * + * @author LevelX2 + */ +public class GrandArbiterAugustinIV extends CardImpl { + + private static final FilterCard filterWhite = new FilterCard("White spells"); + private static final FilterCard filterBlue = new FilterCard("Blue spells"); + static { + filterWhite.add(new ColorPredicate(ObjectColor.WHITE)); + filterBlue.add(new ColorPredicate(ObjectColor.BLUE)); + } + + public GrandArbiterAugustinIV(UUID ownerId) { + super(ownerId, 176, "Grand Arbiter Augustin IV", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W}{U}"); + this.expansionSetCode = "MMA"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Advisor"); + + this.color.setBlue(true); + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // White spells you cast cost {1} less to cast. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostReductionEffect(filterWhite, 1))); + // Blue spells you cast cost {1} less to cast. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostReductionEffect(filterBlue, 1))); + // Spells your opponents cast cost {1} more to cast. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GrandArbiterAugustinIVCostIncreaseEffect())); + } + + public GrandArbiterAugustinIV(final GrandArbiterAugustinIV card) { + super(card); + } + + @Override + public GrandArbiterAugustinIV copy() { + return new GrandArbiterAugustinIV(this); + } +} + +class GrandArbiterAugustinIVCostIncreaseEffect extends CostModificationEffectImpl { + + private static final String effectText = "Spells your opponents cast cost {1} more to cast"; + + GrandArbiterAugustinIVCostIncreaseEffect() { + super(Constants.Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = effectText; + } + + GrandArbiterAugustinIVCostIncreaseEffect(GrandArbiterAugustinIVCostIncreaseEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source, Ability abilityToModify) { + SpellAbility spellAbility = (SpellAbility) abilityToModify; + CardUtil.adjustCost(spellAbility, -1); + return true; + } + + @Override + public boolean applies(Ability abilityToModify, Ability source, Game game) { + if (abilityToModify instanceof SpellAbility) { + if (game.getOpponents(source.getControllerId()).contains(abilityToModify.getControllerId())) { + return true; + } + } + return false; + } + + @Override + public GrandArbiterAugustinIVCostIncreaseEffect copy() { + return new GrandArbiterAugustinIVCostIncreaseEffect(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/modernmasters/NantukoShaman.java b/Mage.Sets/src/mage/sets/modernmasters/NantukoShaman.java new file mode 100644 index 0000000000..8cb23e9a0b --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/NantukoShaman.java @@ -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.modernmasters; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class NantukoShaman extends mage.sets.timespiral.NantukoShaman { + + public NantukoShaman(UUID ownerId) { + super(ownerId); + this.cardNumber = 156; + this.expansionSetCode = "MMA"; + } + + public NantukoShaman(final NantukoShaman card) { + super(card); + } + + @Override + public NantukoShaman copy() { + return new NantukoShaman(this); + } +} diff --git a/Mage.Sets/src/mage/sets/modernmasters/PetalsOfInsight.java b/Mage.Sets/src/mage/sets/modernmasters/PetalsOfInsight.java new file mode 100644 index 0000000000..30d77f0f6c --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/PetalsOfInsight.java @@ -0,0 +1,133 @@ +/* + * 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.modernmasters; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; + +/** + * + * @author LevelX2 + */ +public class PetalsOfInsight extends CardImpl { + + public PetalsOfInsight(UUID ownerId) { + super(ownerId, 60, "Petals of Insight", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{4}{U}"); + this.expansionSetCode = "MMA"; + this.subtype.add("Arcane"); + + this.color.setBlue(true); + + // Look at the top three cards of your library. You may put those cards on the bottom of your library in any order. If you do, return Petals of Insight to its owner's hand. Otherwise, draw three cards. + this.getSpellAbility().addEffect(new PetalsOfInsightEffect()); + } + + public PetalsOfInsight(final PetalsOfInsight card) { + super(card); + } + + @Override + public PetalsOfInsight copy() { + return new PetalsOfInsight(this); + } +} + +class PetalsOfInsightEffect extends OneShotEffect { + + public PetalsOfInsightEffect() { + super(Outcome.Benefit); + this.staticText = "Look at the top three cards of your library. You may put those cards on the bottom of your library in any order. If you do, return Petals of Insight to its owner's hand. Otherwise, draw three cards"; + } + + public PetalsOfInsightEffect(final PetalsOfInsightEffect effect) { + super(effect); + } + + @Override + public PetalsOfInsightEffect copy() { + return new PetalsOfInsightEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + Cards cards = new CardsImpl(Zone.PICK); + int count = Math.min(player.getLibrary().size(), 3); + for (int i = 0; i < count; i++) { + Card card = player.getLibrary().removeFromTop(game); + if (card != null) { + cards.add(card); + game.setZone(card.getId(), Zone.PICK); + } + } + player.lookAtCards("Petals of Insight", cards, game); + if (player.chooseUse(outcome, "Put the cards on the bottom of your library in any order?", game)) { + TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the bottom of your library")); + target.setRequired(true); + while (cards.size() > 1) { + player.choose(Outcome.Neutral, cards, target, game); + Card card = cards.get(target.getFirstTarget(), game); + if (card != null) { + cards.remove(card); + card.moveToZone(Zone.LIBRARY, source.getId(), game, false); + } + target.clearChosen(); + } + if (cards.size() == 1) { + Card card = cards.get(cards.iterator().next(), game); + card.moveToZone(Zone.LIBRARY, source.getId(), game, false); + } + } else { + for (UUID cardId: cards) { + Card card = game.getCard(cardId); + if (card != null) { + card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); + } + } + player.drawCards(3, game, null); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/NantukoShaman.java b/Mage.Sets/src/mage/sets/timespiral/NantukoShaman.java new file mode 100644 index 0000000000..a78a0c22bc --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/NantukoShaman.java @@ -0,0 +1,85 @@ +/* + * 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.timespiral; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.common.ControlsPermanentCondition; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.DrawCardControllerEffect; +import mage.abilities.keyword.SuspendAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.permanent.TappedPredicate; + +/** + * + * @author LevelX2 + */ +public class NantukoShaman extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent(); + static { + filter.add(new TappedPredicate()); + } + + public NantukoShaman(UUID ownerId) { + super(ownerId, 208, "Nantuko Shaman", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Insect"); + this.subtype.add("Shaman"); + + this.color.setGreen(true); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // When Nantuko Shaman enters the battlefield, if you control no tapped lands, draw a card. + Ability ability = new ConditionalTriggeredAbility( + new EntersBattlefieldTriggeredAbility(new DrawCardControllerEffect(1)), + new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.EQUAL_TO, 0), + "When {this} enters the battlefield, if you control no tapped lands, draw a card"); + this.addAbility(ability); + + // Suspend 1-{2}{G}{G} + this.addAbility(new SuspendAbility(1, new ManaCostsImpl("{2}{G}{G}"), this)); + } + + public NantukoShaman(final NantukoShaman card) { + super(card); + } + + @Override + public NantukoShaman copy() { + return new NantukoShaman(this); + } +} From 412692096246f2088cf2d645df5faa72a0d46ac8 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 11 Jun 2013 21:45:19 +0200 Subject: [PATCH 18/22] * Armed // Dangerous - Fixed rule text of Dangerous, Ability lasts until end of combat (not 100% correct). --- Mage.Sets/src/mage/sets/dragonsmaze/ArmedDangerous.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/ArmedDangerous.java b/Mage.Sets/src/mage/sets/dragonsmaze/ArmedDangerous.java index 65637794e2..c21ae44f89 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/ArmedDangerous.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/ArmedDangerous.java @@ -34,6 +34,7 @@ import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.MustBlockSourceEffect; import mage.abilities.effects.common.continious.BoostTargetEffect; import mage.abilities.effects.common.continious.GainAbilityTargetEffect; @@ -66,10 +67,12 @@ public class ArmedDangerous extends SplitCard { // Dangerous // All creatures able to block target creature this turn do so. getRightHalfCard().getColor().setGreen(true); - getRightHalfCard().getSpellAbility().addEffect(new GainAbilityTargetEffect(new SimpleStaticAbility(Zone.BATTLEFIELD, new MustBlockSourceEffect()), Duration.EndOfTurn)); + Effect effect = new GainAbilityTargetEffect( + new SimpleStaticAbility(Zone.BATTLEFIELD, new MustBlockSourceEffect(Duration.EndOfCombat)), Duration.EndOfTurn, + "All creatures able to block target creature this turn do so"); + getRightHalfCard().getSpellAbility().addEffect(effect); getRightHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent(true)); - } public ArmedDangerous(final ArmedDangerous card) { From d94d0b5b92a9f1909532e0667245a095f4e2ad8b Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 11 Jun 2013 21:45:45 +0200 Subject: [PATCH 19/22] [MMA] Added 4 cards. --- .../mage/sets/coldsnap/PerilousResearch.java | 52 +++++++++ .../mage/sets/commander/PerilousResearch.java | 105 ++++++++++++++++++ .../sets/modernmasters/ErrantEphemeron.java | 52 +++++++++ .../sets/modernmasters/PerilousResearch.java | 54 +++++++++ .../modernmasters/RiftwingCloudskate.java | 52 +++++++++ .../sets/modernmasters/WoodfallPrimus.java | 52 +++++++++ .../mage/sets/shadowmoor/WoodfallPrimus.java | 84 ++++++++++++++ .../mage/sets/timespiral/ErrantEphemeron.java | 68 ++++++++++++ .../sets/timespiral/RiftwingCloudskate.java | 77 +++++++++++++ 9 files changed, 596 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/coldsnap/PerilousResearch.java create mode 100644 Mage.Sets/src/mage/sets/commander/PerilousResearch.java create mode 100644 Mage.Sets/src/mage/sets/modernmasters/ErrantEphemeron.java create mode 100644 Mage.Sets/src/mage/sets/modernmasters/PerilousResearch.java create mode 100644 Mage.Sets/src/mage/sets/modernmasters/RiftwingCloudskate.java create mode 100644 Mage.Sets/src/mage/sets/modernmasters/WoodfallPrimus.java create mode 100644 Mage.Sets/src/mage/sets/shadowmoor/WoodfallPrimus.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/ErrantEphemeron.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/RiftwingCloudskate.java diff --git a/Mage.Sets/src/mage/sets/coldsnap/PerilousResearch.java b/Mage.Sets/src/mage/sets/coldsnap/PerilousResearch.java new file mode 100644 index 0000000000..37fa0a5ba7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/PerilousResearch.java @@ -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.coldsnap; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class PerilousResearch extends mage.sets.commander.PerilousResearch { + + public PerilousResearch(UUID ownerId) { + super(ownerId); + this.cardNumber = 41; + this.expansionSetCode = "CSP"; + } + + public PerilousResearch(final PerilousResearch card) { + super(card); + } + + @Override + public PerilousResearch copy() { + return new PerilousResearch(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander/PerilousResearch.java b/Mage.Sets/src/mage/sets/commander/PerilousResearch.java new file mode 100644 index 0000000000..ffaef27f57 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander/PerilousResearch.java @@ -0,0 +1,105 @@ +/* + * 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.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardControllerEffect; +import mage.abilities.effects.common.SacrificeEffect; +import mage.cards.CardImpl; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LevelX2 + */ +public class PerilousResearch extends CardImpl { + + public PerilousResearch(UUID ownerId) { + super(ownerId, 54, "Perilous Research", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); + this.expansionSetCode = "CMD"; + + this.color.setBlue(true); + + // Draw two cards, then sacrifice a permanent. + this.getSpellAbility().addEffect(new DrawCardControllerEffect(2)); + this.getSpellAbility().addEffect(new PerilousResearchEffect()); + } + + public PerilousResearch(final PerilousResearch card) { + super(card); + } + + @Override + public PerilousResearch copy() { + return new PerilousResearch(this); + } +} + +class PerilousResearchEffect extends OneShotEffect { + + public PerilousResearchEffect() { + super(Outcome.Sacrifice); + this.staticText = "then sacrifice a permanent"; + } + + public PerilousResearchEffect(final PerilousResearchEffect effect) { + super(effect); + } + + @Override + public PerilousResearchEffect copy() { + return new PerilousResearchEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + Target target = new TargetControlledPermanent(); + + if (target.canChoose(player.getId(), game) && player.choose(Outcome.Sacrifice, target, source.getSourceId(), game)) { + Permanent permanent = game.getPermanent(target.getFirstTarget()); + if (permanent != null) { + return permanent.sacrifice(source.getSourceId(), game); + } + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/modernmasters/ErrantEphemeron.java b/Mage.Sets/src/mage/sets/modernmasters/ErrantEphemeron.java new file mode 100644 index 0000000000..488a72bb68 --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/ErrantEphemeron.java @@ -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.modernmasters; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class ErrantEphemeron extends mage.sets.timespiral.ErrantEphemeron { + + public ErrantEphemeron(UUID ownerId) { + super(ownerId); + this.cardNumber = 41; + this.expansionSetCode = "MMA"; + } + + public ErrantEphemeron(final ErrantEphemeron card) { + super(card); + } + + @Override + public ErrantEphemeron copy() { + return new ErrantEphemeron(this); + } +} diff --git a/Mage.Sets/src/mage/sets/modernmasters/PerilousResearch.java b/Mage.Sets/src/mage/sets/modernmasters/PerilousResearch.java new file mode 100644 index 0000000000..7574eac482 --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/PerilousResearch.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.modernmasters; + +import java.util.UUID; +import mage.Constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class PerilousResearch extends mage.sets.commander.PerilousResearch { + + public PerilousResearch(UUID ownerId) { + super(ownerId); + this.cardNumber = 58; + this.expansionSetCode = "MMA"; + this.rarity = Rarity.COMMON; + } + + public PerilousResearch(final PerilousResearch card) { + super(card); + } + + @Override + public PerilousResearch copy() { + return new PerilousResearch(this); + } +} diff --git a/Mage.Sets/src/mage/sets/modernmasters/RiftwingCloudskate.java b/Mage.Sets/src/mage/sets/modernmasters/RiftwingCloudskate.java new file mode 100644 index 0000000000..3ed7ba965c --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/RiftwingCloudskate.java @@ -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.modernmasters; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class RiftwingCloudskate extends mage.sets.timespiral.RiftwingCloudskate { + + public RiftwingCloudskate(UUID ownerId) { + super(ownerId); + this.cardNumber = 62; + this.expansionSetCode = "MMA"; + } + + public RiftwingCloudskate(final RiftwingCloudskate card) { + super(card); + } + + @Override + public RiftwingCloudskate copy() { + return new RiftwingCloudskate(this); + } +} diff --git a/Mage.Sets/src/mage/sets/modernmasters/WoodfallPrimus.java b/Mage.Sets/src/mage/sets/modernmasters/WoodfallPrimus.java new file mode 100644 index 0000000000..5fa848515e --- /dev/null +++ b/Mage.Sets/src/mage/sets/modernmasters/WoodfallPrimus.java @@ -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.modernmasters; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class WoodfallPrimus extends mage.sets.shadowmoor.WoodfallPrimus { + + public WoodfallPrimus(UUID ownerId) { + super(ownerId); + this.cardNumber = 174; + this.expansionSetCode = "MMA"; + } + + public WoodfallPrimus(final WoodfallPrimus card) { + super(card); + } + + @Override + public WoodfallPrimus copy() { + return new WoodfallPrimus(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/WoodfallPrimus.java b/Mage.Sets/src/mage/sets/shadowmoor/WoodfallPrimus.java new file mode 100644 index 0000000000..9fe766df20 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shadowmoor/WoodfallPrimus.java @@ -0,0 +1,84 @@ +/* + * 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.shadowmoor; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.PersistAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author LevelX2 + */ +public class WoodfallPrimus extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("noncreature permanent"); + static { + filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); + } + + public WoodfallPrimus(UUID ownerId) { + super(ownerId, 135, "Woodfall Primus", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{G}{G}{G}"); + this.expansionSetCode = "SHM"; + this.subtype.add("Treefolk"); + this.subtype.add("Shaman"); + + this.color.setGreen(true); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // When Woodfall Primus enters the battlefield, destroy target noncreature permanent. + Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false); + ability.addTarget(new TargetPermanent()); + this.addAbility(ability); + // Persist + this.addAbility(new PersistAbility()); + } + + public WoodfallPrimus(final WoodfallPrimus card) { + super(card); + } + + @Override + public WoodfallPrimus copy() { + return new WoodfallPrimus(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/ErrantEphemeron.java b/Mage.Sets/src/mage/sets/timespiral/ErrantEphemeron.java new file mode 100644 index 0000000000..da825500b7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/ErrantEphemeron.java @@ -0,0 +1,68 @@ +/* + * 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.timespiral; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.SuspendAbility; +import mage.cards.CardImpl; + +/** + * + * @author LevelX2 + */ +public class ErrantEphemeron extends CardImpl { + + public ErrantEphemeron(UUID ownerId) { + super(ownerId, 60, "Errant Ephemeron", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{6}{U}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Illusion"); + + this.color.setBlue(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Suspend 4-{1}{U} + this.addAbility(new SuspendAbility(4, new ManaCostsImpl("{1}{U}"), this)); + } + + public ErrantEphemeron(final ErrantEphemeron card) { + super(card); + } + + @Override + public ErrantEphemeron copy() { + return new ErrantEphemeron(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/RiftwingCloudskate.java b/Mage.Sets/src/mage/sets/timespiral/RiftwingCloudskate.java new file mode 100644 index 0000000000..e754dc8069 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/RiftwingCloudskate.java @@ -0,0 +1,77 @@ +/* + * 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.timespiral; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.SuspendAbility; +import mage.cards.CardImpl; +import mage.target.TargetPermanent; + +/** + * + * @author LevelX2 + */ +public class RiftwingCloudskate extends CardImpl { + + public RiftwingCloudskate(UUID ownerId) { + super(ownerId, 73, "Riftwing Cloudskate", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Illusion"); + + this.color.setBlue(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Riftwing Cloudskate enters the battlefield, return target permanent to its owner's hand. + Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), false); + ability.addTarget(new TargetPermanent()); + this.addAbility(ability); + + // Suspend 3-{1}{U} + this.addAbility(new SuspendAbility(3, new ManaCostsImpl("{1}{U}"),this)); + } + + public RiftwingCloudskate(final RiftwingCloudskate card) { + super(card); + } + + @Override + public RiftwingCloudskate copy() { + return new RiftwingCloudskate(this); + } +} From b5f1e05a71f9838cb06904a63dfc8c254a9ad179 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 12 Jun 2013 09:00:38 +0200 Subject: [PATCH 20/22] Fixed missing filter of Woodfall Primus. --- Mage.Sets/src/mage/sets/shadowmoor/WoodfallPrimus.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/shadowmoor/WoodfallPrimus.java b/Mage.Sets/src/mage/sets/shadowmoor/WoodfallPrimus.java index 9fe766df20..21de2959b8 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/WoodfallPrimus.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/WoodfallPrimus.java @@ -67,7 +67,7 @@ public class WoodfallPrimus extends CardImpl { this.addAbility(TrampleAbility.getInstance()); // When Woodfall Primus enters the battlefield, destroy target noncreature permanent. Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false); - ability.addTarget(new TargetPermanent()); + ability.addTarget(new TargetPermanent(filter)); this.addAbility(ability); // Persist this.addAbility(new PersistAbility()); From 62d91fce4e4124d8e0db76ff49c6d5cbd3d71d66 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 12 Jun 2013 09:01:13 +0200 Subject: [PATCH 21/22] * Sarkhan Vol - Fixed third ability that only created one token instead of five. --- Mage.Sets/src/mage/sets/shardsofalara/SarkhanVol.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/shardsofalara/SarkhanVol.java b/Mage.Sets/src/mage/sets/shardsofalara/SarkhanVol.java index f940f3adbf..a16935b453 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/SarkhanVol.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/SarkhanVol.java @@ -64,21 +64,23 @@ public class SarkhanVol extends CardImpl { this.color.setGreen(true); this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false)); + // +1: Creatures you control get +1/+1 and gain haste until end of turn. Effects effects1 = new Effects(); effects1.add(new BoostControlledEffect(1, 1, Duration.EndOfTurn)); effects1.add(new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent())); this.addAbility(new LoyaltyAbility(effects1, 1)); + // -2: Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn. Effects effects2 = new Effects(); effects2.add(new GainControlTargetEffect(Duration.EndOfTurn)); effects2.add(new UntapTargetEffect()); effects2.add(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn)); - LoyaltyAbility ability = new LoyaltyAbility(effects2, -2); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); - this.addAbility(new LoyaltyAbility(new CreateTokenEffect(dragonToken), -6)); + // -6: Put five 4/4 red Dragon creature tokens with flying onto the battlefield. + this.addAbility(new LoyaltyAbility(new CreateTokenEffect(dragonToken, 5), -6)); } public SarkhanVol(final SarkhanVol card) { From 537f826607cfcb11ee701b3033a5874bd1dc1a5f Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 12 Jun 2013 09:02:10 +0200 Subject: [PATCH 22/22] * Sigarda, Host of Herons - Fixed that her ability prevented all players to sacrifice permanents. --- .../src/mage/sets/avacynrestored/SigardaHostOfHerons.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/avacynrestored/SigardaHostOfHerons.java b/Mage.Sets/src/mage/sets/avacynrestored/SigardaHostOfHerons.java index 9dc62fc0ab..edae96f8b4 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/SigardaHostOfHerons.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/SigardaHostOfHerons.java @@ -27,6 +27,7 @@ */ package mage.sets.avacynrestored; +import java.util.UUID; import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; @@ -43,7 +44,6 @@ import mage.game.events.GameEvent; import mage.game.permanent.PermanentCard; import mage.game.stack.Spell; -import java.util.UUID; /** * @author noxx @@ -106,7 +106,7 @@ class SigardaHostOfHeronsEffect extends ReplacementEffectImpl