mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
* Ghost Quarter - Fixed that the second part of the effect did not work, if the target is not destroyed (e.g. indestructible). (Fix #587).
This commit is contained in:
parent
140ffb256a
commit
652daddfe8
1 changed files with 7 additions and 7 deletions
|
@ -28,10 +28,6 @@
|
||||||
package mage.sets.innistrad;
|
package mage.sets.innistrad;
|
||||||
|
|
||||||
import java.util.UUID;
|
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.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||||
|
@ -41,6 +37,10 @@ import mage.abilities.effects.common.DestroyTargetEffect;
|
||||||
import mage.abilities.mana.ColorlessManaAbility;
|
import mage.abilities.mana.ColorlessManaAbility;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.Rarity;
|
||||||
|
import mage.constants.Zone;
|
||||||
import mage.filter.common.FilterBasicLandCard;
|
import mage.filter.common.FilterBasicLandCard;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
|
@ -96,15 +96,15 @@ class GhostQuarterEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
|
Permanent permanent = (Permanent) game.getPermanentOrLKIBattlefield(source.getFirstTarget()); // if indestructible effect should work also
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
Player player = game.getPlayer(permanent.getControllerId());
|
Player player = game.getPlayer(permanent.getControllerId());
|
||||||
if (player.chooseUse(Outcome.PutLandInPlay, "Do you wish to search for a basic land, put it onto the battlefield and then shuffle your library?", game)) {
|
if (player.chooseUse(Outcome.PutLandInPlay, "Do you wish to search for a basic land, put it onto the battlefield and then shuffle your library?", game)) {
|
||||||
TargetCardInLibrary target = new TargetCardInLibrary(new FilterBasicLandCard());
|
TargetCardInLibrary target = new TargetCardInLibrary(new FilterBasicLandCard());
|
||||||
if (player.searchLibrary(target, game)) {
|
if (player.searchLibrary(target, game)) {
|
||||||
Card card = player.getLibrary().getCard(target.getFirstTarget(), game);
|
Card card = player.getLibrary().getCard(target.getFirstTarget(), game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), player.getId());
|
player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.shuffleLibrary(game);
|
player.shuffleLibrary(game);
|
||||||
|
|
Loading…
Reference in a new issue