mirror of
https://github.com/magefree/mage.git
synced 2026-01-23 03:39:54 -08:00
Fixed a problem with the Wish cards of Judgement set where spell copies are wrongly exiled with the original spell.
This commit is contained in:
parent
56900a9b1f
commit
35c90f2dec
5 changed files with 92 additions and 95 deletions
|
|
@ -29,8 +29,10 @@ package mage.cards.b;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.ExileSpellEffect;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
|
@ -52,11 +54,11 @@ import mage.target.TargetCard;
|
||||||
public class BurningWish extends CardImpl {
|
public class BurningWish extends CardImpl {
|
||||||
|
|
||||||
public BurningWish(UUID ownerId, CardSetInfo setInfo) {
|
public BurningWish(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}");
|
||||||
|
|
||||||
|
|
||||||
// You may choose a sorcery card you own from outside the game, reveal that card, and put it into your hand. Exile Burning Wish.
|
// You may choose a sorcery card you own from outside the game, reveal that card, and put it into your hand. Exile Burning Wish.
|
||||||
this.getSpellAbility().addEffect(new BurningWishEffect());
|
this.getSpellAbility().addEffect(new BurningWishEffect());
|
||||||
|
this.getSpellAbility().addEffect(ExileSpellEffect.getInstance());
|
||||||
}
|
}
|
||||||
|
|
||||||
public BurningWish(final BurningWish card) {
|
public BurningWish(final BurningWish card) {
|
||||||
|
|
@ -74,13 +76,14 @@ class BurningWishEffect extends OneShotEffect {
|
||||||
private static final String choiceText = "Choose a sorcery card you own from outside the game, and put it into your hand";
|
private static final String choiceText = "Choose a sorcery card you own from outside the game, and put it into your hand";
|
||||||
|
|
||||||
private static final FilterCard filter = new FilterCard("sorcery card");
|
private static final FilterCard filter = new FilterCard("sorcery card");
|
||||||
static{
|
|
||||||
filter.add(new CardTypePredicate(CardType.SORCERY));
|
static {
|
||||||
|
filter.add(new CardTypePredicate(CardType.SORCERY));
|
||||||
}
|
}
|
||||||
|
|
||||||
public BurningWishEffect() {
|
public BurningWishEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.Benefit);
|
||||||
this.staticText = "You may choose a sorcery card you own from outside the game, reveal that card, and put it into your hand. Exile Burning Wish";
|
this.staticText = "You may choose a sorcery card you own from outside the game, reveal that card, and put it into your hand";
|
||||||
}
|
}
|
||||||
|
|
||||||
public BurningWishEffect(final BurningWishEffect effect) {
|
public BurningWishEffect(final BurningWishEffect effect) {
|
||||||
|
|
@ -94,18 +97,19 @@ class BurningWishEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player player = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (player != null) {
|
MageObject sourceObject = source.getSourceObject(game);
|
||||||
while (player.chooseUse(Outcome.Benefit, choiceText, source, game)) {
|
if (controller != null && sourceObject != null) {
|
||||||
Cards cards = player.getSideboard();
|
while (controller.chooseUse(Outcome.Benefit, choiceText, source, game)) {
|
||||||
if(cards.isEmpty()) {
|
Cards cards = controller.getSideboard();
|
||||||
game.informPlayer(player, "You have no cards outside the game.");
|
if (cards.isEmpty()) {
|
||||||
|
game.informPlayer(controller, "You have no cards outside the game.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<Card> filtered = cards.getCards(filter, game);
|
Set<Card> filtered = cards.getCards(filter, game);
|
||||||
if (filtered.isEmpty()) {
|
if (filtered.isEmpty()) {
|
||||||
game.informPlayer(player, "You have no " + filter.getMessage() + " outside the game.");
|
game.informPlayer(controller, "You have no " + filter.getMessage() + " outside the game.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -115,25 +119,21 @@ class BurningWishEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
|
|
||||||
TargetCard target = new TargetCard(Zone.OUTSIDE, filter);
|
TargetCard target = new TargetCard(Zone.OUTSIDE, filter);
|
||||||
if (player.choose(Outcome.Benefit, filteredCards, target, game)) {
|
if (controller.choose(Outcome.Benefit, filteredCards, target, game)) {
|
||||||
Card card = player.getSideboard().get(target.getFirstTarget(), game);
|
Card card = controller.getSideboard().get(target.getFirstTarget(), game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
|
|
||||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||||
Cards revealCard = new CardsImpl();
|
Cards revealCard = new CardsImpl();
|
||||||
revealCard.add(card);
|
revealCard.add(card);
|
||||||
player.revealCards("Burning Wish", revealCard, game);
|
controller.revealCards(sourceObject.getIdName(), revealCard, game);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Card cardToExile = game.getCard(source.getSourceId());
|
return true;
|
||||||
if(cardToExile != null)
|
|
||||||
{
|
|
||||||
cardToExile.moveToExile(null, "", source.getSourceId(), game);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,10 @@ package mage.cards.c;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.ExileSpellEffect;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
|
@ -52,11 +54,11 @@ import mage.target.TargetCard;
|
||||||
public class CunningWish extends CardImpl {
|
public class CunningWish extends CardImpl {
|
||||||
|
|
||||||
public CunningWish(UUID ownerId, CardSetInfo setInfo) {
|
public CunningWish(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}");
|
||||||
|
|
||||||
|
|
||||||
// You may choose an instant card you own from outside the game, reveal that card, and put it into your hand. Exile Cunning Wish.
|
// You may choose an instant card you own from outside the game, reveal that card, and put it into your hand. Exile Cunning Wish.
|
||||||
this.getSpellAbility().addEffect(new CunningWishEffect());
|
this.getSpellAbility().addEffect(new CunningWishEffect());
|
||||||
|
this.getSpellAbility().addEffect(ExileSpellEffect.getInstance());
|
||||||
}
|
}
|
||||||
|
|
||||||
public CunningWish(final CunningWish card) {
|
public CunningWish(final CunningWish card) {
|
||||||
|
|
@ -74,13 +76,14 @@ class CunningWishEffect extends OneShotEffect {
|
||||||
private static final String choiceText = "Choose an instant card you own from outside the game, and put it into your hand";
|
private static final String choiceText = "Choose an instant card you own from outside the game, and put it into your hand";
|
||||||
|
|
||||||
private static final FilterCard filter = new FilterCard("instant card");
|
private static final FilterCard filter = new FilterCard("instant card");
|
||||||
static{
|
|
||||||
filter.add(new CardTypePredicate(CardType.INSTANT));
|
static {
|
||||||
|
filter.add(new CardTypePredicate(CardType.INSTANT));
|
||||||
}
|
}
|
||||||
|
|
||||||
public CunningWishEffect() {
|
public CunningWishEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.Benefit);
|
||||||
this.staticText = "You may choose an instant card you own from outside the game, reveal that card, and put it into your hand. Exile Cunning Wish";
|
this.staticText = "You may choose an instant card you own from outside the game, reveal that card, and put it into your hand";
|
||||||
}
|
}
|
||||||
|
|
||||||
public CunningWishEffect(final CunningWishEffect effect) {
|
public CunningWishEffect(final CunningWishEffect effect) {
|
||||||
|
|
@ -94,18 +97,19 @@ class CunningWishEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player player = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (player != null) {
|
MageObject sourceObject = source.getSourceObject(game);
|
||||||
while (player.chooseUse(Outcome.Benefit, choiceText, source, game)) {
|
if (controller != null && sourceObject != null) {
|
||||||
Cards cards = player.getSideboard();
|
while (controller.chooseUse(Outcome.Benefit, choiceText, source, game)) {
|
||||||
if(cards.isEmpty()) {
|
Cards cards = controller.getSideboard();
|
||||||
game.informPlayer(player, "You have no cards outside the game.");
|
if (cards.isEmpty()) {
|
||||||
|
game.informPlayer(controller, "You have no cards outside the game.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<Card> filtered = cards.getCards(filter, game);
|
Set<Card> filtered = cards.getCards(filter, game);
|
||||||
if (filtered.isEmpty()) {
|
if (filtered.isEmpty()) {
|
||||||
game.informPlayer(player, "You have no " + filter.getMessage() + " outside the game.");
|
game.informPlayer(controller, "You have no " + filter.getMessage() + " outside the game.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -115,25 +119,21 @@ class CunningWishEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
|
|
||||||
TargetCard target = new TargetCard(Zone.OUTSIDE, filter);
|
TargetCard target = new TargetCard(Zone.OUTSIDE, filter);
|
||||||
if (player.choose(Outcome.Benefit, filteredCards, target, game)) {
|
if (controller.choose(Outcome.Benefit, filteredCards, target, game)) {
|
||||||
Card card = player.getSideboard().get(target.getFirstTarget(), game);
|
Card card = controller.getSideboard().get(target.getFirstTarget(), game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
|
|
||||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||||
Cards revealCard = new CardsImpl();
|
Cards revealCard = new CardsImpl();
|
||||||
revealCard.add(card);
|
revealCard.add(card);
|
||||||
player.revealCards("Cunning Wish", revealCard, game);
|
controller.revealCards(sourceObject.getIdName(), revealCard, game);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Card cardToExile = game.getCard(source.getSourceId());
|
return true;
|
||||||
if(cardToExile != null)
|
|
||||||
{
|
|
||||||
cardToExile.moveToExile(null, "", source.getSourceId(), game);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ package mage.cards.g;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.ExileSpellEffect;
|
import mage.abilities.effects.common.ExileSpellEffect;
|
||||||
|
|
@ -53,7 +54,7 @@ import mage.target.TargetCard;
|
||||||
public class GlitteringWish extends CardImpl {
|
public class GlitteringWish extends CardImpl {
|
||||||
|
|
||||||
public GlitteringWish(UUID ownerId, CardSetInfo setInfo) {
|
public GlitteringWish(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{G}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}{W}");
|
||||||
|
|
||||||
// You may choose a multicolored card you own from outside the game, reveal that card, and put it into your hand. Exile Glittering Wish.
|
// You may choose a multicolored card you own from outside the game, reveal that card, and put it into your hand. Exile Glittering Wish.
|
||||||
this.getSpellAbility().addEffect(new GlitteringWishEffect());
|
this.getSpellAbility().addEffect(new GlitteringWishEffect());
|
||||||
|
|
@ -97,7 +98,8 @@ class GlitteringWishEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller != null) {
|
MageObject sourceObject = source.getSourceObject(game);
|
||||||
|
if (controller != null && sourceObject != null) {
|
||||||
while (controller.chooseUse(Outcome.Benefit, choiceText, source, game)) {
|
while (controller.chooseUse(Outcome.Benefit, choiceText, source, game)) {
|
||||||
Cards cards = controller.getSideboard();
|
Cards cards = controller.getSideboard();
|
||||||
if (cards.isEmpty()) {
|
if (cards.isEmpty()) {
|
||||||
|
|
@ -124,7 +126,7 @@ class GlitteringWishEffect extends OneShotEffect {
|
||||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||||
Cards revealCard = new CardsImpl();
|
Cards revealCard = new CardsImpl();
|
||||||
revealCard.add(card);
|
revealCard.add(card);
|
||||||
controller.revealCards("Glittering Wish", revealCard, game);
|
controller.revealCards(sourceObject.getIdName(), revealCard, game);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,10 @@ package mage.cards.g;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.ExileSpellEffect;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
|
@ -53,11 +55,11 @@ import mage.target.TargetCard;
|
||||||
public class GoldenWish extends CardImpl {
|
public class GoldenWish extends CardImpl {
|
||||||
|
|
||||||
public GoldenWish(UUID ownerId, CardSetInfo setInfo) {
|
public GoldenWish(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{W}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{W}{W}");
|
||||||
|
|
||||||
|
|
||||||
// You may choose an artifact or enchantment card you own from outside the game, reveal that card, and put it into your hand. Exile Golden Wish.
|
// You may choose an artifact or enchantment card you own from outside the game, reveal that card, and put it into your hand. Exile Golden Wish.
|
||||||
this.getSpellAbility().addEffect(new GoldenWishEffect());
|
this.getSpellAbility().addEffect(new GoldenWishEffect());
|
||||||
|
this.getSpellAbility().addEffect(ExileSpellEffect.getInstance());
|
||||||
}
|
}
|
||||||
|
|
||||||
public GoldenWish(final GoldenWish card) {
|
public GoldenWish(final GoldenWish card) {
|
||||||
|
|
@ -75,15 +77,16 @@ class GoldenWishEffect extends OneShotEffect {
|
||||||
private static final String choiceText = "Choose an artifact or enchantment card you own from outside the game, and put it into your hand";
|
private static final String choiceText = "Choose an artifact or enchantment card you own from outside the game, and put it into your hand";
|
||||||
|
|
||||||
private static final FilterCard filter = new FilterCard("artifact or enchantment card");
|
private static final FilterCard filter = new FilterCard("artifact or enchantment card");
|
||||||
static{
|
|
||||||
filter.add(Predicates.or(
|
static {
|
||||||
|
filter.add(Predicates.or(
|
||||||
new CardTypePredicate(CardType.ARTIFACT),
|
new CardTypePredicate(CardType.ARTIFACT),
|
||||||
new CardTypePredicate(CardType.ENCHANTMENT)));
|
new CardTypePredicate(CardType.ENCHANTMENT)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public GoldenWishEffect() {
|
public GoldenWishEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.Benefit);
|
||||||
this.staticText = "You may choose a artifact or enchantment card you own from outside the game, reveal that card, and put it into your hand. Exile Golden Wish";
|
this.staticText = "You may choose a artifact or enchantment card you own from outside the game, reveal that card, and put it into your hand";
|
||||||
}
|
}
|
||||||
|
|
||||||
public GoldenWishEffect(final GoldenWishEffect effect) {
|
public GoldenWishEffect(final GoldenWishEffect effect) {
|
||||||
|
|
@ -97,46 +100,38 @@ class GoldenWishEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player player = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (player != null) {
|
MageObject sourceObject = source.getSourceObject(game);
|
||||||
while (player.chooseUse(Outcome.Benefit, choiceText, source, game)) {
|
if (controller != null && sourceObject != null) {
|
||||||
Cards cards = player.getSideboard();
|
while (controller.chooseUse(Outcome.Benefit, choiceText, source, game)) {
|
||||||
if(cards.isEmpty()) {
|
Cards cards = controller.getSideboard();
|
||||||
game.informPlayer(player, "You have no cards outside the game.");
|
if (cards.isEmpty()) {
|
||||||
|
game.informPlayer(controller, "You have no cards outside the game.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<Card> filtered = cards.getCards(filter, game);
|
Set<Card> filtered = cards.getCards(filter, game);
|
||||||
if (filtered.isEmpty()) {
|
if (filtered.isEmpty()) {
|
||||||
game.informPlayer(player, "You have no " + filter.getMessage() + " outside the game.");
|
game.informPlayer(controller, "You have no " + filter.getMessage() + " outside the game.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Cards filteredCards = new CardsImpl();
|
Cards filteredCards = new CardsImpl();
|
||||||
for (Card card : filtered) {
|
filteredCards.addAll(filtered);
|
||||||
filteredCards.add(card.getId());
|
|
||||||
}
|
|
||||||
|
|
||||||
TargetCard target = new TargetCard(Zone.OUTSIDE, filter);
|
TargetCard target = new TargetCard(Zone.OUTSIDE, filter);
|
||||||
if (player.choose(Outcome.Benefit, filteredCards, target, game)) {
|
if (controller.choose(Outcome.Benefit, filteredCards, target, game)) {
|
||||||
Card card = player.getSideboard().get(target.getFirstTarget(), game);
|
Card card = controller.getSideboard().get(target.getFirstTarget(), game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
|
|
||||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||||
Cards revealCard = new CardsImpl();
|
controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game);
|
||||||
revealCard.add(card);
|
|
||||||
player.revealCards("Golden Wish", revealCard, game);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Card cardToExile = game.getCard(source.getSourceId());
|
return true;
|
||||||
if(cardToExile != null)
|
|
||||||
{
|
|
||||||
cardToExile.moveToExile(null, "", source.getSourceId(), game);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,10 @@ package mage.cards.l;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.ExileSpellEffect;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
|
@ -53,11 +55,11 @@ import mage.target.TargetCard;
|
||||||
public class LivingWish extends CardImpl {
|
public class LivingWish extends CardImpl {
|
||||||
|
|
||||||
public LivingWish(UUID ownerId, CardSetInfo setInfo) {
|
public LivingWish(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{G}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{G}");
|
||||||
|
|
||||||
|
|
||||||
// You may choose a creature or land card you own from outside the game, reveal that card, and put it into your hand. Exile Living Wish.
|
// You may choose a creature or land card you own from outside the game, reveal that card, and put it into your hand. Exile Living Wish.
|
||||||
this.getSpellAbility().addEffect(new LivingWishEffect());
|
this.getSpellAbility().addEffect(new LivingWishEffect());
|
||||||
|
this.getSpellAbility().addEffect(ExileSpellEffect.getInstance());
|
||||||
}
|
}
|
||||||
|
|
||||||
public LivingWish(final LivingWish card) {
|
public LivingWish(final LivingWish card) {
|
||||||
|
|
@ -75,15 +77,16 @@ class LivingWishEffect extends OneShotEffect {
|
||||||
private static final String choiceText = "Choose a creature or land card you own from outside the game, and put it into your hand";
|
private static final String choiceText = "Choose a creature or land card you own from outside the game, and put it into your hand";
|
||||||
|
|
||||||
private static final FilterCard filter = new FilterCard("creature or land card");
|
private static final FilterCard filter = new FilterCard("creature or land card");
|
||||||
static{
|
|
||||||
filter.add(Predicates.or(
|
static {
|
||||||
|
filter.add(Predicates.or(
|
||||||
new CardTypePredicate(CardType.CREATURE),
|
new CardTypePredicate(CardType.CREATURE),
|
||||||
new CardTypePredicate(CardType.LAND)));
|
new CardTypePredicate(CardType.LAND)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public LivingWishEffect() {
|
public LivingWishEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.Benefit);
|
||||||
this.staticText = "You may choose a creature or land card you own from outside the game, reveal that card, and put it into your hand. Exile Living Wish";
|
this.staticText = "You may choose a creature or land card you own from outside the game, reveal that card, and put it into your hand";
|
||||||
}
|
}
|
||||||
|
|
||||||
public LivingWishEffect(final LivingWishEffect effect) {
|
public LivingWishEffect(final LivingWishEffect effect) {
|
||||||
|
|
@ -97,18 +100,19 @@ class LivingWishEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player player = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (player != null) {
|
MageObject sourceObject = source.getSourceObject(game);
|
||||||
while (player.chooseUse(Outcome.Benefit, choiceText, source, game)) {
|
if (controller != null && sourceObject != null) {
|
||||||
Cards cards = player.getSideboard();
|
while (controller.chooseUse(Outcome.Benefit, choiceText, source, game)) {
|
||||||
if(cards.isEmpty()) {
|
Cards cards = controller.getSideboard();
|
||||||
game.informPlayer(player, "You have no cards outside the game.");
|
if (cards.isEmpty()) {
|
||||||
|
game.informPlayer(controller, "You have no cards outside the game.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<Card> filtered = cards.getCards(filter, game);
|
Set<Card> filtered = cards.getCards(filter, game);
|
||||||
if (filtered.isEmpty()) {
|
if (filtered.isEmpty()) {
|
||||||
game.informPlayer(player, "You have no " + filter.getMessage() + " outside the game.");
|
game.informPlayer(controller, "You have no " + filter.getMessage() + " outside the game.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -118,25 +122,21 @@ class LivingWishEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
|
|
||||||
TargetCard target = new TargetCard(Zone.OUTSIDE, filter);
|
TargetCard target = new TargetCard(Zone.OUTSIDE, filter);
|
||||||
if (player.choose(Outcome.Benefit, filteredCards, target, game)) {
|
if (controller.choose(Outcome.Benefit, filteredCards, target, game)) {
|
||||||
Card card = player.getSideboard().get(target.getFirstTarget(), game);
|
Card card = controller.getSideboard().get(target.getFirstTarget(), game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
|
|
||||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||||
Cards revealCard = new CardsImpl();
|
Cards revealCard = new CardsImpl();
|
||||||
revealCard.add(card);
|
revealCard.add(card);
|
||||||
player.revealCards("Living Wish", revealCard, game);
|
controller.revealCards(sourceObject.getIdName(), revealCard, game);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Card cardToExile = game.getCard(source.getSourceId());
|
return true;
|
||||||
if(cardToExile != null)
|
|
||||||
{
|
|
||||||
cardToExile.moveToExile(null, "", source.getSourceId(), game);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue