[MOC] Implement Conjurer's Mantle

This commit is contained in:
theelk801 2023-04-12 08:30:34 -04:00
parent 0ea5ada993
commit 771c291d78
2 changed files with 81 additions and 0 deletions

View file

@ -0,0 +1,80 @@
package mage.cards.c;
import mage.abilities.Ability;
import mage.abilities.common.AttacksAttachedTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterCard;
import mage.filter.predicate.ObjectSourcePlayer;
import mage.filter.predicate.ObjectSourcePlayerPredicate;
import mage.game.Game;
import java.util.Objects;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ConjurersMantle extends CardImpl {
private static final FilterCard filter
= new FilterCard("a card that shares a creature type with that creature");
static {
filter.add(ConjurersMantlePredicate.instance);
}
public ConjurersMantle(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}{W}");
this.subtype.add(SubType.EQUIPMENT);
// Equipped creature gets +1/+1 and has vigilance.
Ability ability = new SimpleStaticAbility(new BoostEquippedEffect(1, 1));
ability.addEffect(new GainAbilityAttachedEffect(
VigilanceAbility.getInstance(), AttachmentType.EQUIPMENT
).setText("and has vigilance"));
this.addAbility(ability);
// Whenever equipped creature attacks, look at the top six cards of your library. You may reveal a card that shares a creature type with that creature from among them and put it into your hand. Put the rest on the bottom of your library in a random order.
this.addAbility(new AttacksAttachedTriggeredAbility(new LookLibraryAndPickControllerEffect(
6, 1, filter, PutCards.HAND, PutCards.BOTTOM_RANDOM
), AttachmentType.EQUIPMENT, false, SetTargetPointer.PERMANENT));
// Equip {1}
this.addAbility(new EquipAbility(1, false));
}
private ConjurersMantle(final ConjurersMantle card) {
super(card);
}
@Override
public ConjurersMantle copy() {
return new ConjurersMantle(this);
}
}
enum ConjurersMantlePredicate implements ObjectSourcePlayerPredicate<Card> {
instance;
@Override
public boolean apply(ObjectSourcePlayer<Card> input, Game game) {
return input
.getSource()
.getEffects()
.stream()
.map(effect -> effect.getTargetPointer().getFirst(game, input.getSource()))
.map(game::getPermanent)
.filter(Objects::nonNull)
.anyMatch(permanent -> permanent.shareCreatureTypes(game, input.getObject()));
}
}

View file

@ -72,6 +72,7 @@ public final class MarchOfTheMachineCommander extends ExpansionSet {
cards.add(new SetCardInfo("Commander's Sphere", 352, Rarity.COMMON, mage.cards.c.CommandersSphere.class));
cards.add(new SetCardInfo("Conclave Mentor", 320, Rarity.UNCOMMON, mage.cards.c.ConclaveMentor.class));
cards.add(new SetCardInfo("Conclave Tribunal", 178, Rarity.UNCOMMON, mage.cards.c.ConclaveTribunal.class));
cards.add(new SetCardInfo("Conjurer's Mantle", 12, Rarity.RARE, mage.cards.c.ConjurersMantle.class));
cards.add(new SetCardInfo("Constable of the Realm", 179, Rarity.UNCOMMON, mage.cards.c.ConstableOfTheRealm.class));
cards.add(new SetCardInfo("Corpse Knight", 321, Rarity.UNCOMMON, mage.cards.c.CorpseKnight.class));
cards.add(new SetCardInfo("Coveted Jewel", 353, Rarity.RARE, mage.cards.c.CovetedJewel.class));