[CLB] Implemented Abdel Adrian, Gorion's Ward

This commit is contained in:
Evan Kranzler 2022-06-04 15:10:23 -04:00
parent 2d0de035f6
commit 32f48e4d29
2 changed files with 106 additions and 0 deletions

View file

@ -0,0 +1,105 @@
package mage.cards.a;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.ChooseABackgroundAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.delayed.OnLeaveReturnExiledToBattlefieldAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.*;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterNonlandPermanent;
import mage.filter.predicate.mageobject.AnotherPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.SoldierToken;
import mage.players.Player;
import mage.target.TargetPermanent;
import mage.util.CardUtil;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class AbdelAdrianGorionsWard extends CardImpl {
public AbdelAdrianGorionsWard(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.WARRIOR);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// When Abdel Adrian, Gorion's Ward enters the battlefield, exile any number of other nonland permanents you control until Abdel Adrian leaves the battlefield. Create a 1/1 white Soldier creature token for each permanent exiled this way.
this.addAbility(new EntersBattlefieldTriggeredAbility(new AbdelAdrianGorionsWardEffect()));
// Choose a Background
this.addAbility(ChooseABackgroundAbility.getInstance());
}
private AbdelAdrianGorionsWard(final AbdelAdrianGorionsWard card) {
super(card);
}
@Override
public AbdelAdrianGorionsWard copy() {
return new AbdelAdrianGorionsWard(this);
}
}
class AbdelAdrianGorionsWardEffect extends OneShotEffect {
private static final FilterPermanent filter
= new FilterNonlandPermanent("other nonland permanents you control");
static {
filter.add(AnotherPredicate.instance);
filter.add(TargetController.YOU.getOwnerPredicate());
}
AbdelAdrianGorionsWardEffect() {
super(Outcome.Benefit);
staticText = "exile any number of other nonland permanents you control until {this} leaves the battlefield. " +
"Create a 1/1 white Soldier creature token for each permanent exiled this way";
}
private AbdelAdrianGorionsWardEffect(final AbdelAdrianGorionsWardEffect effect) {
super(effect);
}
@Override
public AbdelAdrianGorionsWardEffect copy() {
return new AbdelAdrianGorionsWardEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
if (player == null || permanent == null) {
return false;
}
TargetPermanent target = new TargetPermanent(0, Integer.MAX_VALUE, filter, true);
player.choose(outcome, target, source, game);
Cards cards = new CardsImpl(target.getTargets());
player.moveCardsToExile(
cards.getCards(game), source, game, true,
CardUtil.getExileZoneId(game, source),
CardUtil.getSourceName(game, source)
);
cards.retainZone(Zone.EXILED, game);
int count = cards.size();
if (count > 0) {
new SoldierToken().putOntoBattlefield(count, game, source);
}
game.addDelayedTriggeredAbility(new OnLeaveReturnExiledToBattlefieldAbility(), source);
return true;
}
}

View file

@ -22,6 +22,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet {
this.hasBoosters = false; // temporary
cards.add(new SetCardInfo("Aarakocra Sneak", 54, Rarity.COMMON, mage.cards.a.AarakocraSneak.class));
cards.add(new SetCardInfo("Abdel Adrian, Gorion's Ward", 2, Rarity.UNCOMMON, mage.cards.a.AbdelAdrianGorionsWard.class));
cards.add(new SetCardInfo("Acolyte of Bahamut", 212, Rarity.UNCOMMON, mage.cards.a.AcolyteOfBahamut.class));
cards.add(new SetCardInfo("Aether Gale", 712, Rarity.RARE, mage.cards.a.AetherGale.class));
cards.add(new SetCardInfo("Agent of the Iron Throne", 107, Rarity.UNCOMMON, mage.cards.a.AgentOfTheIronThrone.class));