fixed a potential issue with Dispersal not counting transformed lands like Primal Wellspring

This commit is contained in:
Evan Kranzler 2019-04-24 18:08:16 -04:00
parent c92c4db608
commit 087c437658

View file

@ -1,8 +1,5 @@
package mage.cards.d; package mage.cards.d;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
@ -12,11 +9,7 @@ import mage.abilities.effects.common.discard.DiscardEachPlayerEffect;
import mage.abilities.effects.keyword.SurveilEffect; import mage.abilities.effects.keyword.SurveilEffect;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.cards.SplitCard; import mage.cards.SplitCard;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.ComparisonType;
import mage.constants.Outcome;
import mage.constants.SpellAbilityType;
import mage.constants.TargetController;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.common.FilterNonlandPermanent; import mage.filter.common.FilterNonlandPermanent;
import mage.filter.predicate.Predicates; import mage.filter.predicate.Predicates;
@ -29,8 +22,11 @@ import mage.players.Player;
import mage.target.Target; import mage.target.Target;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/** /**
*
* @author TheElk801 * @author TheElk801
*/ */
public final class DiscoveryDispersal extends SplitCard { public final class DiscoveryDispersal extends SplitCard {
@ -57,7 +53,7 @@ public final class DiscoveryDispersal extends SplitCard {
this.getRightHalfCard().getSpellAbility().addEffect(new DispersalEffect()); this.getRightHalfCard().getSpellAbility().addEffect(new DispersalEffect());
} }
public DiscoveryDispersal(final DiscoveryDispersal card) { private DiscoveryDispersal(final DiscoveryDispersal card) {
super(card); super(card);
} }
@ -69,7 +65,7 @@ public final class DiscoveryDispersal extends SplitCard {
class DispersalEffect extends OneShotEffect { class DispersalEffect extends OneShotEffect {
public DispersalEffect() { DispersalEffect() {
super(Outcome.Benefit); super(Outcome.Benefit);
this.staticText = "Each opponent returns a nonland permanent " this.staticText = "Each opponent returns a nonland permanent "
+ "they control with the highest converted mana cost " + "they control with the highest converted mana cost "
@ -77,7 +73,7 @@ class DispersalEffect extends OneShotEffect {
+ "then discards a card."; + "then discards a card.";
} }
public DispersalEffect(final DispersalEffect effect) { private DispersalEffect(final DispersalEffect effect) {
super(effect); super(effect);
} }
@ -100,7 +96,7 @@ class DispersalEffect extends OneShotEffect {
} }
int highestCMC = 0; int highestCMC = 0;
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(opponentId)) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(opponentId)) {
if (permanent != null && !permanent.isLand()) { if (permanent != null) {
highestCMC = Math.max(highestCMC, permanent.getConvertedManaCost()); highestCMC = Math.max(highestCMC, permanent.getConvertedManaCost());
} }
} }