* Fixed that cost modification with target check (Icefall Regent) did not work for flashbacked spells (fixes #1405).

This commit is contained in:
LevelX2 2016-08-05 17:33:52 +02:00
parent 956724b5fa
commit 9b683ef481
3 changed files with 123 additions and 140 deletions

View file

@ -75,6 +75,7 @@ public class FlashbackAbility extends SpellAbility {
this.timing = timingRule;
this.usesStack = false;
this.spellAbilityType = SpellAbilityType.BASE_ALTERNATE;
setCostModificationActive(false);
}
public FlashbackAbility(final FlashbackAbility ability) {
@ -195,7 +196,9 @@ class FlashbackEffect extends OneShotEffect {
spellAbility.clear();
// set the payed flashback costs to the spell ability so abilities like Converge or calculation of {X} values work
spellAbility.getManaCostsToPay().clear();
spellAbility.getManaCostsToPay().addAll(source.getManaCostsToPay());
spellAbility.getManaCostsToPay().addAll(source.getManaCosts());
spellAbility.getManaCosts().clear();
spellAbility.getManaCosts().addAll(source.getManaCosts());
// needed to get e.g. paid costs from Conflagrate
for (Cost cost : source.getCosts()) {
if (!(cost instanceof VariableCost)) {
@ -205,7 +208,7 @@ class FlashbackEffect extends OneShotEffect {
if (!game.isSimulation()) {
game.informPlayers(controller.getLogName() + " flashbacks " + card.getLogName());
}
spellAbility.setCostModificationActive(false); // prevents to apply cost modification twice for flashbacked spells
// spellAbility.setCostModificationActive(false); // prevents to apply cost modification twice for flashbacked spells
if (controller.cast(spellAbility, game, false)) {
ContinuousEffect effect = new FlashbackReplacementEffect();
effect.setTargetPointer(new FixedTarget(source.getSourceId(), game.getState().getZoneChangeCounter(source.getSourceId())));