[STX] Implemented Leyline Invocation

This commit is contained in:
Evan Kranzler 2021-04-04 10:19:32 -04:00
parent ec4eead278
commit 1461a875ff
4 changed files with 100 additions and 0 deletions

View file

@ -0,0 +1,36 @@
package mage.cards.l;
import mage.abilities.dynamicvalue.common.LandsYouControlCount;
import mage.abilities.hint.common.LandsYouControlHint;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.game.permanent.token.QuandrixToken;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class LeylineInvocation extends CardImpl {
public LeylineInvocation(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{5}{G}");
// Create a 0/0 green and blue Fractal creature token. Put X +1/+1 counters on it, where X is the number of lands you control.
this.getSpellAbility().addEffect(QuandrixToken.getEffect(
LandsYouControlCount.instance, "Put X +1/+1 counters on it, " +
"where X is the number of lands you control"
));
this.getSpellAbility().addHint(LandsYouControlHint.instance);
}
private LeylineInvocation(final LeylineInvocation card) {
super(card);
}
@Override
public LeylineInvocation copy() {
return new LeylineInvocation(this);
}
}

View file

@ -121,6 +121,7 @@ public final class StrixhavenSchoolOfMages extends ExpansionSet {
cards.add(new SetCardInfo("Leech Fanatic", 75, Rarity.COMMON, mage.cards.l.LeechFanatic.class)); cards.add(new SetCardInfo("Leech Fanatic", 75, Rarity.COMMON, mage.cards.l.LeechFanatic.class));
cards.add(new SetCardInfo("Leonin Lightscribe", 20, Rarity.RARE, mage.cards.l.LeoninLightscribe.class)); cards.add(new SetCardInfo("Leonin Lightscribe", 20, Rarity.RARE, mage.cards.l.LeoninLightscribe.class));
cards.add(new SetCardInfo("Letter of Acceptance", 256, Rarity.COMMON, mage.cards.l.LetterOfAcceptance.class)); cards.add(new SetCardInfo("Letter of Acceptance", 256, Rarity.COMMON, mage.cards.l.LetterOfAcceptance.class));
cards.add(new SetCardInfo("Leyline Invocation", 136, Rarity.COMMON, mage.cards.l.LeylineInvocation.class));
cards.add(new SetCardInfo("Lorehold Apprentice", 198, Rarity.UNCOMMON, mage.cards.l.LoreholdApprentice.class)); cards.add(new SetCardInfo("Lorehold Apprentice", 198, Rarity.UNCOMMON, mage.cards.l.LoreholdApprentice.class));
cards.add(new SetCardInfo("Lorehold Campus", 268, Rarity.COMMON, mage.cards.l.LoreholdCampus.class)); cards.add(new SetCardInfo("Lorehold Campus", 268, Rarity.COMMON, mage.cards.l.LoreholdCampus.class));
cards.add(new SetCardInfo("Lorehold Command", 199, Rarity.RARE, mage.cards.l.LoreholdCommand.class)); cards.add(new SetCardInfo("Lorehold Command", 199, Rarity.RARE, mage.cards.l.LoreholdCommand.class));

View file

@ -0,0 +1,37 @@
package mage.abilities.dynamicvalue.common;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.filter.StaticFilters;
import mage.game.Game;
/**
* @author TheElk801
*/
public enum LandsYouControlCount implements DynamicValue {
instance;
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
return game.getBattlefield().count(
StaticFilters.FILTER_CONTROLLED_PERMANENT_LAND,
sourceAbility.getSourceId(), sourceAbility.getControllerId(), game
);
}
@Override
public LandsYouControlCount copy() {
return instance;
}
@Override
public String toString() {
return "X";
}
@Override
public String getMessage() {
return "lands you control";
}
}

View file

@ -0,0 +1,26 @@
package mage.abilities.hint.common;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.common.LandsYouControlCount;
import mage.abilities.hint.Hint;
import mage.abilities.hint.ValueHint;
import mage.game.Game;
/**
* @author TheElk801
*/
public enum LandsYouControlHint implements Hint {
instance;
private static final Hint hint = new ValueHint("Lands you control", LandsYouControlCount.instance);
@Override
public String getText(Game game, Ability ability) {
return hint.getText(game, ability);
}
@Override
public Hint copy() {
return instance;
}
}