Fixed face down cost modification (related to 653a2dd7b2)

This commit is contained in:
Oleg Agafonov 2020-07-24 21:30:03 +04:00
parent dfaf09e76c
commit 97c427375d
6 changed files with 92 additions and 29 deletions

View file

@ -3156,6 +3156,11 @@ public abstract class PlayerImpl implements Player, Serializable {
sourceObject.adjustCosts(copyAbility, game);
game.getContinuousEffects().costModification(copyAbility, game);
// reduced all cost
if (copyAbility.getManaCostsToPay().isEmpty()) {
return true;
}
for (Mana mana : copyAbility.getManaCostsToPay().getOptions()) {
if (availableMana.enough(mana)) {
return true;
@ -3193,6 +3198,11 @@ public abstract class PlayerImpl implements Player, Serializable {
sourceObject.adjustCosts(copyAbility, game);
game.getContinuousEffects().costModification(copyAbility, game);
// reduced all cost
if (copyAbility.getManaCostsToPay().isEmpty()) {
return true;
}
for (Mana mana : copyAbility.getManaCostsToPay().getOptions()) {
if (availableMana.enough(mana)) {
return true;
@ -3260,7 +3270,7 @@ public abstract class PlayerImpl implements Player, Serializable {
// So make it available all the time
boolean canUse;
if (ability instanceof MorphAbility && object instanceof Card && game.canPlaySorcery(getId())) {
canUse = canPlayCardByAlternateCost((Card) object, availableMana, ability, game);
canUse = canPlayCardByAlternateCost((Card) object, availableMana, playAbility, game);
} else {
canUse = canPlay(playAbility, availableMana, object, game); // canPlay already checks alternative source costs and all conditions
}