forked from External/mage
[ONE] Implement Contagious Vorrac
This commit is contained in:
parent
774e486cc8
commit
d67f1e61b0
2 changed files with 86 additions and 0 deletions
85
Mage.Sets/src/mage/cards/c/ContagiousVorrac.java
Normal file
85
Mage.Sets/src/mage/cards/c/ContagiousVorrac.java
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.counter.ProliferateEffect;
|
||||
import mage.cards.*;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class ContagiousVorrac extends CardImpl {
|
||||
|
||||
public ContagiousVorrac(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}");
|
||||
|
||||
this.subtype.add(SubType.PHYREXIAN);
|
||||
this.subtype.add(SubType.BOAR);
|
||||
this.subtype.add(SubType.BEAST);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// When Contagious Vorrac enters the battlefield, look at the top four cards of your library. You may reveal a land card from among them and put it into your hand. Put the rest on the bottom of your library in a random order. If you didn't put a card into your hand this way, proliferate.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new ContagiousVorracEffect()));
|
||||
}
|
||||
|
||||
private ContagiousVorrac(final ContagiousVorrac card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContagiousVorrac copy() {
|
||||
return new ContagiousVorrac(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ContagiousVorracEffect extends OneShotEffect {
|
||||
|
||||
ContagiousVorracEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "look at the top four cards of your library. You may reveal a land card from among them " +
|
||||
"and put it into your hand. Put the rest on the bottom of your library in a random order. " +
|
||||
"If you didn't put a card into your hand this way, proliferate";
|
||||
}
|
||||
|
||||
private ContagiousVorracEffect(final ContagiousVorracEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContagiousVorracEffect copy() {
|
||||
return new ContagiousVorracEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, 4));
|
||||
TargetCard target = new TargetCardInLibrary(0, 1, StaticFilters.FILTER_CARD_LAND);
|
||||
player.choose(Outcome.DrawCard, cards, target, game);
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
player.revealCards(source, new CardsImpl(card), game);
|
||||
player.moveCards(card, Zone.HAND, source, game);
|
||||
}
|
||||
cards.retainZone(Zone.LIBRARY, game);
|
||||
player.putCardsOnBottomOfLibrary(card, game, source, false);
|
||||
return card == null || new ProliferateEffect().apply(game, source);
|
||||
}
|
||||
}
|
||||
|
|
@ -60,6 +60,7 @@ public final class PhyrexiaAllWillBeOne extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Chittering Skitterling", 87, Rarity.UNCOMMON, mage.cards.c.ChitteringSkitterling.class));
|
||||
cards.add(new SetCardInfo("Chrome Prowler", 45, Rarity.COMMON, mage.cards.c.ChromeProwler.class));
|
||||
cards.add(new SetCardInfo("Compleat Devotion", 7, Rarity.COMMON, mage.cards.c.CompleatDevotion.class));
|
||||
cards.add(new SetCardInfo("Contagious Vorrac", 164, Rarity.COMMON, mage.cards.c.ContagiousVorrac.class));
|
||||
cards.add(new SetCardInfo("Copper Longlegs", 165, Rarity.COMMON, mage.cards.c.CopperLonglegs.class));
|
||||
cards.add(new SetCardInfo("Copperline Gorge", 249, Rarity.RARE, mage.cards.c.CopperlineGorge.class));
|
||||
cards.add(new SetCardInfo("Crawling Chorus", 8, Rarity.COMMON, mage.cards.c.CrawlingChorus.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue