diff --git a/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java b/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java index 67b4fdfb31..edc43221e6 100644 --- a/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java +++ b/Mage.Client/src/main/java/mage/client/cards/DragCardGrid.java @@ -37,9 +37,11 @@ import javax.swing.JLabel; import javax.swing.JLayeredPane; import javax.swing.JMenu; import javax.swing.JMenuItem; +import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPopupMenu; import javax.swing.JScrollPane; +import mage.cards.Card; import javax.swing.JSlider; import javax.swing.JTextField; import javax.swing.JToggleButton; @@ -49,6 +51,9 @@ import javax.swing.SwingUtilities; import mage.cards.MageCard; import mage.cards.decks.DeckCardInfo; import mage.cards.decks.DeckCardLayout; +import mage.cards.repository.CardCriteria; +import mage.cards.repository.CardInfo; +import mage.cards.repository.CardRepository; import mage.client.MageFrame; import mage.client.constants.Constants; import mage.client.dialog.PreferencesDialog; @@ -63,6 +68,7 @@ import mage.client.util.Event; import mage.client.util.GUISizeHelper; import mage.client.util.Listener; import mage.constants.CardType; +import mage.util.RandomUtil; import mage.view.CardView; import mage.view.CardsView; import org.apache.log4j.Logger; @@ -571,7 +577,7 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg void hideCards(Collection card); void duplicateCards(Collection cards); - + void invertCardSelection(Collection cards); void showAll(); @@ -595,11 +601,13 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg BigCard lastBigCard = null; // Top bar with dropdowns for sort / filter / etc - final JButton sortButton; - final JButton filterButton; - final JButton visibilityButton; - final JButton selectByButton; - final JButton analyseButton; + JButton sortButton; + JButton filterButton; + JButton visibilityButton; + JButton selectByButton; + JButton analyseButton; + JButton blingButton; + // Popup for toolbar final JPopupMenu filterPopup; @@ -750,9 +758,10 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg // Toolbar sortButton = new JButton("Sort"); filterButton = new JButton("Filter"); - visibilityButton = new JButton("Visibility"); + visibilityButton = new JButton("V"); // "Visibility" button selectByButton = new JButton("Select By"); - analyseButton = new JButton("Mana"); + analyseButton = new JButton("M"); // "Mana" button + blingButton = new JButton("B"); // "Bling" button // Name and count label deckNameAndCountLabel = new JLabel(); @@ -773,9 +782,10 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg toolbarInner.add(creatureCountLabel); toolbarInner.add(sortButton); toolbarInner.add(filterButton); - toolbarInner.add(visibilityButton); toolbarInner.add(selectByButton); + toolbarInner.add(visibilityButton); toolbarInner.add(analyseButton); + toolbarInner.add(blingButton); toolbar.add(toolbarInner, BorderLayout.WEST); JPanel sliderPanel = new JPanel(new GridBagLayout()); sliderPanel.setOpaque(false); @@ -923,6 +933,7 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg JMenuItem showAll = new JMenuItem("Show all"); showAll.addActionListener(e -> showAll()); visPopup.add(showAll); + visibilityButton.setToolTipText("Visibility of cards. Right click to get the same options this provides"); visibilityButton.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { @@ -950,15 +961,15 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg ButtonGroup selectByTypeModeGroup = new ButtonGroup(); for (final CardType cardType : CardType.values()) { - if (cardType == cardType.CONSPIRACY) { + if (cardType == cardType.CONSPIRACY) { multiplesButton = new JToggleButton("Multiples"); selectByTypeButtons.put(cardType, multiplesButton); selectByTypeMode.add(multiplesButton); selectByTypeModeGroup.add(multiplesButton); multiplesButton.addActionListener(e -> { - multiplesButton.setSelected(!multiplesButton.isSelected()); - reselectBy(); - }); + multiplesButton.setSelected(!multiplesButton.isSelected()); + reselectBy(); + }); continue; } @@ -1005,10 +1016,19 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg } // Analyse Mana (aka #blue pips, #islands, #white pips, #plains etc.) - analyseButton.setToolTipText("Counts coloured/colourless mana costs. Counts land types."); + analyseButton.setToolTipText("Mana Analyser! Counts coloured/colourless mana costs. Counts land types."); analyseButton.addActionListener(evt -> analyseDeck()); + // Bling button - aka Add in a premium 'JR', 'MBP', 'CS' etc card + blingButton.setToolTipText("Bling your deck! Select the original and added cards by selecting 'Multiples' in the selection options"); + + blingButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent evt) { + blingDeck(); + } + }); + // Filter popup filterPopup = new JPopupMenu(); filterPopup.setPreferredSize(new Dimension(300, 300)); @@ -1098,7 +1118,7 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg l.duplicateCards(toDuplicate); } } - + private void invertSelection() { Collection toInvert = allCards; for (DragCardGridListener l : listeners) { @@ -1468,6 +1488,84 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg MageFrame.getInstance().showMessage(finalInfo); } + public void blingDeck() { + if (!(this.mode == Constants.DeckEditorMode.FREE_BUILDING)) { + return; + } + + if (JOptionPane.showConfirmDialog(null, "Are you sure you want to bling your deck? This process will add cards!", "WARNING", + JOptionPane.YES_NO_OPTION) == JOptionPane.NO_OPTION) { + return; + } + + HashMap pimpedSets = new HashMap<>(); + HashMap pimpedCards = new HashMap<>(); + pimpedSets.put("CP", 1); + pimpedSets.put("JR", 1); + pimpedSets.put("MPS", 1); + pimpedSets.put("CLASH", 1); + pimpedSets.put("ARENA", 1); + pimpedSets.put("UGIN", 1); + pimpedSets.put("WMCQ", 1); + pimpedSets.put("APAC", 1); + pimpedSets.put("EURO", 1); + pimpedSets.put("FNMP", 1); + pimpedSets.put("MGDC", 1); + pimpedSets.put("MPRP", 1); + pimpedSets.put("EXP", 1); + pimpedSets.put("GPX", 1); + pimpedSets.put("GRC", 1); + pimpedSets.put("MBP", 1); + pimpedSets.put("MLP", 1); + pimpedSets.put("PLS", 1); + pimpedSets.put("PTC", 1); + pimpedSets.put("SUS", 1); + + String[] sets = pimpedSets.keySet().toArray(new String[pimpedSets.keySet().size()]); + Boolean didModify = false; + + for (ArrayList> gridRow : cardGrid) { + for (ArrayList stack : gridRow) { + for (CardView card : stack) { + if (card.getSuperTypes().contains("Basic")) { + continue; + } + + if (!pimpedSets.containsKey(card.getExpansionSetCode())) { + final CardCriteria cardCriteria = new CardCriteria(); + cardCriteria.setCodes(sets); + cardCriteria.name(card.getName()); + + List cardPool = CardRepository.instance.findCards(cardCriteria); + + if (cardPool.size() > 0) { + Card acard = cardPool.get(RandomUtil.nextInt(cardPool.size())).getMockCard(); + + if (acard.getName().equals(card.getName())) { + CardView pimpedCard = new CardView(acard); + addCardView(pimpedCard, false); + eventSource.addSpecificCard(pimpedCard, "add-specific-card"); + pimpedCards.put(pimpedCard, 1); + didModify = true; + } + } + } + } + } + + if (didModify) { + for (CardView c : pimpedCards.keySet()) { + sortIntoGrid(c); + } + + layoutGrid(); + cardScroll.revalidate(); + repaint(); + JOptionPane.showMessageDialog(null, "Added " + pimpedCards.size() + " cards. You can select them and the originals by choosing 'Multiples'"); + } + } + } + // Update the contents of the card grid public void setCards(CardsView cardsView, DeckCardLayout layout, BigCard bigCard) { if (bigCard != null) { @@ -1630,10 +1728,10 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg AbstractButton button = selectByTypeButtons.get(cardType); String text = cardType.toString(); int numCards = getCount(cardType); - if (cardType == cardType.CONSPIRACY) { + if (cardType == cardType.CONSPIRACY) { continue; } - + if (numCards > 0) { button.setForeground(Color.BLACK); text = text + " - " + numCards; @@ -1649,7 +1747,7 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg JMenuItem hide = new JMenuItem("Hide"); hide.addActionListener(e2 -> hideSelection()); menu.add(hide); - + JMenuItem invertSelection = new JMenuItem("Invert Selection"); invertSelection.addActionListener(e2 -> invertSelection()); menu.add(invertSelection); 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 270863f5f3..2d65369909 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 @@ -62,7 +62,9 @@ public class Modern extends Constructed { banned.add("Dig Through Time"); banned.add("Dread Return"); banned.add("Eye of Ugin"); + banned.add("Gitaxian Probe"); banned.add("Glimpse of Nature"); + banned.add("Golgari Grave-Troll"); banned.add("Great Furnace"); banned.add("Green Sun's Zenith"); banned.add("Hypergenesis"); diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Standard.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Standard.java index 054c8505d1..1e7377fa5e 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Standard.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Standard.java @@ -67,5 +67,8 @@ public class Standard extends Constructed { } } } + banned.add("Emrakul, the Promised End"); + banned.add("Reflector Mage"); + banned.add("Smuggler's Copter"); } } diff --git a/Mage.Sets/src/mage/cards/t/TezzeretMasterOfMetal.java b/Mage.Sets/src/mage/cards/t/TezzeretMasterOfMetal.java index 07c43f7f38..80d0c6f8f2 100644 --- a/Mage.Sets/src/mage/cards/t/TezzeretMasterOfMetal.java +++ b/Mage.Sets/src/mage/cards/t/TezzeretMasterOfMetal.java @@ -1,156 +1,156 @@ -/* - * 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.cards.t; - -import java.util.List; -import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.LoyaltyAbility; -import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; -import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.ContinuousEffect; -import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.LoseLifeTargetEffect; -import mage.abilities.effects.common.RevealCardsFromLibraryUntilEffect; -import mage.cards.CardImpl; -import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.SubLayer; -import mage.constants.Zone; -import mage.filter.FilterPermanent; -import mage.filter.common.FilterArtifactCard; -import mage.filter.common.FilterControlledArtifactPermanent; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.target.common.TargetOpponent; -import mage.target.targetpointer.FixedTarget; - -/** - * - * @author Styxo - */ -public class TezzeretMasterOfMetal extends CardImpl { - - public TezzeretMasterOfMetal(UUID ownerId, CardSetInfo setInfo) { - super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{4}{U}{B}"); - this.subtype.add("Tezzeret"); - - this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); - - // +1: Reveal cards from the top of your library until you reveal an artifact card. Put that card into your hand and the rest on the bottom of your library in a random order. - this.addAbility(new LoyaltyAbility(new RevealCardsFromLibraryUntilEffect(new FilterArtifactCard(), Zone.HAND, Zone.LIBRARY), 1)); - - // -3: Target opponent loses life equal to the number of artifacts you control. - Ability ability = new LoyaltyAbility(new LoseLifeTargetEffect(new PermanentsOnBattlefieldCount(new FilterControlledArtifactPermanent())), -3); - ability.addTarget(new TargetOpponent()); - this.addAbility(ability); - - // -8: Gain control of all artifacts and creatures target opponent controls. - ability = new LoyaltyAbility(new TezzeretMasterOfMetalEffect(), -8); - ability.addTarget(new TargetOpponent()); - this.addAbility(ability); - } - - public TezzeretMasterOfMetal(final TezzeretMasterOfMetal card) { - super(card); - } - - @Override - public TezzeretMasterOfMetal copy() { - return new TezzeretMasterOfMetal(this); - } -} - -class TezzeretMasterOfMetalEffect extends OneShotEffect { - - private static final FilterPermanent filter = new FilterPermanent("artifacts and creatures"); - - static { - filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.ARTIFACT))); - } - - public TezzeretMasterOfMetalEffect() { - super(Outcome.GainControl); - this.staticText = "Gain control of all artifacts and creatures target opponent controls"; - } - - public TezzeretMasterOfMetalEffect(final TezzeretMasterOfMetalEffect effect) { - super(effect); - } - - @Override - public TezzeretMasterOfMetalEffect copy() { - return new TezzeretMasterOfMetalEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - List permanents = game.getBattlefield().getAllActivePermanents(filter, targetPointer.getFirst(game, source), game); - for (Permanent permanent : permanents) { - ContinuousEffect effect = new TibaltTheFiendBloodedControlEffect(source.getControllerId()); - effect.setTargetPointer(new FixedTarget(permanent.getId())); - game.addEffect(effect, source); - } - return true; - } -} - -class TezzeretMasterOfMetalControlEffect extends ContinuousEffectImpl { - - private final UUID controllerId; - - public TezzeretMasterOfMetalControlEffect(UUID controllerId) { - super(Duration.EndOfGame, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl); - this.controllerId = controllerId; - } - - public TezzeretMasterOfMetalControlEffect(final TezzeretMasterOfMetalControlEffect effect) { - super(effect); - this.controllerId = effect.controllerId; - } - - @Override - public TezzeretMasterOfMetalControlEffect copy() { - return new TezzeretMasterOfMetalControlEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); - if (permanent != null && controllerId != null) { - return permanent.changeControllerId(controllerId, game); - } - return false; - } -} +/* + * 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.cards.t; + +import java.util.List; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.effects.common.RevealCardsFromLibraryUntilEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.SubLayer; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterArtifactCard; +import mage.filter.common.FilterControlledArtifactPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetOpponent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author Styxo + */ +public class TezzeretMasterOfMetal extends CardImpl { + + public TezzeretMasterOfMetal(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{4}{U}{B}"); + this.subtype.add("Tezzeret"); + + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + + // +1: Reveal cards from the top of your library until you reveal an artifact card. Put that card into your hand and the rest on the bottom of your library in a random order. + this.addAbility(new LoyaltyAbility(new RevealCardsFromLibraryUntilEffect(new FilterArtifactCard(), Zone.HAND, Zone.LIBRARY), 1)); + + // -3: Target opponent loses life equal to the number of artifacts you control. + Ability ability = new LoyaltyAbility(new LoseLifeTargetEffect(new PermanentsOnBattlefieldCount(new FilterControlledArtifactPermanent())), -3); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + + // -8: Gain control of all artifacts and creatures target opponent controls. + ability = new LoyaltyAbility(new TezzeretMasterOfMetalEffect(), -8); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + } + + public TezzeretMasterOfMetal(final TezzeretMasterOfMetal card) { + super(card); + } + + @Override + public TezzeretMasterOfMetal copy() { + return new TezzeretMasterOfMetal(this); + } +} + +class TezzeretMasterOfMetalEffect extends OneShotEffect { + + private static final FilterPermanent filter = new FilterPermanent("artifacts and creatures"); + + static { + filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.ARTIFACT))); + } + + public TezzeretMasterOfMetalEffect() { + super(Outcome.GainControl); + this.staticText = "Gain control of all artifacts and creatures target opponent controls"; + } + + public TezzeretMasterOfMetalEffect(final TezzeretMasterOfMetalEffect effect) { + super(effect); + } + + @Override + public TezzeretMasterOfMetalEffect copy() { + return new TezzeretMasterOfMetalEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + List permanents = game.getBattlefield().getAllActivePermanents(filter, targetPointer.getFirst(game, source), game); + for (Permanent permanent : permanents) { + ContinuousEffect effect = new TezzeretMasterOfMetalControlEffect(source.getControllerId()); + effect.setTargetPointer(new FixedTarget(permanent.getId())); + game.addEffect(effect, source); + } + return true; + } +} + +class TezzeretMasterOfMetalControlEffect extends ContinuousEffectImpl { + + private final UUID controllerId; + + public TezzeretMasterOfMetalControlEffect(UUID controllerId) { + super(Duration.EndOfGame, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl); + this.controllerId = controllerId; + } + + public TezzeretMasterOfMetalControlEffect(final TezzeretMasterOfMetalControlEffect effect) { + super(effect); + this.controllerId = effect.controllerId; + } + + @Override + public TezzeretMasterOfMetalControlEffect copy() { + return new TezzeretMasterOfMetalControlEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); + if (permanent != null && controllerId != null) { + return permanent.changeControllerId(controllerId, game); + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/w/WhirOfInvention.java b/Mage.Sets/src/mage/cards/w/WhirOfInvention.java index 632922dc5b..a05fbdd92f 100644 --- a/Mage.Sets/src/mage/cards/w/WhirOfInvention.java +++ b/Mage.Sets/src/mage/cards/w/WhirOfInvention.java @@ -52,8 +52,7 @@ import mage.target.common.TargetCardInLibrary; public class WhirOfInvention extends CardImpl { public WhirOfInvention(UUID ownerId, CardSetInfo setInfo) { - super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{U}{U}{U}"); - + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{U}{U}{U}"); // Improvise (Your artifacts can help cast this spell. Each artifact you tap after you're done activating mana abilities pays for {1}.) addAbility(new ImproviseAbility()); diff --git a/Utils/gen-card.pl b/Utils/gen-card.pl index e205be2c6e..44bf93cada 100755 --- a/Utils/gen-card.pl +++ b/Utils/gen-card.pl @@ -227,11 +227,31 @@ foreach my $ability (@abilities) { $ability =~ m/({.*})/g; $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(this, new ManaCostsImpl("' . fixCost($1) . '")));'; $vars{'abilitiesImports'} .= "\nimport mage.abilities.costs.mana.ManaCostsImpl;"; + } elsif ($keywords{$kw} eq 'type') { + $ability =~ m/\s([a-zA-Z\s]*)/g; + if ($1 =~ m/(^.*\s.*)/g) { + $vars{'abilities'} .= "\n TargetPermanent auraTarget = new TargetPermanent(filter);"; + } else { + $vars{'abilities'} .= "\n TargetPermanent auraTarget = new Target". toCamelCase($1) . "Permanent();"; + $vars{'abilitiesImports'} .= "\nimport mage.target.common.Target". toCamelCase($1) . "Permanent;"; + } + $vars{'abilities'} .= "\n this.getSpellAbility().addTarget(auraTarget);"; + $vars{'abilities'} .= "\n this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));"; + $vars{'abilities'} .= "\n Ability ability = new EnchantAbility(auraTarget.getTargetName());"; + $vars{'abilities'} .= "\n this.addAbility(ability);"; + $vars{'abilitiesImports'} .= "\nimport mage.abilities.Ability;"; + $vars{'abilitiesImports'} .= "\nimport mage.abilities.effects.common.AttachEffect;"; + $vars{'abilitiesImports'} .= "\nimport mage.constants.Outcome;"; + $vars{'abilitiesImports'} .= "\nimport mage.target.TargetPermanent;"; + } elsif ($keywords{$kw} eq 'manaString') { + $ability =~ m/({.*})/g; + $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability("' . fixCost($1) . '"));'; } $vars{'abilitiesImports'} .= "\nimport mage.abilities.keyword." . $kw . "Ability;"; } else { $vars{'abilities'} .= "\n // $kwUnchanged"; } + $vars{'abilities'} .= "\n"; } } } diff --git a/Utils/keywords.txt b/Utils/keywords.txt index f4285f2d63..b905489993 100644 --- a/Utils/keywords.txt +++ b/Utils/keywords.txt @@ -1,10 +1,13 @@ Annihilator|number| Basic landcycling|cost| Battle cry|new| +Bestow|card, manaString| Bloodthirst|number| Bushido|number| -Convoke|new| +Buyback|manaString| Cascade|new| +Changeling|instance| +Convoke|new| Crew|number| Cumulative upkeep|cost| Cycling|cost| @@ -14,10 +17,14 @@ Delve|new| Dethrone|new| Devoid|color| Defender|instance| +Dredge|number| Double Strike|instance| Dredge|number| +Echo|manaString| +Enchant|type| Entwine|manaString| Evoke|card, manaString| +Evolve|new| Exalted|new| Exploit|new| Extort|new| diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index f0f03b4cdf..3724ab628c 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -30403,7 +30403,7 @@ Shipwreck Moray|Aether Revolt|45|C|{3}{U}|Creature - Fish|0|5|When Shipwreck Mor Skyship Plunderer|Aether Revolt|46|U|{1}{U}|Creature - Human Pirate|2|1|Flying$Whenever Skyship Plunderer deals combat damage to a player, for each kind of counter on target permanent or player, give that permanent or player another counter of that kind.| Take into Custody|Aether Revolt|47|C|{U}|Instant|||Tap target creature. It doesn't untap during its controller's next untap step.| Trophy Mage|Aether Revolt|48|U|{2}{U}|Creature - Human Wizard|2|2|When Trophy Mage enters the battlefield, you may search your library for an artifact card with converted mana cost 3, reveal it, put it into your hand, then shuffle your library.| -Whir of Invention|Aether Revolt|49|R|{X}{U}{U}{U}|Sorcery|||Improvise (Your artifacts can help cast this spell. Each artifact you tap after you're done activating mana abilities pays for {1}.)$Search your library for an artifact card with converted mana cost X or less, put it onto the battlefield, then shuffle your library.| +Whir of Invention|Aether Revolt|49|R|{X}{U}{U}{U}|Instant|||Improvise (Your artifacts can help cast this spell. Each artifact you tap after you're done activating mana abilities pays for {1}.)$Search your library for an artifact card with converted mana cost X or less, put it onto the battlefield, then shuffle your library.| Wind-King Raiders|Aether Revolt|50|U|{4}{U}{U}|Creature - Human Artificer|4|3|Improvise (Your artifacts can help cast this spell. Each artifact you tap after you're done activating mana abilities pays for {1}.)$Flying| Aether Poisoner|Aether Revolt|51|C|{1}{B}|Creature - Human Artificer|1|1|Deathtouch (Any amount of damage this deals to a creature is enough to destroy it.)$When Aether Poisoner enters the battlefield, you get {E}{E} (two energy counters).$Whenever Aether Poisoner attacks, you may pay {E}{E}. If you do, create a 1/1 colorless Servo artifact creature token.| Alley Strangler|Aether Revolt|52|C|{2}{B}|Creature - Aetherborn Rogue|2|3|Menace|