diff --git a/Mage.Client/src/main/java/mage/client/MageFrame.java b/Mage.Client/src/main/java/mage/client/MageFrame.java index 186ccb9a107..e67d680f82e 100644 --- a/Mage.Client/src/main/java/mage/client/MageFrame.java +++ b/Mage.Client/src/main/java/mage/client/MageFrame.java @@ -106,7 +106,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient { private static Session session; private ConnectDialog connectDialog; - private ErrorDialog errorDialog; + //private ErrorDialog errorDialog; private static CallbackClient callbackClient; private static Preferences prefs = Preferences.userNodeForPackage(MageFrame.class); private JLabel title; @@ -189,8 +189,8 @@ public class MageFrame extends javax.swing.JFrame implements MageClient { callbackClient = new CallbackClientImpl(this); connectDialog = new ConnectDialog(); desktopPane.add(connectDialog, JLayeredPane.POPUP_LAYER); - errorDialog = new ErrorDialog(); - desktopPane.add(errorDialog, JLayeredPane.POPUP_LAYER); + //errorDialog = new ErrorDialog(); + //desktopPane.add(errorDialog, JLayeredPane.POPUP_LAYER); ui.addComponent(MageComponents.DESKTOP_PANE, desktopPane); try { @@ -839,13 +839,13 @@ public class MageFrame extends javax.swing.JFrame implements MageClient { public void showErrorDialog(final String title, final String message) { if (SwingUtilities.isEventDispatchThread()) { - errorDialog.showDialog(title, message); + //errorDialog.showDialog(title, message); } else { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { - errorDialog.showDialog(title, message); + //errorDialog.showDialog(title, message); } }); } diff --git a/Mage.Client/src/main/java/mage/client/table/TablesPanel.form b/Mage.Client/src/main/java/mage/client/table/TablesPanel.form index e6f2cb29906..0b1bdc66198 100644 --- a/Mage.Client/src/main/java/mage/client/table/TablesPanel.form +++ b/Mage.Client/src/main/java/mage/client/table/TablesPanel.form @@ -17,12 +17,12 @@ - + - - - + + + @@ -32,12 +32,12 @@ - + - + @@ -55,7 +55,9 @@ - + + + @@ -67,6 +69,7 @@ + @@ -98,6 +101,12 @@ + + + + + + @@ -122,7 +131,7 @@ - + @@ -196,28 +205,85 @@ - - - - + - + + + + + + + + + + + + - + - - - - - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
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 628d7b5ab70..11938f4a615 100644 --- a/Mage.Client/src/main/java/mage/client/table/TablesPanel.java +++ b/Mage.Client/src/main/java/mage/client/table/TablesPanel.java @@ -274,21 +274,26 @@ public class TablesPanel extends javax.swing.JPanel { btnNewTable = new javax.swing.JButton(); btnQuickStart = new javax.swing.JButton(); btnNewTournament = new javax.swing.JButton(); + chkShowCompleted = new javax.swing.JCheckBox(); jPanel2 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); jSplitPane1 = new javax.swing.JSplitPane(); chatPanel = new mage.client.chat.ChatPanel(true); + jPanel3 = new javax.swing.JPanel(); + jSplitPane2 = new javax.swing.JSplitPane(); jScrollPane1 = new javax.swing.JScrollPane(); tableTables = new javax.swing.JTable(); + jScrollPane2 = new javax.swing.JScrollPane(); + tableCompleted = new javax.swing.JTable(); btnNewTable.setText("New Match"); btnNewTable.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - btnNewTableActionPerformed(evt); - } - }); + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnNewTableActionPerformed(evt); + } + }); btnQuickStart.setText("Quick Start"); btnQuickStart.addActionListener(new java.awt.event.ActionListener() { @@ -299,34 +304,40 @@ public class TablesPanel extends javax.swing.JPanel { btnNewTournament.setText("New Tournament"); btnNewTournament.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - btnNewTournamentActionPerformed(evt); - } - }); + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnNewTournamentActionPerformed(evt); + } + }); + + chkShowCompleted.setSelected(true); + chkShowCompleted.setText("Show Completed"); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addContainerGap() - .addComponent(btnNewTable) - .addGap(6, 6, 6) - .addComponent(btnNewTournament) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(btnQuickStart) - .addContainerGap(414, Short.MAX_VALUE)) - ); + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(btnNewTable) + .addGap(6, 6, 6) + .addComponent(btnNewTournament) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(btnQuickStart) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(chkShowCompleted) + .addContainerGap(434, Short.MAX_VALUE)) + ); jPanel1Layout.setVerticalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addContainerGap() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(btnNewTable) - .addComponent(btnQuickStart) - .addComponent(btnNewTournament)) - .addContainerGap(16, Short.MAX_VALUE)) - ); + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnNewTable) + .addComponent(btnQuickStart) + .addComponent(btnNewTournament) + .addComponent(chkShowCompleted)) + .addContainerGap(16, Short.MAX_VALUE)) + ); jPanel2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED)); jPanel2.setPreferredSize(new java.awt.Dimension(664, 39)); @@ -342,33 +353,33 @@ public class TablesPanel extends javax.swing.JPanel { jButton1.setMinimumSize(new java.awt.Dimension(55, 25)); jButton1.setPreferredSize(new java.awt.Dimension(55, 25)); jButton1.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - jButton1ActionPerformed(evt); - } - }); + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( - jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel2Layout.createSequentialGroup() - .addContainerGap() - .addComponent(jLabel1) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 449, Short.MAX_VALUE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(22, 22, 22)) - ); + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 449, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(440, 440, 440)) + ); jPanel2Layout.setVerticalGroup( - jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel2Layout.createSequentialGroup() - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel2) - .addComponent(jLabel1)) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel2) + .addComponent(jLabel1)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); jSplitPane1.setDividerSize(3); jSplitPane1.setResizeWeight(1.0); @@ -376,33 +387,63 @@ public class TablesPanel extends javax.swing.JPanel { chatPanel.setMinimumSize(new java.awt.Dimension(100, 43)); jSplitPane1.setRightComponent(chatPanel); + jSplitPane2.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); + tableTables.setModel(this.tableModel); jScrollPane1.setViewportView(tableTables); - jSplitPane1.setLeftComponent(jScrollPane1); + jSplitPane2.setLeftComponent(jScrollPane1); + + tableCompleted.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + {null, null, null, null}, + {null, null, null, null}, + {null, null, null, null}, + {null, null, null, null} + }, + new String [] { + "Title 1", "Title 2", "Title 3", "Title 4" + } + )); + jScrollPane2.setViewportView(tableCompleted); + + jSplitPane2.setRightComponent(jScrollPane2); + + javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); + jPanel3.setLayout(jPanel3Layout); + jPanel3Layout.setHorizontalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jSplitPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 743, Short.MAX_VALUE) + ); + jPanel3Layout.setVerticalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jSplitPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 499, Short.MAX_VALUE) + ); + + jSplitPane1.setLeftComponent(jPanel3); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 721, Short.MAX_VALUE) + .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 848, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addContainerGap(47, Short.MAX_VALUE))) + .addGroup(layout.createSequentialGroup() + .addGap(0, 0, 0) + .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, 779, Short.MAX_VALUE) + .addContainerGap(69, Short.MAX_VALUE))) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 0, 0) - .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE) - .addGap(0, 0, 0) - .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, 0) + .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 501, Short.MAX_VALUE) + .addGap(0, 0, 0) + .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 607, Short.MAX_VALUE)) + .addGap(0, 576, Short.MAX_VALUE)) ); }// //GEN-END:initComponents @@ -456,13 +497,18 @@ public class TablesPanel extends javax.swing.JPanel { private javax.swing.JButton btnNewTournament; private javax.swing.JButton btnQuickStart; private mage.client.chat.ChatPanel chatPanel; + private javax.swing.JCheckBox chkShowCompleted; private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; + private javax.swing.JPanel jPanel3; private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JScrollPane jScrollPane2; private javax.swing.JSplitPane jSplitPane1; + private javax.swing.JSplitPane jSplitPane2; + private javax.swing.JTable tableCompleted; private javax.swing.JTable tableTables; // End of variables declaration//GEN-END:variables diff --git a/Mage.Common/src/mage/interfaces/MageServer.java b/Mage.Common/src/mage/interfaces/MageServer.java index d71127c5996..aba894aae90 100644 --- a/Mage.Common/src/mage/interfaces/MageServer.java +++ b/Mage.Common/src/mage/interfaces/MageServer.java @@ -91,6 +91,7 @@ public interface MageServer { public void sendPlayerBoolean(UUID gameId, String sessionId, Boolean data) throws MageException; public void sendPlayerInteger(UUID gameId, String sessionId, Integer data) throws MageException; public void concedeGame(UUID gameId, String sessionId) throws MageException; + //tournament methods public void startTournament(String sessionId, UUID roomId, UUID tableId) throws MageException; diff --git a/Mage.Common/src/mage/view/TournamentPlayerView.java b/Mage.Common/src/mage/view/TournamentPlayerView.java index 45f7c66e7bb..fe379432c6f 100644 --- a/Mage.Common/src/mage/view/TournamentPlayerView.java +++ b/Mage.Common/src/mage/view/TournamentPlayerView.java @@ -29,9 +29,6 @@ package mage.view; import java.io.Serializable; -import mage.game.tournament.Round; -import mage.game.tournament.Tournament; -import mage.game.tournament.TournamentPairing; import mage.game.tournament.TournamentPlayer; /** diff --git a/Mage.Server/src/main/java/mage/server/TableController.java b/Mage.Server/src/main/java/mage/server/TableController.java index a9d6813d029..10ba2bacd88 100644 --- a/Mage.Server/src/main/java/mage/server/TableController.java +++ b/Mage.Server/src/main/java/mage/server/TableController.java @@ -369,7 +369,7 @@ public class TableController { UUID choosingPlayerId = match.getChooser(); match.endGame(); table.endGame(); -// GameManager.getInstance().saveGame(match.getGame().getId()); + GameManager.getInstance().saveGame(match.getGame().getId()); GameManager.getInstance().removeGame(match.getGame().getId()); try { if (!match.isMatchOver()) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/VineKami.java b/Mage.Sets/src/mage/sets/championsofkamigawa/VineKami.java new file mode 100644 index 00000000000..adf9dca54b6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/VineKami.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.championsofkamigawa; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continious.CantBeBlockedByOneEffect; +import mage.abilities.keyword.SoulshiftAbility; +import mage.cards.CardImpl; + +/** + * + * @author North + */ +public class VineKami extends CardImpl { + + public VineKami(UUID ownerId) { + super(ownerId, 249, "Vine Kami", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{6}{G}"); + this.expansionSetCode = "CHK"; + this.subtype.add("Spirit"); + + this.color.setGreen(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Vine Kami can't be blocked except by two or more creatures. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeBlockedByOneEffect(2))); + this.addAbility(new SoulshiftAbility(6)); + } + + public VineKami(final VineKami card) { + super(card); + } + + @Override + public VineKami copy() { + return new VineKami(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magic2010/HowlOfTheNightPack.java b/Mage.Sets/src/mage/sets/magic2010/HowlOfTheNightPack.java index c27ce0de630..8ebcc3a6c30 100644 --- a/Mage.Sets/src/mage/sets/magic2010/HowlOfTheNightPack.java +++ b/Mage.Sets/src/mage/sets/magic2010/HowlOfTheNightPack.java @@ -45,7 +45,7 @@ public class HowlOfTheNightPack extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("for each Forest you control"); static { - filter.getName().add("Forest"); + filter.getSubtype().add("Forest"); } public HowlOfTheNightPack(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/SeismicStrike.java b/Mage.Sets/src/mage/sets/magic2010/SeismicStrike.java index 2e87cc67401..69915988bf6 100644 --- a/Mage.Sets/src/mage/sets/magic2010/SeismicStrike.java +++ b/Mage.Sets/src/mage/sets/magic2010/SeismicStrike.java @@ -45,7 +45,7 @@ public class SeismicStrike extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("Mountains you control"); static { - filter.getName().add("Mountain"); + filter.getSubtype().add("Mountain"); } public SeismicStrike(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/TendrilsOfCorruption.java b/Mage.Sets/src/mage/sets/magic2010/TendrilsOfCorruption.java index 4d9836d5de5..cbaad2bebc6 100644 --- a/Mage.Sets/src/mage/sets/magic2010/TendrilsOfCorruption.java +++ b/Mage.Sets/src/mage/sets/magic2010/TendrilsOfCorruption.java @@ -46,7 +46,7 @@ public class TendrilsOfCorruption extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("Swamp you control"); static { - filter.getName().add("Swamp"); + filter.getSubtype().add("Swamp"); } public TendrilsOfCorruption(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2012/BloodlordOfVaasgoth.java b/Mage.Sets/src/mage/sets/magic2012/BloodlordOfVaasgoth.java index d78f288dea0..68952359e62 100644 --- a/Mage.Sets/src/mage/sets/magic2012/BloodlordOfVaasgoth.java +++ b/Mage.Sets/src/mage/sets/magic2012/BloodlordOfVaasgoth.java @@ -96,6 +96,7 @@ class BloodlordOfVaasgothEffect extends ContinuousEffectImpl { public BloodlordOfVaasgothEffect(final BloodlordOfVaasgothEffect effect) { super(effect); + this.ability = effect.ability.copy(); } @Override diff --git a/Mage.Sets/src/mage/sets/magic2012/DungroveElder.java b/Mage.Sets/src/mage/sets/magic2012/DungroveElder.java index 53ac1ab3d7d..743155bb586 100644 --- a/Mage.Sets/src/mage/sets/magic2012/DungroveElder.java +++ b/Mage.Sets/src/mage/sets/magic2012/DungroveElder.java @@ -30,13 +30,14 @@ package mage.sets.magic2012; import java.util.UUID; -import mage.Constants; import mage.Constants.CardType; +import mage.Constants.Duration; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.common.continious.BoostSourceEffect; +import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect; import mage.abilities.keyword.HexproofAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; @@ -47,21 +48,23 @@ import mage.filter.common.FilterControlledPermanent; */ public class DungroveElder extends CardImpl { - final static FilterControlledPermanent filterLands = new FilterControlledPermanent("Forests"); + final static FilterControlledPermanent filterLands = new FilterControlledPermanent("Forests you control"); static { - filterLands.getName().add("Forest"); + filterLands.getSubtype().add("Forest"); } public DungroveElder (UUID ownerId) { super(ownerId, 171, "Dungrove Elder", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}"); this.expansionSetCode = "M12"; this.subtype.add("Treefolk"); + this.color.setGreen(true); this.power = new MageInt(0); this.toughness = new MageInt(0); + this.addAbility(new HexproofAbility()); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostSourceEffect(new PermanentsOnBattlefieldCount(filterLands), new PermanentsOnBattlefieldCount(filterLands), Constants.Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filterLands), Duration.EndOfGame))); } public DungroveElder (final DungroveElder card) { diff --git a/Mage.Sets/src/mage/sets/magic2012/StormbloodBerserker.java b/Mage.Sets/src/mage/sets/magic2012/StormbloodBerserker.java index 3289b96bc17..52541235ba9 100644 --- a/Mage.Sets/src/mage/sets/magic2012/StormbloodBerserker.java +++ b/Mage.Sets/src/mage/sets/magic2012/StormbloodBerserker.java @@ -27,88 +27,42 @@ */ package mage.sets.magic2012; -import mage.Constants; +import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.common.continious.CantBeBlockedByOneEffect; import mage.abilities.keyword.BloodthirstAbility; import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.permanent.Permanent; - -import java.util.UUID; /** * @author nantuko */ public class StormbloodBerserker extends CardImpl { - public StormbloodBerserker(UUID ownerId) { - super(ownerId, 156, "Stormblood Berserker", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); - this.expansionSetCode = "M12"; - this.subtype.add("Human"); - this.subtype.add("Berserker"); + public StormbloodBerserker(UUID ownerId) { + super(ownerId, 156, "Stormblood Berserker", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "M12"; + this.subtype.add("Human"); + this.subtype.add("Berserker"); - this.color.setRed(true); - this.power = new MageInt(1); - this.toughness = new MageInt(1); + this.color.setRed(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); - this.addAbility(new BloodthirstAbility(2)); - // Stormblood Berserker can't be blocked except by two or more creatures. - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new StormbloodBerserkerEffect())); - } + this.addAbility(new BloodthirstAbility(2)); + // Stormblood Berserker can't be blocked except by two or more creatures. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeBlockedByOneEffect(2))); + } - public StormbloodBerserker(final StormbloodBerserker card) { - super(card); - } - - @Override - public StormbloodBerserker copy() { - return new StormbloodBerserker(this); - } -} - -class StormbloodBerserkerEffect extends ContinuousEffectImpl { - - public StormbloodBerserkerEffect() { - super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); - staticText = "{this} can't be blocked except by two or more creatures"; - } - - public StormbloodBerserkerEffect(final StormbloodBerserkerEffect effect) { - super(effect); - } - - @Override - public StormbloodBerserkerEffect copy() { - return new StormbloodBerserkerEffect(this); - } - - @Override - public boolean apply(Constants.Layer layer, Constants.SubLayer sublayer, Ability source, Game game) { - Permanent perm = game.getPermanent(source.getSourceId()); - if (perm != null) { - switch (layer) { - case RulesEffects: - perm.setMinBlockedBy(2); - break; - } - return true; - } - return false; - } - - @Override - public boolean apply(Game game, Ability source) { - return false; - } - - @Override - public boolean hasLayer(Constants.Layer layer) { - return layer == Constants.Layer.RulesEffects; - } + public StormbloodBerserker(final StormbloodBerserker card) { + super(card); + } + @Override + public StormbloodBerserker copy() { + return new StormbloodBerserker(this); + } } diff --git a/Mage.Sets/src/mage/sets/morningtide/RhysTheExiled.java b/Mage.Sets/src/mage/sets/morningtide/RhysTheExiled.java index 623caad2f8a..01008538b7f 100644 --- a/Mage.Sets/src/mage/sets/morningtide/RhysTheExiled.java +++ b/Mage.Sets/src/mage/sets/morningtide/RhysTheExiled.java @@ -29,7 +29,6 @@ package mage.sets.morningtide; import java.util.UUID; -import com.sun.org.apache.bcel.internal.generic.NEW; import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; diff --git a/Mage.Sets/src/mage/sets/newphyrexia/Lashwrithe.java b/Mage.Sets/src/mage/sets/newphyrexia/Lashwrithe.java index b6814d9a443..f7740c39cf0 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/Lashwrithe.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/Lashwrithe.java @@ -51,7 +51,7 @@ public class Lashwrithe extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("Swamp you control"); static { - filter.getName().add("Swamp"); + filter.getSubtype().add("Swamp"); filter.setTargetController(TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/PathrazerOfUlamog.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/PathrazerOfUlamog.java index b7809b91070..66da58aab49 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/PathrazerOfUlamog.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/PathrazerOfUlamog.java @@ -29,20 +29,13 @@ package mage.sets.riseoftheeldrazi; import java.util.UUID; import mage.Constants.CardType; -import mage.Constants.Duration; -import mage.Constants.Layer; -import mage.Constants.Outcome; import mage.Constants.Rarity; -import mage.Constants.SubLayer; import mage.Constants.Zone; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.common.continious.CantBeBlockedByOneEffect; import mage.abilities.keyword.AnnihilatorAbility; import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.permanent.Permanent; /** * @@ -59,7 +52,8 @@ public class PathrazerOfUlamog extends CardImpl { this.toughness = new MageInt(9); this.addAbility(new AnnihilatorAbility(3)); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PathrazerOfUlamogEffect())); + // Pathrazer of Ulamog can't be blocked except by three or more creatures. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeBlockedByOneEffect(3))); } public PathrazerOfUlamog(final PathrazerOfUlamog card) { @@ -71,44 +65,3 @@ public class PathrazerOfUlamog extends CardImpl { return new PathrazerOfUlamog(this); } } - -class PathrazerOfUlamogEffect extends ContinuousEffectImpl { - - public PathrazerOfUlamogEffect() { - super(Duration.WhileOnBattlefield, Outcome.Benefit); - staticText = "{this} can't be blocked except by three or more creatures"; - } - - public PathrazerOfUlamogEffect(final PathrazerOfUlamogEffect effect) { - super(effect); - } - - @Override - public PathrazerOfUlamogEffect copy() { - return new PathrazerOfUlamogEffect(this); - } - - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - Permanent perm = game.getPermanent(source.getSourceId()); - if (perm != null) { - switch (layer) { - case RulesEffects: - perm.setMinBlockedBy(3); - break; - } - return true; - } - return false; - } - - @Override - public boolean apply(Game game, Ability source) { - return false; - } - - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.RulesEffects; - } -} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/HordeOfBoggarts.java b/Mage.Sets/src/mage/sets/shadowmoor/HordeOfBoggarts.java new file mode 100644 index 00000000000..a46be0365f1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shadowmoor/HordeOfBoggarts.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.shadowmoor; + +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.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.continious.CantBeBlockedByOneEffect; +import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect; +import mage.cards.CardImpl; +import mage.filter.common.FilterControlledPermanent; + +/** + * + * @author North + */ +public class HordeOfBoggarts extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("red permanents you control"); + + static { + filter.getColor().setRed(true); + filter.setUseColor(true); + } + + public HordeOfBoggarts(UUID ownerId) { + super(ownerId, 94, "Horde of Boggarts", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "SHM"; + this.subtype.add("Goblin"); + + this.color.setRed(true); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Horde of Boggarts's power and toughness are each equal to the number of red permanents you control. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + // Horde of Boggarts can't be blocked except by two or more creatures. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeBlockedByOneEffect(2))); + } + + public HordeOfBoggarts(final HordeOfBoggarts card) { + super(card); + } + + @Override + public HordeOfBoggarts copy() { + return new HordeOfBoggarts(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shardsofalara/KederektCreeper.java b/Mage.Sets/src/mage/sets/shardsofalara/KederektCreeper.java new file mode 100644 index 00000000000..c86c3ad34d9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shardsofalara/KederektCreeper.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.shardsofalara; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continious.CantBeBlockedByOneEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.cards.CardImpl; + +/** + * + * @author North + */ +public class KederektCreeper extends CardImpl { + + public KederektCreeper(UUID ownerId) { + super(ownerId, 176, "Kederekt Creeper", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{U}{B}{R}"); + this.expansionSetCode = "ALA"; + this.subtype.add("Horror"); + + this.color.setRed(true); + this.color.setBlue(true); + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + this.addAbility(DeathtouchAbility.getInstance()); + // Kederekt Creeper can't be blocked except by two or more creatures. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeBlockedByOneEffect(2))); + } + + public KederektCreeper(final KederektCreeper card) { + super(card); + } + + @Override + public KederektCreeper copy() { + return new KederektCreeper(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tenth/BlanchwoodArmor.java b/Mage.Sets/src/mage/sets/tenth/BlanchwoodArmor.java index 400c13f9feb..00d75cc3116 100644 --- a/Mage.Sets/src/mage/sets/tenth/BlanchwoodArmor.java +++ b/Mage.Sets/src/mage/sets/tenth/BlanchwoodArmor.java @@ -52,7 +52,7 @@ public class BlanchwoodArmor extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("Forest you control"); static { - filter.getName().add("Forest"); + filter.getSubtype().add("Forest"); } public BlanchwoodArmor(UUID ownerId) { @@ -66,8 +66,6 @@ public class BlanchwoodArmor extends CardImpl { Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(new PermanentsOnBattlefieldCount(filter), new PermanentsOnBattlefieldCount(filter), Constants.Duration.WhileOnBattlefield))); - // Enchant creature - // Enchanted creature gets +1/+1 for each Forest you control. } public BlanchwoodArmor(final BlanchwoodArmor card) { diff --git a/Mage.Sets/src/mage/sets/tenth/Mortivore.java b/Mage.Sets/src/mage/sets/tenth/Mortivore.java index 0988861494a..79d1d4eb918 100644 --- a/Mage.Sets/src/mage/sets/tenth/Mortivore.java +++ b/Mage.Sets/src/mage/sets/tenth/Mortivore.java @@ -44,7 +44,7 @@ import mage.filter.common.FilterCreatureCard; /** * - * @author anonymous + * @author Loki */ public class Mortivore extends CardImpl { diff --git a/Mage.Sets/src/mage/sets/tenth/Nightmare.java b/Mage.Sets/src/mage/sets/tenth/Nightmare.java index 37029d9f207..92c8fa0cd6c 100644 --- a/Mage.Sets/src/mage/sets/tenth/Nightmare.java +++ b/Mage.Sets/src/mage/sets/tenth/Nightmare.java @@ -49,7 +49,7 @@ public class Nightmare extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("Swamps you control"); static { - filter.getName().add("Swamp"); + filter.getSubtype().add("Swamp"); } public Nightmare(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/SpittingEarth.java b/Mage.Sets/src/mage/sets/tenth/SpittingEarth.java index 3ba391e8319..24e78090013 100644 --- a/Mage.Sets/src/mage/sets/tenth/SpittingEarth.java +++ b/Mage.Sets/src/mage/sets/tenth/SpittingEarth.java @@ -45,7 +45,7 @@ public class SpittingEarth extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("Mountain you control"); static { - filter.getName().add("Mountain"); + filter.getSubtype().add("Mountain"); } public SpittingEarth(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/ViashinoRunner.java b/Mage.Sets/src/mage/sets/tenth/ViashinoRunner.java new file mode 100644 index 00000000000..0e13edd8e29 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tenth/ViashinoRunner.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tenth; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continious.CantBeBlockedByOneEffect; +import mage.cards.CardImpl; + +/** + * + * @author North + */ +public class ViashinoRunner extends CardImpl { + + public ViashinoRunner(UUID ownerId) { + super(ownerId, 245, "Viashino Runner", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "10E"; + this.subtype.add("Viashino"); + + this.color.setRed(true); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Viashino Runner can't be blocked except by two or more creatures. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeBlockedByOneEffect(2))); + } + + public ViashinoRunner(final ViashinoRunner card) { + super(card); + } + + @Override + public ViashinoRunner copy() { + return new ViashinoRunner(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikar/PrimalBellow.java b/Mage.Sets/src/mage/sets/zendikar/PrimalBellow.java index 45adc936373..6f1614b18cb 100644 --- a/Mage.Sets/src/mage/sets/zendikar/PrimalBellow.java +++ b/Mage.Sets/src/mage/sets/zendikar/PrimalBellow.java @@ -47,7 +47,7 @@ public class PrimalBellow extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("Forest you control"); static { - filter.getName().add("Forest"); + filter.getSubtype().add("Forest"); filter.setTargetController(TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/zendikar/TimbermawLarva.java b/Mage.Sets/src/mage/sets/zendikar/TimbermawLarva.java index 00dbc45ed2d..d9bedcf945d 100644 --- a/Mage.Sets/src/mage/sets/zendikar/TimbermawLarva.java +++ b/Mage.Sets/src/mage/sets/zendikar/TimbermawLarva.java @@ -48,7 +48,7 @@ public class TimbermawLarva extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("Forest you control"); static { - filter.getName().add("Forest"); + filter.getSubtype().add("Forest"); filter.setTargetController(TargetController.YOU); } diff --git a/Mage/src/mage/abilities/Mode.java b/Mage/src/mage/abilities/Mode.java index dcabed11204..33641e64f1f 100644 --- a/Mage/src/mage/abilities/Mode.java +++ b/Mage/src/mage/abilities/Mode.java @@ -27,6 +27,7 @@ */ package mage.abilities; +import java.io.Serializable; import java.util.UUID; import mage.abilities.effects.Effects; import mage.choices.Choices; @@ -36,7 +37,7 @@ import mage.target.Targets; * * @author BetaSteward_at_googlemail.com */ -public class Mode { +public class Mode implements Serializable { protected UUID id; protected Targets targets; diff --git a/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java b/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java index 4cef65523ce..d865fcb3358 100644 --- a/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java @@ -98,6 +98,7 @@ public class DamageTargetEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { +// game.getPermanent(source.getControllerId()).getName(); Permanent permanent = game.getPermanent(targetPointer.getFirst(source)); if (permanent != null) { permanent.damage(amount.calculate(game, source), source.getSourceId(), game, preventable, false); diff --git a/Mage/src/mage/abilities/effects/common/continious/CantBeBlockedByOneEffect.java b/Mage/src/mage/abilities/effects/common/continious/CantBeBlockedByOneEffect.java new file mode 100644 index 00000000000..1654a3a75fe --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/continious/CantBeBlockedByOneEffect.java @@ -0,0 +1,86 @@ +/* + * 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.abilities.effects.common.continious; + +import mage.Constants.Duration; +import mage.Constants.Layer; +import mage.Constants.Outcome; +import mage.Constants.SubLayer; +import mage.abilities.Ability; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author North + */ +public class CantBeBlockedByOneEffect extends ContinuousEffectImpl { + + protected int amount; + + public CantBeBlockedByOneEffect(int amount) { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + this.amount = amount; + staticText = "{this} can't be blocked except by " + amount + " or more creatures"; + } + + public CantBeBlockedByOneEffect(final CantBeBlockedByOneEffect effect) { + super(effect); + this.amount = effect.amount; + } + + @Override + public CantBeBlockedByOneEffect copy() { + return new CantBeBlockedByOneEffect(this); + } + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + Permanent perm = game.getPermanent(source.getSourceId()); + if (perm != null) { + switch (layer) { + case RulesEffects: + perm.setMinBlockedBy(amount); + break; + } + return true; + } + return false; + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.RulesEffects; + } +} \ No newline at end of file diff --git a/Mage/src/mage/game/Game.java b/Mage/src/mage/game/Game.java index 3aeaced2dcf..5c1c13714ea 100644 --- a/Mage/src/mage/game/Game.java +++ b/Mage/src/mage/game/Game.java @@ -164,6 +164,10 @@ public interface Game extends MageItem, Serializable { // game options public void setGameOptions(GameOptions options); + // game times + public Date getStartTime(); + public Date getEndTime(); + // game cheats (for tests only) public void cheat(UUID ownerId, Map commands); public void cheat(UUID ownerId, List library, List hand, List battlefield, List graveyard); diff --git a/Mage/src/mage/game/GameImpl.java b/Mage/src/mage/game/GameImpl.java index 832f2c64aaf..1af4d574127 100644 --- a/Mage/src/mage/game/GameImpl.java +++ b/Mage/src/mage/game/GameImpl.java @@ -87,6 +87,9 @@ public abstract class GameImpl> implements Game, Serializa protected Map gameCards = new HashMap(); protected Map lki = new HashMap(); protected GameState state; + + protected Date startTime; + protected Date endTime; protected UUID startingPlayerId; protected UUID winnerId; @@ -279,6 +282,7 @@ public abstract class GameImpl> implements Game, Serializa } if (remainingPlayers <= 1 || numLosers >= state.getPlayers().size() - 1) { state.endGame(); + endTime = new Date(); return true; } return false; @@ -338,6 +342,7 @@ public abstract class GameImpl> implements Game, Serializa @Override public void start(UUID choosingPlayerId, GameOptions options) { + startTime = new Date(); init(choosingPlayerId, options.testMode); PlayerList players = state.getPlayerList(startingPlayerId); Player player = getPlayer(players.get()); @@ -1167,10 +1172,16 @@ public abstract class GameImpl> implements Game, Serializa } } - public void clearGraveyard(UUID playerId) { - - } - + @Override + public Date getStartTime() { + return startTime; + } + + @Override + public Date getEndTime() { + return endTime; + } + @Override public void setGameOptions(GameOptions options) { this.gameOptions = options;