[MOM] Implement Borborygmos and Fblthp

This commit is contained in:
theelk801 2023-04-02 14:49:39 -04:00
parent dfe70f0c9f
commit 75ad2efc08
2 changed files with 127 additions and 0 deletions

View file

@ -0,0 +1,126 @@
package mage.cards.b;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldOrAttacksSourceTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.delayed.ReflexiveTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import mage.target.common.TargetDiscard;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class BorborygmosAndFblthp extends CardImpl {
public BorborygmosAndFblthp(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{U}{R}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.CYCLOPS);
this.subtype.add(SubType.HOMUNCULUS);
this.power = new MageInt(6);
this.toughness = new MageInt(5);
// Whenever Borborygmos and Fblthp enters the battlefield or attacks, draw a card, then you may discard any number of land cards. When you discard one or more cards this way, Borborygmos and Fblthp deals twice that much damage to target creature.
this.addAbility(new EntersBattlefieldOrAttacksSourceTriggeredAbility(new BorborygmosAndFblthpDiscardEffect()));
// {1}{U}: Put Borborygmos and Fblthp into its owner's library third from the top.
this.addAbility(new SimpleActivatedAbility(new BorborygmosAndFblthpTuckEffect(), new ManaCostsImpl<>("{1}{U}")));
}
private BorborygmosAndFblthp(final BorborygmosAndFblthp card) {
super(card);
}
@Override
public BorborygmosAndFblthp copy() {
return new BorborygmosAndFblthp(this);
}
}
class BorborygmosAndFblthpDiscardEffect extends OneShotEffect {
BorborygmosAndFblthpDiscardEffect() {
super(Outcome.Benefit);
staticText = "draw a card, then you may discard any number of land cards. " +
"When you discard one or more cards this way, {this} deals twice that much damage to target creature";
}
private BorborygmosAndFblthpDiscardEffect(final BorborygmosAndFblthpDiscardEffect effect) {
super(effect);
}
@Override
public BorborygmosAndFblthpDiscardEffect copy() {
return new BorborygmosAndFblthpDiscardEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
player.drawCards(1, source, game);
TargetDiscard target = new TargetDiscard(
0, Integer.MAX_VALUE,
StaticFilters.FILTER_CARD_LANDS, player.getId()
);
player.choose(Outcome.Discard, target, source, game);
Cards cards = player.discard(new CardsImpl(target.getTargets()), false, source, game);
if (cards.isEmpty()) {
return true;
}
int damage = 2 * cards.size();
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(
new DamageTargetEffect(damage), false,
"{this} deals twice that much damage to target creature"
);
ability.addTarget(new TargetCreaturePermanent());
game.fireReflexiveTriggeredAbility(ability, source);
return true;
}
}
class BorborygmosAndFblthpTuckEffect extends OneShotEffect {
BorborygmosAndFblthpTuckEffect() {
super(Outcome.Benefit);
staticText = "put {this} into its owner's library third from the top";
}
private BorborygmosAndFblthpTuckEffect(final BorborygmosAndFblthpTuckEffect effect) {
super(effect);
}
@Override
public BorborygmosAndFblthpTuckEffect copy() {
return new BorborygmosAndFblthpTuckEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
return player != null && permanent != null
&& player.putCardOnTopXOfLibrary(permanent, game, source, 3, true);
}
}

View file

@ -27,6 +27,7 @@ public final class MarchOfTheMachine extends ExpansionSet {
cards.add(new SetCardInfo("Bloodfell Caves", 267, Rarity.COMMON, mage.cards.b.BloodfellCaves.class));
cards.add(new SetCardInfo("Blossoming Sands", 268, Rarity.COMMON, mage.cards.b.BlossomingSands.class));
cards.add(new SetCardInfo("Boon-Bringer Valkyrie", 9, Rarity.RARE, mage.cards.b.BoonBringerValkyrie.class));
cards.add(new SetCardInfo("Borborygmos and Fblthp", 219, Rarity.MYTHIC, mage.cards.b.BorborygmosAndFblthp.class));
cards.add(new SetCardInfo("Captive Weird", 49, Rarity.UNCOMMON, mage.cards.c.CaptiveWeird.class));
cards.add(new SetCardInfo("Chandra, Hope's Beacon", 134, Rarity.MYTHIC, mage.cards.c.ChandraHopesBeacon.class));
cards.add(new SetCardInfo("Change the Equation", 50, Rarity.UNCOMMON, mage.cards.c.ChangeTheEquation.class));