From 48874a770a66434f4606ddb5d43fd018ebc5ebee Mon Sep 17 00:00:00 2001 From: Plopman Date: Sun, 16 Sep 2012 19:44:59 +0200 Subject: [PATCH] [ULG] 12 cards --- .../mage/sets/eighthedition/DefenseGrid.java | 52 +++++ .../mage/sets/ninthedition/DefenseGrid.java | 100 +++++++++ .../sets/seventhedition/EngineeredPlague.java | 52 +++++ .../mage/sets/seventhedition/GangOfElk.java | 52 +++++ .../mage/sets/urzaslegacy/DefenseGrid.java | 52 +++++ .../sets/urzaslegacy/EngineeredPlague.java | 120 ++++++++++ .../src/mage/sets/urzaslegacy/GangOfElk.java | 67 ++++++ .../src/mage/sets/urzaslegacy/Intervene.java | 162 ++++++++++++++ .../src/mage/sets/urzaslegacy/MemoryJar.java | 209 ++++++++++++++++++ .../mage/sets/urzaslegacy/MoltenHydra.java | 176 +++++++++++++++ .../sets/urzaslegacy/MultaniMaroSorcerer.java | 104 +++++++++ .../src/mage/sets/urzaslegacy/Repopulate.java | 106 +++++++++ .../src/mage/sets/urzaslegacy/Rivalry.java | 122 ++++++++++ .../mage/sets/urzaslegacy/TreefolkMystic.java | 113 ++++++++++ .../sets/urzaslegacy/ViashinoHeretic.java | 118 ++++++++++ 15 files changed, 1605 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/eighthedition/DefenseGrid.java create mode 100644 Mage.Sets/src/mage/sets/ninthedition/DefenseGrid.java create mode 100644 Mage.Sets/src/mage/sets/seventhedition/EngineeredPlague.java create mode 100644 Mage.Sets/src/mage/sets/seventhedition/GangOfElk.java create mode 100644 Mage.Sets/src/mage/sets/urzaslegacy/DefenseGrid.java create mode 100644 Mage.Sets/src/mage/sets/urzaslegacy/EngineeredPlague.java create mode 100644 Mage.Sets/src/mage/sets/urzaslegacy/GangOfElk.java create mode 100644 Mage.Sets/src/mage/sets/urzaslegacy/Intervene.java create mode 100644 Mage.Sets/src/mage/sets/urzaslegacy/MemoryJar.java create mode 100644 Mage.Sets/src/mage/sets/urzaslegacy/MoltenHydra.java create mode 100644 Mage.Sets/src/mage/sets/urzaslegacy/MultaniMaroSorcerer.java create mode 100644 Mage.Sets/src/mage/sets/urzaslegacy/Repopulate.java create mode 100644 Mage.Sets/src/mage/sets/urzaslegacy/Rivalry.java create mode 100644 Mage.Sets/src/mage/sets/urzaslegacy/TreefolkMystic.java create mode 100644 Mage.Sets/src/mage/sets/urzaslegacy/ViashinoHeretic.java diff --git a/Mage.Sets/src/mage/sets/eighthedition/DefenseGrid.java b/Mage.Sets/src/mage/sets/eighthedition/DefenseGrid.java new file mode 100644 index 0000000000..d123b554f8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/eighthedition/DefenseGrid.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.eighthedition; + +import java.util.UUID; + +/** + * + * @author Plopman + */ +public class DefenseGrid extends mage.sets.ninthedition.DefenseGrid { + + public DefenseGrid(UUID ownerId) { + super(ownerId); + this.cardNumber = 296; + this.expansionSetCode = "8ED"; + } + + public DefenseGrid(final DefenseGrid card) { + super(card); + } + + @Override + public DefenseGrid copy() { + return new DefenseGrid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/DefenseGrid.java b/Mage.Sets/src/mage/sets/ninthedition/DefenseGrid.java new file mode 100644 index 0000000000..1be0b1eb53 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/DefenseGrid.java @@ -0,0 +1,100 @@ +/* + * 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.ninthedition; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.CostModificationEffectImpl; +import mage.cards.CardImpl; +import mage.game.Game; + +/** + * + * @author Plopman + */ +public class DefenseGrid extends CardImpl { + + public DefenseGrid(UUID ownerId) { + super(ownerId, 293, "Defense Grid", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "9ED"; + + // Each spell costs {3} more to cast except during its controller's turn. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new DefenseGridCostModificationEffect())); + + } + + public DefenseGrid(final DefenseGrid card) { + super(card); + } + + @Override + public DefenseGrid copy() { + return new DefenseGrid(this); + } +} + +class DefenseGridCostModificationEffect extends CostModificationEffectImpl { + + DefenseGridCostModificationEffect ( ) { + super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); + staticText = "Each spell costs {3} more to cast except during its controller's turn"; + } + + DefenseGridCostModificationEffect(DefenseGridCostModificationEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source, Ability abilityToModify) { + SpellAbility spellAbility = (SpellAbility) abilityToModify; + spellAbility.getManaCostsToPay().add(new GenericManaCost(3)); + return true; + } + + @Override + public boolean applies(Ability abilityToModify, Ability source, Game game) { + if (abilityToModify instanceof SpellAbility) { + if(!abilityToModify.getControllerId().equals(game.getActivePlayerId())) { + return true; + } + } + return false; + } + + @Override + public DefenseGridCostModificationEffect copy() { + return new DefenseGridCostModificationEffect(this); + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/seventhedition/EngineeredPlague.java b/Mage.Sets/src/mage/sets/seventhedition/EngineeredPlague.java new file mode 100644 index 0000000000..8e9e11df3a --- /dev/null +++ b/Mage.Sets/src/mage/sets/seventhedition/EngineeredPlague.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.seventhedition; + +import java.util.UUID; + +/** + * + * @author Plopman + */ +public class EngineeredPlague extends mage.sets.urzaslegacy.EngineeredPlague { + + public EngineeredPlague(UUID ownerId) { + super(ownerId); + this.cardNumber = 133; + this.expansionSetCode = "7ED"; + } + + public EngineeredPlague(final EngineeredPlague card) { + super(card); + } + + @Override + public EngineeredPlague copy() { + return new EngineeredPlague(this); + } +} diff --git a/Mage.Sets/src/mage/sets/seventhedition/GangOfElk.java b/Mage.Sets/src/mage/sets/seventhedition/GangOfElk.java new file mode 100644 index 0000000000..d963206e0c --- /dev/null +++ b/Mage.Sets/src/mage/sets/seventhedition/GangOfElk.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.seventhedition; + +import java.util.UUID; + +/** + * + * @author Plopman + */ +public class GangOfElk extends mage.sets.urzaslegacy.GangOfElk { + + public GangOfElk(UUID ownerId) { + super(ownerId); + this.cardNumber = 247; + this.expansionSetCode = "7ED"; + } + + public GangOfElk(final GangOfElk card) { + super(card); + } + + @Override + public GangOfElk copy() { + return new GangOfElk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/DefenseGrid.java b/Mage.Sets/src/mage/sets/urzaslegacy/DefenseGrid.java new file mode 100644 index 0000000000..169f585cb2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzaslegacy/DefenseGrid.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.urzaslegacy; + +import java.util.UUID; + +/** + * + * @author Plopman + */ +public class DefenseGrid extends mage.sets.ninthedition.DefenseGrid { + + public DefenseGrid(UUID ownerId) { + super(ownerId); + this.cardNumber = 125; + this.expansionSetCode = "ULG"; + } + + public DefenseGrid(final DefenseGrid card) { + super(card); + } + + @Override + public DefenseGrid copy() { + return new DefenseGrid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/EngineeredPlague.java b/Mage.Sets/src/mage/sets/urzaslegacy/EngineeredPlague.java new file mode 100644 index 0000000000..ed3a276014 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzaslegacy/EngineeredPlague.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.urzaslegacy; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.StaticAbility; +import mage.abilities.common.AsEntersBattlefieldAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continious.BoostAllEffect; +import mage.cards.CardImpl; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.sets.Sets; + +/** + * + * @author Plopman + */ +public class EngineeredPlague extends CardImpl { + + public EngineeredPlague(UUID ownerId) { + super(ownerId, 51, "Engineered Plague", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); + this.expansionSetCode = "ULG"; + + this.color.setBlack(true); + + FilterCreaturePermanent filter = new FilterCreaturePermanent("All creatures of the chosen type"); + // As Engineered Plague enters the battlefield, choose a creature type. + this.addAbility(new AsEntersBattlefieldAbility(new EngineeredPlagueEntersBattlefieldEffect(filter), "choose a creature type")); + // All creatures of the chosen type get -1/-1. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostAllEffect(-1, -1, Constants.Duration.WhileOnBattlefield, filter, false))); + } + + public EngineeredPlague(final EngineeredPlague card) { + super(card); + } + + @Override + public EngineeredPlague copy() { + return new EngineeredPlague(this); + } + + class EngineeredPlagueEntersBattlefieldEffect extends OneShotEffect { + + private FilterCreaturePermanent filter; + public EngineeredPlagueEntersBattlefieldEffect(FilterCreaturePermanent filter) { + super(Constants.Outcome.Benefit); + this.filter = filter; + staticText = "As {this} enters the battlefield, choose a creature type"; + } + + public EngineeredPlagueEntersBattlefieldEffect(final EngineeredPlagueEntersBattlefieldEffect effect) { + super(effect); + this.filter = effect.filter; + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Permanent permanent = game.getPermanent(source.getSourceId()); + if (player != null && permanent != null) { + Choice typeChoice = new ChoiceImpl(true); + typeChoice.setMessage("Choose creature type"); + typeChoice.setChoices(Sets.getCreatureTypes()); + while (!player.choose(Constants.Outcome.Detriment, typeChoice, game)) { + game.debugMessage("player canceled choosing type. retrying."); + } + game.informPlayers(permanent.getName() + ": " + player.getName() + " has chosen " + typeChoice.getChoice()); + filter.add(new SubtypePredicate(typeChoice.getChoice())); + permanent.addInfo("chosen type", "Chosen type: " + typeChoice.getChoice() + ""); + } + return false; + } + + @Override + public EngineeredPlagueEntersBattlefieldEffect copy() { + return new EngineeredPlagueEntersBattlefieldEffect(this); + } + + } + + + +} + diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/GangOfElk.java b/Mage.Sets/src/mage/sets/urzaslegacy/GangOfElk.java new file mode 100644 index 0000000000..728e55d308 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzaslegacy/GangOfElk.java @@ -0,0 +1,67 @@ +/* + * 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.urzaslegacy; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.common.BecomesBlockedByCreatureTriggeredAbility; +import mage.abilities.effects.common.continious.BoostSourceEffect; +import mage.cards.CardImpl; + +/** + * + * @author Plopman + */ +public class GangOfElk extends CardImpl { + + public GangOfElk(UUID ownerId) { + super(ownerId, 102, "Gang of Elk", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{5}{G}"); + this.expansionSetCode = "ULG"; + this.subtype.add("Elk"); + this.subtype.add("Beast"); + + this.color.setGreen(true); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + // Whenever Gang of Elk becomes blocked, it gets +2/+2 until end of turn for each creature blocking it. + this.addAbility(new BecomesBlockedByCreatureTriggeredAbility(new BoostSourceEffect(2, 2, Constants.Duration.EndOfTurn), false)); + } + + public GangOfElk(final GangOfElk card) { + super(card); + } + + @Override + public GangOfElk copy() { + return new GangOfElk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/Intervene.java b/Mage.Sets/src/mage/sets/urzaslegacy/Intervene.java new file mode 100644 index 0000000000..dae43ebf93 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzaslegacy/Intervene.java @@ -0,0 +1,162 @@ +/* + * 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.urzaslegacy; + +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.cards.CardImpl; +import mage.filter.Filter; +import mage.filter.FilterSpell; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.game.stack.StackObject; +import mage.target.Target; +import mage.target.TargetObject; + +/** + * + * @author Plopman + */ +public class Intervene extends CardImpl { + + public Intervene(UUID ownerId) { + super(ownerId, 33, "Intervene", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "ULG"; + + this.color.setBlue(true); + + // Counter target spell that targets a creature. + this.getSpellAbility().addTarget(new InterveneTargetSpell()); + this.getSpellAbility().addEffect(new CounterTargetEffect()); + } + + public Intervene(final Intervene card) { + super(card); + } + + @Override + public Intervene copy() { + return new Intervene(this); + } + + private class InterveneTargetSpell extends TargetObject { + + + public InterveneTargetSpell() { + super(1, Constants.Zone.STACK); + this.targetName = "spell that targets a creature"; + } + + public InterveneTargetSpell(final InterveneTargetSpell target) { + super(target); + } + + @Override + public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { + return canChoose(sourceControllerId, game); + } + + @Override + public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { + return possibleTargets(sourceControllerId, game); + } + + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + if (super.canTarget(id, source, game)) { + if (targetsCreature(id, game)) { + return true; + } + } + return false; + } + + @Override + public boolean canChoose(UUID sourceControllerId, Game game) { + for (StackObject stackObject : game.getStack()) { + if (stackObject instanceof Spell) { + if (targetsCreature(stackObject.getId(), game)) { + return true; + } + } + } + return false; + } + + @Override + public Set possibleTargets(UUID sourceControllerId, Game game) { + Set possibleTargets = new HashSet(); + for (StackObject stackObject : game.getStack()) { + if (stackObject instanceof Spell) { + if (targetsCreature(stackObject.getId(), game)) { + possibleTargets.add(stackObject.getId()); + } + } + } + return possibleTargets; + } + + + private boolean targetsCreature(UUID id, Game game) { + StackObject spell = game.getStack().getStackObject(id); + if (spell != null) { + Ability ability = spell.getStackAbility(); + if (ability != null && !ability.getTargets().isEmpty()) { + for (Target target : ability.getTargets()) { + for (UUID targetId : target.getTargets()) { + Permanent permanent = game.getPermanent(targetId); + if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) { + return true; + } + } + } + } + } + return false; + } + + @Override + public InterveneTargetSpell copy() { + return new InterveneTargetSpell(this); + } + + @Override + public Filter getFilter() { + return new FilterSpell(); + } + } +} + + diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/MemoryJar.java b/Mage.Sets/src/mage/sets/urzaslegacy/MemoryJar.java new file mode 100644 index 0000000000..f3c6506b26 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzaslegacy/MemoryJar.java @@ -0,0 +1,209 @@ +/* + * 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.urzaslegacy; + +import java.util.Iterator; +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.delayed.AtTheEndOfTurnStepPostDelayedTriggeredAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.players.Player; + +/** + * + * @author Plopman + */ +public class MemoryJar extends CardImpl { + + + + public MemoryJar(UUID ownerId) { + super(ownerId, 129, "Memory Jar", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{5}"); + this.expansionSetCode = "ULG"; + + // {tap}, Sacrifice Memory Jar: Each player exiles all cards from his or her hand face down and draws seven cards. + // At the beginning of the next end step, each player discards his or her hand and returns to his or her hand each + //card he or she exiled this way. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new MemoryJarEffect(), new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + + } + + public MemoryJar(final MemoryJar card) { + super(card); + } + + @Override + public MemoryJar copy() { + return new MemoryJar(this); + } +} + +class MemoryJarEffect extends OneShotEffect { + + public MemoryJarEffect() + { + super(Outcome.DrawCard); + staticText = "Each player exiles all cards from his or her hand face down and draws seven cards. At the beginning of the next end step, each player discards his or her hand and returns to his or her hand each card he or she exiled this way."; + } + public MemoryJarEffect(final MemoryJarEffect effect) + { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) + { + Cards cards = new CardsImpl(); + //Exil hand + for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) + { + Cards hand = player.getHand(); + while (hand.size() > 0) { + Card card = hand.get(hand.iterator().next(), game); + if(card != null) + { + card.setFaceDown(true); + card.moveToExile(getId(), "Memory Jar", source.getSourceId(), game); + cards.add(card); + } + } + } + } + //Draw 7 cards + for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) + { + player.drawCards(7, game); + } + } + //Delayed ability + Effect effect = new MemoryJarDelayedEffect(); + effect.setValue("MemoryJarCards", cards); + DelayedTriggeredAbility delayedAbility = new MemoryJarDelayedTriggeredAbility(effect); + + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + game.addDelayedTriggeredAbility(delayedAbility); + return true; + } + + @Override + public MemoryJarEffect copy() { + return new MemoryJarEffect(this); + } +} + +class MemoryJarDelayedEffect extends OneShotEffect { + + public MemoryJarDelayedEffect() + { + super(Outcome.DrawCard); + staticText = "At the beginning of the next end step, each player discards his or her hand and returns to his or her hand each card he or she exiled this way."; + } + public MemoryJarDelayedEffect(final MemoryJarDelayedEffect effect) + { + super(effect); + } + @Override + public MemoryJarDelayedEffect copy() { + return new MemoryJarDelayedEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Cards cards = (Cards)this.getValue("MemoryJarCards"); + + if(cards != null) + { + //Discard + for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) + { + player.discard(player.getHand().size(), source, game); + } + } + //Return to hand + for (Iterator it = cards.getCards(game).iterator(); it.hasNext();) { + Card card = it.next(); + card.moveToZone(Constants.Zone.HAND, source.getSourceId(), game, true); + } + return true; + } + return false; + } + +} + +class MemoryJarDelayedTriggeredAbility extends DelayedTriggeredAbility { + + public MemoryJarDelayedTriggeredAbility(Effect effect) { + super(effect); + } + + public MemoryJarDelayedTriggeredAbility(final MemoryJarDelayedTriggeredAbility ability) { + super(ability); + } + + @Override + public MemoryJarDelayedTriggeredAbility copy() { + return new MemoryJarDelayedTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.END_TURN_STEP_PRE) { + return true; + } + return false; + } + + + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/MoltenHydra.java b/Mage.Sets/src/mage/sets/urzaslegacy/MoltenHydra.java new file mode 100644 index 0000000000..a6e30437d1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzaslegacy/MoltenHydra.java @@ -0,0 +1,176 @@ +/* + * 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.urzaslegacy; + +import java.util.List; +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.CostImpl; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.counters.Counter; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author Plopman + */ +public class MoltenHydra extends CardImpl { + + + + public MoltenHydra(UUID ownerId) { + super(ownerId, 85, "Molten Hydra", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "ULG"; + this.subtype.add("Hydra"); + + this.color.setRed(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {1}{R}{R}: Put a +1/+1 counter on Molten Hydra. + this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), new ManaCostsImpl("{1}{R}{R}"))); + // {tap}, Remove all +1/+1 counters from Molten Hydra: Molten Hydra deals damage to target creature or player equal to the number of +1/+1 counters removed this way. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DamageTargetEffect(new MotltenHydraDynamicValue()), new TapSourceCost()); + ability.addCost(new RemoveAllCountersSourceCost(CounterType.P1P1.createInstance())); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + + } + + public MoltenHydra(final MoltenHydra card) { + super(card); + } + + @Override + public MoltenHydra copy() { + return new MoltenHydra(this); + } +} + + + +class RemoveAllCountersSourceCost extends CostImpl { + + private int amount; + private String name; + + public RemoveAllCountersSourceCost(Counter counter) { + this.name = counter.getName(); + this.amount = counter.getCount(); + this.text = "Remove all " + name + " counters from {this}"; + } + + public RemoveAllCountersSourceCost(RemoveAllCountersSourceCost cost) { + super(cost); + this.amount = cost.amount; + this.name = cost.name; + } + + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + return true; + } + + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + Permanent permanent = game.getPermanent(sourceId); + if (permanent != null) { + this.amount = permanent.getCounters().getCount(name); + permanent.removeCounters(name, amount, game); + this.paid = true; + } + else + { + this.amount = 0; + } + return paid; + } + + @Override + public RemoveAllCountersSourceCost copy() { + return new RemoveAllCountersSourceCost(this); + } + + public int getAmount() { + return amount; + } + + +} + +class MotltenHydraDynamicValue implements DynamicValue { + + + public MotltenHydraDynamicValue() { + + } + + public MotltenHydraDynamicValue(final MotltenHydraDynamicValue dynamicValue) { + } + + @Override + public int calculate(Game game, Ability source) { + int count = 0; + for(Cost cost : source.getCosts()){ + if(cost instanceof RemoveAllCountersSourceCost){ + count += ((RemoveAllCountersSourceCost)cost).getAmount(); + } + } + return count; + } + + @Override + public MotltenHydraDynamicValue clone() { + return new MotltenHydraDynamicValue(this); + } + + @Override + public String toString() { + return "1"; + } + + @Override + public String getMessage() { + return "the number of +1/+1 counters removed this way"; + } +} + diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/MultaniMaroSorcerer.java b/Mage.Sets/src/mage/sets/urzaslegacy/MultaniMaroSorcerer.java new file mode 100644 index 0000000000..f5f4364b7c --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzaslegacy/MultaniMaroSorcerer.java @@ -0,0 +1,104 @@ +/* + * 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.urzaslegacy; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect; +import mage.abilities.keyword.ShroudAbility; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author Plopman + */ +public class MultaniMaroSorcerer extends CardImpl { + + public MultaniMaroSorcerer(UUID ownerId) { + super(ownerId, 107, "Multani, Maro-Sorcerer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); + this.expansionSetCode = "ULG"; + this.supertype.add("Legendary"); + this.subtype.add("Elemental"); + + this.color.setGreen(true); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Shroud + this.addAbility(ShroudAbility.getInstance()); + // Multani, Maro-Sorcerer's power and toughness are each equal to the total number of cards in all players' hands. + this.addAbility(new SimpleStaticAbility(Constants.Zone.ALL, new SetPowerToughnessSourceEffect(new CardsInHandCount(), Constants.Duration.WhileOnBattlefield))); + } + + public MultaniMaroSorcerer(final MultaniMaroSorcerer card) { + super(card); + } + + @Override + public MultaniMaroSorcerer copy() { + return new MultaniMaroSorcerer(this); + } +} + +class CardsInHandCount implements DynamicValue { + @Override + public int calculate(Game game, Ability sourceAbility) { + int count = 0; + for (UUID playerId: game.getPlayer(sourceAbility.getControllerId()).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) + { + count += player.getHand().size(); + } + } + return count; + } + + @Override + public DynamicValue clone() { + return new CardsInHandCount(); + } + + @Override + public String getMessage() { + return "the total number of cards in all players' hands"; + } + + @Override + public String toString() { + return "1"; + } +} diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/Repopulate.java b/Mage.Sets/src/mage/sets/urzaslegacy/Repopulate.java new file mode 100644 index 0000000000..6ec6870e5b --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzaslegacy/Repopulate.java @@ -0,0 +1,106 @@ +/* + * 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.urzaslegacy; + +import java.util.Set; +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.CyclingAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreatureCard; +import mage.game.Game; +import mage.game.turn.TurnMod; +import mage.players.Player; +import mage.target.TargetPlayer; + +/** + * + * @author Plopman + */ +public class Repopulate extends CardImpl { + + public Repopulate(UUID ownerId) { + super(ownerId, 111, "Repopulate", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); + this.expansionSetCode = "ULG"; + + this.color.setGreen(true); + + // Shuffle all creature cards from target player's graveyard into that player's library. + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addEffect(new RepopulateEffect()); + // Cycling {2} + this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}"))); + } + + public Repopulate(final Repopulate card) { + super(card); + } + + @Override + public Repopulate copy() { + return new Repopulate(this); + } +} + +class RepopulateEffect extends OneShotEffect { + + RepopulateEffect() { + super(Constants.Outcome.Benefit); + staticText = "Shuffle all creature cards from target player's graveyard into that player's library"; + } + + RepopulateEffect(final RepopulateEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getFirstTarget()); + if (player != null) { + Set cards = player.getGraveyard().getCards(new FilterCreatureCard(), game); + for(Card card : cards) + { + card.moveToZone(Constants.Zone.LIBRARY, source.getId(), game, true); + } + player.shuffleLibrary(game); + return true; + } + return false; + } + + @Override + public RepopulateEffect copy() { + return new RepopulateEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/Rivalry.java b/Mage.Sets/src/mage/sets/urzaslegacy/Rivalry.java new file mode 100644 index 0000000000..8d87763709 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzaslegacy/Rivalry.java @@ -0,0 +1,122 @@ +/* + * 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.urzaslegacy; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterLandPermanent; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author Plopman + */ +public class Rivalry extends CardImpl { + + public Rivalry(UUID ownerId) { + super(ownerId, 90, "Rivalry", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); + this.expansionSetCode = "ULG"; + + this.color.setRed(true); + + // At the beginning of each player's upkeep, if that player controls more lands than each other player, Rivalry deals 2 damage to him or her. + this.addAbility(new RivalryTriggeredAbility()); + + } + + public Rivalry(final Rivalry card) { + super(card); + } + + @Override + public Rivalry copy() { + return new Rivalry(this); + } +} + +class RivalryTriggeredAbility extends TriggeredAbilityImpl { + + private final static FilterPermanent filter = new FilterLandPermanent(); + + + + public RivalryTriggeredAbility() { + super(Constants.Zone.BATTLEFIELD, new DamageTargetEffect(2), false); + } + + public RivalryTriggeredAbility(final RivalryTriggeredAbility ability) { + super(ability); + } + + @Override + public RivalryTriggeredAbility copy() { + return new RivalryTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) { + if (getTargets().size() == 0) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); + } + } + return true; + } + return false; + } + + @Override + public boolean checkInterveningIfClause(Game game) { + UUID player = game.getActivePlayerId(); + int land = game.getBattlefield().countAll(filter, player, game); + if(player != null){ + for(UUID opponent : game.getOpponents(player)){ + if(land <= game.getBattlefield().countAll(filter, opponent, game)){ + return false; + } + } + return true; + } + return false; + } + + @Override + public String getRule() { + return "At the beginning of each player's upkeep, if that player controls more lands than each other player, Rivalry deals 2 damage to him or her."; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/TreefolkMystic.java b/Mage.Sets/src/mage/sets/urzaslegacy/TreefolkMystic.java new file mode 100644 index 0000000000..d69a2746da --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzaslegacy/TreefolkMystic.java @@ -0,0 +1,113 @@ +/* + * 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.urzaslegacy; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility; +import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.Target; + +/** + * + * @author Plopman + */ +public class TreefolkMystic extends CardImpl { + + public TreefolkMystic(UUID ownerId) { + super(ownerId, 114, "Treefolk Mystic", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "ULG"; + this.subtype.add("Treefolk"); + + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // Whenever Treefolk Mystic blocks or becomes blocked by a creature, destroy all Auras attached to that creature. + this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(new TreefolkMysticEffect(), false)); + } + + public TreefolkMystic(final TreefolkMystic card) { + super(card); + } + + @Override + public TreefolkMystic copy() { + return new TreefolkMystic(this); + } +} + +class TreefolkMysticEffect extends OneShotEffect { + + + + public TreefolkMysticEffect() { + super(Constants.Outcome.DestroyPermanent); + } + + public TreefolkMysticEffect(final TreefolkMysticEffect effect) { + super(effect); + } + + @Override + public TreefolkMysticEffect copy() { + return new TreefolkMysticEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if(permanent != null) + { + for(UUID uuid : permanent.getAttachments()) + { + Permanent aura = game.getPermanent(uuid); + if(aura != null && aura.getSubtype().contains("Aura")) + { + permanent.destroy(source.getId(), game, false); + } + } + } + return false; + } + + @Override + public String getText(Mode mode) { + return "destroy all Auras attached to that creature"; + } + +} diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/ViashinoHeretic.java b/Mage.Sets/src/mage/sets/urzaslegacy/ViashinoHeretic.java new file mode 100644 index 0000000000..870eccdf3c --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzaslegacy/ViashinoHeretic.java @@ -0,0 +1,118 @@ +/* + * 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.urzaslegacy; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetArtifactPermanent; + +/** + * + * @author Plopman + */ +public class ViashinoHeretic extends CardImpl { + + public ViashinoHeretic(UUID ownerId) { + super(ownerId, 95, "Viashino Heretic", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "ULG"; + this.subtype.add("Viashino"); + + this.color.setRed(true); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // {1}{R}, {tap}: Destroy target artifact. Viashino Heretic deals damage to that artifact's controller equal to the artifact's converted mana cost. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ViashinoHereticEffect(), new ManaCostsImpl("{1}{R}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetArtifactPermanent()); + this.addAbility(ability); + } + + public ViashinoHeretic(final ViashinoHeretic card) { + super(card); + } + + @Override + public ViashinoHeretic copy() { + return new ViashinoHeretic(this); + } +} + +class ViashinoHereticEffect extends OneShotEffect { + + + public ViashinoHereticEffect() { + super(Constants.Outcome.DestroyPermanent); + } + + public ViashinoHereticEffect(final ViashinoHereticEffect effect) { + super(effect); + } + + @Override + public ViashinoHereticEffect copy() { + return new ViashinoHereticEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if(permanent != null) + { + int couvertedManaCost = permanent.getManaCost().convertedManaCost(); + Player player = game.getPlayer(permanent.getControllerId()); + permanent.destroy(source.getId(), game, false); + if(player != null){ + player.damage(couvertedManaCost, source.getId(), game, false, true); + } + return true; + } + return false; + } + + @Override + public String getText(Mode mode) { + return "Destroy target artifact. Viashino Heretic deals damage to that artifact's controller equal to the artifact's converted mana cost"; + } + +} \ No newline at end of file