mirror of
https://github.com/magefree/mage.git
synced 2026-01-23 03:39:54 -08:00
* Intet, the Dreamer - Improved handling to look at face down cards exiled with Intet. Works now also if Intet has left the battlefield.
This commit is contained in:
parent
618033c947
commit
9df993bd3a
11 changed files with 276 additions and 208 deletions
|
|
@ -30,12 +30,6 @@ package mage.sets.gatecrash;
|
|||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.constants.AsThoughEffectType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -48,8 +42,12 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.abilities.effects.common.ReturnToHandTargetEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.AsThoughEffectType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.game.ExileZone;
|
||||
import mage.game.Game;
|
||||
|
|
@ -62,29 +60,31 @@ import mage.util.CardUtil;
|
|||
/**
|
||||
* Gatecrash FAQ (01.2013)
|
||||
*
|
||||
* If Bane Alley Broker's first ability resolves when you have no cards in your hand,
|
||||
* you'll draw a card and then exile it. You won't have the opportunity to cast that
|
||||
* card (or do anything else with it) before exiling it.
|
||||
* If Bane Alley Broker's first ability resolves when you have no cards in your
|
||||
* hand, you'll draw a card and then exile it. You won't have the opportunity to
|
||||
* cast that card (or do anything else with it) before exiling it.
|
||||
*
|
||||
* Due to a recent rules change, once you are allowed to look at a face-down card in
|
||||
* exile, you are allowed to look at that card as long as it's exiled. If you no longer
|
||||
* control Bane Alley Broker when its last ability resolves, you can continue to look
|
||||
* at the relevant cards in exile to choose one to return.
|
||||
* Due to a recent rules change, once you are allowed to look at a face-down
|
||||
* card in exile, you are allowed to look at that card as long as it's exiled.
|
||||
* If you no longer control Bane Alley Broker when its last ability resolves,
|
||||
* you can continue to look at the relevant cards in exile to choose one to
|
||||
* return.
|
||||
*
|
||||
* Bane Alley Broker's second and third abilities apply to cards exiled with that
|
||||
* specific Bane Alley Broker, not any other creature named Bane Alley Broker.
|
||||
* You should keep cards exiled by different Bane Alley Brokers separate.
|
||||
* Bane Alley Broker's second and third abilities apply to cards exiled with
|
||||
* that specific Bane Alley Broker, not any other creature named Bane Alley
|
||||
* Broker. You should keep cards exiled by different Bane Alley Brokers
|
||||
* separate.
|
||||
*
|
||||
* If Bane Alley Broker leaves the battlefield, the cards exiled with it will be
|
||||
* exiled indefinitely. If it later returns to the battlefield, it will be a new
|
||||
* object with no connection to the cards exiled with it in its previous existence.
|
||||
* You won't be able to use the "new" Bane Alley Broker to return cards exiled with
|
||||
* the "old" one.
|
||||
* object with no connection to the cards exiled with it in its previous
|
||||
* existence. You won't be able to use the "new" Bane Alley Broker to return
|
||||
* cards exiled with the "old" one.
|
||||
*
|
||||
* Even if not all players can look at the exiled cards, each card's owner is still
|
||||
* known. It is advisable to keep cards owned by different players in distinct piles
|
||||
* in case another player gains control of Bane Alley Broker and exiles one or more
|
||||
* cards with it.
|
||||
* Even if not all players can look at the exiled cards, each card's owner is
|
||||
* still known. It is advisable to keep cards owned by different players in
|
||||
* distinct piles in case another player gains control of Bane Alley Broker and
|
||||
* exiles one or more cards with it.
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
|
@ -99,9 +99,9 @@ public class BaneAlleyBroker extends CardImpl {
|
|||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// {tap}: Draw a card, then exile a card from your hand face down.
|
||||
// {tap}: Draw a card, then exile a card from your hand face down.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BaneAlleyBrokerDrawExileEffect(), new TapSourceCost()));
|
||||
|
||||
|
||||
// You may look at cards exiled with Bane Alley Broker.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.ALL, new BaneAlleyBrokerLookAtCardEffect()));
|
||||
|
||||
|
|
@ -126,44 +126,44 @@ public class BaneAlleyBroker extends CardImpl {
|
|||
class BaneAlleyBrokerDrawExileEffect extends OneShotEffect {
|
||||
|
||||
public BaneAlleyBrokerDrawExileEffect() {
|
||||
super(Outcome.DrawCard);
|
||||
staticText = "Draw a card, then exile a card from your hand face down";
|
||||
super(Outcome.DrawCard);
|
||||
staticText = "Draw a card, then exile a card from your hand face down";
|
||||
}
|
||||
|
||||
public BaneAlleyBrokerDrawExileEffect(final BaneAlleyBrokerDrawExileEffect effect) {
|
||||
super(effect);
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
controller.drawCards(1, game);
|
||||
Target target = new TargetCardInHand(new FilterCard("card to exile"));
|
||||
if (controller.chooseTarget(outcome, target, source, game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (card != null && sourceObject != null) {
|
||||
if (card.moveToExile(CardUtil.getCardExileZoneId(game, source), new StringBuilder(sourceObject.getName()).toString(), source.getSourceId(), game)) {
|
||||
card.setFaceDown(true, game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
controller.drawCards(1, game);
|
||||
Target target = new TargetCardInHand(new FilterCard("card to exile"));
|
||||
if (controller.chooseTarget(outcome, target, source, game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (card != null && sourceObject != null) {
|
||||
if (card.moveToExile(CardUtil.getCardExileZoneId(game, source), new StringBuilder(sourceObject.getName()).toString(), source.getSourceId(), game)) {
|
||||
card.setFaceDown(true, game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaneAlleyBrokerDrawExileEffect copy() {
|
||||
return new BaneAlleyBrokerDrawExileEffect(this);
|
||||
return new BaneAlleyBrokerDrawExileEffect(this);
|
||||
}
|
||||
}
|
||||
|
||||
class TargetCardInBaneAlleyBrokerExile extends TargetCard {
|
||||
|
||||
public TargetCardInBaneAlleyBrokerExile(UUID CardId) {
|
||||
super(1, 1, Zone.EXILED, new FilterCard("card exiled with Bane Alley Broker"));
|
||||
super(1, 1, Zone.EXILED, new FilterCard("card exiled with Bane Alley Broker"));
|
||||
}
|
||||
|
||||
public TargetCardInBaneAlleyBrokerExile(final TargetCardInBaneAlleyBrokerExile target) {
|
||||
|
|
@ -223,7 +223,7 @@ class TargetCardInBaneAlleyBrokerExile extends TargetCard {
|
|||
class BaneAlleyBrokerLookAtCardEffect extends AsThoughEffectImpl {
|
||||
|
||||
public BaneAlleyBrokerLookAtCardEffect() {
|
||||
super(AsThoughEffectType.REVEAL_FACE_DOWN, Duration.EndOfGame, Outcome.Benefit);
|
||||
super(AsThoughEffectType.LOOK_AT_FACE_DOWN, Duration.EndOfGame, Outcome.Benefit);
|
||||
staticText = "You may look at cards exiled with {this}";
|
||||
}
|
||||
|
||||
|
|
@ -252,13 +252,7 @@ class BaneAlleyBrokerLookAtCardEffect extends AsThoughEffectImpl {
|
|||
}
|
||||
UUID exileId = CardUtil.getCardExileZoneId(game, source);
|
||||
ExileZone exile = game.getExile().getExileZone(exileId);
|
||||
if (exile != null && exile.contains(objectId)) {
|
||||
Cards cards = new CardsImpl(card);
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
controller.lookAtCards("Exiled with " + sourceObject.getName(), cards, game);
|
||||
}
|
||||
}
|
||||
return exile != null && exile.contains(objectId);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -34,8 +34,6 @@ import mage.abilities.effects.AsThoughEffectImpl;
|
|||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.AsThoughEffectType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
|
|
@ -167,7 +165,7 @@ class PraetorsGraspRevealEffect extends AsThoughEffectImpl {
|
|||
private final UUID cardId;
|
||||
|
||||
public PraetorsGraspRevealEffect(UUID cardId) {
|
||||
super(AsThoughEffectType.REVEAL_FACE_DOWN, Duration.EndOfGame, Outcome.Benefit);
|
||||
super(AsThoughEffectType.LOOK_AT_FACE_DOWN, Duration.EndOfGame, Outcome.Benefit);
|
||||
this.cardId = cardId;
|
||||
staticText = "You may look at and play that card for as long as it remains exiled";
|
||||
}
|
||||
|
|
@ -198,10 +196,7 @@ class PraetorsGraspRevealEffect extends AsThoughEffectImpl {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Card card = game.getCard(cardId);
|
||||
if (controller != null && card != null && game.getState().getZone(cardId) == Zone.EXILED) {
|
||||
if (controller.chooseUse(outcome, "Reveal exiled card?", source, game)) {
|
||||
Cards cards = new CardsImpl(card);
|
||||
controller.lookAtCards("Exiled with " + sourceObject.getIdName(), cards, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
discard();
|
||||
|
|
|
|||
|
|
@ -27,21 +27,21 @@
|
|||
*/
|
||||
package mage.sets.planarchaos;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.AsThoughEffectImpl;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DoIfCostPaid;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.AsThoughEffectType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
|
|
@ -59,6 +59,8 @@ import mage.util.CardUtil;
|
|||
*/
|
||||
public class IntetTheDreamer extends CardImpl {
|
||||
|
||||
protected static final String VALUE_PREFIX = "ExileZones";
|
||||
|
||||
public IntetTheDreamer(UUID ownerId) {
|
||||
super(ownerId, 158, "Intet, the Dreamer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}{R}{G}");
|
||||
this.expansionSetCode = "PLC";
|
||||
|
|
@ -72,9 +74,12 @@ public class IntetTheDreamer extends CardImpl {
|
|||
// Whenever Intet, the Dreamer deals combat damage to a player, you may pay {2}{U}. If you do, exile the top card of your library face down.
|
||||
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(
|
||||
new DoIfCostPaid(new IntetTheDreamerExileEffect(), new ManaCostsImpl("{2}{U}")), false, true));
|
||||
// You may look at that card for as long as it remains exiled. You may play that card without paying its mana cost for as long as Intet remains on the battlefield.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new IntetTheDreamerEffect()));
|
||||
// You may look at that card for as long as it remains exiled.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.ALL, new IntetTheDreamerLookEffect()));
|
||||
// You may play that card without paying its mana cost for as long as Intet remains on the battlefield.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new IntetTheDreamerCastEffect()));
|
||||
}
|
||||
|
||||
public IntetTheDreamer(final IntetTheDreamer card) {
|
||||
super(card);
|
||||
}
|
||||
|
|
@ -86,46 +91,53 @@ public class IntetTheDreamer extends CardImpl {
|
|||
}
|
||||
|
||||
class IntetTheDreamerExileEffect extends OneShotEffect {
|
||||
|
||||
|
||||
public IntetTheDreamerExileEffect() {
|
||||
super(Outcome.Discard);
|
||||
staticText = "exile the top card of your library face down";
|
||||
}
|
||||
|
||||
|
||||
public IntetTheDreamerExileEffect(final IntetTheDreamerExileEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
Card card = player.getLibrary().getFromTop(game);
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (card != null && sourceObject != null) {
|
||||
UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
player.moveCardToExileWithInfo(card, exileZoneId, sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, false);
|
||||
card.setFaceDown(true, game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Card card = controller.getLibrary().getFromTop(game);
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (card != null && sourceObject != null) {
|
||||
UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
card.setFaceDown(true, game);
|
||||
controller.moveCardsToExile(card, source, game, false, exileZoneId, sourceObject.getIdName());
|
||||
card.setFaceDown(true, game);
|
||||
Set<UUID> exileZones = (Set<UUID>) game.getState().getValue(IntetTheDreamer.VALUE_PREFIX + source.getSourceId().toString());
|
||||
if (exileZones == null) {
|
||||
exileZones = new HashSet<>();
|
||||
game.getState().setValue(IntetTheDreamer.VALUE_PREFIX + source.getSourceId().toString(), exileZones);
|
||||
}
|
||||
exileZones.add(exileZoneId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IntetTheDreamerExileEffect copy() {
|
||||
return new IntetTheDreamerExileEffect(this);
|
||||
}
|
||||
}
|
||||
|
||||
class IntetTheDreamerEffect extends AsThoughEffectImpl {
|
||||
class IntetTheDreamerCastEffect extends AsThoughEffectImpl {
|
||||
|
||||
public IntetTheDreamerEffect() {
|
||||
public IntetTheDreamerCastEffect() {
|
||||
super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.WhileOnBattlefield, Outcome.Benefit);
|
||||
staticText = "You may play the card from exile without paying its mana cost for as long as {this} remains on the battlefield";
|
||||
}
|
||||
|
||||
public IntetTheDreamerEffect(final IntetTheDreamerEffect effect) {
|
||||
public IntetTheDreamerCastEffect(final IntetTheDreamerCastEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
|
@ -135,30 +147,80 @@ class IntetTheDreamerEffect extends AsThoughEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public IntetTheDreamerEffect copy() {
|
||||
return new IntetTheDreamerEffect(this);
|
||||
public IntetTheDreamerCastEffect copy() {
|
||||
return new IntetTheDreamerCastEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (controller != null && sourceObject != null) {
|
||||
Card card = game.getCard(objectId);
|
||||
if (affectedControllerId.equals(source.getControllerId()) && card != null && game.getState().getZone(card.getId()) == Zone.EXILED) {
|
||||
ExileZone zone = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()));
|
||||
if (zone != null && zone.contains(card.getId())) {
|
||||
if (controller.chooseUse(outcome, "Look at the card?", source, game)) {
|
||||
Cards cards = new CardsImpl();
|
||||
cards.add(card);
|
||||
controller.lookAtCards(sourceObject.getName(), cards, game);
|
||||
return false;
|
||||
}
|
||||
controller.setCastSourceIdWithAlternateMana(objectId, null);
|
||||
return true;
|
||||
if (affectedControllerId.equals(source.getControllerId()) && game.getState().getZone(objectId).equals(Zone.EXILED)) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (controller != null && sourceObject != null) {
|
||||
Card card = game.getCard(objectId);
|
||||
if (card != null && card.isFaceDown(game)) {
|
||||
ExileZone zone = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()));
|
||||
if (zone != null && zone.contains(card.getId())/* && CardUtil.cardCanBePlayedNow(card, controller.getId(), game)*/) {
|
||||
if (card.getCardType().contains(CardType.LAND)) {
|
||||
if (game.canPlaySorcery(controller.getId()) && game.getPlayer(controller.getId()).canPlayLand()) {
|
||||
return controller.chooseUse(outcome, "Play " + card.getName() + "?", source, game);
|
||||
}
|
||||
} else {
|
||||
controller.setCastSourceIdWithAlternateMana(objectId, null);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class IntetTheDreamerLookEffect extends AsThoughEffectImpl {
|
||||
|
||||
public IntetTheDreamerLookEffect() {
|
||||
super(AsThoughEffectType.LOOK_AT_FACE_DOWN, Duration.EndOfGame, Outcome.Benefit);
|
||||
staticText = "You may look at that card for as long as it remains exiled";
|
||||
}
|
||||
|
||||
public IntetTheDreamerLookEffect(final IntetTheDreamerLookEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IntetTheDreamerLookEffect copy() {
|
||||
return new IntetTheDreamerLookEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
if (affectedControllerId.equals(source.getControllerId()) && game.getState().getZone(objectId).equals(Zone.EXILED)) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (controller != null && sourceObject != null) {
|
||||
Card card = game.getCard(objectId);
|
||||
if (card != null && card.isFaceDown(game)) {
|
||||
Set<UUID> exileZones = (Set<UUID>) game.getState().getValue(IntetTheDreamer.VALUE_PREFIX + source.getSourceId().toString());
|
||||
if (exileZones != null) {
|
||||
for (ExileZone exileZone : game.getExile().getExileZones()) {
|
||||
if (exileZone.contains(objectId)) {
|
||||
if (!exileZones.contains(exileZone.getId())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue