diff --git a/Mage.Sets/src/mage/sets/exodus/ExaltedDragon.java b/Mage.Sets/src/mage/sets/exodus/ExaltedDragon.java new file mode 100644 index 00000000000..e0931a73e79 --- /dev/null +++ b/Mage.Sets/src/mage/sets/exodus/ExaltedDragon.java @@ -0,0 +1,133 @@ +/* + * 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.exodus; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.ReturnToHandTargetCost; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.players.Player; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author fireshoes + */ +public class ExaltedDragon extends CardImpl { + + public ExaltedDragon(UUID ownerId) { + super(ownerId, 6, "Exalted Dragon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{W}{W}"); + this.expansionSetCode = "EXO"; + this.subtype.add("Dragon"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Exalted Dragon can't attack unless you sacrifice a land. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ExaltedDragonReplacementEffect())); + } + + public ExaltedDragon(final ExaltedDragon card) { + super(card); + } + + @Override + public ExaltedDragon copy() { + return new ExaltedDragon(this); + } +} + +class ExaltedDragonReplacementEffect extends ReplacementEffectImpl { + + private static final FilterControlledPermanent filter = new FilterControlledLandPermanent(); + + ExaltedDragonReplacementEffect ( ) { + super(Duration.WhileOnBattlefield, Outcome.Neutral); + staticText = "{this} can't attack unless you sacrifice a land (This cost is paid as attackers are declared.)"; + } + + ExaltedDragonReplacementEffect ( ExaltedDragonReplacementEffect effect ) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + throw new UnsupportedOperationException("Not supported."); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Player player = game.getPlayer(event.getPlayerId()); + if ( player != null ) { + SacrificeTargetCost attackCost = new SacrificeTargetCost(new TargetControlledPermanent(filter)); + if ( attackCost.canPay(source, source.getSourceId(), event.getPlayerId(), game) && + player.chooseUse(Outcome.Neutral, "Sacrifice a land?", game) ) + { + if (attackCost.pay(source, game, source.getSourceId(), event.getPlayerId(), true) ) { + return false; + } + } + return true; + } + return false; + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DECLARE_ATTACKER; + } + + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return event.getSourceId().equals(source.getSourceId()); + } + + @Override + public ExaltedDragonReplacementEffect copy() { + return new ExaltedDragonReplacementEffect(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/NullProfusion.java b/Mage.Sets/src/mage/sets/planarchaos/NullProfusion.java new file mode 100644 index 00000000000..5078e41db63 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/NullProfusion.java @@ -0,0 +1,105 @@ +/* + * 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.tempest; + +import java.util.UUID; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.SkipDrawStepEffect; +import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect; +import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect.HandSizeModification; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; + +/** + * + * @author emerald000 + */ +public class NullProfusion extends CardImpl { + + public NullProfusion(UUID ownerId) { + super(ownerId, 89, "Null Profusion", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{4}{B}{B}"); + this.expansionSetCode = "PLC"; + + // Skip your draw step. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipDrawStepEffect())); + + // Whenever you play a card, draw a card. + this.addAbility(new NullProfusionTriggeredAbility()); + + // Your maximum hand size is two. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MaximumHandSizeControllerEffect(2, Duration.WhileOnBattlefield, HandSizeModification.SET))); + } + + public NullProfusion(final NullProfusion card) { + super(card); + } + + @Override + public NullProfusion copy() { + return new NullProfusion(this); + } +} + +class NullProfusionTriggeredAbility extends TriggeredAbilityImpl { + + NullProfusionTriggeredAbility() { + super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), false); + } + + NullProfusionTriggeredAbility(final NullProfusionTriggeredAbility ability) { + super(ability); + } + + @Override + public NullProfusionTriggeredAbility copy() { + return new NullProfusionTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST || event.getType() == EventType.LAND_PLAYED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return event.getPlayerId().equals(this.getControllerId()); + } + + @Override + public String getRule() { + return "Whenever you play a card, draw a card."; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/tempestremastered/ExaltedDragon.java b/Mage.Sets/src/mage/sets/tempestremastered/ExaltedDragon.java new file mode 100644 index 00000000000..cb56fb0cc86 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempestremastered/ExaltedDragon.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.tempestremastered; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ExaltedDragon extends mage.sets.exodus.ExaltedDragon { + + public ExaltedDragon(UUID ownerId) { + super(ownerId); + this.cardNumber = 12; + this.expansionSetCode = "TPR"; + } + + public ExaltedDragon(final ExaltedDragon card) { + super(card); + } + + @Override + public ExaltedDragon copy() { + return new ExaltedDragon(this); + } +}