* Reality Scramble - fix that the last matching card is put onto the battlefield instead of the first matching card (fixes #5290).

This commit is contained in:
Quercitron 2018-09-01 15:06:12 +03:00
parent a0776d7b66
commit 470fd4c75a
2 changed files with 38 additions and 1 deletions

View file

@ -38,7 +38,9 @@ public final class RealityScramble extends CardImpl {
public RealityScramble(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}{R}");
// Put target permanent you own on the bottom of your library. Reveal cards from the top of your library until you reveal a card that shares a card type with that permanent. Put that card onto the battlefield and the rest on the bottom of your library in a random order.
// Put target permanent you own on the bottom of your library. Reveal cards from the top of your library
// until you reveal a card that shares a card type with that permanent. Put that card onto the battlefield
// and the rest on the bottom of your library in a random order.
this.getSpellAbility().addEffect(new RealityScrambleEffect());
this.getSpellAbility().addTarget(new TargetPermanent(filter));
@ -99,6 +101,9 @@ class RealityScrambleEffect extends OneShotEffect {
break;
}
}
if (cardToPlay != null) {
break;
}
}
controller.revealCards(source, toReveal, game);
if (cardToPlay != null) {