fixed Mana Web not taking colorless mana into account

This commit is contained in:
Evan Kranzler 2017-09-27 21:19:04 -04:00
parent dbb185c47a
commit 9797f4d23b
2 changed files with 10 additions and 3 deletions

View file

@ -52,7 +52,7 @@ import mage.target.targetpointer.FixedTarget;
public class ManaWeb extends CardImpl {
public ManaWeb(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}");
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
// Whenever a land an opponent controls is tapped for mana, tap all lands that player controls that could produce any type of mana that land could produce.
this.addAbility(new ManaWebTriggeredAbility());
@ -155,7 +155,7 @@ class ManaWebeffect extends OneShotEffect {
}
}
if (mana.containsAny(opponentLandMana)) {
if (mana.containsAny(opponentLandMana, true)) {
tappedLands = opponentPermanent.tap(game) || tappedLands;
}
}

View file

@ -846,15 +846,20 @@ public class Mana implements Comparable<Mana>, Serializable, Copyable<Mana> {
return false;
}
public boolean containsAny(final Mana mana) {
return containsAny(mana, false);
}
/**
* Returns if this objects mana contains any coloured mana the same as the
* passed in {@link Mana}'s mana.
*
* @param mana the mana to check for
* @param includeColorless also check for colorless
* @return true if this contains any of the same type of coloured mana that
* this has
*/
public boolean containsAny(final Mana mana) {
public boolean containsAny(final Mana mana, boolean includeColorless) {
if (mana.black > 0 && this.black > 0) {
return true;
} else if (mana.blue > 0 && this.blue > 0) {
@ -865,6 +870,8 @@ public class Mana implements Comparable<Mana>, Serializable, Copyable<Mana> {
return true;
} else if (mana.green > 0 && this.green > 0) {
return true;
} else if (mana.colorless > 0 && this.colorless > 0 && includeColorless) {
return true;
}
return false;