Merge origin/master

This commit is contained in:
USER 2019-09-08 06:29:40 +08:00
commit 25c09fa7d0
23 changed files with 1390 additions and 86 deletions

View file

@ -0,0 +1,66 @@
package mage.cards.a;
import mage.MageInt;
import mage.abilities.effects.common.continuous.AddCardTypeTargetEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.AdventureCard;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledArtifactPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class AnimatingFaerie extends AdventureCard {
private static final FilterPermanent filter
= new FilterControlledArtifactPermanent("noncreature artifact you control");
static {
filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
}
public AnimatingFaerie(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, new CardType[]{CardType.SORCERY}, "{2}{U}", "Bring to Life", "{2}{U}");
this.subtype.add(SubType.FAERIE);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Bring to Life
// Target noncreature artifact you control becomes a 0/0 artifact creature. Put four +1/+1 counters on it.
this.getAdventureSpellAbility().addEffect(new AddCardTypeTargetEffect(
Duration.EndOfGame, CardType.ARTIFACT, CardType.CREATURE
).setText("Target noncreature artifact you control becomes"));
this.getAdventureSpellAbility().addEffect(new SetPowerToughnessTargetEffect(
0, 0, Duration.EndOfGame
).setText("a 0/0 artifact creature."));
this.getAdventureSpellAbility().addEffect(new AddCountersTargetEffect(
CounterType.P1P1.createInstance(4)
).setText("Put four +1/+1 counters on it."));
this.getAdventureSpellAbility().addTarget(new TargetPermanent(filter));
}
private AnimatingFaerie(final AnimatingFaerie card) {
super(card);
}
@Override
public AnimatingFaerie copy() {
return new AnimatingFaerie(this);
}
}

View file

@ -0,0 +1,127 @@
package mage.cards.b;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CastSourceTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.KnightToken;
import mage.game.stack.Spell;
import mage.target.common.TargetNonlandPermanent;
import mage.watchers.common.CastFromHandWatcher;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class BanishIntoFable extends CardImpl {
public BanishIntoFable(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{W}{U}");
// When you cast this spell from your hand, copy it if you control an artifact, then copy it if you control an enchantment. You may choose new targets for the copies.
this.addAbility(new BanishIntoFableTriggeredAbility());
// Return target nonland permanent to its owner's hand. You create a 2/2 white Knight creature token with vigilance.
this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
this.getSpellAbility().addTarget(new TargetNonlandPermanent());
this.getSpellAbility().addEffect(new CreateTokenEffect(new KnightToken())
.setText("You create a 2/2 white Knight creature token with vigilance"));
}
private BanishIntoFable(final BanishIntoFable card) {
super(card);
}
@Override
public BanishIntoFable copy() {
return new BanishIntoFable(this);
}
}
class BanishIntoFableTriggeredAbility extends CastSourceTriggeredAbility {
BanishIntoFableTriggeredAbility() {
super(null, false);
this.addWatcher(new CastFromHandWatcher());
this.setRuleAtTheTop(true);
}
private BanishIntoFableTriggeredAbility(BanishIntoFableTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (!super.checkTrigger(event, game)) {
return false;
}
CastFromHandWatcher watcher = game.getState().getWatcher(CastFromHandWatcher.class);
if (watcher == null || !watcher.spellWasCastFromHand(event.getSourceId())) {
return false;
}
Spell spell = game.getState().getStack().getSpell(event.getSourceId());
if (spell == null) {
return false;
}
this.getEffects().clear();
this.addEffect(new BanishIntoFableEffect(spell.getId()));
return true;
}
@Override
public BanishIntoFableTriggeredAbility copy() {
return new BanishIntoFableTriggeredAbility(this);
}
}
class BanishIntoFableEffect extends OneShotEffect {
private final UUID spellId;
BanishIntoFableEffect(UUID spellId) {
super(Outcome.Benefit);
this.spellId = spellId;
}
private BanishIntoFableEffect(final BanishIntoFableEffect effect) {
super(effect);
this.spellId = effect.spellId;
}
@Override
public BanishIntoFableEffect copy() {
return new BanishIntoFableEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Spell spell = game.getSpellOrLKIStack(spellId);
if (spell == null) {
return false;
}
if (game.getBattlefield()
.getAllActivePermanents(source.getControllerId())
.stream()
.filter(Permanent::isArtifact)
.count() > 0) {
spell.createCopyOnStack(game, source, source.getControllerId(), true);
}
if (game.getBattlefield()
.getAllActivePermanents(source.getControllerId())
.stream()
.filter(Permanent::isEnchantment)
.count() > 0) {
spell.createCopyOnStack(game, source, source.getControllerId(), true);
}
return true;
}
}

View file

@ -0,0 +1,53 @@
package mage.cards.b;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
import mage.cards.AdventureCard;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.target.common.TargetCardInLibrary;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class BeanstalkGiant extends AdventureCard {
private static final DynamicValue xValue
= new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_PERMANENT_LANDS);
public BeanstalkGiant(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, new CardType[]{CardType.SORCERY}, "{6}{G}", "Fertile Footsteps", "{2}{G}");
this.subtype.add(SubType.GIANT);
this.power = new MageInt(0);
this.toughness = new MageInt(0);
// Beanstalk Giant's power and toughness are each equal to the number of lands you control.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame)));
// Fertile Footsteps
// Search your library for a basic land card, put it onto the battlefield, then shuffle your library.
this.getAdventureSpellAbility().addEffect(
new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND))
);
}
private BeanstalkGiant(final BeanstalkGiant card) {
super(card);
}
@Override
public BeanstalkGiant copy() {
return new BeanstalkGiant(this);
}
}

View file

@ -5,30 +5,35 @@
*/
package mage.cards.b;
import java.util.UUID;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.common.SimpleStaticAbility;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.abilities.keyword.EquipLegendaryAbility;
import mage.abilities.keyword.EquipFilterAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.constants.*;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.SupertypePredicate;
import java.util.UUID;
/**
*
* @author Rystan
*/
public final class BlackbladeReforged extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledLandPermanent();
private static final DynamicValue count
= new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_PERMANENT_LAND);
private static final FilterControlledCreaturePermanent filter
= new FilterControlledCreaturePermanent("legendary creature");
static {
filter.add(new SupertypePredicate(SuperType.LEGENDARY));
}
public BlackbladeReforged(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
@ -36,17 +41,16 @@ public final class BlackbladeReforged extends CardImpl {
this.subtype.add(SubType.EQUIPMENT);
// Equipped creature gets +1/+1 for each land you control.
PermanentsOnBattlefieldCount count = new PermanentsOnBattlefieldCount(filter);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(count, count)));
// Equip legendary creature (3)
this.addAbility(new EquipLegendaryAbility(Outcome.AddAbility, new GenericManaCost(3)));
this.addAbility(new EquipFilterAbility(filter, new GenericManaCost(3)));
// Equip {7}
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(7)));
}
public BlackbladeReforged(final BlackbladeReforged card) {
private BlackbladeReforged(final BlackbladeReforged card) {
super(card);
}

View file

@ -0,0 +1,53 @@
package mage.cards.f;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.continuous.BecomesCreatureAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.game.permanent.token.custom.CreatureToken;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class Frogify extends CardImpl {
public Frogify(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}");
this.subtype.add(SubType.AURA);
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted creature loses all abilities and is a blue Frog creature with base power and toughness 1/1.
this.addAbility(new SimpleStaticAbility(new BecomesCreatureAttachedEffect(
new CreatureToken(1, 1, "", SubType.FROG).withColor("U"),
"Enchanted creature loses all abilities and is a blue Frog creature with base power and toughness 1/1",
Duration.WhileOnBattlefield, BecomesCreatureAttachedEffect.LoseType.ALL
)));
}
private Frogify(final Frogify card) {
super(card);
}
@Override
public Frogify copy() {
return new Frogify(this);
}
}

View file

@ -0,0 +1,93 @@
package mage.cards.k;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class KeeperOfFables extends CardImpl {
public KeeperOfFables(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{G}");
this.subtype.add(SubType.CAT);
this.power = new MageInt(4);
this.toughness = new MageInt(5);
// Whenever one or more non-Human creatures you control deal combat damage to a player, draw a card.
this.addAbility(new KeeperOfFablesTriggeredAbility());
}
private KeeperOfFables(final KeeperOfFables card) {
super(card);
}
@Override
public KeeperOfFables copy() {
return new KeeperOfFables(this);
}
}
class KeeperOfFablesTriggeredAbility extends TriggeredAbilityImpl {
private final List<UUID> damagedPlayerIds = new ArrayList<>();
KeeperOfFablesTriggeredAbility() {
super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), false);
}
private KeeperOfFablesTriggeredAbility(final KeeperOfFablesTriggeredAbility ability) {
super(ability);
}
@Override
public KeeperOfFablesTriggeredAbility copy() {
return new KeeperOfFablesTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER
|| event.getType() == GameEvent.EventType.END_COMBAT_STEP_POST;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) {
if (((DamagedPlayerEvent) event).isCombatDamage()) {
Permanent creature = game.getPermanent(event.getSourceId());
if (creature != null
&& creature.isControlledBy(controllerId)
&& !creature.hasSubtype(SubType.HUMAN, game)
&& !damagedPlayerIds.contains(event.getTargetId())) {
damagedPlayerIds.add(event.getTargetId());
return true;
}
}
}
if (event.getType() == GameEvent.EventType.END_COMBAT_STEP_POST) {
damagedPlayerIds.clear();
}
return false;
}
@Override
public String getRule() {
return "Whenever one or more non-Human creatures you control deal combat damage to a player, draw a card";
}
}

View file

@ -0,0 +1,88 @@
package mage.cards.k;
import mage.abilities.Ability;
import mage.abilities.common.AttacksCreatureYouControlTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.LoseLifeOpponentsEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.Game;
import mage.players.Player;
import java.util.UUID;
import java.util.stream.Collectors;
/**
* @author TheElk801
*/
public final class KnightsCharge extends CardImpl {
private static final FilterControlledCreaturePermanent filter
= new FilterControlledCreaturePermanent(SubType.KNIGHT);
public KnightsCharge(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}{B}");
// Whenever a Knight you control attacks, each opponent loses 1 life and you gain 1 life.
Ability ability = new AttacksCreatureYouControlTriggeredAbility(
new LoseLifeOpponentsEffect(1), false, filter
);
ability.addEffect(new GainLifeEffect(1).concatBy("and"));
this.addAbility(ability);
// {6}{W}{B}, Sacrifice Knights' Charge: Return all Knight creature cards from your graveyard to the battlefield.
ability = new SimpleActivatedAbility(new KnightsChargeEffect(), new ManaCostsImpl("{6}{W}{B}"));
ability.addCost(new SacrificeSourceCost());
this.addAbility(ability);
}
private KnightsCharge(final KnightsCharge card) {
super(card);
}
@Override
public KnightsCharge copy() {
return new KnightsCharge(this);
}
}
class KnightsChargeEffect extends OneShotEffect {
KnightsChargeEffect() {
super(Outcome.Benefit);
staticText = "return all Knight creature cards from your graveyard to the battlefield";
}
private KnightsChargeEffect(final KnightsChargeEffect effect) {
super(effect);
}
@Override
public KnightsChargeEffect copy() {
return new KnightsChargeEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
return player != null && player.moveCards(new CardsImpl(
player.getGraveyard()
.getCards(game)
.stream()
.filter(Card::isCreature)
.filter(card -> card.hasSubtype(SubType.KNIGHT, game))
.collect(Collectors.toSet())
), Zone.BATTLEFIELD, source, game);
}
}

View file

@ -0,0 +1,141 @@
package mage.cards.m;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.mana.BlueManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class MidnightClock extends CardImpl {
public MidnightClock(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}{U}");
// {T}: Add {U}.
this.addAbility(new BlueManaAbility());
// {2}{U}: Put an hour counter on Midnight Clock.
this.addAbility(new SimpleActivatedAbility(
new AddCountersSourceEffect(CounterType.HOUR.createInstance()), new ManaCostsImpl("{2}{U}")
));
// At the beginning of each upkeep, put an hour counter on Midnight Clock.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
new AddCountersSourceEffect(CounterType.HOUR.createInstance()), TargetController.ANY, false
));
// When the twelfth hour counter is put on Midnight Clock, shuffle your hand and graveyard into your library, then draw seven cards. Exile Midnight Clock.
this.addAbility(new MidnightClockTriggeredAbility());
}
private MidnightClock(final MidnightClock card) {
super(card);
}
@Override
public MidnightClock copy() {
return new MidnightClock(this);
}
}
class MidnightClockTriggeredAbility extends TriggeredAbilityImpl {
MidnightClockTriggeredAbility() {
super(Zone.ALL, new MidnightClockEffect(), false);
}
private MidnightClockTriggeredAbility(final MidnightClockTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.COUNTER_ADDED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getTargetId().equals(getSourceId())
&& event.getData().equals(CounterType.HOUR.getName())) {
int amountAdded = event.getAmount();
int hourCounters = amountAdded;
Permanent sourcePermanent = game.getPermanent(getSourceId());
if (sourcePermanent == null) {
sourcePermanent = game.getPermanentEntering(getSourceId());
}
if (sourcePermanent != null) {
hourCounters = sourcePermanent.getCounters(game).getCount(CounterType.HOUR);
}
return hourCounters - amountAdded < 12
&& 12 <= hourCounters;
}
return false;
}
@Override
public MidnightClockTriggeredAbility copy() {
return new MidnightClockTriggeredAbility(this);
}
@Override
public String getRule() {
return "When the twelfth hour counter is put on {this}, " +
"shuffle your hand and graveyard into your library, " +
"then draw seven cards. Exile {this}.";
}
}
class MidnightClockEffect extends OneShotEffect {
private static final Effect effect = new ExileSourceEffect();
MidnightClockEffect() {
super(Outcome.Benefit);
}
private MidnightClockEffect(final MidnightClockEffect effect) {
super(effect);
}
@Override
public MidnightClockEffect copy() {
return new MidnightClockEffect(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.getHand());
cards.addAll(player.getGraveyard());
player.putCardsOnTopOfLibrary(cards, game, source, false);
player.shuffleLibrary(source, game);
player.drawCards(7, game);
return effect.apply(game, source);
}
}

View file

@ -0,0 +1,89 @@
package mage.cards.o;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect;
import mage.abilities.effects.common.continuous.ExchangeControlTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterOpponentsCreaturePermanent;
import mage.filter.predicate.mageobject.PowerPredicate;
import mage.game.permanent.token.FoodToken;
import mage.game.permanent.token.TokenImpl;
import mage.target.TargetPermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class OkoThiefOfCrowns extends CardImpl {
private static final FilterPermanent filter = new FilterOpponentsCreaturePermanent("creature an opponent controls with power 3 or less");
static {
filter.add(new PowerPredicate(ComparisonType.FEWER_THAN, 4));
}
public OkoThiefOfCrowns(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{1}{G}{U}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.OKO);
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4));
// +2: Create a Food token.
this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new FoodToken(), 2)));
// +1: Target artifact or creature loses all abilities and becomes a green Elk creature with base power and toughness 3/3.
Ability ability = new LoyaltyAbility(new BecomesCreatureTargetEffect(
new OkoThiefOfCrownsToken(), true, false, Duration.Custom
).setText("target artifact or creature loses all abilities and becomes a green Elk creature with base power and toughness 3/3"), 1);
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_CREATURE));
this.addAbility(ability);
// 5: Exchange control of target artifact or creature you control and target creature an opponent controls with power 3 or less.
ability = new LoyaltyAbility(new ExchangeControlTargetEffect(
Duration.EndOfGame, "exchange control of target artifact or creature you control " +
"and target creature an opponent controls with power 3 or less", false, true
), -5);
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT_OR_CREATURE));
ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability);
}
private OkoThiefOfCrowns(final OkoThiefOfCrowns card) {
super(card);
}
@Override
public OkoThiefOfCrowns copy() {
return new OkoThiefOfCrowns(this);
}
}
class OkoThiefOfCrownsToken extends TokenImpl {
OkoThiefOfCrownsToken() {
super("", "green Elk creature with base power and toughness 3/3");
cardType.add(CardType.CREATURE);
color.setGreen(true);
subtype.add(SubType.ELK);
power = new MageInt(3);
toughness = new MageInt(3);
}
private OkoThiefOfCrownsToken(final OkoThiefOfCrownsToken token) {
super(token);
}
public OkoThiefOfCrownsToken copy() {
return new OkoThiefOfCrownsToken(this);
}
}

View file

@ -0,0 +1,72 @@
package mage.cards.p;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.permanent.token.RatToken;
import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class PiperOfTheSwarm extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(SubType.RAT, "Rats");
private static final FilterControlledPermanent filter2 = new FilterControlledPermanent(SubType.RAT, "Rats");
public PiperOfTheSwarm(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.WARLOCK);
this.power = new MageInt(1);
this.toughness = new MageInt(3);
// Rats you control have menace.
this.addAbility(new SimpleStaticAbility(
new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter)
));
// {1}{B}, {T}: Create a 1/1 black Rat creature token.
Ability ability = new SimpleActivatedAbility(
new CreateTokenEffect(new RatToken()), new ManaCostsImpl("{1}{B}")
);
ability.addCost(new TapSourceCost());
this.addAbility(ability);
// {2}{B}{B}, {T}, Sacrifice three Rats: Gain control of target creature.
ability = new SimpleActivatedAbility(
new GainControlTargetEffect(Duration.Custom), new ManaCostsImpl("{2}{B}{B}")
);
ability.addCost(new TapSourceCost());
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(3, filter2)));
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}
private PiperOfTheSwarm(final PiperOfTheSwarm card) {
super(card);
}
@Override
public PiperOfTheSwarm copy() {
return new PiperOfTheSwarm(this);
}
}

View file

@ -0,0 +1,64 @@
package mage.cards.s;
import mage.MageInt;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.CreaturesYouControlCount;
import mage.abilities.dynamicvalue.common.OpponentsCount;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.hint.common.CreaturesYouControlHint;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.permanent.token.KnightToken;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class SilverwingSquadron extends CardImpl {
public SilverwingSquadron(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{W}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.KNIGHT);
this.power = new MageInt(0);
this.toughness = new MageInt(0);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Vigilance
this.addAbility(VigilanceAbility.getInstance());
// Silverwing Squadron's power and toughness are each equal to the number of creatures you control.
this.addAbility(new SimpleStaticAbility(
Zone.ALL, new SetPowerToughnessSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame)
).addHint(CreaturesYouControlHint.instance));
// Whenever Silverwing Squadron attacks, create a number of 2/2 white Knight creature tokens with vigilance equal to the number of opponents you have.
this.addAbility(new AttacksTriggeredAbility(
new CreateTokenEffect(new KnightToken(), OpponentsCount.instance).setText(
"create a number of 2/2 white Knight creature tokens with vigilance " +
"equal to the number of opponents you have"
), false
));
}
private SilverwingSquadron(final SilverwingSquadron card) {
super(card);
}
@Override
public SilverwingSquadron copy() {
return new SilverwingSquadron(this);
}
}

View file

@ -0,0 +1,77 @@
package mage.cards.s;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.LoseLifeOpponentsEffect;
import mage.abilities.keyword.LifelinkAbility;
import mage.cards.AdventureCard;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.game.Game;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class SmittenSwordmaster extends AdventureCard {
public SmittenSwordmaster(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, new CardType[]{CardType.SORCERY}, "{1}{B}", "Curry Favor", "{B}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.KNIGHT);
this.power = new MageInt(2);
this.toughness = new MageInt(1);
// Lifelink
this.addAbility(LifelinkAbility.getInstance());
// Curry Favor
// You gain X life and each opponent loses X life, where X is the number of Knights you control.
this.getAdventureSpellAbility().addEffect(new CurryFavorEffect());
}
private SmittenSwordmaster(final SmittenSwordmaster card) {
super(card);
}
@Override
public SmittenSwordmaster copy() {
return new SmittenSwordmaster(this);
}
}
class CurryFavorEffect extends OneShotEffect {
CurryFavorEffect() {
super(Outcome.Benefit);
staticText = "you gain X life and each opponent loses X life, where X is the number of Knights you control";
}
private CurryFavorEffect(final CurryFavorEffect effect) {
super(effect);
}
@Override
public CurryFavorEffect copy() {
return new CurryFavorEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
int xValue = game.getBattlefield()
.getAllActivePermanents(source.getControllerId())
.stream()
.filter(permanent -> permanent != null && permanent.hasSubtype(SubType.KNIGHT, game))
.mapToInt(p -> 1)
.sum();
new GainLifeEffect(xValue).apply(game, source);
new LoseLifeOpponentsEffect(xValue).apply(game, source);
return true;
}
}

View file

@ -0,0 +1,49 @@
package mage.cards.s;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.abilities.keyword.EquipFilterAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.filter.common.FilterControlledCreaturePermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class SteelclawLance extends CardImpl {
private static final FilterControlledCreaturePermanent filter
= new FilterControlledCreaturePermanent(SubType.KNIGHT, "Knight");
public SteelclawLance(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{B}{R}");
this.subtype.add(SubType.EQUIPMENT);
// Equipped creature gets +2/+2.
this.addAbility(new SimpleStaticAbility(new BoostEquippedEffect(2, 2)));
// Equip Knight {1}
this.addAbility(new EquipFilterAbility(filter, new GenericManaCost(1)));
// Equip {3}
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3)));
}
private SteelclawLance(final SteelclawLance card) {
super(card);
}
@Override
public SteelclawLance copy() {
return new SteelclawLance(this);
}
}

View file

@ -0,0 +1,79 @@
package mage.cards.s;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AttacksCreatureYouControlTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.keyword.EquipFilterAbility;
import mage.abilities.keyword.MenaceAbility;
import mage.abilities.keyword.VigilanceAbility;
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.FilterPermanent;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.permanent.EquippedPredicate;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class SyrGwynHeroOfAshvale extends CardImpl {
private static final FilterControlledCreaturePermanent filter
= new FilterControlledCreaturePermanent("an equipped creature you control");
private static final FilterPermanent filter2
= new FilterControlledPermanent(SubType.EQUIPMENT);
private static final FilterControlledCreaturePermanent filter3
= new FilterControlledCreaturePermanent(SubType.KNIGHT, "Knight");
static {
filter.add(EquippedPredicate.instance);
}
public SyrGwynHeroOfAshvale(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}{W}{B}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.KNIGHT);
this.power = new MageInt(5);
this.toughness = new MageInt(5);
// Vigilance
this.addAbility(VigilanceAbility.getInstance());
// Menace
this.addAbility(new MenaceAbility());
// Whenever an equipped creature you control attacks, you draw a card and you lose 1 life.
Ability ability = new AttacksCreatureYouControlTriggeredAbility(
new DrawCardSourceControllerEffect(1).setText("you draw a card and"), false, filter
);
ability.addEffect(new LoseLifeSourceControllerEffect(1));
this.addAbility(ability);
// Equipment you control have equip Knight {0}.
this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect(
new EquipFilterAbility(filter3, new GenericManaCost(0)), Duration.WhileOnBattlefield, filter2
)));
}
private SyrGwynHeroOfAshvale(final SyrGwynHeroOfAshvale card) {
super(card);
}
@Override
public SyrGwynHeroOfAshvale copy() {
return new SyrGwynHeroOfAshvale(this);
}
}

View file

@ -0,0 +1,60 @@
package mage.cards.t;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
import mage.abilities.effects.common.FightTargetSourceEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.TargetPermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ThornMammoth extends CardImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(new ControllerPredicate(TargetController.NOT_YOU));
}
public ThornMammoth(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{G}{G}");
this.subtype.add(SubType.ELEPHANT);
this.power = new MageInt(6);
this.toughness = new MageInt(6);
// Trample
this.addAbility(TrampleAbility.getInstance());
// Whenever Thorn Mammoth or another creature enters the battlefield under your control, Thorn Mammoth fights up to one target creature you don't control.
Ability ability = new EntersBattlefieldControlledTriggeredAbility(
new FightTargetSourceEffect(), StaticFilters.FILTER_PERMANENT_CREATURE,
"Whenever {this} or another creature enters the battlefield under your control, " +
"{this} fights up to one target creature you don't control."
);
ability.addTarget(new TargetPermanent(0, 1, filter, false));
this.addAbility(ability);
}
private ThornMammoth(final ThornMammoth card) {
super(card);
}
@Override
public ThornMammoth copy() {
return new ThornMammoth(this);
}
}

View file

@ -0,0 +1,51 @@
package mage.cards.t;
import mage.Mana;
import mage.abilities.mana.ColorlessManaAbility;
import mage.abilities.mana.ConditionalColoredManaAbility;
import mage.abilities.mana.conditional.ConditionalSpellManaBuilder;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.FilterSpell;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.SubtypePredicate;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class TournamentGrounds extends CardImpl {
private static final FilterSpell filter = new FilterSpell("a Knight or Equipment spell");
static {
filter.add(Predicates.or(
new SubtypePredicate(SubType.KNIGHT),
new SubtypePredicate(SubType.EQUIPMENT)
));
}
public TournamentGrounds(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
// {T}: Add {C}.
this.addAbility(new ColorlessManaAbility());
// {T}: Add {R}, {W}, or {B}. Spend this mana only to cast a Knight or Equipment spell.
this.addAbility(new ConditionalColoredManaAbility(Mana.RedMana(1), new ConditionalSpellManaBuilder(filter)));
this.addAbility(new ConditionalColoredManaAbility(Mana.WhiteMana(1), new ConditionalSpellManaBuilder(filter)));
this.addAbility(new ConditionalColoredManaAbility(Mana.BlackMana(1), new ConditionalSpellManaBuilder(filter)));
}
private TournamentGrounds(final TournamentGrounds card) {
super(card);
}
@Override
public TournamentGrounds copy() {
return new TournamentGrounds(this);
}
}

View file

@ -0,0 +1,72 @@
package mage.cards.w;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.effects.common.continuous.SetToughnessSourceEffect;
import mage.abilities.keyword.DeathtouchAbility;
import mage.abilities.keyword.IndestructibleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.target.TargetPermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class WintermoorCommander extends CardImpl {
private static final FilterPermanent filter
= new FilterControlledPermanent(SubType.KNIGHT, "Knights you control");
private static final DynamicValue xValue
= new PermanentsOnBattlefieldCount(filter);
private static final FilterPermanent filter2
= new FilterControlledPermanent(SubType.KNIGHT, "another target Knight you control");
static {
filter2.add(AnotherPredicate.instance);
}
public WintermoorCommander(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}{B}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.KNIGHT);
this.power = new MageInt(2);
this.toughness = new MageInt(0);
// Deathtouch
this.addAbility(DeathtouchAbility.getInstance());
// Wintermoor Commander's toughness is equal to the number of Knights you control.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetToughnessSourceEffect(xValue, Duration.EndOfGame)));
// Whenever Wintermoor Commander attacks, another target Knight you control gains indestructible until end of turn.
Ability ability = new AttacksTriggeredAbility(new GainAbilityTargetEffect(
IndestructibleAbility.getInstance(), Duration.EndOfTurn
), false);
ability.addTarget(new TargetPermanent(filter2));
this.addAbility(ability);
}
private WintermoorCommander(final WintermoorCommander card) {
super(card);
}
@Override
public WintermoorCommander copy() {
return new WintermoorCommander(this);
}
}

View file

@ -0,0 +1,77 @@
package mage.cards.w;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfCombatTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.continuous.AddCardTypeTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterArtifactCreaturePermanent;
import mage.filter.common.FilterControlledArtifactPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class WorkshopElders extends CardImpl {
private static final FilterPermanent filter
= new FilterArtifactCreaturePermanent("artifact creatures");
private static final FilterPermanent filter2
= new FilterControlledArtifactPermanent("noncreature artifact you control");
static {
filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
}
public WorkshopElders(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{6}{U}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.ARTIFICER);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// Artifact creatures you control have flying.
this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect(
FlyingAbility.getInstance(), Duration.WhileOnBattlefield, filter
)));
// At the beginning of combat on your turn, you may have target noncreature artifact you control become a 0/0 artifact creature. If you do, put four +1/+1 counters on it.
Ability ability = new BeginningOfCombatTriggeredAbility(new AddCardTypeTargetEffect(
Duration.EndOfGame, CardType.ARTIFACT, CardType.CREATURE
).setText("have target noncreature artifact you control become"), TargetController.YOU, true);
ability.addEffect(new SetPowerToughnessTargetEffect(
0, 0, Duration.EndOfGame
).setText("a 0/0 artifact creature."));
ability.addEffect(new AddCountersTargetEffect(
CounterType.P1P1.createInstance(4)
).setText("If you do, put four +1/+1 counters on it."));
ability.addTarget(new TargetPermanent(filter2));
this.addAbility(ability);
}
private WorkshopElders(final WorkshopElders card) {
super(card);
}
@Override
public WorkshopElders copy() {
return new WorkshopElders(this);
}
}

View file

@ -30,9 +30,12 @@ public final class ThroneOfEldraine extends ExpansionSet {
cards.add(new SetCardInfo("Alela, Artful Provocateur", 324, Rarity.MYTHIC, mage.cards.a.AlelaArtfulProvocateur.class));
cards.add(new SetCardInfo("All That Glitters", 2, Rarity.UNCOMMON, mage.cards.a.AllThatGlitters.class));
cards.add(new SetCardInfo("Animating Faerie", 38, Rarity.UNCOMMON, mage.cards.a.AnimatingFaerie.class));
cards.add(new SetCardInfo("Arcane Signet", 331, Rarity.COMMON, mage.cards.a.ArcaneSignet.class));
cards.add(new SetCardInfo("Arcanist's Owl", 206, Rarity.UNCOMMON, mage.cards.a.ArcanistsOwl.class));
cards.add(new SetCardInfo("Bake into a Pie", 76, Rarity.COMMON, mage.cards.b.BakeIntoAPie.class));
cards.add(new SetCardInfo("Banish into Fable", 325, Rarity.RARE, mage.cards.b.BanishIntoFable.class));
cards.add(new SetCardInfo("Beanstalk Giant", 149, Rarity.UNCOMMON, mage.cards.b.BeanstalkGiant.class));
cards.add(new SetCardInfo("Belle of the Brawl", 78, Rarity.UNCOMMON, mage.cards.b.BelleOfTheBrawl.class));
cards.add(new SetCardInfo("Chittering Witch", 319, Rarity.RARE, mage.cards.c.ChitteringWitch.class));
cards.add(new SetCardInfo("Chulane, Teller of Tales", 326, Rarity.MYTHIC, mage.cards.c.ChulaneTellerOfTales.class));
@ -47,16 +50,22 @@ public final class ThroneOfEldraine extends ExpansionSet {
cards.add(new SetCardInfo("Fireborn Knight", 210, Rarity.UNCOMMON, mage.cards.f.FirebornKnight.class));
cards.add(new SetCardInfo("Flaxen Intruder", 155, Rarity.UNCOMMON, mage.cards.f.FlaxenIntruder.class));
cards.add(new SetCardInfo("Foulmire Knight", 90, Rarity.UNCOMMON, mage.cards.f.FoulmireKnight.class));
cards.add(new SetCardInfo("Frogify", 47, Rarity.UNCOMMON, mage.cards.f.Frogify.class));
cards.add(new SetCardInfo("Garruk, Cursed Huntsman", 191, Rarity.MYTHIC, mage.cards.g.GarrukCursedHuntsman.class));
cards.add(new SetCardInfo("Gilded Goose", 160, Rarity.RARE, mage.cards.g.GildedGoose.class));
cards.add(new SetCardInfo("Gluttonous Troll", 327, Rarity.RARE, mage.cards.g.GluttonousTroll.class));
cards.add(new SetCardInfo("Golden Egg", 220, Rarity.COMMON, mage.cards.g.GoldenEgg.class));
cards.add(new SetCardInfo("Heraldic Banner", 222, Rarity.UNCOMMON, mage.cards.h.HeraldicBanner.class));
cards.add(new SetCardInfo("Inspiring Veteran", 194, Rarity.UNCOMMON, mage.cards.i.InspiringVeteran.class));
cards.add(new SetCardInfo("Keeper of Fables", 163, Rarity.UNCOMMON, mage.cards.k.KeeperOfFables.class));
cards.add(new SetCardInfo("Knights' Charge", 328, Rarity.RARE, mage.cards.k.KnightsCharge.class));
cards.add(new SetCardInfo("Lovestruck Beast", 165, Rarity.RARE, mage.cards.l.LovestruckBeast.class));
cards.add(new SetCardInfo("Mace of the Valiant", 314, Rarity.RARE, mage.cards.m.MaceOfTheValiant.class));
cards.add(new SetCardInfo("Maraleaf Pixie", 196, Rarity.UNCOMMON, mage.cards.m.MaraleafPixie.class));
cards.add(new SetCardInfo("Midnight Clock", 54, Rarity.RARE, mage.cards.m.MidnightClock.class));
cards.add(new SetCardInfo("Oko, Thief of Crowns", 197, Rarity.MYTHIC, mage.cards.o.OkoThiefOfCrowns.class));
cards.add(new SetCardInfo("Order of Midnight", 99, Rarity.UNCOMMON, mage.cards.o.OrderOfMidnight.class));
cards.add(new SetCardInfo("Piper of the Swarm", 100, Rarity.RARE, mage.cards.p.PiperOfTheSwarm.class));
cards.add(new SetCardInfo("Rankle, Master of Pranks", 101, Rarity.MYTHIC, mage.cards.r.RankleMasterOfPranks.class));
cards.add(new SetCardInfo("Rosethorn Acolyte", 174, Rarity.COMMON, mage.cards.r.RosethornAcolyte.class));
cards.add(new SetCardInfo("Run Away Together", 62, Rarity.COMMON, mage.cards.r.RunAwayTogether.class));
@ -65,16 +74,24 @@ public final class ThroneOfEldraine extends ExpansionSet {
cards.add(new SetCardInfo("Shinechaser", 201, Rarity.UNCOMMON, mage.cards.s.Shinechaser.class));
cards.add(new SetCardInfo("Shining Armor", 29, Rarity.COMMON, mage.cards.s.ShiningArmor.class));
cards.add(new SetCardInfo("Silverflame Ritual", 30, Rarity.COMMON, mage.cards.s.SilverflameRitual.class));
cards.add(new SetCardInfo("Silverwing Squadron", 315, Rarity.RARE, mage.cards.s.SilverwingSquadron.class));
cards.add(new SetCardInfo("Slaying Fire", 143, Rarity.UNCOMMON, mage.cards.s.SlayingFire.class));
cards.add(new SetCardInfo("Smitten Swordmaster", 105, Rarity.COMMON, mage.cards.s.SmittenSwordmaster.class));
cards.add(new SetCardInfo("Steelbane Hydra", 322, Rarity.RARE, mage.cards.s.SteelbaneHydra.class));
cards.add(new SetCardInfo("Steelclaw Lance", 202, Rarity.UNCOMMON, mage.cards.s.SteelclawLance.class));
cards.add(new SetCardInfo("Syr Gwyn, Hero of Ashvale", 330, Rarity.MYTHIC, mage.cards.s.SyrGwynHeroOfAshvale.class));
cards.add(new SetCardInfo("Taste of Death", 320, Rarity.RARE, mage.cards.t.TasteOfDeath.class));
cards.add(new SetCardInfo("The Circle of Loyalty", 9, Rarity.MYTHIC, mage.cards.t.TheCircleOfLoyalty.class));
cards.add(new SetCardInfo("Thorn Mammoth", 323, Rarity.RARE, mage.cards.t.ThornMammoth.class));
cards.add(new SetCardInfo("Thornwood Falls", 313, Rarity.COMMON, mage.cards.t.ThornwoodFalls.class));
cards.add(new SetCardInfo("Tome Raider", 68, Rarity.COMMON, mage.cards.t.TomeRaider.class));
cards.add(new SetCardInfo("Tome of Legends", 332, Rarity.RARE, mage.cards.t.TomeOfLegends.class));
cards.add(new SetCardInfo("Tournament Grounds", 248, Rarity.UNCOMMON, mage.cards.t.TournamentGrounds.class));
cards.add(new SetCardInfo("Wind-Scarred Crag", 308, Rarity.COMMON, mage.cards.w.WindScarredCrag.class));
cards.add(new SetCardInfo("Wintermoor Commander", 205, Rarity.UNCOMMON, mage.cards.w.WintermoorCommander.class));
cards.add(new SetCardInfo("Wishful Merfolk", 73, Rarity.COMMON, mage.cards.w.WishfulMerfolk.class));
cards.add(new SetCardInfo("Witching Well", 74, Rarity.COMMON, mage.cards.w.WitchingWell.class));
cards.add(new SetCardInfo("Workshop Elders", 318, Rarity.RARE, mage.cards.w.WorkshopElders.class));
// This is here to prevent the incomplete adventure implementation from causing problems and will be removed
cards.removeIf(setCardInfo -> AdventureCard.class.isAssignableFrom(setCardInfo.getCardClass()));

View file

@ -0,0 +1,40 @@
package mage.abilities.keyword;
import mage.abilities.ActivatedAbilityImpl;
import mage.abilities.costs.Cost;
import mage.abilities.effects.common.AttachEffect;
import mage.constants.Outcome;
import mage.constants.TimingRule;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.target.common.TargetControlledCreaturePermanent;
/**
* @author TheElk801
*/
public class EquipFilterAbility extends ActivatedAbilityImpl {
private final FilterControlledCreaturePermanent filter;
public EquipFilterAbility(FilterControlledCreaturePermanent filter, Cost cost) {
super(Zone.BATTLEFIELD, new AttachEffect(Outcome.AddAbility, "Equip"), cost);
this.addTarget(new TargetControlledCreaturePermanent(filter));
this.filter = filter;
this.timing = TimingRule.SORCERY;
}
private EquipFilterAbility(final EquipFilterAbility ability) {
super(ability);
this.filter = ability.filter;
}
@Override
public EquipFilterAbility copy() {
return new EquipFilterAbility(this);
}
@Override
public String getRule() {
return "Equip " + filter.getMessage() + costs.getText() + manaCosts.getText();
}
}

View file

@ -1,69 +0,0 @@
package mage.abilities.keyword;
import java.util.UUID;
import mage.abilities.ActivatedAbilityImpl;
import mage.abilities.costs.Cost;
import mage.abilities.effects.common.AttachEffect;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.TimingRule;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.Target;
import mage.target.common.TargetControlledCreaturePermanent;
/**
* @author Rystan
*/
public class EquipLegendaryAbility extends ActivatedAbilityImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("legendary creature you control");
static {
filter.add(new SupertypePredicate(SuperType.LEGENDARY));
}
public EquipLegendaryAbility(Outcome outcome, Cost cost) {
this(outcome, cost, new TargetControlledCreaturePermanent(filter));
}
public EquipLegendaryAbility(Outcome outcome, Cost cost, Target target) {
super(Zone.BATTLEFIELD, new AttachEffect(outcome, "Equip"), cost);
this.addTarget(target);
this.timing = TimingRule.SORCERY;
}
@Override
public ActivationStatus canActivate(UUID playerId, Game game) {
ActivationStatus activationStatus = super.canActivate(playerId, game);
if (activationStatus.canActivate()) {
Permanent permanent = game.getPermanent(sourceId);
if (permanent != null && permanent.hasSubtype(SubType.EQUIPMENT, game)) {
return activationStatus;
}
}
return activationStatus;
}
public EquipLegendaryAbility(final EquipLegendaryAbility ability) {
super(ability);
}
@Override
public EquipLegendaryAbility copy() {
return new EquipLegendaryAbility(this);
}
@Override
public String getRule() {
return "Equip legendary creature " + costs.getText()
+ manaCosts.getText() + " (" + manaCosts.getText()
+ ": <i>Attach to target legendary creature you control. Equip only as a sorcery.)</i>";
}
}

View file

@ -407,6 +407,7 @@ public enum SubType {
NISSA("Nissa", SubTypeSet.PlaneswalkerType),
NIXILIS("Nixilis", SubTypeSet.PlaneswalkerType),
OBI_WAN("Obi-Wan", SubTypeSet.PlaneswalkerType, true), // Star Wars
OKO("Oko", SubTypeSet.PlaneswalkerType),
RAL("Ral", SubTypeSet.PlaneswalkerType),
ROWAN("Rowan", SubTypeSet.PlaneswalkerType),
SAHEELI("Saheeli", SubTypeSet.PlaneswalkerType),

View file

@ -36066,7 +36066,7 @@ Chulane, Teller of Tales|Throne of Eldraine|326|M|{2}{G}{W}{U}|Legendary Creatur
Gluttonous Troll|Throne of Eldraine|327|R|{2}{B}{G}|Creature - Troll|3|3|Trample$When Gluttonous Troll enters the battlefield, create a number of Food tokens equal to the number of opponents you have.${1}{G}, Sacrifice another nonland permanent: Gluttonous Troll gets +2/+2 until end of turn.|
Knights' Charge|Throne of Eldraine|328|R|{1}{W}{B}|Enchantment|||Whenever a Knight you control attacks, each opponent loses 1 life and you gain 1 life.${6}{W}{B}, Sacrifice Knights' Charge: Return all Knight creature cards from your graveyard to the battlefield.|
Korvold, Fae-Cursed King|Throne of Eldraine|329|M|{2}{B}{R}{G}|Legendary Creature - Dragon Noble|4|4|Flying$Whenever Korvold, Fae-Cursed King enters the battlefield or attacks, sacrifice another permanent.$Whenever you sacrifice a permanent, put a +1/+1 counter on Korvold and draw a card.|
Syr Gwyn, Hero of Ashenvale|Throne of Eldraine|330|M|{3}{R}{W}{B}|Legendary Creature - Human Knight|5|5|Vigilance, menace$Whenever an equipped creature you control attacks, you draw a card and you lose 1 life.$Equipment you control have equip Knight {0}.|
Syr Gwyn, Hero of Ashvale|Throne of Eldraine|330|M|{3}{R}{W}{B}|Legendary Creature - Human Knight|5|5|Vigilance, menace$Whenever an equipped creature you control attacks, you draw a card and you lose 1 life.$Equipment you control have equip Knight {0}.|
Arcane Signet|Throne of Eldraine|331|C|{2}|Artifact|||{T}: Add one mana of any color in your commander's color identity.|
Tome of Legends|Throne of Eldraine|332|R|{2}|Artifact|||Tome of Legends enters the battlefield with a page counter on it.$Whenever your commander enters the battlefield or attacks, put a page counter on Tome of Legends.${1}, {T}, Remove a page counter from Tome of Legends: Draw a card.|
Command Tower|Throne of Eldraine|333|C||Land|||{T}: Add one mana of any color in your commander's color identity.|