mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
* Green Sun's Zenith - Fixed a bug of the used Search effect (also affecting the other colors).
This commit is contained in:
parent
53540838a3
commit
9ec65dc480
1 changed files with 4 additions and 3 deletions
|
|
@ -45,7 +45,7 @@ import mage.target.common.TargetCardInLibrary;
|
|||
*/
|
||||
public class SearchLibraryWithLessCMCPutInPlayEffect extends OneShotEffect {
|
||||
|
||||
private FilterCard filter;
|
||||
private final FilterCard filter;
|
||||
|
||||
public SearchLibraryWithLessCMCPutInPlayEffect() {
|
||||
this(new FilterCard());
|
||||
|
|
@ -66,8 +66,9 @@ public class SearchLibraryWithLessCMCPutInPlayEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, source.getManaCostsToPay().getX() + 1));
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(filter);
|
||||
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));
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(advancedFilter);
|
||||
if (controller.searchLibrary(target, game)) {
|
||||
if (target.getTargets().size() > 0) {
|
||||
Card card = controller.getLibrary().getCard(target.getFirstTarget(), game);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue