* Play with top card library - fixed that player can see next top card before casting current top card;

This commit is contained in:
Oleg Agafonov 2020-01-08 04:54:17 +04:00
parent d3b1be2f75
commit ca4a4528fb
3 changed files with 24 additions and 22 deletions

View file

@ -14,6 +14,8 @@ import mage.filter.Filter;
import mage.filter.predicate.Predicate;
import mage.filter.predicate.Predicates;
import mage.game.Game;
import mage.game.stack.Spell;
import mage.game.stack.StackObject;
import mage.players.Player;
import mage.target.targetpointer.TargetPointer;
@ -395,4 +397,17 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu
this.addDependedToType(DependencyType.AddingCreatureType);
}
}
public boolean isCanLookAtNextTopLibraryCard(Game game) {
// If the top card of your library changes while youre casting a spell, playing a land, or activating an ability,
// you cant look at the new top card until you finish doing so. This means that if you cast the top card of
// your library, you cant look at the next one until youre done paying for that spell. (2019-05-03)
if (!game.getStack().isEmpty()) {
StackObject stackObject = game.getStack().getFirst();
return !(stackObject instanceof Spell)
|| !Zone.LIBRARY.equals(((Spell) stackObject).getFromZone())
|| ((Spell) stackObject).isDoneActivatingManaAbilities();
}
return true;
}
}