- Added Tariff

This commit is contained in:
swordshine
2013-12-22 13:03:31 +00:00
parent 79b8340b80
commit f55abfa576
4 changed files with 26 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import forge.card.MagicColor;
import forge.card.mana.ManaCost;
import forge.card.mana.ManaCostShard;
import org.apache.commons.lang3.StringUtils;
@@ -1205,6 +1206,13 @@ public class AbilityUtils {
if (unlessCost.equals("CardManaCost")) {
cost = new Cost(source.getManaCost(), true);
}
else if (unlessCost.equals("ChosenManaCost")) {
if (source.getChosenCard().isEmpty()) {
cost = new Cost(ManaCost.ZERO, true);
} else {
cost = new Cost(source.getChosenCard().get(0).getManaCost(), true);
}
}
else if (unlessCost.equals("RememberedCostMinus2")) {
if (source.getRemembered().isEmpty() || !(source.getRemembered().get(0) instanceof Card)) {
sa.resolve();

View File

@@ -6268,7 +6268,14 @@ public class Card extends GameEntity implements Comparable<Card> {
}
}
} else if (property.startsWith("greatestCMC")) {
final List<Card> list = CardLists.filter(game.getCardsIn(ZoneType.Battlefield), Presets.CREATURES);
List<Card> list = CardLists.filter(game.getCardsIn(ZoneType.Battlefield), Presets.CREATURES);
if (property.contains("ControlledBy")) {
List<Player> p = AbilityUtils.getDefinedPlayers(source, property.split("ControlledBy")[1], null);
list = CardLists.filterControlledBy(list, p);
if (!list.contains(this)) {
return false;
}
}
for (final Card crd : list) {
if (crd.isSplitCard()) {
if (crd.getCMC(Card.SplitCMCMode.LeftSplitCMC) > this.getCMC() || crd.getCMC(Card.SplitCMCMode.RightSplitCMC) > this.getCMC()) {