Added Experiment Kraj, Odds // Ends, Storage Matrix, Shadow of Doubt, Kami of the Cresent Moon, Living End.

This commit is contained in:
LevelX2 2013-06-03 19:26:46 +02:00
parent a035966608
commit 683faab355
7 changed files with 744 additions and 0 deletions

View file

@ -0,0 +1,129 @@
/*
* 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.dissension;
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.MageInt;
import mage.abilities.Ability;
import mage.abilities.ActivatedAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.filter.predicate.permanent.CounterPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX2
*/
public class ExperimentKraj extends CardImpl<ExperimentKraj> {
public ExperimentKraj(UUID ownerId) {
super(ownerId, 110, "Experiment Kraj", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}{G}{U}{U}");
this.expansionSetCode = "DIS";
this.supertype.add("Legendary");
this.subtype.add("Ooze");
this.subtype.add("Mutant");
this.color.setBlue(true);
this.color.setGreen(true);
this.power = new MageInt(4);
this.toughness = new MageInt(6);
// Experiment Kraj has all activated abilities of each other creature with a +1/+1 counter on it.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ExperimentKrajEffect()));
// {tap}: Put a +1/+1 counter on target creature.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P1P1.createInstance()),new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent(true));
this.addAbility(ability);
}
public ExperimentKraj(final ExperimentKraj card) {
super(card);
}
@Override
public ExperimentKraj copy() {
return new ExperimentKraj(this);
}
}
class ExperimentKrajEffect extends ContinuousEffectImpl<ExperimentKrajEffect> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
static {
filter.add(new CounterPredicate(CounterType.P1P1));
filter.add(new AnotherPredicate());
}
public ExperimentKrajEffect() {
super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
staticText = "{this} has all activated abilities of each other creature with a +1/+1 counter on it";
}
public ExperimentKrajEffect(final ExperimentKrajEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent perm = game.getPermanent(source.getSourceId());
if (perm != null) {
for (Permanent creature :game.getState().getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)){
for (Ability ability: creature.getAbilities()) {
if (ability instanceof ActivatedAbility) {
perm.addAbility(ability, source.getSourceId(), game);
}
}
}
}
return true;
}
@Override
public ExperimentKrajEffect copy() {
return new ExperimentKrajEffect(this);
}
}

View file

@ -0,0 +1,129 @@
/*
* 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.dissension;
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.CopyTargetSpellEffect;
import mage.abilities.effects.common.SacrificeEffect;
import mage.cards.SplitCard;
import mage.filter.FilterSpell;
import mage.filter.common.FilterAttackingCreature;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetPlayer;
import mage.target.TargetSpell;
/**
*
* @author LevelX2
*/
public class OddsEnds extends SplitCard<OddsEnds> {
private static final FilterSpell filter = new FilterSpell("instant or sorcery spell");
static {
filter.add(Predicates.or(
new CardTypePredicate(CardType.INSTANT),
new CardTypePredicate(CardType.SORCERY)));
}
public OddsEnds(UUID ownerId) {
super(ownerId, 153, "Odds", "Ends", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{U}{R}", "{3}{R}{W}", false);
this.expansionSetCode = "DIS";
this.color.setBlue(true);
this.color.setRed(true);
this.color.setWhite(true);
// Odds
// Flip a coin. If it comes up heads, counter target instant or sorcery spell. If it comes up tails, copy that spell and you may choose new targets for the copy.
getLeftHalfCard().getColor().setBlue(true);
getLeftHalfCard().getColor().setRed(true);
getLeftHalfCard().getSpellAbility().addEffect(new OddsEffect());
getLeftHalfCard().getSpellAbility().addTarget(new TargetSpell(filter));
// Ends
// Target player sacrifices two attacking creatures.
getRightHalfCard().getColor().setRed(true);
getRightHalfCard().getColor().setWhite(true);
getRightHalfCard().getSpellAbility().addEffect(new SacrificeEffect(new FilterAttackingCreature(), 2, "Target player"));
getRightHalfCard().getSpellAbility().addTarget(new TargetPlayer());
}
public OddsEnds(final OddsEnds card) {
super(card);
}
@Override
public OddsEnds copy() {
return new OddsEnds(this);
}
}
class OddsEffect extends OneShotEffect<OddsEffect> {
public OddsEffect() {
super(Outcome.Benefit);
this.staticText = "Flip a coin. If it comes up heads, counter target instant or sorcery spell. If it comes up tails, copy that spell and you may choose new targets for the copy";
}
public OddsEffect(final OddsEffect effect) {
super(effect);
}
@Override
public OddsEffect copy() {
return new OddsEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
if (controller.flipCoin(game)) {
game.informPlayers("Odds: Spell countered");
return game.getStack().counter(getTargetPointer().getFirst(game, source), source.getSourceId(), game);
} else {
game.informPlayers("Odds: Spell will be copied");
return new CopyTargetSpellEffect().apply(game, source);
}
}
return false;
}
}

View file

@ -0,0 +1,143 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.ninthedition;
import java.util.HashSet;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.PhaseStep;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.RestrictionEffect;
import mage.cards.CardImpl;
import mage.choices.Choice;
import mage.choices.ChoiceImpl;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author LevelX2
*/
public class StorageMatrix extends CardImpl<StorageMatrix> {
public StorageMatrix(UUID ownerId) {
super(ownerId, 310, "Storage Matrix", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}");
this.expansionSetCode = "9ED";
// As long as Storage Matrix is untapped, each player chooses artifact, creature, or land during his or her untap step. That player can untap only permanents of the chosen type this step.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new StorageMatrixRestrictionEffect()));
}
public StorageMatrix(final StorageMatrix card) {
super(card);
}
@Override
public StorageMatrix copy() {
return new StorageMatrix(this);
}
}
class StorageMatrixRestrictionEffect extends RestrictionEffect<StorageMatrixRestrictionEffect> {
private int turn;
private boolean applies;
private static final HashSet<String> choice = new HashSet<String>();
static{
choice.add(CardType.ARTIFACT.toString());
choice.add(CardType.CREATURE.toString());
choice.add(CardType.LAND.toString());
}
private CardType type;
public StorageMatrixRestrictionEffect() {
super(Duration.WhileOnBattlefield);
staticText = "As long as Storage Matrix is untapped, each player chooses artifact, creature, or land during his or her untap step. That player can untap only permanents of the chosen type this step";
}
public StorageMatrixRestrictionEffect(final StorageMatrixRestrictionEffect effect) {
super(effect);
this.type = effect.type;
this.turn = effect.turn;
this.applies = effect.applies;
}
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
if (game.getStep().getType() == PhaseStep.UNTAP) {
if (game.getTurnNum() != turn) {
turn = game.getTurnNum();
applies = false;
Permanent storageMatrix = game.getPermanent(source.getSourceId());
if (storageMatrix != null && !storageMatrix.isTapped()) {
Choice choiceImpl = new ChoiceImpl();
choiceImpl.setMessage("Untap which kind of permanent?");
choiceImpl.setChoices(choice);
Player player = game.getPlayer(game.getActivePlayerId());
if(player != null){
while(!player.choose(outcome, choiceImpl, game)) {
// player has to choose
}
String choosenType = choiceImpl.getChoice();
game.informPlayers(new StringBuilder(storageMatrix.getName()).append(": ").append(player.getName()).append(" chose to untap ").append(choosenType).toString());
if(choosenType.equals(CardType.ARTIFACT.toString())){
type = CardType.ARTIFACT;
}else if(choosenType.equals(CardType.LAND.toString())){
type = CardType.LAND;
}else{
type = CardType.CREATURE;
}
applies = true;
}
}
}
if (applies) {
return !permanent.getCardType().contains(type);
}
}
return false;
}
@Override
public boolean canBeUntapped(Permanent permanent, Game game) {
return false;
}
@Override
public StorageMatrixRestrictionEffect copy() {
return new StorageMatrixRestrictionEffect(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.ravnika;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.game.events.GameEvent;
/**
*
* @author LevelX2
*/
public class ShadowOfDoubt extends CardImpl<ShadowOfDoubt> {
public ShadowOfDoubt(UUID ownerId) {
super(ownerId, 253, "Shadow of Doubt", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{U/B}{U/B}");
this.expansionSetCode = "RAV";
this.color.setBlue(true);
this.color.setBlack(true);
// <i>({UB} can be paid with either {U} or {B}.)</i>
// Players can't search libraries this turn.
this.getSpellAbility().addEffect(new LibrariesCantBeSearchedEffect());
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardControllerEffect(1));
}
public ShadowOfDoubt(final ShadowOfDoubt card) {
super(card);
}
@Override
public ShadowOfDoubt copy() {
return new ShadowOfDoubt(this);
}
}
class LibrariesCantBeSearchedEffect extends ReplacementEffectImpl<LibrariesCantBeSearchedEffect> {
public LibrariesCantBeSearchedEffect() {
super(Duration.EndOfTurn, Outcome.Benefit);
staticText = "Players can't search libraries this turn";
}
public LibrariesCantBeSearchedEffect(final LibrariesCantBeSearchedEffect effect) {
super(effect);
}
@Override
public LibrariesCantBeSearchedEffect copy() {
return new LibrariesCantBeSearchedEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
return true;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (event.getType() == GameEvent.EventType.SEARCH_LIBRARY) {
return true;
}
return false;
}
}

View file

@ -0,0 +1,67 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.saviorsofkamigawa;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.TargetController;
import mage.MageInt;
import mage.abilities.common.BeginningOfDrawTriggeredAbility;
import mage.abilities.effects.common.DrawCardTargetEffect;
import mage.cards.CardImpl;
/**
*
* @author LevelX2
*/
public class KamiOfTheCrescentMoon extends CardImpl<KamiOfTheCrescentMoon> {
public KamiOfTheCrescentMoon(UUID ownerId) {
super(ownerId, 42, "Kami of the Crescent Moon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{U}{U}");
this.expansionSetCode = "SOK";
this.supertype.add("Legendary");
this.subtype.add("Spirit");
this.color.setBlue(true);
this.power = new MageInt(1);
this.toughness = new MageInt(3);
// At the beginning of each player's draw step, that player draws an additional card.
this.addAbility(new BeginningOfDrawTriggeredAbility(new DrawCardTargetEffect(1), TargetController.ANY, false));
}
public KamiOfTheCrescentMoon(final KamiOfTheCrescentMoon card) {
super(card);
}
@Override
public KamiOfTheCrescentMoon copy() {
return new KamiOfTheCrescentMoon(this);
}
}

View file

@ -0,0 +1,119 @@
/*
* 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.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.SacrificeAllEffect;
import mage.abilities.keyword.SuspendAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreatureCard;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author LevelX2
*/
public class LivingEnd extends CardImpl<LivingEnd> {
public LivingEnd(UUID ownerId) {
super(ownerId, 115, "Living End", Rarity.RARE, new CardType[]{CardType.SORCERY}, "");
this.expansionSetCode = "TSP";
this.color.isBlack();
// Suspend 3-{2}{B}{B}
this.addAbility(new SuspendAbility(3, new ManaCostsImpl("{2}{B}{B}"), this));
// Each player exiles all creature cards from his or her graveyard, then sacrifices all creatures he or she controls, then puts all cards he or she onto the battlefield.
this.getSpellAbility().addEffect(new LivingEndEffect());
}
public LivingEnd(final LivingEnd card) {
super(card);
}
@Override
public LivingEnd copy() {
return new LivingEnd(this);
}
}
class LivingEndEffect extends OneShotEffect<LivingEndEffect> {
public LivingEndEffect() {
super(Outcome.Benefit);
this.staticText = "Each player exiles all creature cards from his or her graveyard, then sacrifices all creatures he or she controls, then puts all cards he or she exiled this way onto the battlefield";
}
public LivingEndEffect(final LivingEndEffect effect) {
super(effect);
}
@Override
public LivingEndEffect copy() {
return new LivingEndEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
// move creature cards from graveyard to exile
for (UUID playerId: controller.getInRange()){
Player player = game.getPlayer(playerId);
if (player != null) {
for (Card card :player.getGraveyard().getCards(new FilterCreatureCard(), game)) {
card.moveToExile(source.getSourceId(), "Living End", source.getSourceId(), game);
}
}
}
// sacrifice all creatures
for (Permanent permanent :game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) {
permanent.sacrifice(source.getSourceId(), game);
}
// put exiled cards to battlefield
for (Card card : game.getState().getExile().getExileZone(source.getSourceId()).getCards(game)) {
card.putOntoBattlefield(game, Zone.EXILED, source.getSourceId(), card.getOwnerId());
}
return true;
}
return false;
}
}

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.urzasdestiny;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public class StorageMatrix extends mage.sets.ninthedition.StorageMatrix {
public StorageMatrix(UUID ownerId) {
super(ownerId);
this.cardNumber = 138;
this.expansionSetCode = "UDS";
}
public StorageMatrix(final StorageMatrix card) {
super(card);
}
@Override
public StorageMatrix copy() {
return new StorageMatrix(this);
}
}