forked from External/mage
there were 3 enums to compare ints, refactored to 1
This commit is contained in:
parent
813d84274a
commit
cb693b5826
339 changed files with 1263 additions and 1225 deletions
|
|
@ -29,10 +29,10 @@
|
|||
package mage.abilities.effects.common.cost;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.CountType;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterNonlandCard;
|
||||
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
||||
import mage.game.Game;
|
||||
|
|
@ -58,7 +58,7 @@ public class CastWithoutPayingManaCostEffect extends OneShotEffect {
|
|||
public CastWithoutPayingManaCostEffect(int maxCost) {
|
||||
super(Outcome.PlayForFree);
|
||||
filter = new FilterNonlandCard("card with converted mana cost " + maxCost + " or less from your hand");
|
||||
filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, maxCost + 1));
|
||||
filter.add(new ConvertedManaCostPredicate(CountType.FEWER_THAN, maxCost + 1));
|
||||
this.manaCost = maxCost;
|
||||
this.staticText = "you may cast a card with converted mana cost " + maxCost + " or less from your hand without paying its mana cost";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,11 +28,11 @@
|
|||
package mage.abilities.effects.common.search;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.CountType;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
||||
import mage.game.Game;
|
||||
|
|
@ -67,7 +67,7 @@ public class SearchLibraryWithLessCMCPutInPlayEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
FilterCard advancedFilter = filter.copy(); // never change static objects so copy the object here before
|
||||
advancedFilter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, source.getManaCostsToPay().getX() + 1));
|
||||
advancedFilter.add(new ConvertedManaCostPredicate(CountType.FEWER_THAN, source.getManaCostsToPay().getX() + 1));
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(advancedFilter);
|
||||
if (controller.searchLibrary(target, game)) {
|
||||
if (!target.getTargets().isEmpty()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue