Fixes a bug where one could cast Green Sun Zenith with X=0 and search up any green creature.

This commit is contained in:
maurer.it 2011-06-11 21:47:15 -04:00
parent b6f4f0082a
commit e8c9f3c8f5

View file

@ -43,6 +43,7 @@ import mage.target.common.TargetCardInLibrary;
import java.util.List;
import java.util.UUID;
import mage.filter.Filter.ComparisonType;
/**
* @author Loki
@ -84,7 +85,9 @@ class GreenSunsZenithSearchEffect extends OneShotEffect<GreenSunsZenithSearchEff
filter.getColor().setGreen(true);
filter.setUseColor(true);
filter.getCardType().add(CardType.CREATURE);
filter.setConvertedManaCost(source.getManaCostsToPay().getVariableCosts().get(0).getAmount());
//Set the mana cost one higher to 'emulate' a less than or equal to comparison.
filter.setConvertedManaCost(source.getManaCostsToPay().getVariableCosts().get(0).getAmount() + 1);
filter.setConvertedManaCostComparison(ComparisonType.LessThan);
TargetCardInLibrary target = new TargetCardInLibrary(filter);
if (player.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {