Implemented Grozoth, Dementia Sliver, and Planewalker's Scorn, Fury, Favor, and Mirth.

This commit is contained in:
fireshoes 2015-08-20 22:42:12 -05:00
parent f49f9d1c18
commit e490a3445a
7 changed files with 822 additions and 110 deletions

View file

@ -1,111 +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.championsofkamigawa;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.SearchEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInLibrary;
/**
*
* @author Loki
*/
public class InameDeathAspect extends CardImpl {
public InameDeathAspect(UUID ownerId) {
super(ownerId, 118, "Iname, Death Aspect", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}{B}");
this.expansionSetCode = "CHK";
this.supertype.add("Legendary");
this.subtype.add("Spirit");
this.power = new MageInt(4);
this.toughness = new MageInt(4);
this.addAbility(new EntersBattlefieldTriggeredAbility(new InameDeathAspectEffect(), true));
}
public InameDeathAspect(final InameDeathAspect card) {
super(card);
}
@Override
public InameDeathAspect copy() {
return new InameDeathAspect(this);
}
}
class InameDeathAspectEffect extends SearchEffect {
private static final FilterCreatureCard filter = new FilterCreatureCard();
static {
filter.add(new SubtypePredicate("Spirit"));
}
public InameDeathAspectEffect() {
super(new TargetCardInLibrary(0, Integer.MAX_VALUE, filter), Outcome.Neutral);
staticText = "search your library for any number of Spirit cards and put them into your graveyard. If you do, shuffle your library";
}
public InameDeathAspectEffect(final InameDeathAspectEffect effect) {
super(effect);
}
@Override
public InameDeathAspectEffect copy() {
return new InameDeathAspectEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null && player.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
player.moveCards(new CardsImpl(target.getTargets()), Zone.LIBRARY, Zone.GRAVEYARD, source, game);
}
player.shuffleLibrary(game);
return true;
}
return false;
}
/*
* 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.championsofkamigawa;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.SearchEffect;
import mage.cards.CardImpl;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInLibrary;
/**
*
* @author Loki
*/
public class InameDeathAspect extends CardImpl {
public InameDeathAspect(UUID ownerId) {
super(ownerId, 118, "Iname, Death Aspect", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}{B}");
this.expansionSetCode = "CHK";
this.supertype.add("Legendary");
this.subtype.add("Spirit");
this.power = new MageInt(4);
this.toughness = new MageInt(4);
this.addAbility(new EntersBattlefieldTriggeredAbility(new InameDeathAspectEffect(), true));
}
public InameDeathAspect(final InameDeathAspect card) {
super(card);
}
@Override
public InameDeathAspect copy() {
return new InameDeathAspect(this);
}
}
class InameDeathAspectEffect extends SearchEffect {
private static final FilterCreatureCard filter = new FilterCreatureCard();
static {
filter.add(new SubtypePredicate("Spirit"));
}
public InameDeathAspectEffect() {
super(new TargetCardInLibrary(0, Integer.MAX_VALUE, filter), Outcome.Neutral);
staticText = "search your library for any number of Spirit cards and put them into your graveyard. If you do, shuffle your library";
}
public InameDeathAspectEffect(final InameDeathAspectEffect effect) {
super(effect);
}
@Override
public InameDeathAspectEffect copy() {
return new InameDeathAspectEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null && player.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
player.moveCards(new CardsImpl(target.getTargets()), Zone.LIBRARY, Zone.GRAVEYARD, source, game);
}
player.shuffleLibrary(game);
return true;
}
return false;
}
}

View file

@ -0,0 +1,117 @@
/*
* 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.planeshift;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
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.game.Game;
import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetCreaturePermanent;
import mage.target.common.TargetOpponent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author fireshoes
*/
public class PlaneswalkersFavor extends CardImpl {
public PlaneswalkersFavor(UUID ownerId) {
super(ownerId, 86, "Planeswalker's Favor", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}");
this.expansionSetCode = "PLS";
// {3}{G}: Target opponent reveals a card at random from his or her hand. Target creature gets +X/+X until end of turn, where X is the revealed card's converted mana cost.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PlaneswalkersFavorEffect(), new ManaCostsImpl("{3}{G}"));
Target target = new TargetOpponent();
ability.addTarget(target);
target = new TargetCreaturePermanent();
ability.addTarget(target);
this.addAbility(ability);
}
public PlaneswalkersFavor(final PlaneswalkersFavor card) {
super(card);
}
@Override
public PlaneswalkersFavor copy() {
return new PlaneswalkersFavor(this);
}
}
class PlaneswalkersFavorEffect extends OneShotEffect {
public PlaneswalkersFavorEffect() {
super(Outcome.Damage);
staticText = "Target opponent reveals a card at random from his or her hand. Target creature gets +X/+X until end of turn, where X is the revealed card's converted mana cost";
}
public PlaneswalkersFavorEffect(final PlaneswalkersFavorEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player opponent = game.getPlayer(source.getTargets().get(0).getFirstTarget());
if (opponent != null && opponent.getHand().size() > 0) {
Cards revealed = new CardsImpl();
Card card = opponent.getHand().getRandom(game);
if (card != null) {
revealed.add(card);
int boostValue = card.getManaCost().convertedManaCost();
opponent.revealCards("Planeswalker's Favor", revealed, game);
ContinuousEffect effect = new BoostTargetEffect(boostValue, boostValue, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(source.getTargets().get(1).getFirstTarget()));
game.addEffect(effect, source);
}
return true;
}
return false;
}
@Override
public PlaneswalkersFavorEffect copy() {
return new PlaneswalkersFavorEffect(this);
}
}

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.planeshift;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
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.common.TargetOpponent;
/**
*
* @author fireshoes
*/
public class PlaneswalkersFury extends CardImpl {
public PlaneswalkersFury(UUID ownerId) {
super(ownerId, 70, "Planeswalker's Fury", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}");
this.expansionSetCode = "PLS";
// {3}{R}: Target opponent reveals a card at random from his or her hand. Planeswalker's Fury deals damage equal to that card's converted mana cost to that player. Activate this ability only any time you could cast a sorcery.
Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new PlaneswalkersFuryEffect(), new ManaCostsImpl("{3}{R}"));
ability.addTarget(new TargetOpponent());
this.addAbility(ability);
}
public PlaneswalkersFury(final PlaneswalkersFury card) {
super(card);
}
@Override
public PlaneswalkersFury copy() {
return new PlaneswalkersFury(this);
}
}
class PlaneswalkersFuryEffect extends OneShotEffect {
public PlaneswalkersFuryEffect() {
super(Outcome.Damage);
staticText = "Target opponent reveals a card at random from his or her hand. Planeswalker's Fury deals damage equal to that card's converted mana cost to that player";
}
public PlaneswalkersFuryEffect(final PlaneswalkersFuryEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player opponent = game.getPlayer(targetPointer.getFirst(game, source));
if (opponent != null && opponent.getHand().size() > 0) {
Cards revealed = new CardsImpl();
Card card = opponent.getHand().getRandom(game);
if (card != null) {
revealed.add(card);
opponent.revealCards("Planeswalker's Fury", revealed, game);
opponent.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true);
}
return true;
}
return false;
}
@Override
public PlaneswalkersFuryEffect copy() {
return new PlaneswalkersFuryEffect(this);
}
}

View file

@ -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.planeshift;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
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.common.TargetOpponent;
/**
*
* @author fireshoes
*/
public class PlaneswalkersMirth extends CardImpl {
public PlaneswalkersMirth(UUID ownerId) {
super(ownerId, 12, "Planeswalker's Mirth", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
this.expansionSetCode = "PLS";
// {3}{W}: Target opponent reveals a card at random from his or her hand. You gain life equal to that card's converted mana cost.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PlaneswalkersMirthEffect(), new ManaCostsImpl("{3}{W}"));
ability.addTarget(new TargetOpponent());
this.addAbility(ability);
}
public PlaneswalkersMirth(final PlaneswalkersMirth card) {
super(card);
}
@Override
public PlaneswalkersMirth copy() {
return new PlaneswalkersMirth(this);
}
}
class PlaneswalkersMirthEffect extends OneShotEffect {
public PlaneswalkersMirthEffect() {
super(Outcome.Damage);
staticText = "Target opponent reveals a card at random from his or her hand. You gain life equal to that card's converted mana cost";
}
public PlaneswalkersMirthEffect(final PlaneswalkersMirthEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player opponent = game.getPlayer(targetPointer.getFirst(game, source));
Player player = game.getPlayer(source.getControllerId());
if (opponent != null && player!= null && opponent.getHand().size() > 0) {
Cards revealed = new CardsImpl();
Card card = opponent.getHand().getRandom(game);
if (card != null) {
revealed.add(card);
opponent.revealCards("Planeswalker's Mirth", revealed, game);
player.gainLife(card.getManaCost().convertedManaCost(), game);
}
return true;
}
return false;
}
@Override
public PlaneswalkersMirthEffect copy() {
return new PlaneswalkersMirthEffect(this);
}
}

View file

@ -0,0 +1,117 @@
/*
* 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.planeshift;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
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.game.Game;
import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetCreaturePermanent;
import mage.target.common.TargetOpponent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author fireshoes
*/
public class PlaneswalkersScorn extends CardImpl {
public PlaneswalkersScorn(UUID ownerId) {
super(ownerId, 52, "Planeswalker's Scorn", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}");
this.expansionSetCode = "PLS";
// {3}{B}: Target opponent reveals a card at random from his or her hand. Target creature gets -X/-X until end of turn, where X is the revealed card's converted mana cost. Activate this ability only any time you could cast a sorcery.
Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new PlaneswalkersScornEffect(), new ManaCostsImpl("{3}{B}"));
Target target = new TargetOpponent();
ability.addTarget(target);
target = new TargetCreaturePermanent();
ability.addTarget(target);
this.addAbility(ability);
}
public PlaneswalkersScorn(final PlaneswalkersScorn card) {
super(card);
}
@Override
public PlaneswalkersScorn copy() {
return new PlaneswalkersScorn(this);
}
}
class PlaneswalkersScornEffect extends OneShotEffect {
public PlaneswalkersScornEffect() {
super(Outcome.Damage);
staticText = "Target opponent reveals a card at random from his or her hand. Target creature gets -X/-X until end of turn, where X is the revealed card's converted mana cost";
}
public PlaneswalkersScornEffect(final PlaneswalkersScornEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player opponent = game.getPlayer(source.getTargets().get(0).getFirstTarget());
if (opponent != null && opponent.getHand().size() > 0) {
Cards revealed = new CardsImpl();
Card card = opponent.getHand().getRandom(game);
if (card != null) {
revealed.add(card);
int boostValue = -1 * card.getManaCost().convertedManaCost();
opponent.revealCards("Planeswalker's Scorn", revealed, game);
ContinuousEffect effect = new BoostTargetEffect(boostValue, boostValue, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(source.getTargets().get(1).getFirstTarget()));
game.addEffect(effect, source);
}
return true;
}
return false;
}
@Override
public PlaneswalkersScornEffect copy() {
return new PlaneswalkersScornEffect(this);
}
}

View file

@ -0,0 +1,138 @@
/*
* 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.ravnica;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.SearchEffect;
import mage.abilities.effects.common.continuous.LoseAbilitySourceEffect;
import mage.abilities.keyword.DefenderAbility;
import mage.abilities.keyword.TransmuteAbility;
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.Filter;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInLibrary;
/**
*
* @author fireshoes
*/
public class Grozoth extends CardImpl {
public Grozoth(UUID ownerId) {
super(ownerId, 53, "Grozoth", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{U}{U}{U}");
this.expansionSetCode = "RAV";
this.subtype.add("Leviathan");
this.power = new MageInt(9);
this.toughness = new MageInt(9);
// Defender
this.addAbility(DefenderAbility.getInstance());
// When Grozoth enters the battlefield, you may search your library for any number of cards that have converted mana cost 9, reveal them, and put them into your hand. If you do, shuffle your library.
this.addAbility(new EntersBattlefieldTriggeredAbility(new GrozothEffect(), true));
// {4}: Grozoth loses defender until end of turn.
this.addAbility(new SimpleActivatedAbility(
Zone.BATTLEFIELD,
new LoseAbilitySourceEffect(DefenderAbility.getInstance(), Duration.EndOfTurn),
new ManaCostsImpl("{4}")));
// Transmute {1}{U}{U}
this.addAbility(new TransmuteAbility("{1}{U}{U}"));
}
public Grozoth(final Grozoth card) {
super(card);
}
@Override
public Grozoth copy() {
return new Grozoth(this);
}
}
class GrozothEffect extends SearchEffect {
private static final FilterCard filter = new FilterCard();
static {
filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, 9));
}
public GrozothEffect() {
super(new TargetCardInLibrary(0, Integer.MAX_VALUE, filter), Outcome.DrawCard);
staticText = "you may search your library for any number of cards that have converted mana cost 9, reveal them, and put them into your hand. If you do, shuffle your library";
}
public GrozothEffect(final GrozothEffect effect) {
super(effect);
}
@Override
public GrozothEffect copy() {
return new GrozothEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Card sourceCard = game.getCard(source.getSourceId());
if (sourceCard != null && player != null && player.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
Cards cards = new CardsImpl();
for (UUID cardId : target.getTargets()) {
Card card = player.getLibrary().remove(cardId, game);
if (card != null) {
cards.add(card);
}
}
player.revealCards(sourceCard.getIdName(), cards, game);
player.moveCards(cards, Zone.LIBRARY, Zone.HAND, source, game);
}
player.shuffleLibrary(game);
return true;
}
return false;
}
}

View file

@ -0,0 +1,132 @@
/*
* 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.timespiral;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.ActivateIfConditionActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.MyTurnCondition;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.NameACardEffect;
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
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.FilterPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetOpponent;
/**
*
* @author fireshoes
*/
public class DementiaSliver extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent("All Slivers");
static {
filter.add(new SubtypePredicate("Sliver"));
}
public DementiaSliver(UUID ownerId) {
super(ownerId, 236, "Dementia Sliver", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}{B}");
this.expansionSetCode = "TSP";
this.subtype.add("Sliver");
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// All Slivers have "{tap}: Name a card. Target opponent reveals a card at random from his or her hand. If it's the named card, that player discards it. Activate this ability only during your turn."
Ability gainedAbility = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new NameACardEffect(NameACardEffect.TypeOfName.ALL), new TapSourceCost(), MyTurnCondition.getInstance());
gainedAbility.addEffect(new DementiaSliverEffect());
gainedAbility.addTarget(new TargetOpponent());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityAllEffect(gainedAbility, Duration.WhileOnBattlefield, filter,
"All Slivers have \"{tap}: Name a card. Target opponent reveals a card at random from his or her hand. If it's the named card, that player discards it\"")));
}
public DementiaSliver(final DementiaSliver card) {
super(card);
}
@Override
public DementiaSliver copy() {
return new DementiaSliver(this);
}
}
class DementiaSliverEffect extends OneShotEffect {
public DementiaSliverEffect() {
super(Outcome.Damage);
staticText = "Target opponent reveals a card at random from his or her hand. If it's the named card, that player discards it";
}
public DementiaSliverEffect(final DementiaSliverEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player opponent = game.getPlayer(targetPointer.getFirst(game, source));
MageObject sourceObject = game.getObject(source.getSourceId());
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
if (opponent != null && sourceObject != null && !cardName.isEmpty()) {
if (opponent.getHand().size() > 0) {
Cards revealed = new CardsImpl();
Card card = opponent.getHand().getRandom(game);
if (card != null) {
revealed.add(card);
opponent.revealCards(sourceObject.getName(), revealed, game);
if (card.getName().equals(cardName)) {
opponent.discard(card, source, game);
}
}
}
return true;
}
return false;
}
@Override
public DementiaSliverEffect copy() {
return new DementiaSliverEffect(this);
}
}