mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
* Fixed the handling of comparing characteristics concerning split cards (related to the recent rule changes).
This commit is contained in:
parent
4b421fa722
commit
0b827b239c
6 changed files with 67 additions and 31 deletions
|
|
@ -28,14 +28,11 @@
|
|||
package mage.filter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import mage.cards.Card;
|
||||
import mage.cards.SplitCard;
|
||||
import mage.filter.predicate.ObjectPlayer;
|
||||
import mage.filter.predicate.ObjectPlayerPredicate;
|
||||
import mage.filter.predicate.ObjectSourcePlayer;
|
||||
|
|
@ -78,12 +75,7 @@ public class FilterCard extends FilterObject<Card> {
|
|||
if (card == null) {
|
||||
return false;
|
||||
}
|
||||
if (card.isSplitCard()) {
|
||||
return super.match(((SplitCard) card).getLeftHalfCard(), game)
|
||||
|| super.match(((SplitCard) card).getRightHalfCard(), game);
|
||||
} else {
|
||||
return super.match(card, game);
|
||||
}
|
||||
return super.match(card, game);
|
||||
}
|
||||
|
||||
public boolean match(Card card, UUID playerId, Game game) {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,10 @@
|
|||
*/
|
||||
package mage.util;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.Mana;
|
||||
import mage.ObjectColor;
|
||||
|
|
@ -36,7 +40,6 @@ import mage.abilities.SpellAbility;
|
|||
import mage.abilities.costs.VariableCost;
|
||||
import mage.abilities.costs.mana.*;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.SplitCard;
|
||||
import mage.filter.FilterMana;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
|
@ -44,11 +47,6 @@ import mage.game.permanent.token.Token;
|
|||
import mage.game.stack.Spell;
|
||||
import mage.util.functions.CopyTokenFunction;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author nantuko
|
||||
*/
|
||||
|
|
@ -540,13 +538,7 @@ public final class CardUtil {
|
|||
cmcObject.add(object.getConvertedManaCost());
|
||||
} else if (object instanceof Card) {
|
||||
Card card = (Card) object;
|
||||
if (card instanceof SplitCard) {
|
||||
SplitCard splitCard = (SplitCard) card;
|
||||
cmcObject.add(splitCard.getLeftHalfCard().getConvertedManaCost());
|
||||
cmcObject.add(splitCard.getRightHalfCard().getConvertedManaCost());
|
||||
} else {
|
||||
cmcObject.add(card.getConvertedManaCost());
|
||||
}
|
||||
cmcObject.add(card.getConvertedManaCost());
|
||||
}
|
||||
return cmcObject;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue