mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
Fixed variable cost not working in ActivateOncePerTurnActivatedAbility.
This commit is contained in:
parent
1ccaf403a6
commit
1181988fd4
2 changed files with 14 additions and 5 deletions
|
@ -35,7 +35,9 @@ import mage.Constants.Zone;
|
||||||
import mage.abilities.costs.Cost;
|
import mage.abilities.costs.Cost;
|
||||||
import mage.abilities.costs.Costs;
|
import mage.abilities.costs.Costs;
|
||||||
import mage.abilities.costs.mana.ManaCosts;
|
import mage.abilities.costs.mana.ManaCosts;
|
||||||
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.costs.mana.PhyrexianManaCost;
|
import mage.abilities.costs.mana.PhyrexianManaCost;
|
||||||
|
import mage.abilities.costs.mana.VariableManaCost;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.Effects;
|
import mage.abilities.effects.Effects;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
|
@ -98,6 +100,8 @@ public abstract class ActivatedAbilityImpl<T extends ActivatedAbilityImpl<T>> ex
|
||||||
if (cost != null) {
|
if (cost != null) {
|
||||||
if (cost instanceof PhyrexianManaCost) {
|
if (cost instanceof PhyrexianManaCost) {
|
||||||
this.addManaCost((PhyrexianManaCost)cost);
|
this.addManaCost((PhyrexianManaCost)cost);
|
||||||
|
} else if (cost instanceof ManaCostsImpl) {
|
||||||
|
this.addManaCost((ManaCostsImpl) cost);
|
||||||
} else {
|
} else {
|
||||||
this.addCost(cost);
|
this.addCost(cost);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,8 @@ import java.util.UUID;
|
||||||
import mage.Constants.Zone;
|
import mage.Constants.Zone;
|
||||||
import mage.abilities.ActivatedAbilityImpl;
|
import mage.abilities.ActivatedAbilityImpl;
|
||||||
import mage.abilities.costs.Cost;
|
import mage.abilities.costs.Cost;
|
||||||
|
import mage.abilities.costs.mana.ManaCost;
|
||||||
|
import mage.abilities.costs.mana.ManaCosts;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
|
||||||
|
@ -51,11 +53,14 @@ public class ActivateOncePerTurnActivatedAbility extends ActivatedAbilityImpl<Ac
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canActivate(UUID playerId, Game game) {
|
public boolean canActivate(UUID playerId, Game game) {
|
||||||
Boolean activated = (Boolean)game.getState().getValue(this.originalId.toString() + "activated");
|
if (super.canActivate(playerId, game)) {
|
||||||
if (activated == null)
|
Boolean activated = (Boolean)game.getState().getValue(this.originalId.toString() + "activated");
|
||||||
return true;
|
if (activated == null)
|
||||||
else
|
return true;
|
||||||
return !activated;
|
else
|
||||||
|
return !activated;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue