* 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 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 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 BR (South America/Brazil) :ec2-54-233-67-0.sa-east-1.compute.amazonaws.com:17171
XMage.tahiti :xmage.tahiti.one:443 XMage.tahiti :xmage.tahiti.one:443

View file

@ -47,10 +47,8 @@ import mage.constants.Duration;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
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.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -71,16 +69,17 @@ public class GryffsBoon extends CardImpl {
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName()); Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability); this.addAbility(ability);
// Enchanted creature gets +1/+0 and has flying. // Enchanted creature gets +1/+0 and has flying.
ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 0, Duration.WhileOnBattlefield)); ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 0, Duration.WhileOnBattlefield));
Effect effect = new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA); Effect effect = new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA);
effect.setText("and has flying"); effect.setText("and has flying");
ability.addEffect(effect); ability.addEffect(effect);
this.addAbility(ability); this.addAbility(ability);
// {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. // {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 = new ActivateAsSorceryActivatedAbility(Zone.GRAVEYARD, new GryffsBoonEffect(), new ManaCostsImpl("{3}{W}"));
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability); this.addAbility(ability);
} }
@ -110,19 +109,11 @@ class GryffsBoonEffect extends OneShotEffect {
Card aura = game.getCard(source.getSourceId()); Card aura = game.getCard(source.getSourceId());
if (aura != null if (aura != null
&& game.getState().getZone(aura.getId()).equals(Zone.GRAVEYARD)) { && game.getState().getZone(aura.getId()).equals(Zone.GRAVEYARD)) {
Player controller = game.getPlayer(source.getControllerId()); Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (!targetPermanent.cantBeEnchantedBy(aura, game)) {
FilterCreaturePermanent filter = new FilterCreaturePermanent(); game.getState().setValue("attachTo:" + aura.getId(), targetPermanent);
TargetPermanent target = new TargetPermanent(filter); aura.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId());
target.setNotTarget(true); return targetPermanent.addAttachment(aura.getId(), game);
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);
}
} }
} }
return false; return false;
@ -132,4 +123,4 @@ class GryffsBoonEffect extends OneShotEffect {
public GryffsBoonEffect copy() { public GryffsBoonEffect copy() {
return new GryffsBoonEffect(this); return new GryffsBoonEffect(this);
} }
} }