mirror of
https://github.com/correl/mage.git
synced 2025-04-09 09:11:05 -09:00
- See b9bee56
This commit is contained in:
parent
6f9db86eb9
commit
e4591f42f0
6 changed files with 113 additions and 52 deletions
Mage.Sets/src/mage/cards
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.b;
|
package mage.cards.b;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -71,7 +70,8 @@ class BringToLightEffect extends OneShotEffect {
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
int numberColors = ColorsOfManaSpentToCastCount.getInstance().calculate(game, source, this);
|
int numberColors = ColorsOfManaSpentToCastCount.getInstance().calculate(game, source, this);
|
||||||
FilterCard filter = new FilterCard();
|
FilterCard filter = new FilterCard();
|
||||||
filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY)));
|
filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE),
|
||||||
|
new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY)));
|
||||||
filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, numberColors + 1));
|
filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, numberColors + 1));
|
||||||
TargetCardInLibrary target = new TargetCardInLibrary(filter);
|
TargetCardInLibrary target = new TargetCardInLibrary(filter);
|
||||||
controller.searchLibrary(target, source, game);
|
controller.searchLibrary(target, source, game);
|
||||||
|
@ -81,9 +81,13 @@ class BringToLightEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
controller.shuffleLibrary(source, game);
|
controller.shuffleLibrary(source, game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
if (controller.chooseUse(outcome, "Cast " + card.getName() + " without paying its mana cost?", source, game)) {
|
if (controller.chooseUse(Outcome.PlayForFree, "Cast " + card.getName()
|
||||||
if (card.getSpellAbility() != null) {
|
+ " without paying its mana cost?", source, game)) {
|
||||||
controller.cast(card.getSpellAbility(), game, true, new MageObjectReference(source.getSourceObject(game), game));
|
game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), Boolean.TRUE);
|
||||||
|
Boolean cardWasCast = controller.cast(controller.chooseAbilityForCast(card, game, true),
|
||||||
|
game, true, new MageObjectReference(source.getSourceObject(game), game));
|
||||||
|
game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), null);
|
||||||
|
if (cardWasCast) {
|
||||||
} else {
|
} else {
|
||||||
Logger.getLogger(BringToLightEffect.class).error("Bring to Light: spellAbility == null " + card.getName());
|
Logger.getLogger(BringToLightEffect.class).error("Bring to Light: spellAbility == null " + card.getName());
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,10 @@ public final class CollectedConjuring extends CardImpl {
|
||||||
public CollectedConjuring(UUID ownerId, CardSetInfo setInfo) {
|
public CollectedConjuring(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U}{R}");
|
||||||
|
|
||||||
// Exile the top six cards of your library. You may cast up to two sorcery cards with converted mana costs 3 or less from among them without paying their mana cost. Put the exiled cards not cast this way on the bottom of your library in a random order.
|
// Exile the top six cards of your library. You may cast up to two sorcery
|
||||||
|
// cards with converted mana costs 3 or less from among them without paying
|
||||||
|
// their mana cost. Put the exiled cards not cast this way on the bottom
|
||||||
|
// of your library in a random order.
|
||||||
this.getSpellAbility().addEffect(new CollectedConjuringEffect());
|
this.getSpellAbility().addEffect(new CollectedConjuringEffect());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +45,8 @@ public final class CollectedConjuring extends CardImpl {
|
||||||
|
|
||||||
class CollectedConjuringEffect extends OneShotEffect {
|
class CollectedConjuringEffect extends OneShotEffect {
|
||||||
|
|
||||||
private static final FilterCard filter = new FilterCard("sorcery cards with converted mana cost 3 or less");
|
private static final FilterCard filter = new FilterCard(
|
||||||
|
"sorcery cards with converted mana cost 3 or less");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filter.add(new CardTypePredicate(CardType.SORCERY));
|
filter.add(new CardTypePredicate(CardType.SORCERY));
|
||||||
|
@ -56,11 +60,11 @@ class CollectedConjuringEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
|
|
||||||
CollectedConjuringEffect() {
|
CollectedConjuringEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.PlayForFree);
|
||||||
this.staticText = "Exile the top six cards of your library. " +
|
this.staticText = "Exile the top six cards of your library. "
|
||||||
"You may cast up to two sorcery cards with converted mana costs 3 or less from among them " +
|
+ "You may cast up to two sorcery cards with converted mana costs 3 or less from among them "
|
||||||
"without paying their mana cost. Put the exiled cards not cast this way " +
|
+ "without paying their mana cost. Put the exiled cards not cast this way "
|
||||||
"on the bottom of your library in a random order.";
|
+ "on the bottom of your library in a random order.";
|
||||||
}
|
}
|
||||||
|
|
||||||
private CollectedConjuringEffect(final CollectedConjuringEffect effect) {
|
private CollectedConjuringEffect(final CollectedConjuringEffect effect) {
|
||||||
|
@ -76,14 +80,17 @@ class CollectedConjuringEffect extends OneShotEffect {
|
||||||
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());
|
||||||
MageObject sourceObject = source.getSourceObject(game);
|
MageObject sourceObject = source.getSourceObject(game);
|
||||||
if (controller == null || sourceObject == null) {
|
if (controller == null
|
||||||
|
|| sourceObject == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 6));
|
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 6));
|
||||||
controller.moveCards(cards, Zone.EXILED, source, game);
|
controller.moveCards(cards, Zone.EXILED, source, game);
|
||||||
int cardsCast = 0;
|
int cardsCast = 0;
|
||||||
while (!cards.getCards(filter, source.getSourceId(), source.getControllerId(), game).isEmpty() && cardsCast < 2) {
|
while (!cards.getCards(filter, source.getSourceId(), source.getControllerId(), game).isEmpty()
|
||||||
if (!controller.chooseUse(Outcome.PlayForFree, "Cast a card exiled with " + sourceObject.getLogName() + " without paying its mana cost?", source, game)) {
|
&& cardsCast < 2) {
|
||||||
|
if (!controller.chooseUse(Outcome.PlayForFree, "Cast a card exiled with "
|
||||||
|
+ sourceObject.getLogName() + " without paying its mana cost?", source, game)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
TargetCard targetCard = new TargetCard(1, Zone.EXILED, filter2);
|
TargetCard targetCard = new TargetCard(1, Zone.EXILED, filter2);
|
||||||
|
@ -94,11 +101,16 @@ class CollectedConjuringEffect extends OneShotEffect {
|
||||||
if (card == null) {
|
if (card == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (controller.cast(card.getSpellAbility(), game, true, new MageObjectReference(source.getSourceObject(game), game))) {
|
game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), Boolean.TRUE);
|
||||||
|
Boolean cardWasCast = controller.cast(controller.chooseAbilityForCast(card, game, true),
|
||||||
|
game, true, new MageObjectReference(source.getSourceObject(game), game));
|
||||||
|
game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), null);
|
||||||
|
if (cardWasCast) {
|
||||||
cards.remove(card);
|
cards.remove(card);
|
||||||
cardsCast++;
|
cardsCast++;
|
||||||
} else {
|
} else {
|
||||||
game.informPlayer(controller, "You're not able to cast " + card.getIdName() + " or you canceled the casting.");
|
game.informPlayer(controller, "You're not able to cast "
|
||||||
|
+ card.getIdName() + " or you canceled the casting.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
controller.putCardsOnBottomOfLibrary(cards, game, source, false);
|
controller.putCardsOnBottomOfLibrary(cards, game, source, false);
|
||||||
|
|
|
@ -126,7 +126,8 @@ class FinaleOfPromiseEffect extends OneShotEffect {
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.map(Card::getName)
|
.map(Card::getName)
|
||||||
.collect(Collectors.joining(" -> "));
|
.collect(Collectors.joining(" -> "));
|
||||||
if (!controller.chooseUse(Outcome.Detriment, "Cast cards by choose order: " + cardsOrder + "?", "Finale of Promise",
|
if (!controller.chooseUse(Outcome.Detriment, "Cast cards by choose order: "
|
||||||
|
+ cardsOrder + "?", "Finale of Promise",
|
||||||
"Use that order", "Reverse", source, game)) {
|
"Use that order", "Reverse", source, game)) {
|
||||||
Collections.reverse(cardsToCast);
|
Collections.reverse(cardsToCast);
|
||||||
}
|
}
|
||||||
|
@ -136,7 +137,10 @@ class FinaleOfPromiseEffect extends OneShotEffect {
|
||||||
for (UUID id : cardsToCast) {
|
for (UUID id : cardsToCast) {
|
||||||
Card card = game.getCard(id);
|
Card card = game.getCard(id);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
controller.cast(card.getSpellAbility(), game, true, new MageObjectReference(source.getSourceObject(game), game));
|
game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), Boolean.TRUE);
|
||||||
|
controller.cast(controller.chooseAbilityForCast(card, game, true),
|
||||||
|
game, true, new MageObjectReference(source.getSourceObject(game), game));
|
||||||
|
game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), null);
|
||||||
ContinuousEffect effect = new FinaleOfPromiseReplacementEffect();
|
ContinuousEffect effect = new FinaleOfPromiseReplacementEffect();
|
||||||
effect.setTargetPointer(new FixedTarget(card.getId(), game.getState().getZoneChangeCounter(card.getId())));
|
effect.setTargetPointer(new FixedTarget(card.getId(), game.getState().getZoneChangeCounter(card.getId())));
|
||||||
game.addEffect(effect, source);
|
game.addEffect(effect, source);
|
||||||
|
@ -205,6 +209,7 @@ class FinaleOfPromiseReplacementEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||||
return zEvent.getToZone() == Zone.GRAVEYARD && event.getTargetId().equals(getTargetPointer().getFirst(game, source));
|
return zEvent.getToZone() == Zone.GRAVEYARD
|
||||||
|
&& event.getTargetId().equals(getTargetPointer().getFirst(game, source));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -32,9 +31,11 @@ public final class MindsDilation extends CardImpl {
|
||||||
public MindsDilation(UUID ownerId, CardSetInfo setInfo) {
|
public MindsDilation(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{5}{U}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{5}{U}{U}");
|
||||||
|
|
||||||
// Whenever an opponent casts their first spell each turn, that player exiles the top card of their library. If it's a nonland card,
|
// Whenever an opponent casts their first spell each turn,
|
||||||
|
// that player exiles the top card of their library. If it's a nonland card,
|
||||||
// you may cast it without paying its mana cost.
|
// you may cast it without paying its mana cost.
|
||||||
this.addAbility(new MindsDilationTriggeredAbility(new MindsDilationEffect(), false), new SpellsCastWatcher());
|
this.addAbility(new MindsDilationTriggeredAbility(new MindsDilationEffect(),
|
||||||
|
false), new SpellsCastWatcher());
|
||||||
}
|
}
|
||||||
|
|
||||||
public MindsDilation(final MindsDilation card) {
|
public MindsDilation(final MindsDilation card) {
|
||||||
|
@ -81,16 +82,19 @@ class MindsDilationTriggeredAbility extends SpellCastOpponentTriggeredAbility {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRule() {
|
public String getRule() {
|
||||||
return "Whenever an opponent casts their first spell each turn, that player exiles the top card of their library."
|
return "Whenever an opponent casts their first spell each turn, "
|
||||||
+ " If it's a nonland card, you may cast it without paying its mana cost.";
|
+ "that player exiles the top card of their library."
|
||||||
|
+ " If it's a nonland card, you may cast it without "
|
||||||
|
+ "paying its mana cost.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MindsDilationEffect extends OneShotEffect {
|
class MindsDilationEffect extends OneShotEffect {
|
||||||
|
|
||||||
MindsDilationEffect() {
|
MindsDilationEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.PlayForFree);
|
||||||
this.staticText = "that player exiles the top card of their library. If it's a nonland card, you may cast it without paying its mana cost";
|
this.staticText = "that player exiles the top card of their library. "
|
||||||
|
+ "If it's a nonland card, you may cast it without paying its mana cost";
|
||||||
}
|
}
|
||||||
|
|
||||||
MindsDilationEffect(final MindsDilationEffect effect) {
|
MindsDilationEffect(final MindsDilationEffect effect) {
|
||||||
|
@ -107,13 +111,20 @@ class MindsDilationEffect extends OneShotEffect {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = source.getSourceObject(game);
|
MageObject sourceObject = source.getSourceObject(game);
|
||||||
Player opponent = game.getPlayer(getTargetPointer().getFirst(game, source));
|
Player opponent = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||||
if (controller != null && sourceObject != null && opponent != null) {
|
if (controller != null
|
||||||
|
&& sourceObject != null
|
||||||
|
&& opponent != null) {
|
||||||
if (opponent.getLibrary().hasCards()) {
|
if (opponent.getLibrary().hasCards()) {
|
||||||
Card card = opponent.getLibrary().getFromTop(game);
|
Card card = opponent.getLibrary().getFromTop(game);
|
||||||
if (card != null && opponent.moveCards(card, Zone.EXILED, source, game)) {
|
if (card != null
|
||||||
|
&& opponent.moveCards(card, Zone.EXILED, source, game)) {
|
||||||
if (!card.isLand()) {
|
if (!card.isLand()) {
|
||||||
if (controller.chooseUse(outcome, "Cast " + card.getLogName() + " without paying its mana cost from exile?", source, game)) {
|
if (controller.chooseUse(outcome, "Cast " + card.getLogName()
|
||||||
controller.cast(card.getSpellAbility(), game, true, new MageObjectReference(source.getSourceObject(game), game));
|
+ " without paying its mana cost from exile?", source, game)) {
|
||||||
|
game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), Boolean.TRUE);
|
||||||
|
controller.cast(controller.chooseAbilityForCast(card, game, true),
|
||||||
|
game, true, new MageObjectReference(source.getSourceObject(game), game));
|
||||||
|
game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,13 +28,17 @@ public final class MizzixsMastery extends CardImpl {
|
||||||
public MizzixsMastery(UUID ownerId, CardSetInfo setInfo) {
|
public MizzixsMastery(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{R}");
|
||||||
|
|
||||||
// Exile target card that's an instant or sorcery from your graveyard. For each card exiled this way, copy it, and you may cast the copy without paying its mana cost. Exile Mizzix's Mastery.
|
// Exile target card that's an instant or sorcery from your graveyard.
|
||||||
|
// For each card exiled this way, copy it, and you may cast the copy
|
||||||
|
// without paying its mana cost. Exile Mizzix's Mastery.
|
||||||
this.getSpellAbility().addEffect(new MizzixsMasteryEffect());
|
this.getSpellAbility().addEffect(new MizzixsMasteryEffect());
|
||||||
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(new FilterInstantOrSorceryCard("card that's an instant or sorcery from your graveyard")));
|
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(
|
||||||
|
new FilterInstantOrSorceryCard("card that's an instant or sorcery from your graveyard")));
|
||||||
this.getSpellAbility().addEffect(ExileSpellEffect.getInstance());
|
this.getSpellAbility().addEffect(ExileSpellEffect.getInstance());
|
||||||
|
|
||||||
// Overload {5}{R}{R}{R}
|
// Overload {5}{R}{R}{R}
|
||||||
Ability ability = new OverloadAbility(this, new MizzixsMasteryOverloadEffect(), new ManaCostsImpl("{5}{R}{R}{R}"));
|
Ability ability = new OverloadAbility(this, new MizzixsMasteryOverloadEffect(),
|
||||||
|
new ManaCostsImpl("{5}{R}{R}{R}"));
|
||||||
ability.addEffect(ExileSpellEffect.getInstance());
|
ability.addEffect(ExileSpellEffect.getInstance());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
@ -53,7 +57,9 @@ class MizzixsMasteryEffect extends OneShotEffect {
|
||||||
|
|
||||||
public MizzixsMasteryEffect() {
|
public MizzixsMasteryEffect() {
|
||||||
super(Outcome.PlayForFree);
|
super(Outcome.PlayForFree);
|
||||||
this.staticText = "Exile target card that's an instant or sorcery from your graveyard. For each card exiled this way, copy it, and you may cast the copy without paying its mana cost";
|
this.staticText = "Exile target card that's an instant or sorcery from your "
|
||||||
|
+ "graveyard. For each card exiled this way, copy it, and you "
|
||||||
|
+ "may cast the copy without paying its mana cost";
|
||||||
}
|
}
|
||||||
|
|
||||||
public MizzixsMasteryEffect(final MizzixsMasteryEffect effect) {
|
public MizzixsMasteryEffect(final MizzixsMasteryEffect effect) {
|
||||||
|
@ -74,8 +80,12 @@ class MizzixsMasteryEffect extends OneShotEffect {
|
||||||
if (controller.moveCards(card, Zone.EXILED, source, game)) {
|
if (controller.moveCards(card, Zone.EXILED, source, game)) {
|
||||||
Card cardCopy = game.copyCard(card, source, source.getControllerId());
|
Card cardCopy = game.copyCard(card, source, source.getControllerId());
|
||||||
if (cardCopy.getSpellAbility().canChooseTarget(game)
|
if (cardCopy.getSpellAbility().canChooseTarget(game)
|
||||||
&& controller.chooseUse(outcome, "Cast copy of " + card.getName() + " without paying its mana cost?", source, game)) {
|
&& controller.chooseUse(outcome, "Cast copy of "
|
||||||
controller.cast(cardCopy.getSpellAbility(), game, true, new MageObjectReference(source.getSourceObject(game), game));
|
+ card.getName() + " without paying its mana cost?", source, game)) {
|
||||||
|
game.getState().setValue("PlayFromNotOwnHandZone" + cardCopy.getId(), Boolean.TRUE);
|
||||||
|
controller.cast(controller.chooseAbilityForCast(cardCopy, game, true),
|
||||||
|
game, true, new MageObjectReference(source.getSourceObject(game), game));
|
||||||
|
game.getState().setValue("PlayFromNotOwnHandZone" + cardCopy.getId(), null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,7 +99,9 @@ class MizzixsMasteryOverloadEffect extends OneShotEffect {
|
||||||
|
|
||||||
public MizzixsMasteryOverloadEffect() {
|
public MizzixsMasteryOverloadEffect() {
|
||||||
super(Outcome.PlayForFree);
|
super(Outcome.PlayForFree);
|
||||||
this.staticText = "Exile each card that's an instant or sorcery from your graveyard. For each card exiled this way, copy it, and you may cast the copy without paying its mana cost. Exile {this}";
|
this.staticText = "Exile each card that's an instant or sorcery from "
|
||||||
|
+ "your graveyard. For each card exiled this way, copy it, "
|
||||||
|
+ "and you may cast the copy without paying its mana cost. Exile {this}";
|
||||||
}
|
}
|
||||||
|
|
||||||
public MizzixsMasteryOverloadEffect(final MizzixsMasteryOverloadEffect effect) {
|
public MizzixsMasteryOverloadEffect(final MizzixsMasteryOverloadEffect effect) {
|
||||||
|
@ -105,7 +117,8 @@ class MizzixsMasteryOverloadEffect extends OneShotEffect {
|
||||||
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) {
|
if (controller != null) {
|
||||||
Set<Card> cardsToExile = controller.getGraveyard().getCards(new FilterInstantOrSorceryCard(), source.getId(), source.getControllerId(), game);
|
Set<Card> cardsToExile = controller.getGraveyard().getCards(
|
||||||
|
new FilterInstantOrSorceryCard(), source.getId(), source.getControllerId(), game);
|
||||||
if (!cardsToExile.isEmpty()) {
|
if (!cardsToExile.isEmpty()) {
|
||||||
if (controller.moveCards(cardsToExile, Zone.EXILED, source, game)) {
|
if (controller.moveCards(cardsToExile, Zone.EXILED, source, game)) {
|
||||||
Cards copiedCards = new CardsImpl();
|
Cards copiedCards = new CardsImpl();
|
||||||
|
@ -114,18 +127,25 @@ class MizzixsMasteryOverloadEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
boolean continueCasting = true;
|
boolean continueCasting = true;
|
||||||
while (continueCasting && controller.isInGame()) {
|
while (continueCasting && controller.isInGame()) {
|
||||||
TargetCard targetCard = new TargetCard(0, 1, Zone.EXILED, new FilterCard("copied card to cast without paying its mana cost?"));
|
TargetCard targetCard = new TargetCard(0, 1, Zone.EXILED,
|
||||||
|
new FilterCard("copied card to cast without paying its mana cost?"));
|
||||||
targetCard.setNotTarget(true);
|
targetCard.setNotTarget(true);
|
||||||
if (controller.choose(outcome, copiedCards, targetCard, game)) {
|
if (controller.choose(Outcome.PlayForFree, copiedCards, targetCard, game)) {
|
||||||
Card selectedCard = game.getCard(targetCard.getFirstTarget());
|
Card selectedCard = game.getCard(targetCard.getFirstTarget());
|
||||||
if (selectedCard != null && selectedCard.getSpellAbility().canChooseTarget(game)) {
|
if (selectedCard != null
|
||||||
if (controller.cast(selectedCard.getSpellAbility(), game, true, new MageObjectReference(source.getSourceObject(game), game))) {
|
&& selectedCard.getSpellAbility().canChooseTarget(game)) {
|
||||||
|
game.getState().setValue("PlayFromNotOwnHandZone" + selectedCard.getId(), Boolean.TRUE);
|
||||||
|
Boolean cardWasCast = controller.cast(controller.chooseAbilityForCast(selectedCard, game, true),
|
||||||
|
game, true, new MageObjectReference(source.getSourceObject(game), game));
|
||||||
|
game.getState().setValue("PlayFromNotOwnHandZone" + selectedCard.getId(), null);
|
||||||
|
if (cardWasCast) {
|
||||||
copiedCards.remove(selectedCard);
|
copiedCards.remove(selectedCard);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
continueCasting = !copiedCards.isEmpty()
|
continueCasting = !copiedCards.isEmpty()
|
||||||
&& controller.chooseUse(outcome, "Cast one of the copied cards without paying its mana cost?", source, game);
|
&& controller.chooseUse(Outcome.PlayForFree, "Cast one of the copied "
|
||||||
|
+ "cards without paying its mana cost?", source, game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,8 @@ public final class OmnispellAdept extends CardImpl {
|
||||||
this.power = new MageInt(3);
|
this.power = new MageInt(3);
|
||||||
this.toughness = new MageInt(4);
|
this.toughness = new MageInt(4);
|
||||||
|
|
||||||
// {2}{U}, {T}: You may cast an instant or sorcery card from your hand without paying its mana cost.
|
// {2}{U}, {T}: You may cast an instant or sorcery card from your hand
|
||||||
|
// without paying its mana cost.
|
||||||
Ability ability = new SimpleActivatedAbility(
|
Ability ability = new SimpleActivatedAbility(
|
||||||
new OmnispellAdeptEffect(), new ManaCostsImpl("{2}{U}")
|
new OmnispellAdeptEffect(), new ManaCostsImpl("{2}{U}")
|
||||||
);
|
);
|
||||||
|
@ -55,11 +56,13 @@ public final class OmnispellAdept extends CardImpl {
|
||||||
|
|
||||||
class OmnispellAdeptEffect extends OneShotEffect {
|
class OmnispellAdeptEffect extends OneShotEffect {
|
||||||
|
|
||||||
private static final FilterCard filter = new FilterInstantOrSorceryCard("instant or sorcery card from your hand");
|
private static final FilterCard filter = new FilterInstantOrSorceryCard(
|
||||||
|
"instant or sorcery card from your hand");
|
||||||
|
|
||||||
public OmnispellAdeptEffect() {
|
public OmnispellAdeptEffect() {
|
||||||
super(Outcome.PlayForFree);
|
super(Outcome.PlayForFree);
|
||||||
this.staticText = "you may cast an instant or sorcery card from your hand without paying its mana cost";
|
this.staticText = "you may cast an instant or sorcery card from your hand "
|
||||||
|
+ "without paying its mana cost";
|
||||||
}
|
}
|
||||||
|
|
||||||
public OmnispellAdeptEffect(final OmnispellAdeptEffect effect) {
|
public OmnispellAdeptEffect(final OmnispellAdeptEffect effect) {
|
||||||
|
@ -79,13 +82,16 @@ class OmnispellAdeptEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
Target target = new TargetCardInHand(filter);
|
Target target = new TargetCardInHand(filter);
|
||||||
if (target.canChoose(source.getSourceId(), controller.getId(), game)
|
if (target.canChoose(source.getSourceId(), controller.getId(), game)
|
||||||
&& controller.chooseUse(outcome, "Cast an instant or sorcery card from your hand without paying its mana cost?", source, game)) {
|
&& controller.chooseUse(Outcome.PlayForFree, "Cast an instant or sorcery "
|
||||||
|
+ "card from your hand without paying its mana cost?", source, game)) {
|
||||||
Card cardToCast = null;
|
Card cardToCast = null;
|
||||||
boolean cancel = false;
|
boolean cancel = false;
|
||||||
while (controller.canRespond() && !cancel) {
|
while (controller.canRespond()
|
||||||
if (controller.chooseTarget(outcome, target, source, game)) {
|
&& !cancel) {
|
||||||
|
if (controller.chooseTarget(Outcome.PlayForFree, target, source, game)) {
|
||||||
cardToCast = game.getCard(target.getFirstTarget());
|
cardToCast = game.getCard(target.getFirstTarget());
|
||||||
if (cardToCast != null && cardToCast.getSpellAbility().canChooseTarget(game)) {
|
if (cardToCast != null
|
||||||
|
&& cardToCast.getSpellAbility().canChooseTarget(game)) {
|
||||||
cancel = true;
|
cancel = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -93,7 +99,10 @@ class OmnispellAdeptEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cardToCast != null) {
|
if (cardToCast != null) {
|
||||||
controller.cast(cardToCast.getSpellAbility(), game, true, new MageObjectReference(source.getSourceObject(game), game));
|
game.getState().setValue("PlayFromNotOwnHandZone" + cardToCast.getId(), Boolean.TRUE);
|
||||||
|
controller.cast(controller.chooseAbilityForCast(cardToCast, game, true),
|
||||||
|
game, true, new MageObjectReference(source.getSourceObject(game), game));
|
||||||
|
game.getState().setValue("PlayFromNotOwnHandZone" + cardToCast.getId(), null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue