diff --git a/Mage.Common/src/main/java/mage/view/TableView.java b/Mage.Common/src/main/java/mage/view/TableView.java index 1d8b74e0416..dd7de79d347 100644 --- a/Mage.Common/src/main/java/mage/view/TableView.java +++ b/Mage.Common/src/main/java/mage/view/TableView.java @@ -24,8 +24,7 @@ * 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.view; import java.io.Serializable; @@ -33,7 +32,6 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.UUID; - import mage.constants.SkillLevel; import mage.constants.TableState; import mage.game.Game; @@ -47,6 +45,7 @@ import mage.game.tournament.TournamentPlayer; * @author BetaSteward_at_googlemail.com */ public class TableView implements Serializable { + private static final long serialVersionUID = 1L; private UUID tableId; @@ -77,9 +76,9 @@ public class TableView implements Serializable { } this.controllerName = table.getControllerName(); this.tableState = table.getState(); - if (table.getState() == TableState.WAITING || - table.getState() == TableState.READY_TO_START || - table.getState() == TableState.STARTING) { + if (table.getState() == TableState.WAITING + || table.getState() == TableState.READY_TO_START + || table.getState() == TableState.STARTING) { this.createTime = table.getCreateTime(); } else { if (table.isTournament()) { @@ -94,7 +93,7 @@ public class TableView implements Serializable { } if (!table.isTournament()) { // MATCH - if (table.getState()==TableState.WAITING || table.getState()==TableState.READY_TO_START) { + if (table.getState() == TableState.WAITING || table.getState() == TableState.READY_TO_START) { tableStateText = table.getState().toString() + " (" + table.getMatch().getPlayers().size() + '/' + table.getSeats().length + ')'; } else { tableStateText = table.getState().toString(); @@ -131,6 +130,9 @@ public class TableView implements Serializable { addInfo.append("Wins:").append(table.getMatch().getWinsNeeded()); addInfo.append(sbScore.toString()); } + if (table.getNumberOfSeats() > 3) { + addInfo.append(" Rng: ").append(table.getMatch().getOptions().getRange().toString()); + } this.additionalInfo = addInfo.toString(); this.skillLevel = table.getMatch().getOptions().getSkillLevel(); this.quitRatio = Integer.toString(table.getMatch().getOptions().getQuitRatio()); diff --git a/Mage.Sets/src/mage/cards/b/BitterheartWitch.java b/Mage.Sets/src/mage/cards/b/BitterheartWitch.java index 20bcf385b02..b0a4fac32d6 100644 --- a/Mage.Sets/src/mage/cards/b/BitterheartWitch.java +++ b/Mage.Sets/src/mage/cards/b/BitterheartWitch.java @@ -98,21 +98,21 @@ class BitterheartWitchEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); + Player controller = game.getPlayer(source.getControllerId()); Player targetPlayer = game.getPlayer(source.getFirstTarget()); - if (player != null && targetPlayer != null) { + if (controller != null && targetPlayer != null) { TargetCardInLibrary targetCard = new TargetCardInLibrary(filter); - if (player.searchLibrary(targetCard, game)) { + if (controller.searchLibrary(targetCard, game)) { Card card = game.getCard(targetCard.getFirstTarget()); if (card != null) { game.getState().setValue("attachTo:" + card.getId(), targetPlayer.getId()); - card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId()); - targetPlayer.addAttachment(card.getId(), game); + if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) { + targetPlayer.addAttachment(card.getId(), game); + } } - player.shuffleLibrary(source, game); - return true; } - player.shuffleLibrary(source, game); + controller.shuffleLibrary(source, game); + return true; } return false; } diff --git a/Mage.Sets/src/mage/cards/c/CollectiveVoyage.java b/Mage.Sets/src/mage/cards/c/CollectiveVoyage.java index 7518e2b2060..178cd63f69a 100644 --- a/Mage.Sets/src/mage/cards/c/CollectiveVoyage.java +++ b/Mage.Sets/src/mage/cards/c/CollectiveVoyage.java @@ -27,6 +27,8 @@ */ package mage.cards.c; +import java.util.Objects; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.costs.Cost; import mage.abilities.costs.mana.GenericManaCost; @@ -42,9 +44,6 @@ import mage.game.Game; import mage.players.Player; import mage.target.common.TargetCardInLibrary; -import java.util.Objects; -import java.util.UUID; - /** * * @author LevelX2 @@ -52,8 +51,7 @@ import java.util.UUID; public class CollectiveVoyage extends CardImpl { public CollectiveVoyage(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{G}"); - + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}"); // Join forces - Starting with you, each player may pay any amount of mana. Each player searches his or her library for up to X basic land cards, where X is the total amount of mana paid this way, puts them onto the battlefield tapped, then shuffles his or her library. this.getSpellAbility().addEffect(new CollectiveVoyageEffect()); @@ -91,7 +89,7 @@ class CollectiveVoyageEffect extends OneShotEffect { if (controller != null) { int xSum = 0; xSum += playerPaysXGenericMana(controller, source, game); - for(UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { if (!Objects.equals(playerId, controller.getId())) { Player player = game.getPlayer(playerId); if (player != null) { @@ -100,7 +98,7 @@ class CollectiveVoyageEffect extends OneShotEffect { } } } - for(UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { TargetCardInLibrary target = new TargetCardInLibrary(0, xSum, StaticFilters.FILTER_BASIC_LAND_CARD); @@ -128,6 +126,8 @@ class CollectiveVoyageEffect extends OneShotEffect { int xValue = 0; boolean payed = false; while (player.canRespond() && !payed) { + int bookmark = game.bookmarkState(); + player.resetStoredBookmark(game); xValue = player.announceXMana(0, Integer.MAX_VALUE, "How much mana will you pay?", game, source); if (xValue > 0) { Cost cost = new GenericManaCost(xValue); @@ -135,9 +135,14 @@ class CollectiveVoyageEffect extends OneShotEffect { } else { payed = true; } + if (!payed) { + game.restoreState(bookmark, "Collective Voyage"); + game.fireUpdatePlayersEvent(); + } else { + game.removeBookmark(bookmark); + } } game.informPlayers(new StringBuilder(player.getLogName()).append(" pays {").append(xValue).append("}.").toString()); return xValue; } } - diff --git a/Mage.Sets/src/mage/cards/c/CurseOfMisfortunes.java b/Mage.Sets/src/mage/cards/c/CurseOfMisfortunes.java index 05bb4b8fa4d..4d128d2c0d1 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfMisfortunes.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfMisfortunes.java @@ -27,6 +27,7 @@ */ package mage.cards.c; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.OnEventTriggeredAbility; import mage.abilities.effects.OneShotEffect; @@ -51,8 +52,6 @@ import mage.target.TargetPlayer; import mage.target.common.TargetCardInLibrary; import mage.target.targetpointer.FixedTarget; -import java.util.UUID; - /** * * @author BetaSteward @@ -97,13 +96,14 @@ class CurseOfMisfortunesEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - FilterCard filter = new FilterCard("Curse card that doesn't have the same name as a Curse attached to enchanted player"); - filter.add(new SubtypePredicate(SubType.CURSE)); + Player controller = game.getPlayer(source.getControllerId()); Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { + if (controller != null && enchantment != null && enchantment.getAttachedTo() != null) { Player targetPlayer = game.getPlayer(enchantment.getAttachedTo()); Player player = game.getPlayer(source.getControllerId()); if (player != null && targetPlayer != null) { + FilterCard filter = new FilterCard("Curse card that doesn't have the same name as a Curse attached to enchanted player"); + filter.add(new SubtypePredicate(SubType.CURSE)); // get the names of attached Curses for (UUID attachmentId: targetPlayer.getAttachments()) { Permanent attachment = game.getPermanent(attachmentId); @@ -111,19 +111,20 @@ class CurseOfMisfortunesEffect extends OneShotEffect { filter.add(Predicates.not(new NamePredicate(attachment.getName()))); } } - TargetCardInLibrary targetCard = new TargetCardInLibrary(filter); if (player.searchLibrary(targetCard, game)) { Card card = game.getCard(targetCard.getFirstTarget()); if (card != null) { this.setTargetPointer(new FixedTarget(targetPlayer.getId())); game.getState().setValue("attachTo:" + card.getId(), targetPlayer.getId()); - player.shuffleLibrary(source, game); - return card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId()); + if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) { + targetPlayer.addAttachment(card.getId(), game); + } } } player.shuffleLibrary(source, game); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/cards/v/VerdantSunsAvatar.java b/Mage.Sets/src/mage/cards/v/VerdantSunsAvatar.java new file mode 100644 index 00000000000..480888b4a03 --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/VerdantSunsAvatar.java @@ -0,0 +1,149 @@ +/* + * 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.v; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author spjspj + */ +public class VerdantSunsAvatar extends CardImpl { + + public VerdantSunsAvatar(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + + this.subtype.add("Dinosaur"); + this.subtype.add("Avatar"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // When Verdant Sun's Avatar or another creature enters the battlefield under your control, you gain life equal to that creature's toughness. + this.addAbility(new VerdantSunsAvatarTriggeredAbility()); + } + + public VerdantSunsAvatar(final VerdantSunsAvatar card) { + super(card); + } + + @Override + public VerdantSunsAvatar copy() { + return new VerdantSunsAvatar(this); + } +} + +class VerdantSunsAvatarTriggeredAbility extends TriggeredAbilityImpl { + + public VerdantSunsAvatarTriggeredAbility() { + super(Zone.BATTLEFIELD, new VerdantSunsAvatarEffect(), false); + } + + public VerdantSunsAvatarTriggeredAbility(VerdantSunsAvatarTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent.isCreature() + && permanent.getControllerId().equals(this.controllerId)) { + Effect effect = this.getEffects().get(0); + // Life is determined during resolution so it has to be retrieved there (e.g. Giant Growth before resolution) + effect.setValue("lifeSource", event.getTargetId()); + effect.setValue("zoneChangeCounter", permanent.getZoneChangeCounter(game)); + return true; + } + return false; + } + + @Override + public String getRule() { + return "When {this} or another creature enters the battlefield under your control, " + super.getRule(); + } + + @Override + public VerdantSunsAvatarTriggeredAbility copy() { + return new VerdantSunsAvatarTriggeredAbility(this); + } +} + +class VerdantSunsAvatarEffect extends OneShotEffect { + + public VerdantSunsAvatarEffect() { + super(Outcome.GainLife); + staticText = "you gain life equal to that creature's toughness"; + } + + public VerdantSunsAvatarEffect(final VerdantSunsAvatarEffect effect) { + super(effect); + } + + @Override + public VerdantSunsAvatarEffect copy() { + return new VerdantSunsAvatarEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + UUID creatureId = (UUID) getValue("lifeSource"); + Integer zoneChangeCounter = (Integer) getValue("zoneChangeCounter"); + Permanent creature = game.getPermanent(creatureId); + if (creature == null || creature.getZoneChangeCounter(game) != zoneChangeCounter) { + creature = (Permanent) game.getLastKnownInformation(creatureId, Zone.BATTLEFIELD, zoneChangeCounter); + } + if (creature != null) { + int amount = creature.getToughness().getValue(); + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + player.gainLife(amount, game); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/v/VraskasContempt.java b/Mage.Sets/src/mage/cards/v/VraskasContempt.java new file mode 100644 index 00000000000..ad64c6d42e7 --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/VraskasContempt.java @@ -0,0 +1,61 @@ +/* + * 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.v; + +import java.util.UUID; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.target.common.TargetCreatureOrPlaneswalker; + +/** + * + * @author spjspj + */ +public class VraskasContempt extends CardImpl { + + public VraskasContempt(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{B}{B}"); + + // Exile target creature or planeswalker. You gain 2 life. + this.getSpellAbility().addEffect(new ExileTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreatureOrPlaneswalker()); + this.getSpellAbility().addEffect(new GainLifeEffect(2)); + } + + public VraskasContempt(final VraskasContempt card) { + super(card); + } + + @Override + public VraskasContempt copy() { + return new VraskasContempt(this); + } +} diff --git a/Mage.Sets/src/mage/cards/w/WakerOfTheWilds.java b/Mage.Sets/src/mage/cards/w/WakerOfTheWilds.java new file mode 100644 index 00000000000..2c93d6a8fcf --- /dev/null +++ b/Mage.Sets/src/mage/cards/w/WakerOfTheWilds.java @@ -0,0 +1,81 @@ +/* + * 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.w; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterControlledLandPermanent; +import mage.game.permanent.token.WallOfResurgenceToken; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author spjspj + */ +public class WakerOfTheWilds extends CardImpl { + + public WakerOfTheWilds(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + + this.subtype.add("Merfolk"); + this.subtype.add("Shaman"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {X}{G}{G}: Put X +1/+1 counters on target land you control. That land becomes a 0/0 Elemental creature with haste that's still a land. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new AddCountersTargetEffect(CounterType.P1P1.createInstance(0), new ManacostVariableValue()), new ManaCostsImpl("{X}{G}{G}")); + Effect effect = new BecomesCreatureTargetEffect(new WallOfResurgenceToken(), false, true, Duration.Custom); + effect.setText("That land becomes a 0/0 Elemental creature with haste that's still a land"); + ability.addEffect(effect); + ability.addTarget(new TargetControlledPermanent(new FilterControlledLandPermanent())); + this.addAbility(ability); + } + + public WakerOfTheWilds(final WakerOfTheWilds card) { + super(card); + } + + @Override + public WakerOfTheWilds copy() { + return new WakerOfTheWilds(this); + } +} diff --git a/Mage.Sets/src/mage/cards/w/WalkThePlank.java b/Mage.Sets/src/mage/cards/w/WalkThePlank.java new file mode 100644 index 00000000000..cc7a6250404 --- /dev/null +++ b/Mage.Sets/src/mage/cards/w/WalkThePlank.java @@ -0,0 +1,71 @@ +/* + * 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.w; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author spjspj + */ +public class WalkThePlank extends CardImpl { + + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Merfolk creature"); + + static { + filter.add(new CardTypePredicate(CardType.CREATURE)); + filter.add(Predicates.not(new SubtypePredicate(SubType.MERFOLK))); + } + + public WalkThePlank(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}{B}"); + + // Destroy target non-Merfolk creature. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + } + + public WalkThePlank(final WalkThePlank card) { + super(card); + } + + @Override + public WalkThePlank copy() { + return new WalkThePlank(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Ixalan.java b/Mage.Sets/src/mage/sets/Ixalan.java index cb2c7e4d91f..dbb8427e342 100644 --- a/Mage.Sets/src/mage/sets/Ixalan.java +++ b/Mage.Sets/src/mage/sets/Ixalan.java @@ -6,6 +6,7 @@ package mage.sets; import mage.cards.ExpansionSet; +import mage.constants.Rarity; import mage.constants.SetType; /** @@ -30,5 +31,9 @@ public class Ixalan extends ExpansionSet { this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 8; + cards.add(new SetCardInfo("Verdant Sun's Avatar", 410, Rarity.RARE, mage.cards.v.VerdantSunsAvatar.class)); + cards.add(new SetCardInfo("Vraska's Contempt", 210, Rarity.RARE, mage.cards.v.VraskasContempt.class)); + cards.add(new SetCardInfo("Waker of the Wilds", 415, Rarity.RARE, mage.cards.w.WakerOfTheWilds.class)); + cards.add(new SetCardInfo("Walk the Plank", 220, Rarity.UNCOMMON, mage.cards.w.WalkThePlank.class)); } -} \ No newline at end of file +} diff --git a/Mage/src/main/java/mage/abilities/effects/AuraReplacementEffect.java b/Mage/src/main/java/mage/abilities/effects/AuraReplacementEffect.java index 60e5c3af96f..873e81e5a50 100644 --- a/Mage/src/main/java/mage/abilities/effects/AuraReplacementEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/AuraReplacementEffect.java @@ -27,6 +27,7 @@ */ package mage.abilities.effects; +import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.SpellAbility; @@ -44,8 +45,6 @@ import mage.players.Player; import mage.target.Target; import mage.target.common.TargetCardInGraveyard; -import java.util.UUID; - /** * Cards with the Aura subtype don't change the zone they are in, if there is no * valid target on the battlefield. Also, when entering the battlefield and it @@ -98,19 +97,23 @@ public class AuraReplacementEffect extends ReplacementEffectImpl { } // Aura enters the battlefield attached Object object = game.getState().getValue("attachTo:" + card.getId()); - if (object != null && object instanceof PermanentCard) { - return false; + if (object != null) { + if (object instanceof PermanentCard) { + // Aura is attached to a permanent on the battlefield + return false; + } + if (object instanceof UUID) { + Player player = game.getPlayer((UUID) object); + if (player != null) { + // Aura is attached to a player + return false; + } + } } UUID targetId = null; MageObject sourceObject = game.getObject(sourceId); boolean enchantCardInGraveyard = false; -// if (sourceObject instanceof Spell) { -// if (fromZone.equals(Zone.EXILED)) { -// // cast from exile (e.g. Neightveil Spector) -> no replacement -// return false; -// } -// } if (sourceObject instanceof StackAbility) { StackAbility stackAbility = (StackAbility) sourceObject; if (!stackAbility.getEffects().isEmpty()) {