mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 13:19:18 -08:00
Added Epic Ability and add the 5 cards that use it. Did not get the chance to test it well due to some memory issues with the client/server.
This commit is contained in:
parent
e6f55d3b80
commit
1c2f0ae65d
7 changed files with 733 additions and 0 deletions
68
Mage.Sets/src/mage/sets/saviorsofkamigawa/EndlessSwarm.java
Normal file
68
Mage.Sets/src/mage/sets/saviorsofkamigawa/EndlessSwarm.java
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* 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.abilities.dynamicvalue.common.CardsInControllerHandCount;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.EpicEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.permanent.token.SnakeToken;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
||||
*/
|
||||
public class EndlessSwarm extends CardImpl<EndlessSwarm> {
|
||||
|
||||
public EndlessSwarm(UUID ownerId) {
|
||||
super(ownerId, 129, "Endless Swarm", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{G}");
|
||||
this.expansionSetCode = "SOK";
|
||||
|
||||
this.color.setGreen(true);
|
||||
|
||||
// Put a 1/1 green Snake creature token onto the battlefield for each card in your hand.
|
||||
this.getSpellAbility().addEffect(new CreateTokenEffect(new SnakeToken(), new CardsInControllerHandCount()));
|
||||
|
||||
// Epic
|
||||
this.getSpellAbility().addEffect(new EpicEffect());
|
||||
|
||||
}
|
||||
|
||||
public EndlessSwarm(final EndlessSwarm card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EndlessSwarm copy() {
|
||||
return new EndlessSwarm(this);
|
||||
}
|
||||
}
|
||||
114
Mage.Sets/src/mage/sets/saviorsofkamigawa/EnduringIdeal.java
Normal file
114
Mage.Sets/src/mage/sets/saviorsofkamigawa/EnduringIdeal.java
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
/*
|
||||
* 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.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.EpicEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
||||
*/
|
||||
public class EnduringIdeal extends CardImpl<EnduringIdeal> {
|
||||
|
||||
public EnduringIdeal(UUID ownerId) {
|
||||
super(ownerId, 9, "Enduring Ideal", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{W}");
|
||||
this.expansionSetCode = "SOK";
|
||||
|
||||
this.color.setWhite(true);
|
||||
|
||||
// Search your library for an enchantment card and put it onto the battlefield. Then shuffle your library.
|
||||
this.getSpellAbility().addEffect(new EnduringIdealEffect());
|
||||
|
||||
// Epic
|
||||
this.getSpellAbility().addEffect(new EpicEffect());
|
||||
|
||||
}
|
||||
|
||||
public EnduringIdeal(final EnduringIdeal card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnduringIdeal copy() {
|
||||
return new EnduringIdeal(this);
|
||||
}
|
||||
}
|
||||
|
||||
class EnduringIdealEffect extends OneShotEffect<EnduringIdealEffect> {
|
||||
|
||||
private static final FilterCard filter = new FilterCard();
|
||||
|
||||
static {
|
||||
filter.add(new CardTypePredicate(CardType.ENCHANTMENT));
|
||||
}
|
||||
|
||||
public EnduringIdealEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "Search your library for an enchantment card and put it onto the battlefield. Then shuffle your library";
|
||||
}
|
||||
|
||||
public EnduringIdealEffect(final EnduringIdealEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
boolean applied = false;
|
||||
Player you = game.getPlayer(source.getControllerId());
|
||||
if (you != null) {
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(filter);
|
||||
you.searchLibrary(target, game);
|
||||
Card targetCard = game.getCard(target.getFirstTarget());
|
||||
if (targetCard != null) {
|
||||
applied = targetCard.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), you.getId());
|
||||
}
|
||||
you.shuffleLibrary(game);
|
||||
}
|
||||
return applied;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnduringIdealEffect copy() {
|
||||
return new EnduringIdealEffect(this);
|
||||
}
|
||||
}
|
||||
122
Mage.Sets/src/mage/sets/saviorsofkamigawa/EternalDominion.java
Normal file
122
Mage.Sets/src/mage/sets/saviorsofkamigawa/EternalDominion.java
Normal 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.saviorsofkamigawa;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.EpicEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
import mage.target.common.TargetOpponent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*
|
||||
*/
|
||||
public class EternalDominion extends CardImpl<EternalDominion> {
|
||||
|
||||
public EternalDominion(UUID ownerId) {
|
||||
super(ownerId, 36, "Eternal Dominion", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{7}{U}{U}{U}");
|
||||
this.expansionSetCode = "SOK";
|
||||
|
||||
this.color.setBlue(true);
|
||||
|
||||
// Search target opponent's library for an artifact, creature, enchantment, or land card. Put that card onto the battlefield under your control. Then that player shuffles his or her library.
|
||||
this.getSpellAbility().addEffect(new EternalDominionEffect());
|
||||
this.getSpellAbility().addTarget(new TargetOpponent(true));
|
||||
|
||||
// Epic
|
||||
this.getSpellAbility().addEffect(new EpicEffect());
|
||||
|
||||
}
|
||||
|
||||
public EternalDominion(final EternalDominion card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EternalDominion copy() {
|
||||
return new EternalDominion(this);
|
||||
}
|
||||
}
|
||||
|
||||
class EternalDominionEffect extends OneShotEffect<EternalDominionEffect> {
|
||||
|
||||
private static final FilterCard filter = new FilterCard();
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT),
|
||||
new CardTypePredicate(CardType.CREATURE),
|
||||
new CardTypePredicate(CardType.ENCHANTMENT),
|
||||
new CardTypePredicate(CardType.LAND)));
|
||||
}
|
||||
|
||||
public EternalDominionEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "Search target opponent's library for an artifact, creature, enchantment, or land card. Put that card onto the battlefield under your control. Then that player shuffles his or her library";
|
||||
}
|
||||
|
||||
public EternalDominionEffect(final EternalDominionEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
boolean applied = false;
|
||||
Player opponent = game.getPlayer(source.getFirstTarget());
|
||||
Player you = game.getPlayer(source.getControllerId());
|
||||
if (opponent != null
|
||||
&& you != null) {
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(filter);
|
||||
you.searchLibrary(target, game, opponent.getId());
|
||||
Card targetCard = game.getCard(target.getFirstTarget());
|
||||
if (targetCard != null) {
|
||||
applied = targetCard.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), you.getId());
|
||||
}
|
||||
opponent.shuffleLibrary(game);
|
||||
}
|
||||
return applied;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EternalDominionEffect copy() {
|
||||
return new EternalDominionEffect(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
/*
|
||||
* 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.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.common.CardsInControllerHandCount;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.EpicEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*
|
||||
*/
|
||||
public class NeverendingTorment extends CardImpl<NeverendingTorment> {
|
||||
|
||||
public NeverendingTorment(UUID ownerId) {
|
||||
super(ownerId, 83, "Neverending Torment", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{B}");
|
||||
this.expansionSetCode = "SOK";
|
||||
|
||||
this.color.setBlack(true);
|
||||
|
||||
// Search target player's library for X cards, where X is the number of cards in your hand, and exile them. Then that player shuffles his or her library.
|
||||
this.getSpellAbility().addEffect(new NeverendingTormentEffect());
|
||||
this.getSpellAbility().addTarget(new TargetPlayer(true));
|
||||
|
||||
// Epic
|
||||
this.getSpellAbility().addEffect(new EpicEffect());
|
||||
}
|
||||
|
||||
public NeverendingTorment(final NeverendingTorment card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NeverendingTorment copy() {
|
||||
return new NeverendingTorment(this);
|
||||
}
|
||||
}
|
||||
|
||||
class NeverendingTormentEffect extends OneShotEffect<NeverendingTormentEffect> {
|
||||
|
||||
public NeverendingTormentEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "Search target player's library for X cards, where X is the number of cards in your hand, and exile them. Then that player shuffles his or her library";
|
||||
}
|
||||
|
||||
public NeverendingTormentEffect(final NeverendingTormentEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
UUID exileId = CardUtil.getCardExileZoneId(game, source);
|
||||
boolean applied = false;
|
||||
Player targetPlayer = game.getPlayer(source.getFirstTarget());
|
||||
Player you = game.getPlayer(source.getControllerId());
|
||||
if (targetPlayer != null
|
||||
&& you != null) {
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(new CardsInControllerHandCount().calculate(game, source), new FilterCard());
|
||||
you.searchLibrary(target, game, targetPlayer.getId());
|
||||
for (UUID cardId : target.getTargets()) {
|
||||
final Card targetCard = game.getCard(cardId);
|
||||
if (targetCard != null) {
|
||||
applied = targetCard.moveToExile(exileId, "Neverending Torment", source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
targetPlayer.shuffleLibrary(game);
|
||||
}
|
||||
return applied;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NeverendingTormentEffect copy() {
|
||||
return new NeverendingTormentEffect(this);
|
||||
}
|
||||
}
|
||||
125
Mage.Sets/src/mage/sets/saviorsofkamigawa/UndyingFlames.java
Normal file
125
Mage.Sets/src/mage/sets/saviorsofkamigawa/UndyingFlames.java
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
/*
|
||||
* 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.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.EpicEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
import mage.target.common.TargetCreatureOrPlayer;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*
|
||||
*/
|
||||
public class UndyingFlames extends CardImpl<UndyingFlames> {
|
||||
|
||||
public UndyingFlames(UUID ownerId) {
|
||||
super(ownerId, 119, "Undying Flames", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{R}");
|
||||
this.expansionSetCode = "SOK";
|
||||
|
||||
this.color.setRed(true);
|
||||
|
||||
// Exile cards from the top of your library until you exile a nonland card. Undying Flames deals damage to target creature or player equal to that card's converted mana cost.
|
||||
this.getSpellAbility().addEffect(new UndyingFlamesEffect());
|
||||
|
||||
// Epic
|
||||
this.getSpellAbility().addEffect(new EpicEffect());
|
||||
|
||||
}
|
||||
|
||||
public UndyingFlames(final UndyingFlames card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UndyingFlames copy() {
|
||||
return new UndyingFlames(this);
|
||||
}
|
||||
}
|
||||
|
||||
class UndyingFlamesEffect extends OneShotEffect<UndyingFlamesEffect> {
|
||||
|
||||
public UndyingFlamesEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "Exile cards from the top of your library until you exile a nonland card. Undying Flames deals damage to target creature or player equal to that card's converted mana cost";
|
||||
}
|
||||
|
||||
public UndyingFlamesEffect(final UndyingFlamesEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
UUID exileId = CardUtil.getCardExileZoneId(game, source);
|
||||
boolean applied = false;
|
||||
Player you = game.getPlayer(source.getControllerId());
|
||||
while (you != null
|
||||
&& you.getLibrary().size() > 0) {
|
||||
Card card = you.getLibrary().removeFromTop(game);
|
||||
if (card != null) {
|
||||
if (card.getCardType().contains(CardType.LAND)) {
|
||||
card.moveToExile(exileId, "Undying Flames", source.getSourceId(), game);
|
||||
} else {
|
||||
Target target = new TargetCreatureOrPlayer();
|
||||
if (you.chooseTarget(Outcome.Damage, target, source, game)) {
|
||||
Permanent creature = game.getPermanent(target.getFirstTarget());
|
||||
if (creature != null) {
|
||||
creature.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, true, false);
|
||||
applied = true;
|
||||
break;
|
||||
}
|
||||
Player player = game.getPlayer(target.getFirstTarget());
|
||||
if (player != null) {
|
||||
player.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, true, false);
|
||||
applied = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return applied;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UndyingFlamesEffect copy() {
|
||||
return new UndyingFlamesEffect(this);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue