mirror of
https://github.com/correl/mage.git
synced 2024-11-29 11:09:53 +00:00
[SWS] Fixed some problems.
This commit is contained in:
parent
966e2f686d
commit
4d7e744187
3 changed files with 17 additions and 7 deletions
|
@ -50,11 +50,11 @@ public class Regression extends CardImpl {
|
|||
}
|
||||
|
||||
public Regression(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{G}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}");
|
||||
|
||||
// Choose target artifact or enchantment. Its owner shuffles it into his or her library.
|
||||
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) {
|
||||
|
|
|
@ -35,6 +35,8 @@ import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.AnotherCardPredicate;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
|
||||
/**
|
||||
|
@ -43,15 +45,21 @@ import mage.target.common.TargetCardInYourGraveyard;
|
|||
*/
|
||||
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) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}");
|
||||
this.subtype.add("Beast");
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// 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.addTarget(new TargetCardInYourGraveyard());
|
||||
ability.addTarget(new TargetCardInYourGraveyard(filter));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ import mage.constants.Outcome;
|
|||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -40,11 +41,12 @@ public class ShuffleIntoLibraryTargetEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
|
||||
if (permanent != null) {
|
||||
if (permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true)) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (permanent != null && controller != null) {
|
||||
if (controller.moveCards(permanent, Zone.LIBRARY, source, game)) {
|
||||
game.getPlayer(permanent.getOwnerId()).shuffleLibrary(source, game);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue