- Fixes all but the Conflagrate issue in regards to FlashbackAbility. The CMC issue works with the Flashback cards as well. Conflagrate will require more testing to see what is going on.

This commit is contained in:
Achilles 2017-03-30 21:11:15 -05:00
parent c56975fa7e
commit c968a03ff8
2 changed files with 8 additions and 4 deletions

View file

@ -53,7 +53,7 @@ import java.util.UUID;
public class Conflagrate extends CardImpl {
public Conflagrate(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{X}{R}");
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{X}{R}");
// Conflagrate deals X damage divided as you choose among any number of target creatures and/or players.
DynamicValue xValue = new ConflagrateVariableValue();
@ -81,12 +81,13 @@ class ConflagrateVariableValue implements DynamicValue {
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
int xValue = sourceAbility.getManaCostsToPay().getX();
for (Cost cost : sourceAbility.getCosts()) {
if (cost instanceof DiscardTargetCost) {
return ((DiscardTargetCost) cost).getCards().size();
xValue = ((DiscardTargetCost) cost).getCards().size();
}
}
return sourceAbility.getManaCostsToPay().getX();
return xValue;
}
@Override

View file

@ -30,6 +30,7 @@ package mage.abilities.costs;
import java.util.UUID;
import mage.abilities.Ability;
import mage.game.Game;
import mage.game.stack.Spell;
import mage.players.Player;
import mage.target.Target;
import mage.target.Targets;
@ -165,7 +166,9 @@ public abstract class VariableCostImpl implements Cost, VariableCost {
public int announceXValue(Ability source, Game game) {
int xValue = 0;
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Spell spell = game.getStack().getSpell(source.getId());
if (controller != null
&& spell != null) {
xValue = controller.announceXCost(getMinValue(source, game), getMaxValue(source, game),
"Announce the number of " + actionText, game, source, this);
}