mirror of
https://github.com/correl/mage.git
synced 2024-12-27 03:00:13 +00:00
* Path to Exile - Fixed that zone change replacement effects prevented the search effect to happen (fixes #824).
This commit is contained in:
parent
5161f849f9
commit
0c19b429f7
1 changed files with 13 additions and 11 deletions
|
@ -53,7 +53,9 @@ public class PathToExile extends CardImpl {
|
||||||
public PathToExile(UUID ownerId) {
|
public PathToExile(UUID ownerId) {
|
||||||
super(ownerId, 15, "Path to Exile", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{W}");
|
super(ownerId, 15, "Path to Exile", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{W}");
|
||||||
this.expansionSetCode = "CON";
|
this.expansionSetCode = "CON";
|
||||||
|
|
||||||
|
// Exile target creature. Its controller may search his or her library for a basic land card,
|
||||||
|
// put that card onto the battlefield tapped, then shuffle his or her library.
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||||
this.getSpellAbility().addEffect(new PathToExileEffect());
|
this.getSpellAbility().addEffect(new PathToExileEffect());
|
||||||
}
|
}
|
||||||
|
@ -90,19 +92,19 @@ class PathToExileEffect extends OneShotEffect {
|
||||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||||
if (controller != null && permanent != null) {
|
if (controller != null && permanent != null) {
|
||||||
Player player = game.getPlayer(permanent.getControllerId());
|
Player player = game.getPlayer(permanent.getControllerId());
|
||||||
if (controller.moveCardToExileWithInfo(permanent, null, "", source.getSourceId(), game, Zone.BATTLEFIELD)) {
|
// if the zone change to exile gets replaced does not prevent the target controller to be able to search
|
||||||
if (player.chooseUse(Outcome.PutCardInPlay, "Search your library for a basic land card?", game)) {
|
controller.moveCardToExileWithInfo(permanent, null, "", source.getSourceId(), game, Zone.BATTLEFIELD);
|
||||||
TargetCardInLibrary target = new TargetCardInLibrary(new FilterBasicLandCard());
|
if (player.chooseUse(Outcome.PutCardInPlay, "Search your library for a basic land card?", game)) {
|
||||||
if (player.searchLibrary(target, game)) {
|
TargetCardInLibrary target = new TargetCardInLibrary(new FilterBasicLandCard());
|
||||||
Card card = player.getLibrary().getCard(target.getFirstTarget(), game);
|
if (player.searchLibrary(target, game)) {
|
||||||
if (card != null) {
|
Card card = player.getLibrary().getCard(target.getFirstTarget(), game);
|
||||||
player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), true);
|
if (card != null) {
|
||||||
}
|
player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), true);
|
||||||
}
|
}
|
||||||
player.shuffleLibrary(game);
|
|
||||||
}
|
}
|
||||||
return true;
|
player.shuffleLibrary(game);
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue