- Fixed Possibility Storm.

Issue: https://github.com/magefree/mage/issues/2685
This commit is contained in:
Jeff 2017-03-09 12:26:50 -06:00
parent cb5fc3037e
commit 368dd9a5be

View file

@ -28,8 +28,6 @@
package mage.cards.p;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
@ -131,11 +129,18 @@ class PossibilityStormEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source));
boolean noLongerOnStack = false; // spell was exiled already by another effect, for example NivMagus Elemental
if (spell == null) {
spell = ((Spell) game.getLastKnownInformation(targetPointer.getFirst(game, source), Zone.STACK));
noLongerOnStack = true;
}
MageObject sourceObject = source.getSourceObject(game);
if (sourceObject != null && spell != null) {
Player spellController = game.getPlayer(spell.getControllerId());
if (spellController != null
&& spellController.moveCardsToExile(spell, source, game, true, source.getSourceId(), sourceObject.getIdName())) {
if (spellController != null) {
if (!noLongerOnStack) {
spellController.moveCardsToExile(spell, source, game, true, source.getSourceId(), sourceObject.getIdName());
}
if (spellController.getLibrary().hasCards()) {
Library library = spellController.getLibrary();
Card card;