diff --git a/Mage.Sets/src/mage/sets/arabiannights/AbuJafar.java b/Mage.Sets/src/mage/sets/arabiannights/AbuJafar.java new file mode 100644 index 0000000000..e0aeb78ce7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/AbuJafar.java @@ -0,0 +1,72 @@ +/* + * 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.arabiannights; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.BlockedByIdPredicate; +import mage.filter.predicate.permanent.BlockingAttackerIdPredicate; + +/** + * + * @author MarcoMarin + */ +public class AbuJafar extends CardImpl { + + public AbuJafar(UUID ownerId) { + super(ownerId, 55, "Abu Ja'far", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "ARN"; + this.subtype.add("Human"); + this.power = new MageInt(0); + this.toughness = new MageInt(1); + + FilterCreaturePermanent filter = new FilterCreaturePermanent(); + filter.add(Predicates.or(new BlockedByIdPredicate(this.getId()), + new BlockingAttackerIdPredicate(this.getId()))); + + // When Abu Ja'far dies, destroy all creatures blocking or blocked by it. They can't be regenerated. + this.addAbility(new DiesTriggeredAbility(new DestroyAllEffect(filter), true)); + } + + public AbuJafar(final AbuJafar card) { + super(card); + } + + @Override + public AbuJafar copy() { + return new AbuJafar(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/AladdinsLamp.java b/Mage.Sets/src/mage/sets/arabiannights/AladdinsLamp.java new file mode 100644 index 0000000000..f3b65f6c8a --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/AladdinsLamp.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.arabiannights; + +import java.util.UUID; + +/** + * + * @author MarcoMarin + */ +public class AladdinsLamp extends mage.sets.revisededition.AladdinsLamp { + + public AladdinsLamp(UUID ownerId) { + super(ownerId); + this.cardNumber = 70; + this.expansionSetCode = "ARN"; + } + + public AladdinsLamp(final AladdinsLamp card) { + super(card); + } + + @Override + public AladdinsLamp copy() { + return new AladdinsLamp(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/EyeForAnEye.java b/Mage.Sets/src/mage/sets/arabiannights/EyeForAnEye.java new file mode 100644 index 0000000000..e95cb97f45 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/EyeForAnEye.java @@ -0,0 +1,135 @@ +/* + * 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.arabiannights; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author MarcoMarin + */ +public class EyeForAnEye extends CardImpl { + + public EyeForAnEye(UUID ownerId) { + super(ownerId, 59, "Eye for an Eye", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{W}{W}"); + this.expansionSetCode = "ARN"; + + // The next time a source of your choice would deal damage to you this turn, instead that source deals that much damage to you and Eye for an Eye deals that much damage to that source's controller. + this.addAbility(new EyeForAnEyeTriggeredAbility(new EyeForAnEyeEffect())); + + } + + public EyeForAnEye(final EyeForAnEye card) { + super(card); + } + + @Override + public EyeForAnEye copy() { + return new EyeForAnEye(this); + } +} + +class EyeForAnEyeTriggeredAbility extends TriggeredAbilityImpl { + + public EyeForAnEyeTriggeredAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect); + } + + public EyeForAnEyeTriggeredAbility(final EyeForAnEyeTriggeredAbility ability) { + super(ability); + } + + @Override + public EyeForAnEyeTriggeredAbility copy() { + return new EyeForAnEyeTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DAMAGED_PLAYER; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + MageObject sourceObject = game.getObject(event.getSourceId()); + this.getEffects().get(0).setValue("damageAmount", event.getAmount()); + this.getEffects().get(0).setTargetPointer(new FixedTarget(game.getControllerId(sourceObject.getId()))); + return true; + } + + @Override + public String getRule() { + return "The next time a source of your choice would deal damage to you this turn, instead that source deals that much damage to you and {this} deals that much damage to that source's controller."; + } +} + +class EyeForAnEyeEffect extends OneShotEffect { + + public EyeForAnEyeEffect() { + super(Outcome.Damage); + } + + public EyeForAnEyeEffect(final EyeForAnEyeEffect effect) { + super(effect); + } + + @Override + public EyeForAnEyeEffect copy() { + return new EyeForAnEyeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Integer damageAmount = (Integer) this.getValue("damageAmount"); + UUID targetId = this.targetPointer.getFirst(game, source); + if (damageAmount != null && targetId != null) { + Player player = game.getPlayer(targetId); + if (player != null) { + player.damage(damageAmount, targetId, game, false, true); + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/HurrJackal.java b/Mage.Sets/src/mage/sets/arabiannights/HurrJackal.java new file mode 100644 index 0000000000..9028086f7f --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/HurrJackal.java @@ -0,0 +1,71 @@ +/* + * 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.arabiannights; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; + +import mage.abilities.effects.common.CantBeRegeneratedTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author MarcoMarin + */ +public class HurrJackal extends CardImpl { + + public HurrJackal(UUID ownerId) { + super(ownerId, 48, "Hurr Jackal", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "ARN"; + this.subtype.add("Hound"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}: Target creature can't be regenerated this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBeRegeneratedTargetEffect(Duration.EndOfTurn), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public HurrJackal(final HurrJackal card) { + super(card); + } + + @Override + public HurrJackal copy() { + return new HurrJackal(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/Jihad.java b/Mage.Sets/src/mage/sets/arabiannights/Jihad.java new file mode 100644 index 0000000000..d2672a9155 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/Jihad.java @@ -0,0 +1,123 @@ +/* + * 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.arabiannights; + +import java.util.UUID; +import mage.abilities.common.AsEntersBattlefieldAbility; +import mage.abilities.effects.common.ChooseOpponentEffect; +import mage.abilities.effects.common.ChooseColorEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.OnEventTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.common.NoCreatureCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TokenPredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.players.Player; + +/** + * + * @author MarcoMarin + */ +public class Jihad extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("White creatures"); + + static { + filter.add(new ColorPredicate(ObjectColor.WHITE)); + } + + public Jihad(UUID ownerId) { + super(ownerId, 60, "Jihad", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{W}{W}{W}"); + this.expansionSetCode = "ARN"; + + // As Jihad enters the battlefield, choose a color and an opponent. + this.addAbility(new AsEntersBattlefieldAbility(new ChooseColorEffect(Outcome.Detriment))); + this.addAbility(new AsEntersBattlefieldAbility(new ChooseOpponentEffect(Outcome.Detriment))); + + // White creatures get +2/+1 as long as the chosen player controls a nontoken permanent of the chosen color. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(2, 1, Duration.WhileOnBattlefield, filter, false))); + + // When the chosen player controls no nontoken permanents of the chosen color, sacrifice Jihad. + + // Not quite as immediate as I'd like but.. Static doesnt accept that effect and probably only work upon casting (maybe a continuous ability would, if not hog the system) + TriggeredAbility triggered = new OnEventTriggeredAbility(GameEvent.EventType.STEP_CHANGED, "end Jihad", true, new SacrificeSourceEffect()); + this.addAbility(new ConditionalTriggeredAbility(triggered, new NoColoredPermanentOpponentCondition(), "no nontoken permanents of the chosen color, sacrifice Jihad")); + //this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalOneShotEffect(new SacrificeSourceEffect()), new NoColoredPermanentOpponentCondition(), "Jihad ending")); + + } + + public Jihad(final Jihad card) { + super(card); + } + + @Override + public Jihad copy() { + return new Jihad(this); + } +} + +class NoColoredPermanentOpponentCondition implements Condition { + + private static NoColoredPermanentOpponentCondition fInstance = new NoColoredPermanentOpponentCondition(); + + public static Condition getInstance() { + return fInstance; + } + + @Override + public boolean apply(Game game, Ability source) { + UUID chosenOpponent = (UUID) game.getState().getValue(source.getSourceId().toString() + ChooseOpponentEffect.VALUE_KEY); + + FilterPermanent filter = new FilterPermanent(); + filter.add(new ColorPredicate((ObjectColor) game.getState().getValue(source.getSourceId() + "_color"))); + filter.add(Predicates.not(new TokenPredicate())); + //filter.add(new ColorPredicate(ObjectColor.WHITE)); // Given this typing, somehow the above doesn't seem right, but I copied from StoryCircle card + + return game.getBattlefield().countAll(filter, chosenOpponent, game)==0; + + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/arabiannights/MagneticMountain.java b/Mage.Sets/src/mage/sets/arabiannights/MagneticMountain.java new file mode 100644 index 0000000000..29c5150d0a --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/MagneticMountain.java @@ -0,0 +1,137 @@ +/* + * 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.arabiannights; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.DontUntapInControllersUntapStepAllEffect; +import mage.abilities.effects.common.UntapEnchantedEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.ObjectPlayer; +import mage.filter.predicate.ObjectPlayerPredicate; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + + + +/** + * + * @author MarcoMarin + */ +public class MagneticMountain extends CardImpl { + + public static final FilterCreaturePermanent filter = new FilterCreaturePermanent("blue creatures"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLUE)); + } + + public MagneticMountain(UUID ownerId) { + super(ownerId, 50, "Magnetic Mountain", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}{R}"); + this.expansionSetCode = "ARN"; + + // Blue creatures don't untap during their controllers' untap steps. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new DontUntapInControllersUntapStepAllEffect(Duration.WhileOnBattlefield, TargetController.ANY, filter))); + // At the beginning of each player's upkeep, that player may choose any number of tapped blue creatures he or she controls and pay {4} for each creature chosen this way. If the player does, untap those creatures. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new MagneticMountainEffect(), TargetController.ANY, false)); + } + + public MagneticMountain(final MagneticMountain card) { + super(card); + } + + @Override + public MagneticMountain copy() { + return new MagneticMountain(this); + } +} +class MagneticMountainEffect extends DoIfCostPaid { + + public MagneticMountainEffect(){ + super(new UntapEnchantedEffect(), new GenericManaCost(4)); + } + + public MagneticMountainEffect(final MagneticMountainEffect effect) { + super(effect); + } + + @Override + public MagneticMountainEffect copy() { + return new MagneticMountainEffect(this); + } + + @Override + protected Player getPayingPlayer(Game game, Ability source) { + return game.getPlayer(game.getActivePlayerId()); + } + + @Override + public String getText(Mode mode) { + return new StringBuilder("that player may ").append(getCostText()) + .append(". If he or she does, ").append(executingEffects.getText(mode)).toString(); + } + + @Override + public boolean apply(Game game, Ability source) { + FilterCreaturePermanent filter = new FilterCreaturePermanent("blue creatures"); + filter.add(new ColorPredicate(ObjectColor.BLUE)); + filter.add(new MagneticMountainPredicate()); + + if (game.getBattlefield().getAllActivePermanents(filter, game.getActivePlayerId(), game).size()>0){ + this.copy(); + } + return true; + + } + class MagneticMountainPredicate implements ObjectPlayerPredicate> { + @Override + public boolean apply(ObjectPlayer input, Game game) { + return input.getObject().isTapped(); + + } + @Override + public String toString() { + return "Tapped"; + } +} +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/arabiannights/Piety.java b/Mage.Sets/src/mage/sets/arabiannights/Piety.java new file mode 100644 index 0000000000..ec8c046951 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/Piety.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.arabiannights; + +import java.util.UUID; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterBlockingCreature; + +/** + * + * @author MarcoMarin + */ +public class Piety extends CardImpl { + + public static final FilterBlockingCreature filter = new FilterBlockingCreature(); + + public Piety(UUID ownerId) { + super(ownerId, 64, "Piety", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{W}"); + this.expansionSetCode = "ARN"; + + // Blocking creatures get +0/+3 until end of turn. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(0, 3, Duration.EndOfTurn, filter, false))); + //this.addAbility(new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_POST, "end Piety", true, new BoostAllEffect(0, 3, Duration.EndOfTurn, filter, false))); + } + + public Piety(final Piety card) { + super(card); + } + + @Override + public Piety copy() { + return new Piety(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/Pyramids.java b/Mage.Sets/src/mage/sets/arabiannights/Pyramids.java new file mode 100644 index 0000000000..246d81e8ac --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/Pyramids.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.arabiannights; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterEnchantmentPermanent; +import mage.filter.predicate.ObjectPlayer; +import mage.filter.predicate.ObjectPlayerPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author MarcoMarin + */ +public class Pyramids extends CardImpl { + + private static final FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent("Auras attached to a land"); + + static { + filter.add(new SubtypePredicate("Aura")); + filter.add(new PyramidsPredicate()); + } + + public Pyramids(UUID ownerId) { + super(ownerId, 81, "Pyramids", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{6}"); + this.expansionSetCode = "ARN"; + + // {2}: Choose one - Destroy target Aura attached to a land; + Effect effect = new DestroyTargetEffect(); + effect.setText("Destroy target Aura attached to a land"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}")); + //or the next time target land would be destroyed this turn, remove all damage marked on it instead. + Mode mode = new Mode(); //back in the day this was not technically "damage", hopefully this modern description will work nowadays + mode.getEffects().add(new PreventDamageToTargetEffect(Duration.EndOfTurn)); + mode.getTargets().add(new TargetLandPermanent()); + ability.addMode(mode); + + this.addAbility(ability); + } + + public Pyramids(final Pyramids card) { + super(card); + } + + @Override + public Pyramids copy() { + return new Pyramids(this); + } +} +class PyramidsPredicate implements ObjectPlayerPredicate> { + @Override + public boolean apply(ObjectPlayer input, Game game) { + Permanent attachment = input.getObject(); + if (attachment != null) { + Permanent permanent = game.getPermanent(attachment.getAttachedTo()); + if (permanent != null && permanent.getCardType().contains(CardType.LAND)) { + return true; + } + } + return false; + } + @Override + public String toString() { + return "Attached to a land"; + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/SandalsOfAbdallah.java b/Mage.Sets/src/mage/sets/arabiannights/SandalsOfAbdallah.java new file mode 100644 index 0000000000..25631d47f6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/SandalsOfAbdallah.java @@ -0,0 +1,82 @@ +/* + * 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.arabiannights; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.IslandwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +import mage.target.common.TargetCreaturePermanent; +import mage.abilities.common.DiesCreatureTriggeredAbility; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.PermanentIdPredicate; + +/** + * + * @author MarcoMarin + */ +public class SandalsOfAbdallah extends CardImpl { + + public SandalsOfAbdallah(UUID ownerId) { + super(ownerId, 83, "Sandals of Abdallah", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "ARN"; + + // {2}, {tap}: Target creature gains islandwalk until end of turn. When that creature dies this turn, destroy Sandals of Abdallah. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(new IslandwalkAbility(), Duration.EndOfTurn), new ManaCostsImpl("{2}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + + //If the following doesn work, Alternatively do //Target target = ability.getTargets() + //target.setTargetTag(1); + //then later do: filter.add(new AnotherTargetPredicate(1)); + FilterCreaturePermanent filter = new FilterCreaturePermanent(); + //hopefully a null pointer wont break anything before the ability is activated :-S + filter.add(new PermanentIdPredicate(ability.getFirstTarget())); + this.addAbility(new DiesCreatureTriggeredAbility(new SacrificeSourceEffect(), false, filter, true)); + } + + public SandalsOfAbdallah(final SandalsOfAbdallah card) { + super(card); + } + + @Override + public SandalsOfAbdallah copy() { + return new SandalsOfAbdallah(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/YdwenEfreet.java b/Mage.Sets/src/mage/sets/arabiannights/YdwenEfreet.java new file mode 100644 index 0000000000..a34afe0306 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/YdwenEfreet.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.arabiannights; + +import java.util.UUID; + +/** + * + * @author MarcoMarin + */ +public class YdwenEfreet extends mage.sets.mastersedition.YdwenEfreet { + + public YdwenEfreet(UUID ownerId) { + super(ownerId); + this.cardNumber = 54; + this.expansionSetCode = "ARN"; + } + + public YdwenEfreet(final YdwenEfreet card) { + super(card); + } + + @Override + public YdwenEfreet copy() { + return new YdwenEfreet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/AbuJafar.java b/Mage.Sets/src/mage/sets/chronicles/AbuJafar.java new file mode 100644 index 0000000000..ea06c186c0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/AbuJafar.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.chronicles; + +import java.util.UUID; + +/** + * + * @author MarcoMarin + */ +public class AbuJafar extends mage.sets.arabiannights.AbuJafar { + + public AbuJafar(UUID ownerId) { + super(ownerId); + this.cardNumber = 57; + this.expansionSetCode = "CHR"; + } + + public AbuJafar(final AbuJafar card) { + super(card); + } + + @Override + public AbuJafar copy() { + return new AbuJafar(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/EyeForAnEye.java b/Mage.Sets/src/mage/sets/fifthedition/EyeForAnEye.java new file mode 100644 index 0000000000..339327f805 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/EyeForAnEye.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author MarcoMarin + */ +public class EyeForAnEye extends mage.sets.arabiannights.EyeForAnEye { + + public EyeForAnEye(UUID ownerId) { + super(ownerId); + this.cardNumber = 306; + this.expansionSetCode = "5ED"; + this.rarity = Rarity.RARE; + } + + public EyeForAnEye(final EyeForAnEye card) { + super(card); + } + + @Override + public EyeForAnEye copy() { + return new EyeForAnEye(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/AladdinsLamp.java b/Mage.Sets/src/mage/sets/fourthedition/AladdinsLamp.java new file mode 100644 index 0000000000..bac8af1382 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/AladdinsLamp.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author MarcoMarin + */ +public class AladdinsLamp extends mage.sets.revisededition.AladdinsLamp { + + public AladdinsLamp(UUID ownerId) { + super(ownerId); + this.cardNumber = 309; + this.expansionSetCode = "4ED"; + } + + public AladdinsLamp(final AladdinsLamp card) { + super(card); + } + + @Override + public AladdinsLamp copy() { + return new AladdinsLamp(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/EyeForAnEye.java b/Mage.Sets/src/mage/sets/fourthedition/EyeForAnEye.java new file mode 100644 index 0000000000..941e5ef857 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/EyeForAnEye.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author MarcoMarin + */ +public class EyeForAnEye extends mage.sets.arabiannights.EyeForAnEye { + + public EyeForAnEye(UUID ownerId) { + super(ownerId); + this.cardNumber = 275; + this.expansionSetCode = "4ED"; + this.rarity = Rarity.RARE; + } + + public EyeForAnEye(final EyeForAnEye card) { + super(card); + } + + @Override + public EyeForAnEye copy() { + return new EyeForAnEye(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/HurrJackal.java b/Mage.Sets/src/mage/sets/fourthedition/HurrJackal.java new file mode 100644 index 0000000000..ffe5f72200 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/HurrJackal.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author MarcoMarin + */ +public class HurrJackal extends mage.sets.arabiannights.HurrJackal { + + public HurrJackal(UUID ownerId) { + super(ownerId); + this.cardNumber = 221; + this.expansionSetCode = "4ED"; + this.rarity = Rarity.RARE; + } + + public HurrJackal(final HurrJackal card) { + super(card); + } + + @Override + public HurrJackal copy() { + return new HurrJackal(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/MagneticMountain.java b/Mage.Sets/src/mage/sets/fourthedition/MagneticMountain.java new file mode 100644 index 0000000000..9aea98cb09 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/MagneticMountain.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author MarcoMarin + */ +public class MagneticMountain extends mage.sets.arabiannights.MagneticMountain { + + public MagneticMountain(UUID ownerId) { + super(ownerId); + this.cardNumber = 227; + this.expansionSetCode = "4ED"; + this.rarity = Rarity.RARE; + } + + public MagneticMountain(final MagneticMountain card) { + super(card); + } + + @Override + public MagneticMountain copy() { + return new MagneticMountain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/Piety.java b/Mage.Sets/src/mage/sets/fourthedition/Piety.java new file mode 100644 index 0000000000..38d7ebedce --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Piety.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author MarcoMarin + */ +public class Piety extends mage.sets.arabiannights.Piety { + + public Piety(UUID ownerId) { + super(ownerId); + this.cardNumber = 291; + this.expansionSetCode = "4ED"; + } + + public Piety(final Piety card) { + super(card); + } + + @Override + public Piety copy() { + return new Piety(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/YdwenEfreet.java b/Mage.Sets/src/mage/sets/mastersedition/YdwenEfreet.java new file mode 100644 index 0000000000..782273068a --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/YdwenEfreet.java @@ -0,0 +1,102 @@ +/* + * 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.mastersedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BlocksTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + + +/** + * + * @author MarcoMarin + */ +public class YdwenEfreet extends CardImpl { + + public YdwenEfreet(UUID ownerId) { + super(ownerId, 112, "Ydwen Efreet", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{R}{R}{R}"); + this.expansionSetCode = "MED"; + this.subtype.add("Efreet"); + this.power = new MageInt(3); + this.toughness = new MageInt(6); + + // Whenever Ydwen Efreet blocks, flip a coin. If you lose the flip, remove Ydwen Efreet from combat and it can't block this turn. Creatures it was blocking that had become blocked by only Ydwen Efreet this combat become unblocked. + this.addAbility(new BlocksTriggeredAbility(new YdwenEfreetEffect(), false)); + } + + public YdwenEfreet(final YdwenEfreet card) { + super(card); + } + + @Override + public YdwenEfreet copy() { + return new YdwenEfreet(this); + } +} + +class YdwenEfreetEffect extends OneShotEffect { + + public YdwenEfreetEffect() { + super(Outcome.Damage); + staticText = "flip a coin. If you lose the flip, remove {this} from combat and it can't block."; + } + + public YdwenEfreetEffect(YdwenEfreetEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent creature = game.getPermanent(source.getSourceId()); + if (controller != null && creature != null) { + if (controller.flipCoin(game)) { + return true; + } else { + creature.removeFromCombat(game); + creature.setMaxBlocks(0); + return true; + } + } + return false; + } + + @Override + public YdwenEfreetEffect copy() { + return new YdwenEfreetEffect(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/EyeForAnEye.java b/Mage.Sets/src/mage/sets/masterseditioniv/EyeForAnEye.java new file mode 100644 index 0000000000..b7e219fa53 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/EyeForAnEye.java @@ -0,0 +1,54 @@ +/* + * 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.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author MarcoMarin + */ +public class EyeForAnEye extends mage.sets.arabiannights.EyeForAnEye { + + public EyeForAnEye(UUID ownerId) { + super(ownerId); + this.cardNumber = 12; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.RARE; + } + + public EyeForAnEye(final EyeForAnEye card) { + super(card); + } + + @Override + public EyeForAnEye copy() { + return new EyeForAnEye(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/AladdinsLamp.java b/Mage.Sets/src/mage/sets/revisededition/AladdinsLamp.java new file mode 100644 index 0000000000..5d3fd7d74a --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/AladdinsLamp.java @@ -0,0 +1,145 @@ +/* + * 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.revisededition; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.players.Player; +import mage.target.TargetCard; + +/** + * + * @author MarcoMarin + */ +public class AladdinsLamp extends CardImpl { + + public AladdinsLamp(UUID ownerId) { + super(ownerId, 231, "Aladdin's Lamp", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{10}"); + this.expansionSetCode = "3ED"; + + // {X}, {tap}: The next time you would draw a card this turn, instead look at the top X cards of your library, put all but one of them on the bottom of your library in a random order, then draw a card. X can't be 0. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AladdinsLampEffect(), new ManaCostsImpl("{X}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + } + + + public AladdinsLamp(final AladdinsLamp card) { + super(card); + } + + @Override + public AladdinsLamp copy() { + return new AladdinsLamp(this); + } +} + +class AladdinsLampEffect extends ReplacementEffectImpl { + + public AladdinsLampEffect() { + super(Duration.EndOfTurn, Outcome.DrawCard); + staticText = "The next time you would draw a card this turn, instead look at the top X cards of your library, put all but one of them on the bottom of your library in a random order, then draw a card. X can't be 0."; + } + + public AladdinsLampEffect(final AladdinsLampEffect effect) { + super(effect); + } + + @Override + public AladdinsLampEffect copy() { + return new AladdinsLampEffect(this); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + + Cards cards = new CardsImpl(); + int count = source.getManaCostsToPay().getX(); + count = Math.min(player.getLibrary().size(), count); + for (int i = 0; i < count; i++) { + Card card = player.getLibrary().removeFromTop(game);// I'd like to use .getTopCards(game, count), but it returns a set which I dunno how to work with and would break the copied code adding to effort/time; + if (card != null) { + cards.add(card); + } + } + player.lookAtCards("Aladdin's Lamp", cards, game); + + TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard()); + + if (player.choose(outcome, cards, target, game)) { + Card card = cards.get(target.getFirstTarget(), game); + if (card != null) { + cards.remove(card); + card.moveToZone(Zone.HAND, source.getSourceId(), game, false); + } + } + + + // Put the rest on the bottom of your library in a random order + while (cards.size() > 0) { + Card card = cards.getRandom(game); + if (card != null) { + cards.remove(card); + card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false); + } + } + //player.drawCards(1, game); // Technically I should move it to the top and then draw but, I cant confirm that flag above refers to bottom of library + return true; + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DRAW_CARD; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return source.getControllerId().equals(event.getPlayerId()); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/revisededition/EyeForAnEye.java b/Mage.Sets/src/mage/sets/revisededition/EyeForAnEye.java new file mode 100644 index 0000000000..bf3e6351de --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/EyeForAnEye.java @@ -0,0 +1,54 @@ +/* + * 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.revisededition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author MarcoMarin + */ +public class EyeForAnEye extends mage.sets.arabiannights.EyeForAnEye { + + public EyeForAnEye(UUID ownerId) { + super(ownerId); + this.cardNumber = 202; + this.expansionSetCode = "3ED"; + this.rarity = Rarity.RARE; + } + + public EyeForAnEye(final EyeForAnEye card) { + super(card); + } + + @Override + public EyeForAnEye copy() { + return new EyeForAnEye(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/MagneticMountain.java b/Mage.Sets/src/mage/sets/revisededition/MagneticMountain.java new file mode 100644 index 0000000000..7de2dfe9ec --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/MagneticMountain.java @@ -0,0 +1,54 @@ +/* + * 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.revisededition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author MarcoMarin + */ +public class MagneticMountain extends mage.sets.arabiannights.MagneticMountain { + + public MagneticMountain(UUID ownerId) { + super(ownerId); + this.cardNumber = 162; + this.expansionSetCode = "3ED"; + this.rarity = Rarity.RARE; + } + + public MagneticMountain(final MagneticMountain card) { + super(card); + } + + @Override + public MagneticMountain copy() { + return new MagneticMountain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/UncleIstvan.java b/Mage.Sets/src/mage/sets/thedark/UncleIstvan.java index ef5f97115e..c5a9f3c6f4 100644 --- a/Mage.Sets/src/mage/sets/thedark/UncleIstvan.java +++ b/Mage.Sets/src/mage/sets/thedark/UncleIstvan.java @@ -54,7 +54,7 @@ public class UncleIstvan extends CardImpl { this.toughness = new MageInt(3); // Prevent all damage that would be dealt to Uncle Istvan by creatures. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PreventDamageToSourceBySubtypeEffect("Creature"))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PreventDamageToSourceByCardTypeEffect(CardType.CREATURE))); } public UncleIstvan(final UncleIstvan card) { @@ -67,23 +67,23 @@ public class UncleIstvan extends CardImpl { } } -class PreventDamageToSourceBySubtypeEffect extends PreventAllDamageToSourceEffect { +class PreventDamageToSourceByCardTypeEffect extends PreventAllDamageToSourceEffect { - private String subtype; + private CardType cardType; - public PreventDamageToSourceBySubtypeEffect(){ - this("a"); + public PreventDamageToSourceByCardTypeEffect(){ + this(null); } - public PreventDamageToSourceBySubtypeEffect(String sub){ + public PreventDamageToSourceByCardTypeEffect(CardType cardT){ super(Duration.WhileOnBattlefield); - subtype = sub; + cardType = cardT; } @Override public boolean applies(GameEvent event, Ability source, Game game) { if (super.applies(event, source, game)) { - if (game.getObject(event.getSourceId()).hasSubtype(subtype)){ + if (game.getObject(event.getSourceId()).getCardType().contains(cardType)){ if (event.getTargetId().equals(source.getSourceId())) { return true; } diff --git a/Mage/src/main/java/mage/counters/CounterType.java b/Mage/src/main/java/mage/counters/CounterType.java index 8e2ebf75ba..ea6455df24 100644 --- a/Mage/src/main/java/mage/counters/CounterType.java +++ b/Mage/src/main/java/mage/counters/CounterType.java @@ -109,6 +109,7 @@ public enum CounterType { VELOCITY("velocity"), VERSE("verse"), VITALITY("vitality"), + WIND("wind"), WISH("wish"); private final String name;