mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 05:09:16 -08:00
updated Mistveil Plains implementation
This commit is contained in:
parent
b82df08a80
commit
c303b5adf8
5 changed files with 128 additions and 133 deletions
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
package mage.cards.m;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.ActivateIfConditionActivatedAbility;
|
||||
|
|
@ -14,29 +13,28 @@ import mage.abilities.mana.WhiteManaAbility;
|
|||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.constants.*;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class MistveilPlains extends CardImpl {
|
||||
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("you control two or more white permanents");
|
||||
|
||||
static {
|
||||
filter.add(new ColorPredicate(ObjectColor.WHITE));
|
||||
}
|
||||
|
||||
public MistveilPlains(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.LAND},"");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
|
||||
this.subtype.add(SubType.PLAINS);
|
||||
|
||||
// <i>({tap}: Add {W}.)</i>
|
||||
|
|
@ -47,10 +45,11 @@ public final class MistveilPlains extends CardImpl {
|
|||
|
||||
// {W}, {tap}: Put target card from your graveyard on the bottom of your library. Activate this ability only if you control two or more white permanents.
|
||||
Ability ability = new ActivateIfConditionActivatedAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new MistveilPlainsGraveyardToLibraryEffect(),
|
||||
new ManaCostsImpl("{W}"),
|
||||
new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.MORE_THAN, 1));
|
||||
Zone.BATTLEFIELD,
|
||||
new MistveilPlainsGraveyardToLibraryEffect(),
|
||||
new ManaCostsImpl("{W}"),
|
||||
new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.MORE_THAN, 1)
|
||||
);
|
||||
ability.addTarget(new TargetCardInYourGraveyard());
|
||||
ability.addCost(new TapSourceCost());
|
||||
this.addAbility(ability);
|
||||
|
|
@ -85,10 +84,12 @@ class MistveilPlainsGraveyardToLibraryEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Card card = game.getCard(getTargetPointer().getFirst(game, source));
|
||||
if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) {
|
||||
return card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
|
||||
Card card = game.getCard(source.getFirstTarget());
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (card == null || player == null ||
|
||||
game.getState().getZone(card.getId()) == Zone.GRAVEYARD) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
return player.putCardsOnBottomOfLibrary(card, game, source, false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue