mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 21:42:07 -08:00
* Modal double faces cards - fixed that color identity doesn't contains second side colors;
This commit is contained in:
parent
10ac8ab86f
commit
31d134843a
4 changed files with 48 additions and 24 deletions
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.filter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -115,11 +114,11 @@ public class FilterMana implements Serializable {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return (black ? "{B}" : "")
|
||||
+ (green ? "{G}" : "")
|
||||
+ (red ? "{R}" : "")
|
||||
// wubrg order
|
||||
return (white ? "{W}" : "")
|
||||
+ (blue ? "{U}" : "")
|
||||
+ (white ? "{W}" : "");
|
||||
+ (black ? "{B}" : "")
|
||||
+ (red ? "{R}" : "")
|
||||
+ (green ? "{G}" : "");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,10 @@ import mage.abilities.dynamicvalue.DynamicValue;
|
|||
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.mana.*;
|
||||
import mage.cards.AdventureCard;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.ModalDoubleFacesCard;
|
||||
import mage.cards.SplitCard;
|
||||
import mage.choices.Choice;
|
||||
import mage.constants.ColoredManaSymbol;
|
||||
import mage.filter.FilterMana;
|
||||
|
|
@ -610,10 +613,17 @@ public final class ManaUtil {
|
|||
}
|
||||
|
||||
public static FilterMana getColorIdentity(Card card) {
|
||||
// TODO: is it support mdf cards?
|
||||
// TODO: is it support adventure cards?
|
||||
Card secondSide = card.getSecondCardFace();
|
||||
return getColorIdentity(card.getColor(null), card.getManaCost().getSymbols(), card.getRules(), secondSide);
|
||||
Card secondSide;
|
||||
if (card instanceof SplitCard) {
|
||||
secondSide = ((SplitCard) card).getRightHalfCard();
|
||||
} else if (card instanceof AdventureCard) {
|
||||
secondSide = ((AdventureCard) card).getSpellCard();
|
||||
} else if (card instanceof ModalDoubleFacesCard) {
|
||||
secondSide = ((ModalDoubleFacesCard) card).getRightHalfCard();
|
||||
} else {
|
||||
secondSide = card.getSecondCardFace();
|
||||
}
|
||||
return getColorIdentity(card.getColor(), card.getManaCost().getSymbols(), card.getRules(), secondSide);
|
||||
}
|
||||
|
||||
public static int getColorIdentityHash(FilterMana colorIdentity) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue