[ORI] Added 6 black cards.

This commit is contained in:
LevelX2 2015-06-30 01:24:51 +02:00
parent 0ee0ba3a95
commit 123d1e4ec6
20 changed files with 1005 additions and 232 deletions

View file

@ -28,11 +28,11 @@
package mage.sets.magic2015;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.effects.common.search.SearchTargetGraveyardHandLibraryForCardNameAndExileEffect;
import mage.abilities.keyword.ConvokeAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.repository.CardRepository;
import mage.choices.Choice;
@ -54,7 +54,6 @@ public class StainTheMind extends CardImpl {
super(ownerId, 117, "Stain the Mind", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{B}");
this.expansionSetCode = "M15";
// Convoke
this.addAbility(new ConvokeAbility());
// Name a nonland card. Search target player's graveyard, hand, and library for any number of card's with that name and exile them. Then that player shuffles his or her library.
@ -75,7 +74,7 @@ public class StainTheMind extends CardImpl {
class StainTheMindEffect extends SearchTargetGraveyardHandLibraryForCardNameAndExileEffect {
public StainTheMindEffect() {
super(true, "target player's","any number of cards with that name");
super(true, "target player's", "any number of cards with that name");
}
public StainTheMindEffect(final StainTheMindEffect effect) {
@ -99,9 +98,9 @@ class StainTheMindEffect extends SearchTargetGraveyardHandLibraryForCardNameAndE
}
String cardName;
cardName = cardChoice.getChoice();
Card card = game.getCard(source.getSourceId());
if (card != null) {
game.informPlayers(card.getName()+"named card: [" + cardName + "]");
MageObject sourceObject = game.getObject(source.getSourceId());
if (sourceObject != null) {
game.informPlayers(sourceObject.getName() + " named card: [" + cardName + "]");
}
super.applySearchAndExile(game, source, cardName, player.getId());

View file

@ -0,0 +1,70 @@
/*
* 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.magicorigins;
import java.util.UUID;
import mage.Mana;
import mage.abilities.condition.common.SpellMasteryCondition;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AddManaToManaPoolSourceControllerEffect;
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.target.common.TargetCardInLibrary;
/**
*
* @author LevelX2
*/
public class DarkPetition extends CardImpl {
public DarkPetition(UUID ownerId) {
super(ownerId, 90, "Dark Petition", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{B}{B}");
this.expansionSetCode = "ORI";
// Search your library for a card and put that card into your hand. Then shuffle your library.
this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary()));
// <i>Spell mastery</i> - If there are two or more instant and/or sorcery cards in your graveyard, add {B}{B}{B} to your mana pool.
Effect effect = new ConditionalOneShotEffect(new AddManaToManaPoolSourceControllerEffect(Mana.BlackMana(3)),
SpellMasteryCondition.getInstance(), "<br><i>Spell mastery</i> - If there are two or more instant and/or sorcery cards in your graveyard, add {B}{B}{B} to your mana pool");
this.getSpellAbility().addEffect(effect);
}
public DarkPetition(final DarkPetition card) {
super(card);
}
@Override
public DarkPetition copy() {
return new DarkPetition(this);
}
}

View file

@ -0,0 +1,94 @@
/*
* 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.magicorigins;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.LoseGameSourceControllerEffect;
import mage.abilities.effects.common.discard.DiscardTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.target.common.TargetCreatureOrPlayer;
import mage.target.common.TargetOpponent;
/**
*
* @author LevelX2
*/
public class DemonicPact extends CardImpl {
public DemonicPact(UUID ownerId) {
super(ownerId, 92, "Demonic Pact", Rarity.MYTHIC, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}");
this.expansionSetCode = "ORI";
// At the beginning of your upkeep, choose one that hasn't been chosen
// - Demonic Pact deals 4 damage to target creature or player and you gain 4 life;
Ability ability = new BeginningOfUpkeepTriggeredAbility(new DamageTargetEffect(4), TargetController.YOU, false);
ability.getModes().setEachModeOnlyOnce(true);
ability.addTarget(new TargetCreatureOrPlayer());
Effect effect = new GainLifeEffect(4);
effect.setText("and you gain 4 life");
ability.addEffect(effect);
// - Target opponent discards two cards
Mode mode = new Mode();
mode.getTargets().add(new TargetOpponent());
mode.getEffects().add(new DiscardTargetEffect(2));
ability.addMode(mode);
// - Draw two cards
mode = new Mode();
mode.getEffects().add(new DrawCardSourceControllerEffect(2));
ability.addMode(mode);
// - You lose the game.
mode = new Mode();
mode.getEffects().add(new LoseGameSourceControllerEffect());
ability.addMode(mode);
this.addAbility(ability);
}
public DemonicPact(final DemonicPact card) {
super(card);
}
@Override
public DemonicPact copy() {
return new DemonicPact(this);
}
}

View file

@ -0,0 +1,101 @@
/*
* 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.magicorigins;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.DeathtouchAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author LevelX2
*/
public class FuneralBladePredator extends CardImpl {
public FuneralBladePredator(UUID ownerId) {
super(ownerId, 101, "Funeral-Blade Predator", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}");
this.expansionSetCode = "ORI";
this.subtype.add("Human");
this.subtype.add("Warrior");
this.power = new MageInt(1);
this.toughness = new MageInt(4);
// Deathtouch
this.addAbility(DeathtouchAbility.getInstance());
// Whenever Funeral-Blade Predator deals combat damage to a player, that player loses life equal to the number of creature cards in your graveyard.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new FuneralBladePredatorEffect(), false, true));
}
public FuneralBladePredator(final FuneralBladePredator card) {
super(card);
}
@Override
public FuneralBladePredator copy() {
return new FuneralBladePredator(this);
}
}
class FuneralBladePredatorEffect extends OneShotEffect {
public FuneralBladePredatorEffect() {
super(Outcome.LoseLife);
this.staticText = "that player loses life equal to the number of creature cards in your graveyard";
}
public FuneralBladePredatorEffect(final FuneralBladePredatorEffect effect) {
super(effect);
}
@Override
public FuneralBladePredatorEffect copy() {
return new FuneralBladePredatorEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source));
Player controller = game.getPlayer(source.getControllerId());
if (targetPlayer != null && controller != null) {
targetPlayer.loseLife(controller.getGraveyard().count(new FilterCreatureCard(), game), game);
return true;
}
return false;
}
}

View file

@ -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.magicorigins;
import java.util.UUID;
import mage.ConditionalMana;
import mage.MageInt;
import mage.MageObject;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.PayLifeCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.DeathtouchAbility;
import mage.abilities.mana.ConditionalColoredManaAbility;
import mage.abilities.mana.builder.ConditionalManaBuilder;
import mage.abilities.mana.conditional.CreatureCastManaCondition;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.AttackingPredicate;
import mage.game.Game;
import mage.target.common.TargetControlledCreaturePermanent;
/**
*
* @author LevelX2
*/
public class GnarlrootTrapper extends CardImpl {
private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("attacking ELf you control");
static {
filter.add(new AttackingPredicate());
filter.add(new SubtypePredicate("Elf"));
}
public GnarlrootTrapper(UUID ownerId) {
super(ownerId, 100, "Gnarlroot Trapper", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{B}");
this.expansionSetCode = "ORI";
this.subtype.add("Elf");
this.subtype.add("Druid");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// {T}, Pay 1 life: Add {G} to your mana pool. Spend this mana only to cast an Elf creature spell.
Ability ability = new ConditionalColoredManaAbility(new TapSourceCost(), Mana.GreenMana(1), new GnarlrootTrapperManaBuilder());
ability.addCost(new PayLifeCost(1));
this.addAbility(ability);
// {T}: Target attacking Elf you control gains deathtouch until end of turn.
Effect effect = new GainAbilityTargetEffect(DeathtouchAbility.getInstance(), Duration.EndOfTurn);
effect.setText("Target attacking Elf you control gains deathtouch until end of turn. <i>(Any amount of damage it deals to a creature is enough to destroy it.)</i>");
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost());
ability.addTarget(new TargetControlledCreaturePermanent(filter));
this.addAbility(ability);
}
public GnarlrootTrapper(final GnarlrootTrapper card) {
super(card);
}
@Override
public GnarlrootTrapper copy() {
return new GnarlrootTrapper(this);
}
}
class GnarlrootTrapperManaBuilder extends ConditionalManaBuilder {
@Override
public ConditionalMana build(Object... options) {
return new GnarlrootTrapperConditionalMana(this.mana);
}
@Override
public String getRule() {
return "Spend this mana only to cast an Elf creature spell.";
}
}
class GnarlrootTrapperManaCondition extends CreatureCastManaCondition {
@Override
public boolean apply(Game game, Ability source) {
if (super.apply(game, source)) {
MageObject object = game.getObject(source.getSourceId());
if (object.hasSubtype("Elf")
&& object.getCardType().contains(CardType.CREATURE)) {
return true;
}
}
return false;
}
}
class GnarlrootTrapperConditionalMana extends ConditionalMana {
public GnarlrootTrapperConditionalMana(Mana mana) {
super(mana);
addCondition(new GnarlrootTrapperManaCondition());
}
}

View file

@ -0,0 +1,86 @@
/*
* 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.magicorigins;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.constants.AttachmentType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX2
*/
public class InfernalScarring extends CardImpl {
public InfernalScarring(UUID ownerId) {
super(ownerId, 102, "Infernal Scarring", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}");
this.expansionSetCode = "ORI";
this.subtype.add("Aura");
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted creature gets +2/+0 and has "When this creature dies, draw a card."
Effect effect = new BoostEnchantedEffect(2, 0, Duration.WhileOnBattlefield);
effect.setText("Enchanted creature gets +2/+0");
ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect);
effect = new GainAbilityAttachedEffect(new DiesTriggeredAbility(new DrawCardSourceControllerEffect(1)), AttachmentType.AURA, Duration.WhileOnBattlefield);
effect.setText("and has \"When this creature dies, draw a card.\"");
ability.addEffect(effect);
this.addAbility(ability);
}
public InfernalScarring(final InfernalScarring card) {
super(card);
}
@Override
public InfernalScarring copy() {
return new InfernalScarring(this);
}
}

View file

@ -0,0 +1,122 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magicorigins;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.effects.common.search.SearchTargetGraveyardHandLibraryForCardNameAndExileEffect;
import mage.cards.CardImpl;
import mage.cards.repository.CardRepository;
import mage.choices.Choice;
import mage.choices.ChoiceImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetOpponent;
/**
*
* @author LevelX2
*/
public class InfiniteObliteration extends CardImpl {
public InfiniteObliteration(UUID ownerId) {
super(ownerId, 103, "Infinite Obliteration", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{B}{B}");
this.expansionSetCode = "ORI";
// Name a creature card. Search target opponent's graveyard, hand, and library
// for any number of cards with that name and exile them. Then that player shuffles his or her library.
this.getSpellAbility().addEffect(new InfiniteObliterationEffect());
this.getSpellAbility().addTarget(new TargetOpponent());
}
public InfiniteObliteration(final InfiniteObliteration card) {
super(card);
}
@Override
public InfiniteObliteration copy() {
return new InfiniteObliteration(this);
}
}
class InfiniteObliterationEffect extends SearchTargetGraveyardHandLibraryForCardNameAndExileEffect {
public InfiniteObliterationEffect() {
super(true, "target opponent's", "any number of cards with that name");
}
public InfiniteObliterationEffect(final InfiniteObliterationEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
Player controller = game.getPlayer(source.getControllerId());
if (player != null && controller != null) {
Choice cardChoice = new ChoiceImpl();
cardChoice.setChoices(CardRepository.instance.getCreatureNames());
cardChoice.clearChoice();
cardChoice.setMessage("Name a creature card");
while (!controller.choose(Outcome.Exile, cardChoice, game)) {
if (!controller.isInGame()) {
return false;
}
}
String cardName;
cardName = cardChoice.getChoice();
MageObject sourceObject = game.getObject(source.getSourceId());
if (sourceObject != null) {
game.informPlayers(sourceObject.getName() + " named card: [" + cardName + "]");
}
super.applySearchAndExile(game, source, cardName, player.getId());
}
return true;
}
@Override
public InfiniteObliterationEffect copy() {
return new InfiniteObliterationEffect(this);
}
@Override
public String getText(Mode mode) {
StringBuilder sb = new StringBuilder();
sb.append("Name a creature card. ");
sb.append(super.getText(mode));
return sb.toString();
}
}

View file

@ -25,24 +25,23 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.returntoravnica;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CantBeCounteredSourceEffect;
import mage.abilities.effects.common.search.SearchTargetGraveyardHandLibraryForCardNameAndExileEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.repository.CardRepository;
import mage.choices.Choice;
import mage.choices.ChoiceImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
@ -54,15 +53,14 @@ import mage.target.common.TargetOpponent;
*/
public class SlaughterGames extends CardImpl {
public SlaughterGames (UUID ownerId) {
public SlaughterGames(UUID ownerId) {
super(ownerId, 197, "Slaughter Games", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{B}{R}");
this.expansionSetCode = "RTR";
// Slaughter Games can't be countered by spells or abilities.
Effect effect = new CantBeCounteredSourceEffect();
Effect effect = new CantBeCounteredSourceEffect();
effect.setText("{this} can't be countered by spells or abilities");
Ability ability = new SimpleStaticAbility(Zone.STACK,effect);
Ability ability = new SimpleStaticAbility(Zone.STACK, effect);
ability.setRuleAtTheTop(true);
this.addAbility(ability);
@ -72,7 +70,7 @@ public class SlaughterGames extends CardImpl {
}
public SlaughterGames (final SlaughterGames card) {
public SlaughterGames(final SlaughterGames card) {
super(card);
}
@ -85,7 +83,7 @@ public class SlaughterGames extends CardImpl {
class SlaughterGamesEffect extends SearchTargetGraveyardHandLibraryForCardNameAndExileEffect {
public SlaughterGamesEffect() {
super(true, "target opponent's","any number of cards with that name");
super(true, "target opponent's", "any number of cards with that name");
}
public SlaughterGamesEffect(final SlaughterGamesEffect effect) {
@ -109,9 +107,9 @@ class SlaughterGamesEffect extends SearchTargetGraveyardHandLibraryForCardNameAn
}
String cardName;
cardName = cardChoice.getChoice();
Card card = game.getCard(source.getSourceId());
if (card != null) {
game.informPlayers(card.getName()+"named card: [" + cardName + "]");
MageObject sourceObject = game.getObject(source.getSourceId());
if (sourceObject != null) {
game.informPlayers(sourceObject.getName() + " named card: [" + cardName + "]");
}
super.applySearchAndExile(game, source, cardName, player.getId());
@ -132,4 +130,4 @@ class SlaughterGamesEffect extends SearchTargetGraveyardHandLibraryForCardNameAn
return sb.toString();
}
}
}

View file

@ -1,16 +1,16 @@
/*
* Copyright 2011 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
@ -20,7 +20,7 @@
* 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.
@ -28,10 +28,7 @@
package mage.sets.scarsofmirrodin;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
@ -40,6 +37,10 @@ import mage.cards.CardsImpl;
import mage.cards.repository.CardRepository;
import mage.choices.Choice;
import mage.choices.ChoiceImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetPlayer;
@ -54,7 +55,6 @@ public class Memoricide extends CardImpl {
super(ownerId, 69, "Memoricide", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{B}");
this.expansionSetCode = "SOM";
// Name a nonland card. Search target player's graveyard, hand, and library for any number of cards with
// that name and exile them. Then that player shuffles his or her library
this.getSpellAbility().addTarget(new TargetPlayer());
@ -99,20 +99,23 @@ class MemoricideEffect extends OneShotEffect {
}
String cardName = cardChoice.getChoice();
game.informPlayers("Memoricide, named card: [" + cardName + "]");
for (Card card: player.getGraveyard().getCards(game)) {
MageObject sourceObject = game.getObject(source.getSourceId());
if (sourceObject != null) {
game.informPlayers(sourceObject.getName() + " named card: [" + cardName + "]");
}
for (Card card : player.getGraveyard().getCards(game)) {
if (card.getName().equals(cardName)) {
card.moveToExile(null, "", source.getSourceId(), game);
card.moveToExile(null, "", source.getSourceId(), game);
}
}
for (Card card: player.getHand().getCards(game)) {
for (Card card : player.getHand().getCards(game)) {
if (card.getName().equals(cardName)) {
card.moveToExile(null, "", source.getSourceId(), game);
card.moveToExile(null, "", source.getSourceId(), game);
}
}
for (Card card: player.getLibrary().getCards(game)) {
for (Card card : player.getLibrary().getCards(game)) {
if (card.getName().equals(cardName)) {
card.moveToExile(null, "", source.getSourceId(), game);
card.moveToExile(null, "", source.getSourceId(), game);
}
}
controller.lookAtCards("Memoricide Hand", player.getHand(), game);
@ -127,4 +130,4 @@ class MemoricideEffect extends OneShotEffect {
return new MemoricideEffect(this);
}
}
}