Fixes for GlintHawk, FaerieImposter. New card implementation DrakeFamiliar.

This commit is contained in:
drmDev 2016-03-04 12:20:43 -05:00
parent 20e7130bb1
commit 8f1af6b940
3 changed files with 27 additions and 27 deletions

View file

@ -109,7 +109,7 @@ class QuicklingEffect extends OneShotEffect {
Permanent permanent = game.getPermanent(target.getFirstTarget()); Permanent permanent = game.getPermanent(target.getFirstTarget());
if (permanent != null) { if (permanent != null) {
targetChosen = true; targetChosen = true;
controller.moveCards(permanent, null, Zone.HAND, source, game); permanent.moveToZone(Zone.HAND, this.getId(), game, false);
} }
} }

View file

@ -101,15 +101,13 @@ class FaerieImpostorEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller != null) {
boolean targetChosen = false; boolean targetChosen = false;
TargetPermanent target = new TargetPermanent(1, 1, filter, false); TargetPermanent target = new TargetPermanent(1, 1, filter, true);
if (target.canChoose(controller.getId(), game) && controller.chooseUse(outcome, "Return another creature you control to its owner's hand?", source, game)) {
if (target.canChoose(controller.getId(), game)) { controller.chooseTarget(Outcome.ReturnToHand, target, source, game);
controller.choose(Outcome.ReturnToHand, target, source.getSourceId(), game);
Permanent permanent = game.getPermanent(target.getFirstTarget()); Permanent permanent = game.getPermanent(target.getFirstTarget());
if (permanent != null) { if (permanent != null) {
targetChosen = true; targetChosen = true;
controller.moveCards(permanent, null, Zone.HAND, source, game); permanent.moveToZone(Zone.HAND, this.getId(), game, false);
} }
} }

View file

@ -28,10 +28,6 @@
package mage.sets.scarsofmirrodin; package mage.sets.scarsofmirrodin;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Outcome;
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;
@ -39,6 +35,10 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.SacrificeSourceEffect; import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game; import mage.game.Game;
@ -60,6 +60,8 @@ public class GlintHawk extends CardImpl {
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// When Glint Hawk enters the battlefield, sacrifice it unless you return an artifact you control to its owner's hand.
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
this.addAbility(new EntersBattlefieldTriggeredAbility(new GlintHawkEffect())); this.addAbility(new EntersBattlefieldTriggeredAbility(new GlintHawkEffect()));
} }
@ -95,24 +97,24 @@ class GlintHawkEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
boolean targetChosen = false; boolean targetChosen = false;
Player player = game.getPlayer(source.getControllerId()); TargetPermanent target = new TargetPermanent(1, 1, filter, true);
TargetPermanent target = new TargetPermanent(1, 1, filter, false); if (target.canChoose(controller.getId(), game) && controller.chooseUse(outcome, "Return an artifact you control to its owner's hand?", source, game)) {
controller.chooseTarget(Outcome.Sacrifice, target, source, game);
if (target.canChoose(player.getId(), game)) {
player.choose(Outcome.Sacrifice, target, source.getSourceId(), game);
Permanent permanent = game.getPermanent(target.getFirstTarget()); Permanent permanent = game.getPermanent(target.getFirstTarget());
if (permanent != null) {
if ( permanent != null ) {
targetChosen = true; targetChosen = true;
permanent.moveToZone(Zone.HAND, this.getId(), game, false); permanent.moveToZone(Zone.HAND, this.getId(), game, false);
} }
} }
if ( !targetChosen ) { if (!targetChosen) {
new SacrificeSourceEffect().apply(game, source); new SacrificeSourceEffect().apply(game, source);
} }
return true;
}
return false; return false;
} }