* Gryff's Boon - Fixed that the target was wrongly selected during resolution.

This commit is contained in:
LevelX2 2016-06-19 16:13:50 +02:00
parent 7563b0c30f
commit f691017cda
2 changed files with 11 additions and 20 deletions

View file

@ -1,5 +1,5 @@
XMage.de 1 (Europe/Germany) fast :xmage.de:17171
woogerworks (North America/USA) :xmage.woogerworks.info:17171
woogerworks (North America/USA) :xmage.woogerworks.com:17171
XMage Testserver (Europe/France) 1.4.8v0 :176.31.186.181:17171
XMage BR (South America/Brazil) :ec2-54-233-67-0.sa-east-1.compute.amazonaws.com:17171
XMage.tahiti :xmage.tahiti.one:443

View file

@ -47,10 +47,8 @@ import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
@ -81,6 +79,7 @@ public class GryffsBoon extends CardImpl {
// {3}{W}: Return Gryff's Boon from your graveyard to the battlefield attached to target creature. Activate this ability only any time you could cast a sorcery.
ability = new ActivateAsSorceryActivatedAbility(Zone.GRAVEYARD, new GryffsBoonEffect(), new ManaCostsImpl("{3}{W}"));
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}
@ -110,19 +109,11 @@ class GryffsBoonEffect extends OneShotEffect {
Card aura = game.getCard(source.getSourceId());
if (aura != null
&& game.getState().getZone(aura.getId()).equals(Zone.GRAVEYARD)) {
Player controller = game.getPlayer(source.getControllerId());
FilterCreaturePermanent filter = new FilterCreaturePermanent();
TargetPermanent target = new TargetPermanent(filter);
target.setNotTarget(true);
if (controller != null
&& controller.choose(Outcome.PutCardInPlay, target, source.getSourceId(), game)) {
Permanent targetPermanent = game.getPermanent(target.getFirstTarget());
if (!targetPermanent.cantBeEnchantedBy(aura, game)) {
game.getState().setValue("attachTo:" + aura.getId(), targetPermanent);
aura.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), controller.getId());
return targetPermanent.addAttachment(aura.getId(), game);
}
Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (!targetPermanent.cantBeEnchantedBy(aura, game)) {
game.getState().setValue("attachTo:" + aura.getId(), targetPermanent);
aura.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId());
return targetPermanent.addAttachment(aura.getId(), game);
}
}
return false;