mirror of
https://github.com/correl/mage.git
synced 2024-12-27 03:00:13 +00:00
Small fixes to ExchangeControlTargetEffect, GlintHawk and SavingGrasp
This commit is contained in:
parent
9ea25aa723
commit
d6d07c3f9e
3 changed files with 15 additions and 6 deletions
|
@ -28,6 +28,7 @@
|
||||||
package mage.sets.darkascension;
|
package mage.sets.darkascension;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import mage.Constants;
|
||||||
import mage.Constants.CardType;
|
import mage.Constants.CardType;
|
||||||
import mage.Constants.Rarity;
|
import mage.Constants.Rarity;
|
||||||
import mage.Constants.TimingRule;
|
import mage.Constants.TimingRule;
|
||||||
|
@ -35,7 +36,9 @@ import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.effects.common.ReturnToHandTargetEffect;
|
import mage.abilities.effects.common.ReturnToHandTargetEffect;
|
||||||
import mage.abilities.keyword.FlashbackAbility;
|
import mage.abilities.keyword.FlashbackAbility;
|
||||||
import mage.cards.CardImpl;
|
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> {
|
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) {
|
public SavingGrasp(UUID ownerId) {
|
||||||
super(ownerId, 46, "Saving Grasp", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}");
|
super(ownerId, 46, "Saving Grasp", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}");
|
||||||
this.expansionSetCode = "DKA";
|
this.expansionSetCode = "DKA";
|
||||||
|
@ -50,7 +59,7 @@ public class SavingGrasp extends CardImpl<SavingGrasp> {
|
||||||
this.color.setBlue(true);
|
this.color.setBlue(true);
|
||||||
|
|
||||||
// Return target creature you own to your hand.
|
// Return target creature you own to your hand.
|
||||||
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
|
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
|
||||||
this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
|
this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
|
||||||
// Flashback {W}
|
// Flashback {W}
|
||||||
this.addAbility(new FlashbackAbility(new ManaCostsImpl("{W}"), TimingRule.INSTANT));
|
this.addAbility(new FlashbackAbility(new ManaCostsImpl("{W}"), TimingRule.INSTANT));
|
||||||
|
|
|
@ -78,7 +78,7 @@ public class GlintHawk extends CardImpl<GlintHawk> {
|
||||||
class GlintHawkEffect extends OneShotEffect<GlintHawkEffect> {
|
class GlintHawkEffect extends OneShotEffect<GlintHawkEffect> {
|
||||||
|
|
||||||
private static final FilterControlledPermanent filter;
|
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 {
|
static {
|
||||||
filter = new FilterControlledPermanent();
|
filter = new FilterControlledPermanent();
|
||||||
|
|
|
@ -114,7 +114,7 @@ public class ExchangeControlTargetEffect extends ContinuousEffectImpl<ExchangeCo
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
// if (this.lockedControllers != null) {
|
if (this.lockedControllers != null) {
|
||||||
for (UUID permanentId : targetPointer.getTargets(game, source)) {
|
for (UUID permanentId : targetPointer.getTargets(game, source)) {
|
||||||
Permanent permanent = game.getPermanent(permanentId);
|
Permanent permanent = game.getPermanent(permanentId);
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
|
@ -132,8 +132,8 @@ public class ExchangeControlTargetEffect extends ContinuousEffectImpl<ExchangeCo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
// }
|
}
|
||||||
// return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue