[SWS] Fixed some problems.

This commit is contained in:
LevelX2 2016-10-07 17:56:16 +02:00
parent 966e2f686d
commit 4d7e744187
3 changed files with 17 additions and 7 deletions

View file

@ -54,7 +54,7 @@ public class Regression extends CardImpl {
// Choose target artifact or enchantment. Its owner shuffles it into his or her library. // Choose target artifact or enchantment. Its owner shuffles it into his or her library.
this.getSpellAbility().addEffect(new ShuffleIntoLibraryTargetEffect()); this.getSpellAbility().addEffect(new ShuffleIntoLibraryTargetEffect());
this.getSpellAbility().addTarget(new TargetPermanent(1, 1, filter, true)); this.getSpellAbility().addTarget(new TargetPermanent(filter));
} }
public Regression(final Regression card) { public Regression(final Regression card) {

View file

@ -35,6 +35,8 @@ import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.AnotherCardPredicate;
import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetCardInYourGraveyard;
/** /**
@ -43,6 +45,12 @@ import mage.target.common.TargetCardInYourGraveyard;
*/ */
public class ShaakHerd extends CardImpl { public class ShaakHerd extends CardImpl {
private final static FilterCard filter = new FilterCard("another target creature card");
static {
filter.add(new AnotherCardPredicate());
}
public ShaakHerd(UUID ownerId, CardSetInfo setInfo) { public ShaakHerd(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}");
this.subtype.add("Beast"); this.subtype.add("Beast");
@ -51,7 +59,7 @@ public class ShaakHerd extends CardImpl {
// When Shaak Herd dies, you may return another target creature card from your graveyard to your hand. // When Shaak Herd dies, you may return another target creature card from your graveyard to your hand.
Ability ability = new DiesTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect(), true); Ability ability = new DiesTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect(), true);
ability.addTarget(new TargetCardInYourGraveyard()); ability.addTarget(new TargetCardInYourGraveyard(filter));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -12,6 +12,7 @@ import mage.constants.Outcome;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player;
/** /**
* *
@ -40,11 +41,12 @@ public class ShuffleIntoLibraryTargetEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
if (permanent != null) { Player controller = game.getPlayer(source.getControllerId());
if (permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true)) { if (permanent != null && controller != null) {
if (controller.moveCards(permanent, Zone.LIBRARY, source, game)) {
game.getPlayer(permanent.getOwnerId()).shuffleLibrary(source, game); game.getPlayer(permanent.getOwnerId()).shuffleLibrary(source, game);
return true;
} }
return true;
} }
return false; return false;
} }