[DMC] Implemented Torsten, Founder of Benalia

This commit is contained in:
Evan Kranzler 2022-09-19 09:20:45 -04:00
parent a405248dcc
commit c843dd23e1
2 changed files with 90 additions and 0 deletions

View file

@ -0,0 +1,89 @@
package mage.cards.t;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesSourceTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.*;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.token.SoldierToken;
import mage.players.Player;
import mage.target.TargetCard;
import mage.target.common.TargetCardInLibrary;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class TorstenFounderOfBenalia extends CardImpl {
public TorstenFounderOfBenalia(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{G}{W}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.SOLDIER);
this.power = new MageInt(7);
this.toughness = new MageInt(7);
// When Torsten, Founder of Benalia enters the battlefield, reveal the top seven cards of your library. Put any number of creature and/or land cards from among them into your hand and the rest on the bottom of your library in a random order.
this.addAbility(new EntersBattlefieldTriggeredAbility(new TorstenFounderOfBenaliaEffect()));
// When Torsten dies, create seven 1/1 white Soldier creature tokens.
this.addAbility(new DiesSourceTriggeredAbility(new CreateTokenEffect(new SoldierToken(), 7)));
}
private TorstenFounderOfBenalia(final TorstenFounderOfBenalia card) {
super(card);
}
@Override
public TorstenFounderOfBenalia copy() {
return new TorstenFounderOfBenalia(this);
}
}
class TorstenFounderOfBenaliaEffect extends OneShotEffect {
TorstenFounderOfBenaliaEffect() {
super(Outcome.Benefit);
staticText = "reveal the top seven cards of your library. Put any number of creature and/or land cards " +
"from among them into your hand and the rest on the bottom of your library in a random order";
}
private TorstenFounderOfBenaliaEffect(final TorstenFounderOfBenaliaEffect effect) {
super(effect);
}
@Override
public TorstenFounderOfBenaliaEffect copy() {
return new TorstenFounderOfBenaliaEffect(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, 7));
player.revealCards(source, cards, game);
TargetCard target = new TargetCardInLibrary(
0, Integer.MAX_VALUE, StaticFilters.FILTER_CARD_CREATURE_OR_LAND
);
player.choose(outcome, cards, target, game);
Cards toHand = new CardsImpl(target.getTargets());
player.moveCards(toHand, Zone.HAND, source, game);
cards.retainZone(Zone.LIBRARY, game);
player.putCardsOnBottomOfLibrary(cards, game, source, false);
return true;
}
}

View file

@ -194,6 +194,7 @@ public final class DominariaUnitedCommander extends ExpansionSet {
cards.add(new SetCardInfo("Thrill of Possibility", 127, Rarity.COMMON, mage.cards.t.ThrillOfPossibility.class));
cards.add(new SetCardInfo("Time Wipe", 173, Rarity.RARE, mage.cards.t.TimeWipe.class));
cards.add(new SetCardInfo("Tobias, Doomed Conqueror", 45, Rarity.UNCOMMON, mage.cards.t.TobiasDoomedConqueror.class));
cards.add(new SetCardInfo("Torsten, Founder of Benalia", 47, Rarity.MYTHIC, mage.cards.t.TorstenFounderOfBenalia.class));
cards.add(new SetCardInfo("Transguild Courier", 194, Rarity.UNCOMMON, mage.cards.t.TransguildCourier.class));
cards.add(new SetCardInfo("Traxos, Scourge of Kroog", 195, Rarity.RARE, mage.cards.t.TraxosScourgeOfKroog.class));
cards.add(new SetCardInfo("Two-Headed Hellkite", 14, Rarity.RARE, mage.cards.t.TwoHeadedHellkite.class));