diff --git a/Mage.Sets/src/mage/sets/fifthedition/Armageddon.java b/Mage.Sets/src/mage/sets/fifthedition/Armageddon.java new file mode 100644 index 0000000000..e6b16b12a8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/Armageddon.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.sets.fifthedition; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.cards.CardImpl; +import mage.filter.common.FilterLandPermanent; + +/** + * + * @author Loki + */ +public class Armageddon extends CardImpl { + + public Armageddon(UUID ownerId) { + super(ownerId, 283, "Armageddon", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{W}"); + this.expansionSetCode = "5ED"; + + this.color.setWhite(true); + + // Destroy all lands. + this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterLandPermanent("lands"))); + } + + public Armageddon(final Armageddon card) { + super(card); + } + + @Override + public Armageddon copy() { + return new Armageddon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/Armageddon.java b/Mage.Sets/src/mage/sets/fourthedition/Armageddon.java new file mode 100644 index 0000000000..a45fe7efad --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Armageddon.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author Loki + */ +public class Armageddon extends mage.sets.fifthedition.Armageddon { + + public Armageddon(UUID ownerId) { + super(ownerId); + this.cardNumber = 255; + this.expansionSetCode = "4ED"; + } + + public Armageddon(final Armageddon card) { + super(card); + } + + @Override + public Armageddon copy() { + return new Armageddon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/Calciderm.java b/Mage.Sets/src/mage/sets/planarchaos/Calciderm.java index 9f95a78843..07c3883f14 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/Calciderm.java +++ b/Mage.Sets/src/mage/sets/planarchaos/Calciderm.java @@ -35,6 +35,7 @@ import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.ShroudAbility; import mage.abilities.keyword.VanishingAbility; +import mage.abilities.keyword.VanishingTriggeredAbility; import mage.cards.CardImpl; import mage.counters.CounterType; @@ -58,6 +59,7 @@ public class Calciderm extends CardImpl { // Vanishing 4 this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(4)))); this.addAbility(new VanishingAbility()); + this.addAbility(new VanishingTriggeredAbility()); } public Calciderm(final Calciderm card) { diff --git a/Mage.Sets/src/mage/sets/sixthedition/Armageddon.java b/Mage.Sets/src/mage/sets/sixthedition/Armageddon.java new file mode 100644 index 0000000000..bbaf917985 --- /dev/null +++ b/Mage.Sets/src/mage/sets/sixthedition/Armageddon.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.sixthedition; + +import java.util.UUID; + +/** + * + * @author Loki + */ +public class Armageddon extends mage.sets.fifthedition.Armageddon { + + public Armageddon(UUID ownerId) { + super(ownerId); + this.cardNumber = 4; + this.expansionSetCode = "6ED"; + } + + public Armageddon(final Armageddon card) { + super(card); + } + + @Override + public Armageddon copy() { + return new Armageddon(this); + } +} diff --git a/Mage/src/mage/abilities/keyword/VanishingAbility.java b/Mage/src/mage/abilities/keyword/VanishingAbility.java index b7db9bd872..5fc76b5ff2 100644 --- a/Mage/src/mage/abilities/keyword/VanishingAbility.java +++ b/Mage/src/mage/abilities/keyword/VanishingAbility.java @@ -44,9 +44,7 @@ class VanishingEffect extends OneShotEffect { if (p != null) { int amount = p.getCounters().getCount(CounterType.TIME); if (amount > 0) { - p.getCounters().removeCounter(CounterType.TIME, 1); - } else { - p.sacrifice(source.getSourceId(), game); + p.removeCounters(CounterType.TIME.createInstance(), game); } return true; } diff --git a/Mage/src/mage/abilities/keyword/VanishingTriggeredAbility.java b/Mage/src/mage/abilities/keyword/VanishingTriggeredAbility.java new file mode 100644 index 0000000000..bf41009548 --- /dev/null +++ b/Mage/src/mage/abilities/keyword/VanishingTriggeredAbility.java @@ -0,0 +1,40 @@ +package mage.abilities.keyword; + +import mage.Constants; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; + +public class VanishingTriggeredAbility extends TriggeredAbilityImpl { + public VanishingTriggeredAbility() { + super(Constants.Zone.BATTLEFIELD, new SacrificeSourceEffect()); + } + + public VanishingTriggeredAbility(final VanishingTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.COUNTER_REMOVED && event.getData().equals("Time") && event.getTargetId().equals(this.getSourceId())) { + Permanent p = game.getPermanent(this.getSourceId()); + if (p != null) { + return p.getCounters().getCount(CounterType.TIME) == 0; + } + } + return false; + } + + @Override + public VanishingTriggeredAbility copy() { + return new VanishingTriggeredAbility(this); + } + + @Override + public String getRule() { + return ""; + } +}