mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
Fixed canPlay method to care abou alternate casting costs.
This commit is contained in:
parent
e9e615f66a
commit
63208c33ed
1 changed files with 10 additions and 0 deletions
|
@ -57,6 +57,7 @@ import mage.abilities.common.PassAbility;
|
||||||
import mage.abilities.common.delayed.AtTheEndOfTurnStepPostDelayedTriggeredAbility;
|
import mage.abilities.common.delayed.AtTheEndOfTurnStepPostDelayedTriggeredAbility;
|
||||||
import mage.abilities.costs.AdjustingSourceCosts;
|
import mage.abilities.costs.AdjustingSourceCosts;
|
||||||
import mage.abilities.costs.AlternativeCost;
|
import mage.abilities.costs.AlternativeCost;
|
||||||
|
import mage.abilities.costs.AlternativeCostSourceAbility;
|
||||||
import mage.abilities.costs.AlternativeSourceCosts;
|
import mage.abilities.costs.AlternativeSourceCosts;
|
||||||
import mage.abilities.effects.RestrictionEffect;
|
import mage.abilities.effects.RestrictionEffect;
|
||||||
import mage.abilities.effects.RestrictionUntapNotMoreThanEffect;
|
import mage.abilities.effects.RestrictionUntapNotMoreThanEffect;
|
||||||
|
@ -1834,6 +1835,15 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MageObject object = game.getObject(ability.getSourceId());
|
||||||
|
for (Ability objectAbility :object.getAbilities()) {
|
||||||
|
if (objectAbility instanceof AlternativeCostSourceAbility) {
|
||||||
|
if (objectAbility.getCosts().canPay(ability.getSourceId(), playerId, game)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (AlternativeCost cost: ability.getAlternativeCosts()) {
|
for (AlternativeCost cost: ability.getAlternativeCosts()) {
|
||||||
if (cost.isAvailable(game, ability) && cost.canPay(ability.getSourceId(), playerId, game)) {
|
if (cost.isAvailable(game, ability) && cost.canPay(ability.getSourceId(), playerId, game)) {
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue