- Fixed Battlefield Thaumaturge not reducing cost of Polymorphous Rush

This commit is contained in:
swordshine
2014-05-11 14:22:35 +00:00
parent 47c455a967
commit a8545035c7
3 changed files with 25 additions and 4 deletions

View File

@@ -19,6 +19,7 @@ package forge.game.card;
import com.google.common.base.Predicate; import com.google.common.base.Predicate;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import forge.GameCommand; import forge.GameCommand;
import forge.card.CardCharacteristicName; import forge.card.CardCharacteristicName;
import forge.card.CardType; import forge.card.CardType;
@@ -56,6 +57,7 @@ import forge.game.zone.Zone;
import forge.game.zone.ZoneType; import forge.game.zone.ZoneType;
import forge.util.Aggregates; import forge.util.Aggregates;
import forge.util.Lang; import forge.util.Lang;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import java.util.*; import java.util.*;
@@ -557,6 +559,16 @@ public class CardFactoryUtil {
return 0; 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; int n = s.startsWith("Amount") ? objects.size() : 0;
return doXMath(n, extractOperators(s), source); return doXMath(n, extractOperators(s), source);
} }

View File

@@ -13,6 +13,7 @@ import forge.card.mana.ManaCostShard;
import forge.game.Game; import forge.game.Game;
import forge.game.ability.AbilityUtils; import forge.game.ability.AbilityUtils;
import forge.game.card.Card; import forge.game.card.Card;
import forge.game.card.CardFactoryUtil;
import forge.game.card.CardLists; import forge.game.card.CardLists;
import forge.game.card.CardPredicates; import forge.game.card.CardPredicates;
import forge.game.player.Player; import forge.game.player.Player;
@@ -410,8 +411,16 @@ public class ManaCostAdjustment {
if (params.containsKey("AffectedZone") && !card.isInZone(ZoneType.smartValueOf(params.get("AffectedZone")))) { if (params.containsKey("AffectedZone") && !card.isInZone(ZoneType.smartValueOf(params.get("AffectedZone")))) {
return; 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")) { if (!params.containsKey("Color")) {
manaCost.decreaseColorlessMana(value); manaCost.decreaseColorlessMana(value);

View File

@@ -3,8 +3,8 @@ ManaCost:1 U
Types:Creature Human Wizard Types:Creature Human Wizard
PT:2/1 PT:2/1
S:Mode$ ReduceCost | ValidCard$ Instant.YouCtrl,Sorcery.YouCtrl | Type$ Spell | Amount$ ReduceCost | References$ ReduceCost | EffectZone$ All | Description$ Each instant and sorcery spell you cast costs {1} less to cast for each creature it targets. S:Mode$ ReduceCost | ValidCard$ Instant.YouCtrl,Sorcery.YouCtrl | Type$ Spell | Amount$ ReduceCost | References$ ReduceCost | EffectZone$ All | Description$ Each instant and sorcery spell you cast costs {1} less to cast for each creature it targets.
SVar:ReduceCost:Targeted$Valid Creature SVar:ReduceCost:TargetedObjects$Valid Creature
T:Mode$ SpellCast | ValidActivatingPlayer$ You | TargetsValid$ Card.Self | TriggerZones$ Battlefield | Execute$ TrigPump | TriggerDescription$ Heroic - Whenever you cast a spell that targets CARDNAME, CARDNAME gains hexproof until end of turn.. T:Mode$ SpellCast | ValidActivatingPlayer$ You | TargetsValid$ Card.Self | TriggerZones$ Battlefield | Execute$ TrigPump | TriggerDescription$ Heroic - Whenever you cast a spell that targets CARDNAME, CARDNAME gains hexproof until end of turn.
SVar:TrigPump:AB$ Pump | Cost$ 0 | KW$ Hexproof SVar:TrigPump:AB$ Pump | Cost$ 0 | KW$ Hexproof
SVar:Picture:http://www.wizards.com/global/images/magic/general/battlefield_thaumaturge.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/battlefield_thaumaturge.jpg
Oracle:Each instant and sorcery spell you cast costs {1} less to cast for each creature it targets.\nHeroic - Whenever you cast a spell that targets Battlefield Thaumaturge, Battlefield Thaumaturge gains hexproof until end of turn. Oracle:Each instant and sorcery spell you cast costs {1} less to cast for each creature it targets.\nHeroic - Whenever you cast a spell that targets Battlefield Thaumaturge, Battlefield Thaumaturge gains hexproof until end of turn.