Small fixes to ExchangeControlTargetEffect, GlintHawk and SavingGrasp

This commit is contained in:
LevelX2 2012-09-30 09:46:21 +02:00
parent 9ea25aa723
commit d6d07c3f9e
3 changed files with 15 additions and 6 deletions

View file

@ -28,6 +28,7 @@
package mage.sets.darkascension;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.TimingRule;
@ -35,7 +36,9 @@ import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.abilities.keyword.FlashbackAbility;
import mage.cards.CardImpl;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.other.OwnerPredicate;
import mage.target.common.TargetCreaturePermanent;
/**
*
@ -43,6 +46,12 @@ import mage.target.common.TargetControlledCreaturePermanent;
*/
public class SavingGrasp extends CardImpl<SavingGrasp> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you own");
static {
filter.add(new OwnerPredicate(Constants.TargetController.YOU));
}
public SavingGrasp(UUID ownerId) {
super(ownerId, 46, "Saving Grasp", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}");
this.expansionSetCode = "DKA";
@ -50,7 +59,7 @@ public class SavingGrasp extends CardImpl<SavingGrasp> {
this.color.setBlue(true);
// Return target creature you own to your hand.
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
// Flashback {W}
this.addAbility(new FlashbackAbility(new ManaCostsImpl("{W}"), TimingRule.INSTANT));

View file

@ -78,7 +78,7 @@ public class GlintHawk extends CardImpl<GlintHawk> {
class GlintHawkEffect extends OneShotEffect<GlintHawkEffect> {
private static final FilterControlledPermanent filter;
private static final String effectText = "When {this} enters the battlefield, sacrifice it unless you return an artifact you control to its owner's hand";
private static final String effectText = "sacrifice it unless you return an artifact you control to its owner's hand";
static {
filter = new FilterControlledPermanent();

View file

@ -114,7 +114,7 @@ public class ExchangeControlTargetEffect extends ContinuousEffectImpl<ExchangeCo
@Override
public boolean apply(Game game, Ability source) {
// if (this.lockedControllers != null) {
if (this.lockedControllers != null) {
for (UUID permanentId : targetPointer.getTargets(game, source)) {
Permanent permanent = game.getPermanent(permanentId);
if (permanent != null) {
@ -132,8 +132,8 @@ public class ExchangeControlTargetEffect extends ContinuousEffectImpl<ExchangeCo
}
}
return true;
// }
// return false;
}
return false;
}
@Override