CardProperty: hasXCost, it should check ManaCost

This commit is contained in:
Hans Mackowiak
2021-02-23 16:58:55 +01:00
parent 848635d8e0
commit 96532309ce
4 changed files with 6 additions and 12 deletions

View File

@@ -5,6 +5,7 @@ import com.google.common.collect.Lists;
import forge.card.ColorSet;
import forge.card.MagicColor;
import forge.card.mana.ManaCost;
import forge.card.mana.ManaCostShard;
import forge.game.Direction;
import forge.game.EvenOdd;
@@ -1389,8 +1390,8 @@ public class CardProperty {
return false;
}
} else if (property.startsWith("hasXCost")) {
SpellAbility sa1 = card.getFirstSpellAbility();
if (sa1 != null && !sa1.costHasManaX()) {
ManaCost cost = card.getManaCost();
if (cost == null || cost.countX() <= 0) {
return false;
}
} else if (property.startsWith("suspended")) {

View File

@@ -18,7 +18,6 @@
package forge.game.cost;
import forge.card.mana.ManaCost;
import forge.card.mana.ManaCostShard;
import forge.game.mana.ManaConversionMatrix;
import forge.game.player.Player;
import forge.game.spellability.SpellAbility;
@@ -77,7 +76,7 @@ public class CostPartMana extends CostPart {
}
public final int getAmountOfX() {
return this.cost.getShardCount(ManaCostShard.X);
return this.cost.countX();
}
/**