Added cards.

This commit is contained in:
North 2011-10-13 22:56:59 +03:00
parent a426991bfa
commit 1e91dbe7e3
10 changed files with 1071 additions and 0 deletions

View file

@ -0,0 +1,115 @@
/*
* 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.conflux;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardsImpl;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author North
*/
public class SkywardEyeProphets extends CardImpl<SkywardEyeProphets> {
public SkywardEyeProphets(UUID ownerId) {
super(ownerId, 125, "Skyward Eye Prophets", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{W}{U}");
this.expansionSetCode = "CON";
this.subtype.add("Human");
this.subtype.add("Wizard");
this.color.setBlue(true);
this.color.setGreen(true);
this.color.setWhite(true);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
this.addAbility(VigilanceAbility.getInstance());
// {tap}: Reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put it into your hand.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SkywardEyeProphetsEffect(), new TapSourceCost()));
}
public SkywardEyeProphets(final SkywardEyeProphets card) {
super(card);
}
@Override
public SkywardEyeProphets copy() {
return new SkywardEyeProphets(this);
}
}
class SkywardEyeProphetsEffect extends OneShotEffect<SkywardEyeProphetsEffect> {
public SkywardEyeProphetsEffect() {
super(Outcome.DrawCard);
this.staticText = "Reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put it into your hand";
}
public SkywardEyeProphetsEffect(final SkywardEyeProphetsEffect effect) {
super(effect);
}
@Override
public SkywardEyeProphetsEffect copy() {
return new SkywardEyeProphetsEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null && player.getLibrary().size() > 0) {
CardsImpl cards = new CardsImpl();
Card card = player.getLibrary().removeFromTop(game);
if (card != null) {
cards.add(card);
player.revealCards("Skyward Eye Prophets", cards, game);
if (card.getCardType().contains(CardType.LAND)) {
card.putOntoBattlefield(game, Zone.HAND, source.getId(), source.getControllerId());
} else {
card.moveToZone(Zone.HAND, source.getId(), game, true);
}
return true;
}
}
return false;
}
}

View file

@ -0,0 +1,74 @@
/*
* 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.fifthdawn;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.ShuffleSpellEffect;
import mage.cards.CardImpl;
import mage.filter.Filter.ComparisonScope;
import mage.filter.common.FilterControlledPermanent;
import mage.game.permanent.token.InsectToken;
/**
*
* @author North
*/
public class BeaconOfCreation extends CardImpl<BeaconOfCreation> {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("Forest you control");
static {
filter.getSubtype().add("Forest");
filter.setScopeSubtype(ComparisonScope.Any);
}
public BeaconOfCreation(UUID ownerId) {
super(ownerId, 82, "Beacon of Creation", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{G}");
this.expansionSetCode = "5DN";
this.color.setGreen(true);
// Put a 1/1 green Insect creature token onto the battlefield for each Forest you control.
this.getSpellAbility().addEffect(new CreateTokenEffect(new InsectToken(), new PermanentsOnBattlefieldCount(filter)));
// Shuffle Beacon of Creation into its owner's library.
this.getSpellAbility().addEffect(ShuffleSpellEffect.getInstance());
}
public BeaconOfCreation(final BeaconOfCreation card) {
super(card);
}
@Override
public BeaconOfCreation copy() {
return new BeaconOfCreation(this);
}
}

View file

@ -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.fifthdawn;
import java.util.UUID;
/**
*
* @author North
*/
public class BeaconOfImmortality extends mage.sets.tenth.BeaconOfImmortality {
public BeaconOfImmortality(UUID ownerId) {
super(ownerId);
this.cardNumber = 6;
this.expansionSetCode = "5DN";
}
public BeaconOfImmortality(final BeaconOfImmortality card) {
super(card);
}
@Override
public BeaconOfImmortality copy() {
return new BeaconOfImmortality(this);
}
}

View file

@ -0,0 +1,92 @@
/*
* 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.fifthdawn;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ShuffleSpellEffect;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.game.turn.TurnMod;
import mage.target.TargetPlayer;
/**
*
* @author North
*/
public class BeaconOfTomorrows extends CardImpl<BeaconOfTomorrows> {
public BeaconOfTomorrows(UUID ownerId) {
super(ownerId, 24, "Beacon of Tomorrows", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{6}{U}{U}");
this.expansionSetCode = "5DN";
this.color.setBlue(true);
// Target player takes an extra turn after this one.
this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addEffect(new BeaconOfTomorrowsEffect());
// Shuffle Beacon of Tomorrows into its owner's library.
this.getSpellAbility().addEffect(ShuffleSpellEffect.getInstance());
}
public BeaconOfTomorrows(final BeaconOfTomorrows card) {
super(card);
}
@Override
public BeaconOfTomorrows copy() {
return new BeaconOfTomorrows(this);
}
}
class BeaconOfTomorrowsEffect extends OneShotEffect<BeaconOfTomorrowsEffect> {
public BeaconOfTomorrowsEffect() {
super(Outcome.ExtraTurn);
staticText = "Target player takes an extra turn after this one";
}
public BeaconOfTomorrowsEffect(final BeaconOfTomorrowsEffect effect) {
super(effect);
}
@Override
public BeaconOfTomorrowsEffect copy() {
return new BeaconOfTomorrowsEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
game.getState().getTurnMods().add(new TurnMod(source.getFirstTarget(), false));
return true;
}
}

View file

@ -0,0 +1,196 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magic2010;
import java.util.Set;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Layer;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.SubLayer;
import mage.Constants.Zone;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.mana.BlackManaAbility;
import mage.abilities.mana.BlueManaAbility;
import mage.abilities.mana.GreenManaAbility;
import mage.abilities.mana.RedManaAbility;
import mage.abilities.mana.WhiteManaAbility;
import mage.cards.CardImpl;
import mage.choices.ChoiceImpl;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
/**
*
* @author North
*/
public class ConvincingMirage extends CardImpl<ConvincingMirage> {
public ConvincingMirage(UUID ownerId) {
super(ownerId, 46, "Convincing Mirage", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}");
this.expansionSetCode = "M10";
this.subtype.add("Aura");
this.color.setBlue(true);
// Enchant land
TargetPermanent auraTarget = new TargetLandPermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment));
// As Convincing Mirage enters the battlefield, choose a basic land type.
this.addAbility(new EntersBattlefieldTriggeredAbility(new ConvincingMirageEffect(), false));
// Enchanted land is the chosen type.
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConvincingMirageContinousEffect()));
}
public ConvincingMirage(final ConvincingMirage card) {
super(card);
}
@Override
public ConvincingMirage copy() {
return new ConvincingMirage(this);
}
}
class ConvincingMirageEffect extends OneShotEffect<ConvincingMirageEffect> {
public ConvincingMirageEffect() {
super(Outcome.Neutral);
this.staticText = "choose a basic land type";
}
public ConvincingMirageEffect(final ConvincingMirageEffect effect) {
super(effect);
}
@Override
public ConvincingMirageEffect copy() {
return new ConvincingMirageEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
ChoiceImpl choices = new ChoiceImpl(true);
Set choicesSet = choices.getChoices();
choicesSet.add("Forest");
choicesSet.add("Plains");
choicesSet.add("Mountain");
choicesSet.add("Island");
choicesSet.add("Swamp");
if (player.choose(Outcome.Neutral, choices, game)) {
game.getState().setValue(source.getSourceId().toString() + "_ConvincingMirage", choices.getChoice());
return true;
}
}
return false;
}
}
class ConvincingMirageContinousEffect extends ContinuousEffectImpl<ConvincingMirageContinousEffect> {
public ConvincingMirageContinousEffect() {
super(Duration.WhileOnBattlefield, Outcome.Neutral);
staticText = "Enchanted land is the chosen type";
}
public ConvincingMirageContinousEffect(final ConvincingMirageContinousEffect effect) {
super(effect);
}
@Override
public ConvincingMirageContinousEffect copy() {
return new ConvincingMirageContinousEffect(this);
}
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Permanent enchantment = game.getPermanent(source.getSourceId());
String choice = (String) game.getState().getValue(source.getSourceId().toString() + "_ConvincingMirage");
if (enchantment != null && enchantment.getAttachedTo() != null && choice != null) {
Permanent land = game.getPermanent(enchantment.getAttachedTo());
if (land != null) {
switch (layer) {
case TypeChangingEffects_4:
if (sublayer == SubLayer.NA) {
land.getSubtype().clear();
land.getSubtype().add(choice);
}
break;
case AbilityAddingRemovingEffects_6:
if (sublayer == SubLayer.NA) {
land.getAbilities().clear();
if (choice.equals("Forest")) {
land.addAbility(new GreenManaAbility());
}
if (choice.equals("Plains")) {
land.addAbility(new WhiteManaAbility());
}
if (choice.equals("Mountain")) {
land.addAbility(new RedManaAbility());
}
if (choice.equals("Island")) {
land.addAbility(new BlueManaAbility());
}
if (choice.equals("Swamp")) {
land.addAbility(new BlackManaAbility());
}
}
break;
}
return true;
}
}
return false;
}
@Override
public boolean apply(Game game, Ability source) {
return false;
}
@Override
public boolean hasLayer(Layer layer) {
return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.TypeChangingEffects_4;
}
}

View file

@ -0,0 +1,110 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.riseoftheeldrazi;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.players.Library;
import mage.players.Player;
import mage.target.TargetPlayer;
/**
*
* @author North
*/
public class KeeningStone extends CardImpl<KeeningStone> {
public KeeningStone(UUID ownerId) {
super(ownerId, 219, "Keening Stone", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{6}");
this.expansionSetCode = "ROE";
// {5}, {tap}: Target player puts the top X cards of his or her library into his or her graveyard, where X is the number of cards in that player's graveyard.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new KeeningStoneEffect(), new GenericManaCost(5));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetPlayer());
this.addAbility(ability);
}
public KeeningStone(final KeeningStone card) {
super(card);
}
@Override
public KeeningStone copy() {
return new KeeningStone(this);
}
}
class KeeningStoneEffect extends OneShotEffect<KeeningStoneEffect> {
public KeeningStoneEffect() {
super(Outcome.Neutral);
this.staticText = "Target player puts the top X cards of his or her library into his or her graveyard, where X is the number of cards in that player's graveyard";
}
public KeeningStoneEffect(final KeeningStoneEffect effect) {
super(effect);
}
@Override
public KeeningStoneEffect copy() {
return new KeeningStoneEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getFirstTarget());
if (player != null) {
Library library = player.getLibrary();
int amount = Math.min(player.getGraveyard().size(), library.size());
for (int i = 0; i < amount; i++) {
Card card = library.removeFromTop(game);
if (card != null) {
card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, true);
}
}
if (amount > 0) {
return true;
}
}
return false;
}
}

View file

@ -0,0 +1,116 @@
/*
* 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.riseoftheeldrazi;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.common.SpellCastTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.filter.Filter.ComparisonScope;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreatureOrPlayer;
/**
*
* @author North
*/
public class SphinxBoneWand extends CardImpl<SphinxBoneWand> {
private static final FilterCard filter = new FilterCard("an instant or sorcery spell");
static {
filter.getCardType().add(CardType.INSTANT);
filter.getCardType().add(CardType.SORCERY);
filter.setScopeCardType(ComparisonScope.Any);
}
public SphinxBoneWand(UUID ownerId) {
super(ownerId, 225, "Sphinx-Bone Wand", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{7}");
this.expansionSetCode = "ROE";
// Whenever you cast an instant or sorcery spell, you may put a charge counter on Sphinx-Bone Wand. If you do, Sphinx-Bone Wand deals damage equal to the number of charge counters on it to target creature or player.
SpellCastTriggeredAbility ability = new SpellCastTriggeredAbility(new SphinxBoneWandEffect(), filter, true);
ability.addTarget(new TargetCreatureOrPlayer());
this.addAbility(ability);
}
public SphinxBoneWand(final SphinxBoneWand card) {
super(card);
}
@Override
public SphinxBoneWand copy() {
return new SphinxBoneWand(this);
}
}
class SphinxBoneWandEffect extends OneShotEffect<SphinxBoneWandEffect> {
public SphinxBoneWandEffect() {
super(Outcome.Damage);
this.staticText = "put a charge counter on Sphinx-Bone Wand. If you do, Sphinx-Bone Wand deals damage equal to the number of charge counters on it to target creature or player";
}
public SphinxBoneWandEffect(final SphinxBoneWandEffect effect) {
super(effect);
}
@Override
public SphinxBoneWandEffect copy() {
return new SphinxBoneWandEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (sourcePermanent != null) {
sourcePermanent.addCounters(CounterType.CHARGE.createInstance(), game);
int amount = sourcePermanent.getCounters().getCount(CounterType.CHARGE);
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null) {
permanent.damage(amount, source.getSourceId(), game, true, false);
}
Player player = game.getPlayer(source.getFirstTarget());
if (player != null) {
player.damage(amount, source.getSourceId(), game, false, true);
}
return true;
}
return false;
}
}

View file

@ -0,0 +1,103 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.tenth;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ShuffleSpellEffect;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetPlayer;
/**
*
* @author North
*/
public class BeaconOfImmortality extends CardImpl<BeaconOfImmortality> {
public BeaconOfImmortality(UUID ownerId) {
super(ownerId, 10, "Beacon of Immortality", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{5}{W}");
this.expansionSetCode = "10E";
this.color.setWhite(true);
// Double target player's life total.
this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addEffect(new BeaconOfImmortalityEffect());
// Shuffle Beacon of Immortality into its owner's library.
this.getSpellAbility().addEffect(ShuffleSpellEffect.getInstance());
}
public BeaconOfImmortality(final BeaconOfImmortality card) {
super(card);
}
@Override
public BeaconOfImmortality copy() {
return new BeaconOfImmortality(this);
}
}
class BeaconOfImmortalityEffect extends OneShotEffect<BeaconOfImmortalityEffect> {
public BeaconOfImmortalityEffect() {
super(Outcome.GainLife);
this.staticText = "Double target player's life total";
}
public BeaconOfImmortalityEffect(final BeaconOfImmortalityEffect effect) {
super(effect);
}
@Override
public BeaconOfImmortalityEffect copy() {
return new BeaconOfImmortalityEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getFirstTarget());
if (player != null) {
int amount = game.getLife();
if (amount < 0) {
player.loseLife(amount, game);
return true;
}
if (amount > 0) {
player.gainLife(amount, game);
return true;
}
}
return false;
}
}

View file

@ -0,0 +1,105 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.worldwake;
import java.util.List;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.filter.common.FilterNonlandCard;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInLibrary;
/**
*
* @author North
*/
public class SelectiveMemory extends CardImpl<SelectiveMemory> {
public SelectiveMemory(UUID ownerId) {
super(ownerId, 37, "Selective Memory", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{U}");
this.expansionSetCode = "WWK";
this.color.setBlue(true);
// Search your library for any number of nonland cards and exile them. Then shuffle your library.
this.getSpellAbility().addEffect(new SelectiveMemoryEffect());
}
public SelectiveMemory(final SelectiveMemory card) {
super(card);
}
@Override
public SelectiveMemory copy() {
return new SelectiveMemory(this);
}
}
class SelectiveMemoryEffect extends OneShotEffect<SelectiveMemoryEffect> {
public SelectiveMemoryEffect() {
super(Outcome.Exile);
this.staticText = "Search your library for any number of nonland cards and exile them. Then shuffle your library";
}
public SelectiveMemoryEffect(final SelectiveMemoryEffect effect) {
super(effect);
}
@Override
public SelectiveMemoryEffect copy() {
return new SelectiveMemoryEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
TargetCardInLibrary target = new TargetCardInLibrary(0, Integer.MAX_VALUE, new FilterNonlandCard());
if (player.searchLibrary(target, game)) {
for (UUID targetId : target.getTargets()) {
Card card = player.getLibrary().remove(targetId, game);
if (card != null) {
card.moveToExile(null, "", source.getSourceId(), game);
}
}
}
player.getLibrary().shuffle();
return true;
}
return false;
}
}

View file

@ -0,0 +1,108 @@
/*
* 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.worldwake;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardsImpl;
import mage.game.Game;
import mage.players.Library;
import mage.players.Player;
/**
*
* @author North
*/
public class TreasureHunt extends CardImpl<TreasureHunt> {
public TreasureHunt(UUID ownerId) {
super(ownerId, 42, "Treasure Hunt", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{U}");
this.expansionSetCode = "WWK";
this.color.setBlue(true);
// Reveal cards from the top of your library until you reveal a nonland card, then put all cards revealed this way into your hand.
this.getSpellAbility().addEffect(new TreasureHuntEffect());
}
public TreasureHunt(final TreasureHunt card) {
super(card);
}
@Override
public TreasureHunt copy() {
return new TreasureHunt(this);
}
}
class TreasureHuntEffect extends OneShotEffect<TreasureHuntEffect> {
public TreasureHuntEffect() {
super(Outcome.DrawCard);
this.staticText = "Reveal cards from the top of your library until you reveal a nonland card, then put all cards revealed this way into your hand";
}
public TreasureHuntEffect(final TreasureHuntEffect effect) {
super(effect);
}
@Override
public TreasureHuntEffect copy() {
return new TreasureHuntEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null && player.getLibrary().size() > 0) {
CardsImpl cards = new CardsImpl();
Library library = player.getLibrary();
Card card = null;
do {
card = library.removeFromTop(game);
if (card != null) {
cards.add(card);
card.moveToZone(Zone.HAND, source.getId(), game, false);
}
} while (library.size() > 0 && card != null && card.getCardType().contains(CardType.LAND));
if (!cards.isEmpty()) {
player.revealCards("Treasure Hunt", cards, game);
}
return true;
}
return false;
}
}