[DMU] Compleated Ajani, Sleeper Agent

This commit is contained in:
Daniel Bomar 2022-08-21 13:41:48 -05:00
parent 346be39f2a
commit e341023d23
No known key found for this signature in database
GPG key ID: C86C8658F4023918
3 changed files with 131 additions and 0 deletions

View file

@ -0,0 +1,101 @@
package mage.cards.a;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.GetEmblemEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.effects.common.counter.DistributeCountersEffect;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.Card;
import mage.cards.CardsImpl;
import mage.constants.*;
import mage.abilities.keyword.CompleatedAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.command.emblems.AjaniSleeperAgentEmblem;
import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetCreaturePermanentAmount;
/**
*
* @author weirddan455
*/
public final class AjaniSleeperAgent extends CardImpl {
public AjaniSleeperAgent(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{1}{G}{G/W/P}{W}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.AJANI);
this.setStartingLoyalty(4);
// Compleated
this.addAbility(CompleatedAbility.getInstance());
// +1: Reveal the top card of your library. If it's a creature or planeswalker card, put it into your hand. Otherwise, you may put it on the bottom of your library.
this.addAbility(new LoyaltyAbility(new AjaniSleeperAgentEffect(), 1));
// 3: Distribute three +1/+1 counters among up to three target creatures. They gain vigilance until end of turn.
Ability ability = new LoyaltyAbility(new DistributeCountersEffect(CounterType.P1P1, 3, false, "up to three target creatures"), -3);
ability.addEffect(new GainAbilityTargetEffect(VigilanceAbility.getInstance()).setText("They gain vigilance until end of turn"));
Target target = new TargetCreaturePermanentAmount(3);
target.setMinNumberOfTargets(0);
target.setMaxNumberOfTargets(3);
ability.addTarget(target);
this.addAbility(ability);
// 6: You get an emblem with "Whenever you cast a creature or planeswalker spell, target opponent gets two poison counters."
this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new AjaniSleeperAgentEmblem()), -6));
}
private AjaniSleeperAgent(final AjaniSleeperAgent card) {
super(card);
}
@Override
public AjaniSleeperAgent copy() {
return new AjaniSleeperAgent(this);
}
}
class AjaniSleeperAgentEffect extends OneShotEffect {
public AjaniSleeperAgentEffect() {
super(Outcome.Benefit);
this.staticText = "Reveal the top card of your library. If it's a creature or planeswalker card, put it into your hand. Otherwise, you may put it on the bottom of your library.";
}
private AjaniSleeperAgentEffect(final AjaniSleeperAgentEffect effect) {
super(effect);
}
@Override
public AjaniSleeperAgentEffect copy() {
return new AjaniSleeperAgentEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
return false;
}
Card card = controller.getLibrary().getFromTop(game);
if (card == null) {
return false;
}
controller.revealCards(source, new CardsImpl(card), game);
if (card.isCreature(game) || card.isPlaneswalker(game)) {
controller.moveCards(card, Zone.HAND, source, game);
} else if (controller.chooseUse(Outcome.Neutral, "Put " + card.getName() + " on the bottom of your library?", source, game)) {
controller.putCardsOnBottomOfLibrary(card, game, source, true);
}
return true;
}
}

View file

@ -28,6 +28,7 @@ public final class DominariaUnited extends ExpansionSet {
this.maxCardNumberInBooster = 281; this.maxCardNumberInBooster = 281;
cards.add(new SetCardInfo("Adarkar Wastes", 243, Rarity.RARE, mage.cards.a.AdarkarWastes.class)); cards.add(new SetCardInfo("Adarkar Wastes", 243, Rarity.RARE, mage.cards.a.AdarkarWastes.class));
cards.add(new SetCardInfo("Ajani, Sleeper Agent", 192, Rarity.MYTHIC, mage.cards.a.AjaniSleeperAgent.class));
cards.add(new SetCardInfo("Archangel of Wrath", 3, Rarity.RARE, mage.cards.a.ArchangelOfWrath.class)); cards.add(new SetCardInfo("Archangel of Wrath", 3, Rarity.RARE, mage.cards.a.ArchangelOfWrath.class));
cards.add(new SetCardInfo("Aron, Benalia's Ruin", 292, Rarity.UNCOMMON, mage.cards.a.AronBenaliasRuin.class)); cards.add(new SetCardInfo("Aron, Benalia's Ruin", 292, Rarity.UNCOMMON, mage.cards.a.AronBenaliasRuin.class));
cards.add(new SetCardInfo("Benalish Sleeper", 8, Rarity.COMMON, mage.cards.b.BenalishSleeper.class)); cards.add(new SetCardInfo("Benalish Sleeper", 8, Rarity.COMMON, mage.cards.b.BenalishSleeper.class));

View file

@ -0,0 +1,29 @@
package mage.game.command.emblems;
import mage.abilities.Ability;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.common.counter.AddPoisonCounterTargetEffect;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.FilterSpell;
import mage.filter.predicate.Predicates;
import mage.game.command.Emblem;
import mage.target.common.TargetOpponent;
public final class AjaniSleeperAgentEmblem extends Emblem {
private static final FilterSpell filter = new FilterSpell("a creature or planeswalker spell");
static {
filter.add(Predicates.or(CardType.CREATURE.getPredicate(), CardType.PLANESWALKER.getPredicate()));
}
// You get an emblem with "Whenever you cast a creature or planeswalker spell, target opponent gets two poison counters."
public AjaniSleeperAgentEmblem() {
this.setName("Emblem Ajani");
this.setExpansionSetCodeForImage("DMU");
Ability ability = new SpellCastControllerTriggeredAbility(Zone.COMMAND, new AddPoisonCounterTargetEffect(2), filter, false, false);
ability.addTarget(new TargetOpponent());
this.getAbilities().add(ability);
}
}