[CMR] Implemented Rebbec, Architect of Ascension

This commit is contained in:
Evan Kranzler 2020-10-27 09:27:39 -04:00
parent 46ef223400
commit bce7efb8cf
3 changed files with 86 additions and 0 deletions

View file

@ -0,0 +1,79 @@
package mage.cards.r;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.keyword.PartnerAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.filter.FilterCard;
import mage.filter.StaticFilters;
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 RebbecArchitectOfAscension extends CardImpl {
private static final FilterCard filter
= new FilterCard("each converted mana cost among artifacts you control");
static {
filter.add(RebbecArchitectOfAscensionPredicate.instance);
}
public RebbecArchitectOfAscension(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.ARTIFICER);
this.power = new MageInt(3);
this.toughness = new MageInt(4);
// Artifacts you control have protection from each converted mana cost among artifacts you control.
this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect(
new ProtectionAbility(filter), Duration.WhileOnBattlefield,
StaticFilters.FILTER_PERMANENT_ARTIFACT
)));
// Partner
this.addAbility(PartnerAbility.getInstance());
}
private RebbecArchitectOfAscension(final RebbecArchitectOfAscension card) {
super(card);
}
@Override
public RebbecArchitectOfAscension copy() {
return new RebbecArchitectOfAscension(this);
}
}
enum RebbecArchitectOfAscensionPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<MageObject>> {
instance;
@Override
public boolean apply(ObjectSourcePlayer<MageObject> input, Game game) {
return game.getBattlefield()
.getActivePermanents(
StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT,
game.getControllerId(input.getSourceId()), input.getSourceId(), game
).stream()
.filter(Objects::nonNull)
.mapToInt(MageObject::getConvertedManaCost)
.anyMatch(n -> input.getObject().getConvertedManaCost() == n);
}
}

View file

@ -46,6 +46,7 @@ public final class CommanderLegends extends ExpansionSet {
cards.add(new SetCardInfo("Prossh, Skyraider of Kher", 530, Rarity.MYTHIC, mage.cards.p.ProsshSkyraiderOfKher.class));
cards.add(new SetCardInfo("Prying Eyes", 86, Rarity.COMMON, mage.cards.p.PryingEyes.class));
cards.add(new SetCardInfo("Raise the Alarm", 41, Rarity.COMMON, mage.cards.r.RaiseTheAlarm.class));
cards.add(new SetCardInfo("Rebbec, Architect of Ascension", 42, Rarity.UNCOMMON, mage.cards.r.RebbecArchitectOfAscension.class));
cards.add(new SetCardInfo("Rejuvenating Springs", 354, Rarity.RARE, mage.cards.r.RejuvenatingSprings.class));
cards.add(new SetCardInfo("Sengir, the Dark Baron", 149, Rarity.RARE, mage.cards.s.SengirTheDarkBaron.class));
cards.add(new SetCardInfo("Siani, Eye of the Storm", 95, Rarity.UNCOMMON, mage.cards.s.SianiEyeOfTheStorm.class));

View file

@ -216,6 +216,12 @@ public final class StaticFilters {
FILTER_PERMANENT_ARTIFACT.setLockedFilter(true);
}
public static final FilterArtifactPermanent FILTER_PERMANENT_ARTIFACTS = new FilterArtifactPermanent("artifacts");
static {
FILTER_PERMANENT_ARTIFACTS.setLockedFilter(true);
}
public static final FilterArtifactPermanent FILTER_PERMANENT_ARTIFACT_AN = new FilterArtifactPermanent("an artifact");
static {