mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 05:09:16 -08:00
Some changes/fixes to epic effect and cards using it.
This commit is contained in:
parent
1c2f0ae65d
commit
81d630b65b
10 changed files with 72 additions and 30 deletions
|
|
@ -44,7 +44,7 @@ import mage.game.permanent.token.SnakeToken;
|
|||
public class EndlessSwarm extends CardImpl<EndlessSwarm> {
|
||||
|
||||
public EndlessSwarm(UUID ownerId) {
|
||||
super(ownerId, 129, "Endless Swarm", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{G}");
|
||||
super(ownerId, 129, "Endless Swarm", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{G}{G}{G}");
|
||||
this.expansionSetCode = "SOK";
|
||||
|
||||
this.color.setGreen(true);
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ import mage.target.common.TargetCardInLibrary;
|
|||
public class EnduringIdeal extends CardImpl<EnduringIdeal> {
|
||||
|
||||
public EnduringIdeal(UUID ownerId) {
|
||||
super(ownerId, 9, "Enduring Ideal", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{W}");
|
||||
super(ownerId, 9, "Enduring Ideal", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{W}{W}");
|
||||
this.expansionSetCode = "SOK";
|
||||
|
||||
this.color.setWhite(true);
|
||||
|
|
|
|||
|
|
@ -58,7 +58,8 @@ public class EternalDominion extends CardImpl<EternalDominion> {
|
|||
|
||||
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.
|
||||
// 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));
|
||||
|
||||
|
|
@ -108,7 +109,7 @@ class EternalDominionEffect extends OneShotEffect<EternalDominionEffect> {
|
|||
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());
|
||||
applied = you.putOntoBattlefieldWithInfo(targetCard, game, Zone.LIBRARY, source.getSourceId());
|
||||
}
|
||||
opponent.shuffleLibrary(game);
|
||||
}
|
||||
|
|
@ -119,4 +120,4 @@ class EternalDominionEffect extends OneShotEffect<EternalDominionEffect> {
|
|||
public EternalDominionEffect copy() {
|
||||
return new EternalDominionEffect(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
|
|
@ -37,6 +37,7 @@ 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.game.Game;
|
||||
import mage.players.Player;
|
||||
|
|
@ -52,7 +53,7 @@ import mage.util.CardUtil;
|
|||
public class NeverendingTorment extends CardImpl<NeverendingTorment> {
|
||||
|
||||
public NeverendingTorment(UUID ownerId) {
|
||||
super(ownerId, 83, "Neverending Torment", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{B}");
|
||||
super(ownerId, 83, "Neverending Torment", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{B}{B}");
|
||||
this.expansionSetCode = "SOK";
|
||||
|
||||
this.color.setBlack(true);
|
||||
|
|
@ -88,18 +89,17 @@ class NeverendingTormentEffect extends OneShotEffect<NeverendingTormentEffect> {
|
|||
|
||||
@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());
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(you.getHand().size(), 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);
|
||||
applied |= you.moveCardToExileWithInfo(targetCard, null, null, source.getSourceId(), game, Zone.LIBRARY);
|
||||
}
|
||||
}
|
||||
targetPlayer.shuffleLibrary(game);
|
||||
|
|
@ -111,4 +111,4 @@ class NeverendingTormentEffect extends OneShotEffect<NeverendingTormentEffect> {
|
|||
public NeverendingTormentEffect copy() {
|
||||
return new NeverendingTormentEffect(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,12 +36,12 @@ import mage.cards.CardImpl;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
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;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -51,13 +51,14 @@ import mage.util.CardUtil;
|
|||
public class UndyingFlames extends CardImpl<UndyingFlames> {
|
||||
|
||||
public UndyingFlames(UUID ownerId) {
|
||||
super(ownerId, 119, "Undying Flames", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{R}");
|
||||
super(ownerId, 119, "Undying Flames", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{R}{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());
|
||||
this.getSpellAbility().addTarget(new TargetCreatureOrPlayer(true));
|
||||
|
||||
// Epic
|
||||
this.getSpellAbility().addEffect(new EpicEffect());
|
||||
|
|
@ -78,7 +79,7 @@ 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";
|
||||
staticText = "Exile cards from the top of your library until you exile a nonland card. {this} deals damage to target creature or player equal to that card's converted mana cost";
|
||||
}
|
||||
|
||||
public UndyingFlamesEffect(final UndyingFlamesEffect effect) {
|
||||
|
|
@ -87,27 +88,28 @@ class UndyingFlamesEffect extends OneShotEffect<UndyingFlamesEffect> {
|
|||
|
||||
@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 sourceCard = game.getCard(source.getSourceId());
|
||||
while (you != null && sourceCard != null
|
||||
&& you.getLibrary().size() > 0 && you.isInGame()) {
|
||||
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());
|
||||
you.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, Zone.LIBRARY);
|
||||
if (!card.getCardType().contains(CardType.LAND)) {
|
||||
int damage = card.getManaCost().convertedManaCost();
|
||||
if (damage > 0) {
|
||||
Permanent creature = game.getPermanent(this.getTargetPointer().getFirst(game, source));
|
||||
if (creature != null) {
|
||||
creature.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, true, false);
|
||||
creature.damage(damage, source.getSourceId(), game, true, false);
|
||||
game.informPlayers(new StringBuilder(sourceCard.getName()).append(" deals ").append(damage).append(" damage to ").append(creature.getName()).toString());
|
||||
applied = true;
|
||||
break;
|
||||
}
|
||||
Player player = game.getPlayer(target.getFirstTarget());
|
||||
Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source));
|
||||
if (player != null) {
|
||||
player.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, true, false);
|
||||
player.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true);
|
||||
game.informPlayers(new StringBuilder(sourceCard.getName()).append(" deals ").append(damage).append(" damage to ").append(player.getName()).toString());
|
||||
applied = true;
|
||||
break;
|
||||
}
|
||||
|
|
@ -122,4 +124,4 @@ class UndyingFlamesEffect extends OneShotEffect<UndyingFlamesEffect> {
|
|||
public UndyingFlamesEffect copy() {
|
||||
return new UndyingFlamesEffect(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue