forked from External/mage
Gavi, Nest Warden - fixed game error on usage
This commit is contained in:
parent
5eb4bb0112
commit
655625d695
2 changed files with 11 additions and 5 deletions
|
|
@ -93,13 +93,17 @@ class CyclingZeroCostEffect extends CostModificationEffectImpl {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null || !player.chooseUse(outcome, "Pay {0} to cycle this card?", source, game)) {
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
if (game.inCheckPlayableState() || player.chooseUse(outcome, "Pay {0} to cycle this card?", source, game)) {
|
||||
abilityToModify.clearManaCostsToPay();
|
||||
abilityToModify.getCosts().removeIf(cost -> !CyclingDiscardCost.class.isInstance(cost));
|
||||
abilityToModify.addManaCostsToPay(new GenericManaCost(0));
|
||||
return true;
|
||||
}
|
||||
abilityToModify.clearManaCostsToPay();
|
||||
abilityToModify.getCosts().removeIf(cost -> !CyclingDiscardCost.class.isInstance(cost));
|
||||
abilityToModify.addManaCostsToPay(new GenericManaCost(0));
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ public interface CostModificationEffect extends ContinuousEffect {
|
|||
/**
|
||||
* Called by the {@link ContinuousEffects#costModification(java.util.UUID, mage.abilities.Ability, mage.game.Game) ContinuousEffects.costModification}
|
||||
* method.
|
||||
* <p>
|
||||
* Warning, choose dialogs restricted in plyable calculation, so you must check inCheckPlayableState
|
||||
*
|
||||
* @param game The game for which this effect should be applied.
|
||||
* @param source The source ability of this effect.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue