mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
- Fixed Battlefield Thaumaturge not reducing cost of Polymorphous Rush
This commit is contained in:
@@ -19,6 +19,7 @@ package forge.game.card;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import forge.GameCommand;
|
||||
import forge.card.CardCharacteristicName;
|
||||
import forge.card.CardType;
|
||||
@@ -56,6 +57,7 @@ import forge.game.zone.Zone;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.util.Aggregates;
|
||||
import forge.util.Lang;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.*;
|
||||
@@ -557,6 +559,16 @@ public class CardFactoryUtil {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (s.startsWith("Valid")) {
|
||||
final List<Card> cards = new ArrayList<Card>();
|
||||
for (Object o : objects) {
|
||||
if (o instanceof Card) {
|
||||
cards.add((Card) o);
|
||||
}
|
||||
}
|
||||
return CardFactoryUtil.handlePaid(cards, s, source);
|
||||
}
|
||||
|
||||
int n = s.startsWith("Amount") ? objects.size() : 0;
|
||||
return doXMath(n, extractOperators(s), source);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import forge.card.mana.ManaCostShard;
|
||||
import forge.game.Game;
|
||||
import forge.game.ability.AbilityUtils;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.card.CardFactoryUtil;
|
||||
import forge.game.card.CardLists;
|
||||
import forge.game.card.CardPredicates;
|
||||
import forge.game.player.Player;
|
||||
@@ -410,8 +411,16 @@ public class ManaCostAdjustment {
|
||||
if (params.containsKey("AffectedZone") && !card.isInZone(ZoneType.smartValueOf(params.get("AffectedZone")))) {
|
||||
return;
|
||||
}
|
||||
// CardFactory.xCout() cannot calculate cards like Battlefield Thaumaturge
|
||||
int value = AbilityUtils.calculateAmount(hostCard, amount, sa);
|
||||
|
||||
int value;
|
||||
if ("AffectedX".equals(amount)) {
|
||||
value = CardFactoryUtil.xCount(card, hostCard.getSVar(amount));
|
||||
} else if ("X".equals(amount)){
|
||||
value = CardFactoryUtil.xCount(hostCard, hostCard.getSVar(amount));
|
||||
} else {
|
||||
value = AbilityUtils.calculateAmount(hostCard, amount, sa);
|
||||
}
|
||||
|
||||
|
||||
if (!params.containsKey("Color")) {
|
||||
manaCost.decreaseColorlessMana(value);
|
||||
|
||||
Reference in New Issue
Block a user