From 4f1763a6014b1d2d006e3fe3db9ac32e1fb57f10 Mon Sep 17 00:00:00 2001 From: BetaSteward Date: Sat, 30 Oct 2010 02:23:40 +0000 Subject: [PATCH] new cards --- .../src/mage/sets/magic2010/IceCage.java | 2 +- .../mage/sets/magic2010/PlatinumAngel.java | 53 +++++++ .../mage/sets/magic2011/AngelicArbiter.java | 4 +- .../src/mage/sets/magic2011/Pacifism.java | 2 +- .../mage/sets/magic2011/PlatinumAngel.java | 53 +++++++ .../src/mage/sets/magic2011/Plummet.java | 79 +++++++++ .../src/mage/sets/magic2011/Preordain.java | 65 ++++++++ .../src/mage/sets/magic2011/PrimalCocoon.java | 150 ++++++++++++++++++ .../mage/sets/magic2011/PrimevalTitan.java | 126 +++++++++++++++ .../src/mage/sets/tenth/PlatinumAngel.java | 120 ++++++++++++++ .../AddPlusOneCountersAttachedEffect.java | 81 ++++++++++ 11 files changed, 731 insertions(+), 4 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/magic2010/PlatinumAngel.java create mode 100644 Mage.Sets/src/mage/sets/magic2011/PlatinumAngel.java create mode 100644 Mage.Sets/src/mage/sets/magic2011/Plummet.java create mode 100644 Mage.Sets/src/mage/sets/magic2011/Preordain.java create mode 100644 Mage.Sets/src/mage/sets/magic2011/PrimalCocoon.java create mode 100644 Mage.Sets/src/mage/sets/magic2011/PrimevalTitan.java create mode 100644 Mage.Sets/src/mage/sets/tenth/PlatinumAngel.java create mode 100644 Mage/src/mage/abilities/effects/common/AddPlusOneCountersAttachedEffect.java diff --git a/Mage.Sets/src/mage/sets/magic2010/IceCage.java b/Mage.Sets/src/mage/sets/magic2010/IceCage.java index 37fd5a5b81..37ed7ffb63 100644 --- a/Mage.Sets/src/mage/sets/magic2010/IceCage.java +++ b/Mage.Sets/src/mage/sets/magic2010/IceCage.java @@ -159,7 +159,7 @@ class IceCageAbility extends TriggeredAbilityImpl { @Override public String getRule() { - return "When enchanted creature becomes the target of a spell or ability, destroy Ice Cage"; + return "When enchanted creature becomes the target of a spell or ability, destroy Ice Cage."; } } diff --git a/Mage.Sets/src/mage/sets/magic2010/PlatinumAngel.java b/Mage.Sets/src/mage/sets/magic2010/PlatinumAngel.java new file mode 100644 index 0000000000..96f55368eb --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2010/PlatinumAngel.java @@ -0,0 +1,53 @@ +/* + * 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.magic2010; + +import java.util.UUID; + +/** + * + * @author BetaSteward_at_googlemail.com + */ +public class PlatinumAngel extends mage.sets.tenth.PlatinumAngel { + + public PlatinumAngel(UUID ownerId) { + super(ownerId); + this.expansionSetCode = "M10"; + } + + public PlatinumAngel(final PlatinumAngel card) { + super(card); + } + + @Override + public PlatinumAngel copy() { + return new PlatinumAngel(this); + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/AngelicArbiter.java b/Mage.Sets/src/mage/sets/magic2011/AngelicArbiter.java index afbc6a7eda..12fffb45e0 100644 --- a/Mage.Sets/src/mage/sets/magic2011/AngelicArbiter.java +++ b/Mage.Sets/src/mage/sets/magic2011/AngelicArbiter.java @@ -166,7 +166,7 @@ class AngelicArbiterEffect1 extends ReplacementEffectImpl @Override public String getText(Ability source) { - return "Each opponent who cast a spell this turn can't attack with creatures."; + return "Each opponent who cast a spell this turn can't attack with creatures"; } } @@ -208,7 +208,7 @@ class AngelicArbiterEffect2 extends ReplacementEffectImpl @Override public String getText(Ability source) { - return "Each opponent who attacked with a creature this turn can't cast spells."; + return "Each opponent who attacked with a creature this turn can't cast spells"; } } diff --git a/Mage.Sets/src/mage/sets/magic2011/Pacifism.java b/Mage.Sets/src/mage/sets/magic2011/Pacifism.java index c92c015f5e..6144a15f39 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Pacifism.java +++ b/Mage.Sets/src/mage/sets/magic2011/Pacifism.java @@ -34,7 +34,7 @@ import java.util.UUID; * * @author BetaSteward_at_googlemail.com */ -public class Pacifism extends mage.sets.magic2010.Pacifism { +public class Pacifism extends mage.sets.tenth.Pacifism { public Pacifism(UUID ownerId) { super(ownerId); diff --git a/Mage.Sets/src/mage/sets/magic2011/PlatinumAngel.java b/Mage.Sets/src/mage/sets/magic2011/PlatinumAngel.java new file mode 100644 index 0000000000..e6dcddbe3e --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2011/PlatinumAngel.java @@ -0,0 +1,53 @@ +/* + * 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.magic2011; + +import java.util.UUID; + +/** + * + * @author BetaSteward_at_googlemail.com + */ +public class PlatinumAngel extends mage.sets.tenth.PlatinumAngel { + + public PlatinumAngel(UUID ownerId) { + super(ownerId); + this.expansionSetCode = "M11"; + } + + public PlatinumAngel(final PlatinumAngel card) { + super(card); + } + + @Override + public PlatinumAngel copy() { + return new PlatinumAngel(this); + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/Plummet.java b/Mage.Sets/src/mage/sets/magic2011/Plummet.java new file mode 100644 index 0000000000..9e338ed9f7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2011/Plummet.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.magic2011; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.cards.CardImpl; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author BetaSteward_at_googlemail.com + */ +public class Plummet extends CardImpl { + + private static FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with flying"); + + static { + filter.getAbilities().add(FlyingAbility.getInstance()); + } + + public Plummet(UUID ownerId) { + super(ownerId, "Plummet", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); + this.expansionSetCode = "M11"; + this.color.setGreen(true); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + } + + public Plummet(final Plummet card) { + super(card); + } + + @Override + public Plummet copy() { + return new Plummet(this); + } + + @Override + public String getArt() { + return ""; + } +} diff --git a/Mage.Sets/src/mage/sets/magic2011/Preordain.java b/Mage.Sets/src/mage/sets/magic2011/Preordain.java new file mode 100644 index 0000000000..ad7fcdc6b7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2011/Preordain.java @@ -0,0 +1,65 @@ +/* + * 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.magic2011; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.effects.common.DrawCardControllerEffect; +import mage.abilities.effects.common.ScryEffect; +import mage.cards.CardImpl; + +/** + * + * @author BetaSteward_at_googlemail.com + */ +public class Preordain extends CardImpl { + + public Preordain(UUID ownerId) { + super(ownerId, "Preordain", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{U}"); + this.expansionSetCode = "M11"; + this.color.setBlue(true); + this.getSpellAbility().addEffect(new ScryEffect(2)); + this.getSpellAbility().addEffect(new DrawCardControllerEffect(1)); + } + + public Preordain(final Preordain card) { + super(card); + } + + @Override + public Preordain copy() { + return new Preordain(this); + } + + @Override + public String getArt() { + return ""; + } +} diff --git a/Mage.Sets/src/mage/sets/magic2011/PrimalCocoon.java b/Mage.Sets/src/mage/sets/magic2011/PrimalCocoon.java new file mode 100644 index 0000000000..70a27d852a --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2011/PrimalCocoon.java @@ -0,0 +1,150 @@ +/* + * 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.magic2011; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.AddPlusOneCountersAttachedEffect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DestroySourceEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author BetaSteward_at_googlemail.com + */ +public class PrimalCocoon extends CardImpl { + + public PrimalCocoon(UUID ownerId) { + super(ownerId, "Primal Cocoon", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{G}"); + this.expansionSetCode = "M11"; + this.color.setGreen(true); + this.subtype.add("Aura"); + + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit)); + Ability ability = new EnchantAbility(Outcome.Benefit, auraTarget); + this.addAbility(ability); + this.addAbility(new PrimalCocoonAbility1()); + this.addAbility(new PrimalCocoonAbility2()); + + } + + public PrimalCocoon(final PrimalCocoon card) { + super(card); + } + + @Override + public PrimalCocoon copy() { + return new PrimalCocoon(this); + } + + @Override + public String getArt() { + return ""; + } +} + +class PrimalCocoonAbility1 extends TriggeredAbilityImpl { + + public PrimalCocoonAbility1() { + super(Zone.BATTLEFIELD, new AddPlusOneCountersAttachedEffect(1)); + } + + public PrimalCocoonAbility1(final PrimalCocoonAbility1 ability) { + super(ability); + } + + @Override + public PrimalCocoonAbility1 copy() { + return new PrimalCocoonAbility1(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { + trigger(game, this.controllerId); + return true; + } + return false; + } + + @Override + public String getRule() { + return "At the beginning of your upkeep, put a +1/+1 counter on enchanted creature."; + } +} + +class PrimalCocoonAbility2 extends TriggeredAbilityImpl { + + public PrimalCocoonAbility2() { + super(Zone.BATTLEFIELD, new DestroySourceEffect()); + } + + public PrimalCocoonAbility2(final PrimalCocoonAbility2 ability) { + super(ability); + } + + @Override + public PrimalCocoonAbility2 copy() { + return new PrimalCocoonAbility2(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent enchantment = game.getPermanent(sourceId); + if (enchantment != null && enchantment.getAttachedTo() != null) { + if (event.getSourceId().equals(enchantment.getAttachedTo()) && + (event.getType() == EventType.ATTACKER_DECLARED || event.getType() == EventType.BLOCKER_DECLARED)) { + trigger(game, event.getPlayerId()); + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "When enchanted creature attacks or blocks, sacrifice Primal Cocoon."; + } + +} diff --git a/Mage.Sets/src/mage/sets/magic2011/PrimevalTitan.java b/Mage.Sets/src/mage/sets/magic2011/PrimevalTitan.java new file mode 100644 index 0000000000..ee48db0224 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2011/PrimevalTitan.java @@ -0,0 +1,126 @@ +/* + * 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.magic2011; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.BoostSourceEffect; +import mage.abilities.effects.common.DamageMultiEffect; +import mage.abilities.effects.common.SearchLibraryPutInPlayEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterBasicLandCard; +import mage.filter.common.FilterLandCard; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.events.ZoneChangeEvent; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author BetaSteward_at_googlemail.com + */ +public class PrimevalTitan extends CardImpl { + + public PrimevalTitan(UUID ownerId) { + super(ownerId, "Primeval Titan", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); + this.expansionSetCode = "M11"; + this.subtype.add("Giant"); + this.color.setGreen(true); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + this.addAbility(TrampleAbility.getInstance()); + this.addAbility(new PrimevalTitanAbility()); + } + + public PrimevalTitan(final PrimevalTitan card) { + super(card); + } + + @Override + public PrimevalTitan copy() { + return new PrimevalTitan(this); + } + + @Override + public String getArt() { + return ""; + } + +} + +class PrimevalTitanAbility extends TriggeredAbilityImpl { + + public PrimevalTitanAbility() { + super(Zone.BATTLEFIELD, null, false); + TargetCardInLibrary target = new TargetCardInLibrary(2, new FilterLandCard()); + this.addEffect(new SearchLibraryPutInPlayEffect(target, true, Outcome.PutLandInPlay)); + } + + public PrimevalTitanAbility(final PrimevalTitanAbility ability) { + super(ability); + } + + @Override + public PrimevalTitanAbility copy() { + return new PrimevalTitanAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { + trigger(game, event.getPlayerId()); + return true; + } + if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId()) ) { + ZoneChangeEvent zEvent = (ZoneChangeEvent)event; + if (zEvent.getToZone() == Zone.BATTLEFIELD) { + trigger(game, event.getPlayerId()); + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever Primeval Titan enters the battlefield or attacks, you may search your library for up to two land cards, put them onto the battlefield tapped, then shuffle your library."; + } + +} diff --git a/Mage.Sets/src/mage/sets/tenth/PlatinumAngel.java b/Mage.Sets/src/mage/sets/tenth/PlatinumAngel.java new file mode 100644 index 0000000000..de79ae51b7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tenth/PlatinumAngel.java @@ -0,0 +1,120 @@ +/* + * 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.Duration; +import mage.Constants.Outcome; +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.ReplacementEffectImpl; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; + +/** + * + * @author BetaSteward_at_googlemail.com + */ +public class PlatinumAngel extends CardImpl { + + public PlatinumAngel(UUID ownerId) { + super(ownerId, "Platinum Angel", Rarity.MYTHIC, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{7}"); + this.expansionSetCode = "10E"; + this.subtype.add("Angel"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlatinumAngelEffect())); + } + + public PlatinumAngel(final PlatinumAngel card) { + super(card); + } + + @Override + public PlatinumAngel copy() { + return new PlatinumAngel(this); + } + + @Override + public String getArt() { + return ""; + } + + class PlatinumAngelEffect extends ReplacementEffectImpl { + + public PlatinumAngelEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + } + + public PlatinumAngelEffect(final PlatinumAngelEffect effect) { + super(effect); + } + + @Override + public PlatinumAngelEffect copy() { + return new PlatinumAngelEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if ((event.getType() == EventType.WINS && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) || + (event.getType() == EventType.LOSES && event.getPlayerId().equals(source.getControllerId()))) { + return true; + } + return false; + } + + @Override + public String getText(Ability source) { + return "You can't lose the game and your opponents can't win the game"; + } + + } + +} diff --git a/Mage/src/mage/abilities/effects/common/AddPlusOneCountersAttachedEffect.java b/Mage/src/mage/abilities/effects/common/AddPlusOneCountersAttachedEffect.java new file mode 100644 index 0000000000..be09dca7a1 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/AddPlusOneCountersAttachedEffect.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.abilities.effects.common; + +import mage.Constants.Outcome; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.counters.PlusOneCounter; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author BetaSteward_at_googlemail.com + */ +public class AddPlusOneCountersAttachedEffect extends OneShotEffect { + + private int amount; + + public AddPlusOneCountersAttachedEffect(int amount) { + super(Outcome.BoostCreature); + this.amount = amount; + } + + public AddPlusOneCountersAttachedEffect(final AddPlusOneCountersAttachedEffect effect) { + super(effect); + this.amount = effect.amount; + } + + @Override + public AddPlusOneCountersAttachedEffect copy() { + return new AddPlusOneCountersAttachedEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment != null && enchantment.getAttachedTo() != null) { + Permanent creature = game.getPermanent(enchantment.getAttachedTo()); + if (creature != null) { + creature.getCounters().addCounter(new PlusOneCounter(amount)); + } + } + return true; + } + + @Override + public String getText(Ability source) { + if (amount > 1) + return "put " + Integer.toString(amount) + " +1/+1 counters on enchanted creature"; + else + return "put a +1/+1 counter on enchanted creature"; + } + +}