mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
* Restoration Angel - Made target creature selection mandatory.
This commit is contained in:
parent
29a2bbfcc1
commit
7ea4cc6ed0
1 changed files with 17 additions and 18 deletions
|
@ -28,10 +28,6 @@
|
||||||
package mage.sets.avacynrestored;
|
package mage.sets.avacynrestored;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import mage.constants.CardType;
|
|
||||||
import mage.constants.Rarity;
|
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
|
@ -40,12 +36,16 @@ import mage.abilities.keyword.FlashAbility;
|
||||||
import mage.abilities.keyword.FlyingAbility;
|
import mage.abilities.keyword.FlyingAbility;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.Rarity;
|
||||||
|
import mage.constants.Zone;
|
||||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||||
import mage.filter.predicate.Predicates;
|
import mage.filter.predicate.Predicates;
|
||||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
|
import mage.players.Player;
|
||||||
import mage.target.common.TargetControlledCreaturePermanent;
|
import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -75,7 +75,7 @@ public class RestorationAngel extends CardImpl<RestorationAngel> {
|
||||||
|
|
||||||
// When Restoration Angel enters the battlefield, you may exile target non-Angel creature you control, then return that card to the battlefield under your control
|
// When Restoration Angel enters the battlefield, you may exile target non-Angel creature you control, then return that card to the battlefield under your control
|
||||||
Ability ability = new EntersBattlefieldTriggeredAbility(new RestorationAngelEffect(), true);
|
Ability ability = new EntersBattlefieldTriggeredAbility(new RestorationAngelEffect(), true);
|
||||||
ability.addTarget(new TargetControlledCreaturePermanent(1, 1, filter, false));
|
ability.addTarget(new TargetControlledCreaturePermanent(1, 1, filter, false, true));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,20 +107,19 @@ class RestorationAngelEffect extends OneShotEffect<RestorationAngelEffect> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
boolean exiled = false;
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
if (controller != null) {
|
||||||
if (sourcePermanent == null) {
|
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||||
sourcePermanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
|
Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
|
||||||
}
|
if (permanent != null && sourcePermanent != null) {
|
||||||
Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
|
controller.moveCardToExileWithInfo(permanent, source.getSourceId(), sourcePermanent.getName(), source.getSourceId(), game, Zone.BATTLEFIELD);
|
||||||
if (permanent != null) {
|
Card card = game.getCard(targetPointer.getFirst(game, source));
|
||||||
permanent.moveToExile(source.getSourceId(), sourcePermanent.getName(), source.getSourceId(), game);
|
if (card != null) {
|
||||||
Card card = game.getCard(targetPointer.getFirst(game, source));
|
Zone currentZone = game.getState().getZone(card.getId());
|
||||||
if (card != null) {
|
return controller.putOntoBattlefieldWithInfo(card, game, currentZone, source.getSourceId());
|
||||||
Zone currentZone = game.getState().getZone(card.getId());
|
}
|
||||||
return card.putOntoBattlefield(game, currentZone, source.getSourceId(), source.getControllerId());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return exiled;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue