Add Niv-Mizzet Reborn

This commit is contained in:
swordshine
2019-05-04 19:43:01 +08:00
parent 312dfc0205
commit e4fad75edd
5 changed files with 40 additions and 0 deletions

View File

@@ -112,6 +112,11 @@ public final class ColorSet implements Comparable<ColorSet>, Iterable<Byte>, Ser
return (this.myColor & colormask) == colormask;
}
/** this has exactly the colors defined by operand. */
public boolean hasExactlyColor(final int colormask) {
return this.myColor == colormask;
}
/** this has no other colors except defined by operand. */
public boolean hasNoColorsExcept(final ColorSet other) {
return hasNoColorsExcept(other.getColor());

View File

@@ -25,6 +25,8 @@ public final class MagicColor {
public static final byte[] WUBRG = new byte[] { WHITE, BLUE, BLACK, RED, GREEN };
public static final byte[] WUBRGC = new byte[] { WHITE, BLUE, BLACK, RED, GREEN, COLORLESS };
public static final byte[] COLORPAIR = new byte[] { WHITE | BLUE, BLUE | BLACK, BLACK | RED, RED | GREEN, GREEN |WHITE,
WHITE | BLUE, BLUE | RED, BLACK | GREEN, RED | WHITE, GREEN | BLUE};
/**
* Private constructor to prevent instantiation.

View File

@@ -1,5 +1,6 @@
package forge.game.ability.effects;
import forge.card.MagicColor;
import forge.game.Game;
import forge.game.GameActionUtil;
import forge.game.GameEntityCounterTable;
@@ -9,6 +10,7 @@ import forge.game.card.Card;
import forge.game.card.CardCollection;
import forge.game.card.CardCollectionView;
import forge.game.card.CardLists;
import forge.game.card.CardPredicates;
import forge.game.card.CardZoneTable;
import forge.game.card.CounterType;
import forge.game.player.DelayedReveal;
@@ -224,6 +226,20 @@ public class DigEffect extends SpellAbilityEffect {
int numChanging = Math.min(destZone1ChangeNum, valid.size());
movedCards = CardLists.getRandomSubList(valid, numChanging);
}
else if (sa.hasParam("ForEachColorPair")) {
movedCards = new CardCollection();
if (p == chooser) {
chooser.getController().tempShowCards(top);
}
for (final byte pair : MagicColor.COLORPAIR) {
Card chosen = chooser.getController().chooseSingleEntityForEffect(CardLists.filter(valid, CardPredicates.isExactlyColor(pair)),
delayedReveal, sa, "Choose one", false, p);
if (chosen != null) {
movedCards.add(chosen);
}
}
chooser.getController().endTempShowCards();
}
else if (allButOne) {
movedCards = new CardCollection(valid);
String prompt;

View File

@@ -234,6 +234,15 @@ public final class CardPredicates {
};
} // getColor()
public static final Predicate<Card> isExactlyColor(final byte color) {
return new Predicate<Card>() {
@Override
public boolean apply(final Card c) {
return CardUtil.getColors(c).hasExactlyColor(color);
}
};
}
public static final Predicate<Card> isColorless() {
return new Predicate<Card>() {
@Override

View File

@@ -0,0 +1,8 @@
Name:Niv-Mizzet Reborn
ManaCost:W U B R G
Types:Legendary Creature Dragon Avatar
PT:6/6
K:Flying
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigDig | TriggerDescription$ When CARDNAME enters the battlefield, reveal the top ten cards of your library. For each color pair, choose a card that's exactly those colors from among them. Put the chosen cards into your hand and the rest on the bottom of your library in a random order.
SVar:TrigDig:DB$ Dig | DigNum$ 10 | Reveal$ True | ForEachColorPair$ True | RestRandomOrder$ True
Oracle:Flying\nWhen Niv-Mizzet Reborn enters the battlefield, reveal the top ten cards of your library. For each color pair, choose a card that's exactly those colors from among them. Put the chosen cards into your hand and the rest on the bottom of your library in a random order.