mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 19:11:59 -08:00
- Fixed Possibility Storm.
Issue: https://github.com/magefree/mage/issues/2685
This commit is contained in:
parent
cb5fc3037e
commit
368dd9a5be
1 changed files with 9 additions and 4 deletions
|
|
@ -28,8 +28,6 @@
|
||||||
package mage.cards.p;
|
package mage.cards.p;
|
||||||
|
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
|
@ -131,11 +129,18 @@ class PossibilityStormEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, 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);
|
MageObject sourceObject = source.getSourceObject(game);
|
||||||
if (sourceObject != null && spell != null) {
|
if (sourceObject != null && spell != null) {
|
||||||
Player spellController = game.getPlayer(spell.getControllerId());
|
Player spellController = game.getPlayer(spell.getControllerId());
|
||||||
if (spellController != null
|
if (spellController != null) {
|
||||||
&& spellController.moveCardsToExile(spell, source, game, true, source.getSourceId(), sourceObject.getIdName())) {
|
if (!noLongerOnStack) {
|
||||||
|
spellController.moveCardsToExile(spell, source, game, true, source.getSourceId(), sourceObject.getIdName());
|
||||||
|
}
|
||||||
if (spellController.getLibrary().hasCards()) {
|
if (spellController.getLibrary().hasCards()) {
|
||||||
Library library = spellController.getLibrary();
|
Library library = spellController.getLibrary();
|
||||||
Card card;
|
Card card;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue