Fixed FilterCard with splitcard

This commit is contained in:
Plopman 2013-08-13 19:04:35 +02:00
parent 61d0e7db0d
commit da3c153a10

View file

@ -33,6 +33,7 @@ import java.util.List;
import java.util.Set;
import java.util.UUID;
import mage.cards.Card;
import mage.cards.SplitCard;
import mage.filter.predicate.ObjectPlayer;
import mage.filter.predicate.ObjectPlayerPredicate;
import mage.filter.predicate.ObjectSourcePlayer;
@ -62,6 +63,26 @@ public class FilterCard extends FilterObject<Card> {
this.extraPredicates = new ArrayList<ObjectPlayerPredicate<ObjectPlayer<Card>>>(filter.extraPredicates);
}
//20130711 708.6c
/* If anything performs a comparison involving multiple characteristics or
* values of one or more split cards in any zone other than the stack or
* involving multiple characteristics or values of one or more fused split
* spells, each characteristic or value is compared separately. If each of
* the individual comparisons would return a yes answer, the whole
* comparison returns a yes answer. The individual comparisons may involve
* different halves of the same split card.
*/
@Override
public boolean match(Card card, Game game) {
if(card.isSplitCard()){
return super.match(((SplitCard)card).getLeftHalfCard(), game) ||
super.match(((SplitCard)card).getRightHalfCard(), game);
}
else{
return super.match(card, game);
}
}
public boolean match(Card card, UUID playerId, Game game) {
if (!this.match(card, game)) {
return false;