forked from External/mage
[FIN] fix Ultimate Magic: Meteor condition
This commit is contained in:
parent
1b07b6284a
commit
ac734dfef8
1 changed files with 11 additions and 0 deletions
|
|
@ -8,12 +8,14 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
|
|
@ -76,6 +78,15 @@ class UltimateMagicMeteorEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
if (!Optional
|
||||
.ofNullable(source)
|
||||
.map(Ability::getSourceId)
|
||||
.map(game::getSpell)
|
||||
.map(Spell::getFromZone)
|
||||
.map(Zone.EXILED::match)
|
||||
.orElse(false)) {
|
||||
return false;
|
||||
}
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue