[STX] Implemented Blex, Vexing Pest (#7719)

This commit is contained in:
Daniel Bomar 2021-04-06 07:21:56 -05:00 committed by GitHub
parent 1eb1a36ee0
commit 2476b4deb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 123 additions and 0 deletions

View file

@ -0,0 +1,122 @@
package mage.cards.b;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.DiesSourceTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.LookLibraryControllerEffect;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.cards.ModalDoubleFacesCard;
import mage.constants.*;
import mage.cards.CardSetInfo;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetCard;
/**
*
* @author weirddan455
*/
public final class BlexVexingPest extends ModalDoubleFacesCard {
private static final FilterCreaturePermanent filter
= new FilterCreaturePermanent("Pests, Bats, Insects, Snakes, and Spiders");
static {
filter.add(Predicates.or(
SubType.PEST.getPredicate(),
SubType.BAT.getPredicate(),
SubType.INSECT.getPredicate(),
SubType.SNAKE.getPredicate(),
SubType.SPIDER.getPredicate()
));
}
public BlexVexingPest(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo,
new CardType[]{CardType.CREATURE}, new SubType[]{SubType.PEST}, "{2}{G}",
"Search for Blex", new CardType[]{CardType.SORCERY}, new SubType[]{}, "{2}{B}{B}"
);
// 1.
// Blex, Vexing Pest
// Legendary Creature - Pest
this.getLeftHalfCard().addSuperType(SuperType.LEGENDARY);
this.getLeftHalfCard().setPT(new MageInt(3), new MageInt(2));
// Other Pests, Bats, Insects, Snakes, and Spiders you control get +1/+1.
this.getLeftHalfCard().addAbility(new SimpleStaticAbility(
new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter, true)
));
// When Blex, Vexing Pest dies, you gain 4 life.
this.getLeftHalfCard().addAbility(new DiesSourceTriggeredAbility(new GainLifeEffect(4)));
// 2.
// Search for Blex
// Sorcery
// Look at the top five cards of your library.
// You may put any number of them into your hand and the rest into your graveyard.
// You lose 3 life for each card put into your hand this way.
this.getRightHalfCard().getSpellAbility().addEffect(new SearchForBlexEffect());
}
private BlexVexingPest(final BlexVexingPest card) {
super(card);
}
@Override
public BlexVexingPest copy() {
return new BlexVexingPest(this);
}
}
class SearchForBlexEffect extends LookLibraryControllerEffect {
private static final FilterCard filter = new FilterCard("cards to put into your hand");
public SearchForBlexEffect() {
super(Outcome.DrawCard, StaticValue.get(5), false, Zone.GRAVEYARD, true);
this.staticText = "Look at the top five cards of your library. "
+ "You may put any number of them into your hand and the rest into your graveyard. "
+ "You lose 3 life for each card put into your hand this way";
}
private SearchForBlexEffect(final SearchForBlexEffect effect) {
super(effect);
}
@Override
public SearchForBlexEffect copy() {
return new SearchForBlexEffect(this);
}
@Override
protected void actionWithSelectedCards(Cards cards, Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
TargetCard target = new TargetCard(0, 5, Zone.LIBRARY, filter);
if (player.choose(outcome, cards, target, game)) {
Cards pickedCards = new CardsImpl(target.getTargets());
cards.removeAll(pickedCards);
player.moveCards(pickedCards, Zone.HAND, source, game);
player.loseLife(pickedCards.size() * 3, game, source, false);
}
}
}
@Override
public String getText(Mode mode) {
return staticText;
}
}

View file

@ -49,6 +49,7 @@ public final class StrixhavenSchoolOfMages extends ExpansionSet {
cards.add(new SetCardInfo("Big Play", 122, Rarity.COMMON, mage.cards.b.BigPlay.class));
cards.add(new SetCardInfo("Biomathematician", 164, Rarity.COMMON, mage.cards.b.Biomathematician.class));
cards.add(new SetCardInfo("Blade Historian", 165, Rarity.RARE, mage.cards.b.BladeHistorian.class));
cards.add(new SetCardInfo("Blex, Vexing Pest", 148, Rarity.MYTHIC, mage.cards.b.BlexVexingPest.class));
cards.add(new SetCardInfo("Blood Age General", 93, Rarity.COMMON, mage.cards.b.BloodAgeGeneral.class));
cards.add(new SetCardInfo("Blood Researcher", 166, Rarity.COMMON, mage.cards.b.BloodResearcher.class));
cards.add(new SetCardInfo("Blot Out the Sky", 167, Rarity.MYTHIC, mage.cards.b.BlotOutTheSky.class));