mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
fixed Niv-Mizzet Reborn not allowing any selections (fixes #5713)
This commit is contained in:
parent
1baf044402
commit
3301cc3b78
1 changed files with 12 additions and 1 deletions
|
@ -91,11 +91,19 @@ class NivMizzetRebornEffect extends OneShotEffect {
|
||||||
String otherColors = "";
|
String otherColors = "";
|
||||||
for (char c : "WUBRG".toCharArray()) {
|
for (char c : "WUBRG".toCharArray()) {
|
||||||
if (color1.charAt(0) == c || color2.charAt(0) == c) {
|
if (color1.charAt(0) == c || color2.charAt(0) == c) {
|
||||||
otherColors += c;
|
continue;
|
||||||
}
|
}
|
||||||
|
otherColors += c;
|
||||||
}
|
}
|
||||||
return otherColors;
|
return otherColors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isInCards(Cards cards, Game game) {
|
||||||
|
FilterCard filter = new FilterCard(getDescription());
|
||||||
|
filter.add(new ColorPredicate(new ObjectColor(color1 + color2)));
|
||||||
|
filter.add(Predicates.not(new ColorPredicate(new ObjectColor(getOtherColors()))));
|
||||||
|
return cards.getCards(game).stream().anyMatch(card -> filter.match(card, game));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NivMizzetRebornEffect() {
|
NivMizzetRebornEffect() {
|
||||||
|
@ -127,6 +135,9 @@ class NivMizzetRebornEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
player.revealCards(source, cards, game);
|
player.revealCards(source, cards, game);
|
||||||
for (Guild guild : Guild.values()) {
|
for (Guild guild : Guild.values()) {
|
||||||
|
if (!guild.isInCards(cards, game)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
TargetCard target = guild.getTarget();
|
TargetCard target = guild.getTarget();
|
||||||
if (player.choose(outcome, cards, target, game)) {
|
if (player.choose(outcome, cards, target, game)) {
|
||||||
Card card = game.getCard(target.getFirstTarget());
|
Card card = game.getCard(target.getFirstTarget());
|
||||||
|
|
Loading…
Reference in a new issue