* Brilliant Ultimatum - Fixed that it was not checked if the player is still allowed to play a land.

This commit is contained in:
LevelX2 2018-10-25 16:15:24 +02:00
parent 52f0ae8bd5
commit 44d3276046
5 changed files with 47 additions and 40 deletions

View file

@ -1,4 +1,3 @@
package mage.cards.b; package mage.cards.b;
import java.util.ArrayList; import java.util.ArrayList;
@ -111,6 +110,7 @@ class BrilliantUltimatumEffect extends OneShotEffect {
TargetCard targetExiledCard = new TargetCard(Zone.EXILED, new FilterCard()); TargetCard targetExiledCard = new TargetCard(Zone.EXILED, new FilterCard());
if (controller.chooseTarget(Outcome.PlayForFree, selectedPile, targetExiledCard, source, game)) { if (controller.chooseTarget(Outcome.PlayForFree, selectedPile, targetExiledCard, source, game)) {
Card card = selectedPile.get(targetExiledCard.getFirstTarget(), game); Card card = selectedPile.get(targetExiledCard.getFirstTarget(), game);
controller.canPlayLand();
if (controller.playCard(card, game, true, true, new MageObjectReference(source.getSourceObject(game), game))) { if (controller.playCard(card, game, true, true, new MageObjectReference(source.getSourceObject(game), game))) {
selectedPileCards.remove(card); selectedPileCards.remove(card);
selectedPile.remove(card); selectedPile.remove(card);

View file

@ -1,4 +1,3 @@
package mage.cards.w; package mage.cards.w;
import java.util.UUID; import java.util.UUID;
@ -14,8 +13,8 @@ import mage.abilities.effects.RestrictionEffect;
import mage.cards.Card; import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.AsThoughEffectType; import mage.constants.AsThoughEffectType;
import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Zone; import mage.constants.Zone;
@ -58,7 +57,7 @@ class WordOfCommandEffect extends OneShotEffect {
public WordOfCommandEffect() { public WordOfCommandEffect() {
super(Outcome.GainControl); super(Outcome.GainControl);
this.staticText = "Look at target opponent's hand and choose a card from it. You control that player until Word of Command finishes resolving. The player plays that card if able. While doing so, the player can activate mana abilities only if they're from lands that player controls and only if mana they produce is spent to activate other mana abilities of lands the player controls and/or to play that card. If the chosen card is cast as a spell, you control the player while that spell is resolving"; this.staticText = "Look at target opponent's hand and choose a card from it. You control that player until {this} finishes resolving. The player plays that card if able. While doing so, the player can activate mana abilities only if they're from lands that player controls and only if mana they produce is spent to activate other mana abilities of lands the player controls and/or to play that card. If the chosen card is cast as a spell, you control the player while that spell is resolving";
} }
public WordOfCommandEffect(final WordOfCommandEffect effect) { public WordOfCommandEffect(final WordOfCommandEffect effect) {

View file

@ -1,4 +1,3 @@
package mage.abilities; package mage.abilities;
import java.util.UUID; import java.util.UUID;
@ -31,7 +30,10 @@ public class PlayLandAbility extends ActivatedAbilityImpl {
return ActivationStatus.getFalse(); return ActivationStatus.getFalse();
} }
//20091005 - 114.2a //20091005 - 114.2a
return new ActivationStatus(game.isActivePlayer(playerId) && game.getPlayer(playerId).canPlayLand() && game.canPlaySorcery(playerId), permittingObject); return new ActivationStatus(game.isActivePlayer(playerId)
&& game.getPlayer(playerId).canPlayLand()
&& game.canPlaySorcery(playerId),
permittingObject);
} }
@Override @Override

View file

@ -1,5 +1,7 @@
package mage.players; package mage.players;
import java.io.Serializable;
import java.util.*;
import mage.MageItem; import mage.MageItem;
import mage.MageObject; import mage.MageObject;
import mage.MageObjectReference; import mage.MageObjectReference;
@ -37,9 +39,6 @@ import mage.target.TargetCard;
import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetCardInLibrary;
import mage.util.Copyable; import mage.util.Copyable;
import java.io.Serializable;
import java.util.*;
/** /**
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
*/ */
@ -361,6 +360,7 @@ public interface Player extends MageItem, Copyable<Player> {
* @param ignoreTiming if it's cast during the resolution of another spell * @param ignoreTiming if it's cast during the resolution of another spell
* no sorcery or play land timing restriction are checked. For a land it has * no sorcery or play land timing restriction are checked. For a land it has
* to be the turn of the player playing that card. * to be the turn of the player playing that card.
* @param reference mage object that allows to play the card
* @return * @return
*/ */
boolean playCard(Card card, Game game, boolean noMana, boolean ignoreTiming, MageObjectReference reference); boolean playCard(Card card, Game game, boolean noMana, boolean ignoreTiming, MageObjectReference reference);
@ -370,7 +370,7 @@ public interface Player extends MageItem, Copyable<Player> {
* @param game * @param game
* @param ignoreTiming false - it won't be checked if the stack is empty and * @param ignoreTiming false - it won't be checked if the stack is empty and
* you are able to play a Sorcery. It's still checked, if you are able to * you are able to play a Sorcery. It's still checked, if you are able to
* play a land concerning the numner of lands you already played. * play a land concerning the number of lands you already played.
* @return * @return
*/ */
boolean playLand(Card card, Game game, boolean ignoreTiming); boolean playLand(Card card, Game game, boolean ignoreTiming);

View file

@ -1145,9 +1145,15 @@ public abstract class PlayerImpl implements Player, Serializable {
} }
//20091005 - 114.2a //20091005 - 114.2a
ActivationStatus activationStatus = playLandAbility.canActivate(this.playerId, game); ActivationStatus activationStatus = playLandAbility.canActivate(this.playerId, game);
if (!ignoreTiming && !activationStatus.canActivate()) { if (ignoreTiming) {
if (!canPlayLand()) {
return false; // ignore timing does not mean that more lands than normal can be played
}
} else {
if (!activationStatus.canActivate()) {
return false; return false;
} }
}
//20091005 - 305.1 //20091005 - 305.1
if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.PLAY_LAND, card.getId(), card.getId(), playerId, activationStatus.getPermittingObject()))) { if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.PLAY_LAND, card.getId(), card.getId(), playerId, activationStatus.getPermittingObject()))) {