From 2fb0b267bf423ce32f70b934bc479b2c170f204a Mon Sep 17 00:00:00 2001 From: Loki Date: Mon, 17 Jan 2011 23:09:38 +0200 Subject: [PATCH] SOM --- .../sets/scarsofmirrodin/Glimmerpost.java | 110 ++++++++++++++++++ .../mage/sets/scarsofmirrodin/IchorRats.java | 105 +++++++++++++++++ .../sets/scarsofmirrodin/RustedRelic.java | 84 +++++++++++++ .../sets/scarsofmirrodin/TumbleMagnet.java | 80 +++++++++++++ 4 files changed, 379 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/scarsofmirrodin/Glimmerpost.java create mode 100644 Mage.Sets/src/mage/sets/scarsofmirrodin/IchorRats.java create mode 100644 Mage.Sets/src/mage/sets/scarsofmirrodin/RustedRelic.java create mode 100644 Mage.Sets/src/mage/sets/scarsofmirrodin/TumbleMagnet.java diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Glimmerpost.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Glimmerpost.java new file mode 100644 index 00000000000..1bf6a56a676 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Glimmerpost.java @@ -0,0 +1,110 @@ +/* + * 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.scarsofmirrodin; + +import java.util.UUID; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.mana.ColorlessManaAbility; +import mage.cards.CardImpl; +import mage.filter.Filter; +import mage.filter.FilterCard; +import mage.filter.FilterPermanent; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author Loki + */ +public class Glimmerpost extends CardImpl { + + public Glimmerpost (UUID ownerId) { + super(ownerId, 227, "Glimmerpost", Rarity.COMMON, new CardType[]{CardType.LAND}, null); + this.expansionSetCode = "SOM"; + this.subtype.add("Locus"); + this.addAbility(new ColorlessManaAbility()); + this.addAbility(new EntersBattlefieldTriggeredAbility(new GlimmerpostEffect())); + } + + public Glimmerpost (final Glimmerpost card) { + super(card); + } + + @Override + public Glimmerpost copy() { + return new Glimmerpost(this); + } + +} + +class GlimmerpostEffect extends OneShotEffect { + private static FilterPermanent filter = new FilterPermanent(); + + static { + filter.getSubtype().add("Locus"); + filter.setScopeSubtype(Filter.ComparisonScope.Any); + } + + public GlimmerpostEffect() { + super(Constants.Outcome.GainLife); + } + + public GlimmerpostEffect(final GlimmerpostEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + int amount = game.getBattlefield().count(filter, source.getControllerId(), game); + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + player.gainLife(amount, game); + return true; + } + return false; + } + + @Override + public GlimmerpostEffect copy() { + return new GlimmerpostEffect(this); + } + + @Override + public String getText(Ability source) { + return "you gain 1 life for each Locus on the battlefield"; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/IchorRats.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/IchorRats.java new file mode 100644 index 00000000000..87aed1ea749 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/IchorRats.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.scarsofmirrodin; + +import java.util.UUID; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.InfectAbility; +import mage.cards.CardImpl; +import mage.counters.CounterType; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author Loki + */ +public class IchorRats extends CardImpl { + + public IchorRats (UUID ownerId) { + super(ownerId, 67, "Ichor Rats", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "SOM"; + this.subtype.add("Rat"); + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + this.addAbility(InfectAbility.getInstance()); + this.addAbility(new EntersBattlefieldTriggeredAbility(new IchorRatsEffect(), false)); + } + + public IchorRats (final IchorRats card) { + super(card); + } + + @Override + public IchorRats copy() { + return new IchorRats(this); + } + +} + +class IchorRatsEffect extends OneShotEffect { + public IchorRatsEffect() { + super(Constants.Outcome.Damage); + } + + public IchorRatsEffect(final IchorRatsEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + for (UUID playerId : game.getPlayerList()) { + Player player = game.getPlayer(playerId); + if (player != null) { + player.getCounters().addCounter(CounterType.POISON.createInstance()); + } + } + return true; + } + + @Override + public IchorRatsEffect copy() { + return new IchorRatsEffect(this); + } + + @Override + public String getText(Ability source) { + return "each player gets a poison counter"; + } +} diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/RustedRelic.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/RustedRelic.java new file mode 100644 index 00000000000..33f5daabe6e --- /dev/null +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/RustedRelic.java @@ -0,0 +1,84 @@ +/* + * 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.scarsofmirrodin; + +import java.util.UUID; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.Metalcraft; +import mage.abilities.condition.common.MyTurn; +import mage.abilities.decorator.ConditionalContinousEffect; +import mage.abilities.effects.common.BecomesCreatureSourceEOTEffect; +import mage.abilities.effects.common.BoostControlledEffect; +import mage.cards.CardImpl; +import mage.game.permanent.token.Token; + +/** + * + * @author Loki + */ +public class RustedRelic extends CardImpl { + + public RustedRelic (UUID ownerId) { + super(ownerId, 199, "Rusted Relic", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "SOM"; + this.addAbility( + new SimpleStaticAbility(Zone.BATTLEFIELD, + new ConditionalContinousEffect( + new BecomesCreatureSourceEOTEffect(new RustedRelicToken(), "artifact"), + Metalcraft.getInstance(), + "Metalcraft - Rusted Relic is a 5/5 Golem artifact creature as long as you control three or more artifacts"))); + } + + public RustedRelic (final RustedRelic card) { + super(card); + } + + @Override + public RustedRelic copy() { + return new RustedRelic(this); + } +} + +class RustedRelicToken extends Token { + + public RustedRelicToken() { + super("Rusted Relic", "a 5/5 Golem artifact creature"); + cardType.add(Constants.CardType.CREATURE); + subtype.add("Golem"); + power = new MageInt(5); + toughness = new MageInt(5); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/TumbleMagnet.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/TumbleMagnet.java new file mode 100644 index 00000000000..104d31ffc87 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/TumbleMagnet.java @@ -0,0 +1,80 @@ +/* + * 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.scarsofmirrodin; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.AddCountersSourceEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.cards.CardImpl; +import mage.counters.CounterType; +import mage.filter.Filter; +import mage.filter.FilterPermanent; +import mage.target.TargetPermanent; + +/** + * + * @author Loki + */ +public class TumbleMagnet extends CardImpl { + private static FilterPermanent filter = new FilterPermanent("artifact or creature"); + + static { + filter.getCardType().add(CardType.ARTIFACT); + filter.getCardType().add(CardType.CREATURE); + filter.setScopeCardType(Filter.ComparisonScope.Any); + } + + public TumbleMagnet (UUID ownerId) { + super(ownerId, 218, "Tumble Magnet", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "SOM"; + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(3)), "Tumble Magnet enters the battlefield with three charge counters on it")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new TapSourceCost()); + ability.addCost(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance())); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + } + + public TumbleMagnet (final TumbleMagnet card) { + super(card); + } + + @Override + public TumbleMagnet copy() { + return new TumbleMagnet(this); + } + +}