mirror of
https://github.com/magefree/mage.git
synced 2026-01-24 20:29:19 -08:00
Changed Decree of Justice to attach it's mana cost to the CycleTriggeredAbility instead handling the cost in the card.
This commit is contained in:
parent
2e3c916717
commit
8ff6368aaf
1 changed files with 7 additions and 7 deletions
|
|
@ -34,6 +34,7 @@ import mage.abilities.costs.mana.GenericManaCost;
|
||||||
import mage.abilities.costs.mana.ManaCost;
|
import mage.abilities.costs.mana.ManaCost;
|
||||||
import mage.abilities.costs.mana.ManaCosts;
|
import mage.abilities.costs.mana.ManaCosts;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
|
import mage.abilities.costs.mana.VariableManaCost;
|
||||||
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
|
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.CreateTokenEffect;
|
import mage.abilities.effects.common.CreateTokenEffect;
|
||||||
|
|
@ -66,6 +67,7 @@ public class DecreeOfJustice extends CardImpl {
|
||||||
|
|
||||||
// When you cycle Decree of Justice, you may pay {X}. If you do, create X 1/1 white Soldier creature tokens.
|
// When you cycle Decree of Justice, you may pay {X}. If you do, create X 1/1 white Soldier creature tokens.
|
||||||
Ability ability = new CycleTriggeredAbility(new DecreeOfJusticeCycleEffect(), true);
|
Ability ability = new CycleTriggeredAbility(new DecreeOfJusticeCycleEffect(), true);
|
||||||
|
ability.addCost(new ManaCostsImpl<>("{X}"));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -98,14 +100,12 @@ class DecreeOfJusticeCycleEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player player = game.getPlayer(source.getControllerId());
|
Player player = game.getPlayer(source.getControllerId());
|
||||||
ManaCosts<ManaCost> cost = new ManaCostsImpl<>("{X}");
|
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
int costX = player.announceXMana(0, Integer.MAX_VALUE, "Announce the value for {X}", game, source);
|
Token token = new SoldierToken();
|
||||||
cost.add(new GenericManaCost(costX));
|
int X = new ManacostVariableValue().calculate(game, source, this);
|
||||||
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) {
|
token.putOntoBattlefield(X, game, source.getSourceId(), source.getControllerId());
|
||||||
Token token = new SoldierToken();
|
return true;
|
||||||
token.putOntoBattlefield(costX, game, source.getSourceId(), source.getControllerId());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue