mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 11:02:00 -08:00
[DFT] Implement Redshift, Rocketeer Chief
This commit is contained in:
parent
6e98d9ea34
commit
d098ca5346
7 changed files with 207 additions and 185 deletions
|
|
@ -1,11 +1,8 @@
|
||||||
package mage.cards.b;
|
package mage.cards.b;
|
||||||
|
|
||||||
import mage.ConditionalMana;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.Mana;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
import mage.abilities.costs.Cost;
|
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.dynamicvalue.common.GetXValue;
|
import mage.abilities.dynamicvalue.common.GetXValue;
|
||||||
import mage.abilities.effects.common.DamageTargetEffect;
|
import mage.abilities.effects.common.DamageTargetEffect;
|
||||||
|
|
@ -14,14 +11,12 @@ import mage.abilities.effects.mana.AddConditionalManaOfAnyColorEffect;
|
||||||
import mage.abilities.effects.mana.ManaEffect;
|
import mage.abilities.effects.mana.ManaEffect;
|
||||||
import mage.abilities.keyword.CrewAbility;
|
import mage.abilities.keyword.CrewAbility;
|
||||||
import mage.abilities.keyword.ExhaustAbility;
|
import mage.abilities.keyword.ExhaustAbility;
|
||||||
import mage.abilities.mana.builder.ConditionalManaBuilder;
|
import mage.abilities.mana.builder.common.ActivatedAbilityManaBuilder;
|
||||||
import mage.abilities.mana.conditional.ManaCondition;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.counters.CounterType;
|
import mage.counters.CounterType;
|
||||||
import mage.game.Game;
|
|
||||||
import mage.target.common.TargetAnyTarget;
|
import mage.target.common.TargetAnyTarget;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
@ -39,7 +34,7 @@ public final class Boommobile extends CardImpl {
|
||||||
this.toughness = new MageInt(5);
|
this.toughness = new MageInt(5);
|
||||||
|
|
||||||
// When this Vehicle enters, add four mana of any one color. Spend this mana only to activate abilities.
|
// When this Vehicle enters, add four mana of any one color. Spend this mana only to activate abilities.
|
||||||
ManaEffect entersEffect = new AddConditionalManaOfAnyColorEffect(4, new BoommobileManaBuilder());
|
ManaEffect entersEffect = new AddConditionalManaOfAnyColorEffect(4, new ActivatedAbilityManaBuilder());
|
||||||
entersEffect.setText("add four mana of any one color. Spend this mana only to activate abilities.");
|
entersEffect.setText("add four mana of any one color. Spend this mana only to activate abilities.");
|
||||||
this.addAbility(new EntersBattlefieldTriggeredAbility(entersEffect));
|
this.addAbility(new EntersBattlefieldTriggeredAbility(entersEffect));
|
||||||
|
|
||||||
|
|
@ -62,41 +57,3 @@ public final class Boommobile extends CardImpl {
|
||||||
return new Boommobile(this);
|
return new Boommobile(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class BoommobileManaBuilder extends ConditionalManaBuilder {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ConditionalMana build(Object... options) {
|
|
||||||
return new BoommobileConditionalMana(this.mana);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getRule() {
|
|
||||||
return "Spend this mana only to activate abilities";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class BoommobileConditionalMana extends ConditionalMana {
|
|
||||||
|
|
||||||
BoommobileConditionalMana(Mana mana) {
|
|
||||||
super(mana);
|
|
||||||
staticText = "Spend this mana only to activate abilities";
|
|
||||||
addCondition(new BoommobileManaCondition());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class BoommobileManaCondition extends ManaCondition {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
if (source != null && !source.isActivated()) {
|
|
||||||
return source.isActivatedAbility();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source, UUID originalId, Cost costsToPay) {
|
|
||||||
return apply(game, source);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,9 @@
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import mage.ConditionalMana;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.Mana;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldAbility;
|
import mage.abilities.common.EntersBattlefieldAbility;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.condition.Condition;
|
|
||||||
import mage.abilities.costs.Cost;
|
|
||||||
import mage.abilities.costs.common.RemoveCountersSourceCost;
|
import mage.abilities.costs.common.RemoveCountersSourceCost;
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.costs.mana.GenericManaCost;
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
|
|
@ -15,14 +11,12 @@ import mage.abilities.dynamicvalue.common.CountersSourceCount;
|
||||||
import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect;
|
import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect;
|
||||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||||
import mage.abilities.mana.ConditionalColorlessManaAbility;
|
import mage.abilities.mana.ConditionalColorlessManaAbility;
|
||||||
import mage.abilities.mana.builder.ConditionalManaBuilder;
|
import mage.abilities.mana.builder.common.ActivatedAbilityManaBuilder;
|
||||||
import mage.abilities.mana.conditional.ManaCondition;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.counters.CounterType;
|
import mage.counters.CounterType;
|
||||||
import mage.game.Game;
|
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
@ -46,7 +40,7 @@ public final class CrypticTrilobite extends CardImpl {
|
||||||
// Remove a +1/+1 counter from Cryptic Trilobite: Add {C}{C}. Spend this mana only to activate abilities.
|
// Remove a +1/+1 counter from Cryptic Trilobite: Add {C}{C}. Spend this mana only to activate abilities.
|
||||||
this.addAbility(new ConditionalColorlessManaAbility(
|
this.addAbility(new ConditionalColorlessManaAbility(
|
||||||
new RemoveCountersSourceCost(CounterType.P1P1.createInstance()),
|
new RemoveCountersSourceCost(CounterType.P1P1.createInstance()),
|
||||||
2, new CrypticTrilobiteManaBuilder(),
|
2, new ActivatedAbilityManaBuilder(),
|
||||||
new CountersSourceCount(CounterType.P1P1)
|
new CountersSourceCount(CounterType.P1P1)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
@ -67,40 +61,3 @@ public final class CrypticTrilobite extends CardImpl {
|
||||||
return new CrypticTrilobite(this);
|
return new CrypticTrilobite(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class CrypticTrilobiteManaBuilder extends ConditionalManaBuilder {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ConditionalMana build(Object... options) {
|
|
||||||
return new CrypticTrilobiteConditionalMana(this.mana);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getRule() {
|
|
||||||
return "Spend this mana only to activate abilities";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class CrypticTrilobiteConditionalMana extends ConditionalMana {
|
|
||||||
|
|
||||||
CrypticTrilobiteConditionalMana(Mana mana) {
|
|
||||||
super(mana);
|
|
||||||
staticText = "Spend this mana only to activate abilities";
|
|
||||||
addCondition(new CrypticTrilobiteManaCondition());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class CrypticTrilobiteManaCondition extends ManaCondition implements Condition {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
return source != null
|
|
||||||
&& !source.isActivated()
|
|
||||||
&& source.isActivatedAbility();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source, UUID originalId, Cost costsToPay) {
|
|
||||||
return apply(game, source);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,13 @@
|
||||||
package mage.cards.o;
|
package mage.cards.o;
|
||||||
|
|
||||||
import mage.ConditionalMana;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.Mana;
|
import mage.Mana;
|
||||||
import mage.abilities.Ability;
|
|
||||||
import mage.abilities.condition.Condition;
|
|
||||||
import mage.abilities.costs.Cost;
|
|
||||||
import mage.abilities.mana.ConditionalColoredManaAbility;
|
import mage.abilities.mana.ConditionalColoredManaAbility;
|
||||||
import mage.abilities.mana.builder.ConditionalManaBuilder;
|
import mage.abilities.mana.builder.common.ActivatedAbilityManaBuilder;
|
||||||
import mage.abilities.mana.conditional.ManaCondition;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.game.Game;
|
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
@ -32,7 +26,7 @@ public final class OmenHawker extends CardImpl {
|
||||||
|
|
||||||
// {T}: Add {C}{U}. Spend this many only to activate abilities.
|
// {T}: Add {C}{U}. Spend this many only to activate abilities.
|
||||||
this.addAbility(new ConditionalColoredManaAbility(
|
this.addAbility(new ConditionalColoredManaAbility(
|
||||||
new Mana(0, 1, 0, 0, 0, 0, 0, 1), new OmenHawkerManaBuilder()
|
new Mana(0, 1, 0, 0, 0, 0, 0, 1), new ActivatedAbilityManaBuilder()
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -45,41 +39,3 @@ public final class OmenHawker extends CardImpl {
|
||||||
return new OmenHawker(this);
|
return new OmenHawker(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class OmenHawkerManaBuilder extends ConditionalManaBuilder {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ConditionalMana build(Object... options) {
|
|
||||||
return new OmenHawkerConditionalMana(this.mana);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getRule() {
|
|
||||||
return "Spend this mana only to activate abilities";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class OmenHawkerConditionalMana extends ConditionalMana {
|
|
||||||
|
|
||||||
OmenHawkerConditionalMana(Mana mana) {
|
|
||||||
super(mana);
|
|
||||||
staticText = "Spend this mana only to activate abilities";
|
|
||||||
addCondition(new OmenHawkerManaCondition());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class OmenHawkerManaCondition extends ManaCondition implements Condition {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
if (source != null && !source.isActivated()) {
|
|
||||||
return source.isActivatedAbility();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source, UUID originalId, Cost costsToPay) {
|
|
||||||
return apply(game, source);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
144
Mage.Sets/src/mage/cards/r/RedshiftRocketeerChief.java
Normal file
144
Mage.Sets/src/mage/cards/r/RedshiftRocketeerChief.java
Normal file
|
|
@ -0,0 +1,144 @@
|
||||||
|
package mage.cards.r;
|
||||||
|
|
||||||
|
import mage.MageInt;
|
||||||
|
import mage.Mana;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
|
import mage.abilities.dynamicvalue.common.SourcePermanentPowerValue;
|
||||||
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.mana.ManaEffect;
|
||||||
|
import mage.abilities.keyword.ExhaustAbility;
|
||||||
|
import mage.abilities.keyword.VigilanceAbility;
|
||||||
|
import mage.abilities.mana.SimpleManaAbility;
|
||||||
|
import mage.abilities.mana.builder.ConditionalManaBuilder;
|
||||||
|
import mage.abilities.mana.builder.common.ActivatedAbilityManaBuilder;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.cards.Cards;
|
||||||
|
import mage.cards.CardsImpl;
|
||||||
|
import mage.choices.ChoiceColor;
|
||||||
|
import mage.constants.*;
|
||||||
|
import mage.filter.StaticFilters;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.players.Player;
|
||||||
|
import mage.target.TargetCard;
|
||||||
|
import mage.target.common.TargetCardInHand;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TheElk801
|
||||||
|
*/
|
||||||
|
public final class RedshiftRocketeerChief extends CardImpl {
|
||||||
|
|
||||||
|
public RedshiftRocketeerChief(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}{G}");
|
||||||
|
|
||||||
|
this.supertype.add(SuperType.LEGENDARY);
|
||||||
|
this.subtype.add(SubType.GOBLIN);
|
||||||
|
this.subtype.add(SubType.PILOT);
|
||||||
|
this.power = new MageInt(2);
|
||||||
|
this.toughness = new MageInt(3);
|
||||||
|
|
||||||
|
// Vigilance
|
||||||
|
this.addAbility(VigilanceAbility.getInstance());
|
||||||
|
|
||||||
|
// {T}: Add X mana of any one color, where X is Redshift's power. Spend this mana only to activate abilities.
|
||||||
|
this.addAbility(new SimpleManaAbility(new RedshiftRocketeerChiefManaEffect(), new TapSourceCost()));
|
||||||
|
|
||||||
|
// Exhaust -- {10}{R}{G}: Put any number of permanent cards from your hand onto the battlefield.
|
||||||
|
this.addAbility(new ExhaustAbility(new RedshiftRocketeerChiefEffect(), new ManaCostsImpl<>("{10}{R}{G}")));
|
||||||
|
}
|
||||||
|
|
||||||
|
private RedshiftRocketeerChief(final RedshiftRocketeerChief card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RedshiftRocketeerChief copy() {
|
||||||
|
return new RedshiftRocketeerChief(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class RedshiftRocketeerChiefManaEffect extends ManaEffect {
|
||||||
|
|
||||||
|
private final ConditionalManaBuilder manaBuilder = new ActivatedAbilityManaBuilder();
|
||||||
|
|
||||||
|
RedshiftRocketeerChiefManaEffect() {
|
||||||
|
this.staticText = "Add X mana of any one color, where X is {this}'s power. " + manaBuilder.getRule();
|
||||||
|
}
|
||||||
|
|
||||||
|
private RedshiftRocketeerChiefManaEffect(final RedshiftRocketeerChiefManaEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Mana> getNetMana(Game game, Ability source) {
|
||||||
|
List<Mana> netMana = new ArrayList<>();
|
||||||
|
if (game == null) {
|
||||||
|
return netMana;
|
||||||
|
}
|
||||||
|
int currentPower = SourcePermanentPowerValue.NOT_NEGATIVE.calculate(game, source, null);
|
||||||
|
netMana.add(manaBuilder.setMana(Mana.BlackMana(currentPower), source, game).build());
|
||||||
|
netMana.add(manaBuilder.setMana(Mana.BlueMana(currentPower), source, game).build());
|
||||||
|
netMana.add(manaBuilder.setMana(Mana.RedMana(currentPower), source, game).build());
|
||||||
|
netMana.add(manaBuilder.setMana(Mana.GreenMana(currentPower), source, game).build());
|
||||||
|
netMana.add(manaBuilder.setMana(Mana.WhiteMana(currentPower), source, game).build());
|
||||||
|
return netMana;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mana produceMana(Game game, Ability source) {
|
||||||
|
Mana mana = new Mana();
|
||||||
|
if (game == null) {
|
||||||
|
return mana;
|
||||||
|
}
|
||||||
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
|
if (controller == null) {
|
||||||
|
return mana;
|
||||||
|
}
|
||||||
|
ChoiceColor choice = new ChoiceColor();
|
||||||
|
if (!controller.choose(Outcome.PutManaInPool, choice, game)) {
|
||||||
|
return mana;
|
||||||
|
}
|
||||||
|
Mana chosen = choice.getMana(SourcePermanentPowerValue.NOT_NEGATIVE.calculate(game, source, null));
|
||||||
|
return manaBuilder.setMana(chosen, source, game).build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RedshiftRocketeerChiefManaEffect copy() {
|
||||||
|
return new RedshiftRocketeerChiefManaEffect(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class RedshiftRocketeerChiefEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
RedshiftRocketeerChiefEffect() {
|
||||||
|
super(Outcome.Benefit);
|
||||||
|
staticText = "put any number of permanent cards from your hand onto the battlefield";
|
||||||
|
}
|
||||||
|
|
||||||
|
private RedshiftRocketeerChiefEffect(final RedshiftRocketeerChiefEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RedshiftRocketeerChiefEffect copy() {
|
||||||
|
return new RedshiftRocketeerChiefEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
Player player = game.getPlayer(source.getControllerId());
|
||||||
|
if (player == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
TargetCard target = new TargetCardInHand(0, Integer.MAX_VALUE, StaticFilters.FILTER_CARD_PERMANENTS);
|
||||||
|
player.choose(outcome, player.getHand(), target, source, game);
|
||||||
|
Cards cards = new CardsImpl(target.getTargets());
|
||||||
|
return !cards.isEmpty() && player.moveCards(cards, Zone.BATTLEFIELD, source, game);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,16 +1,10 @@
|
||||||
package mage.cards.t;
|
package mage.cards.t;
|
||||||
|
|
||||||
import mage.ConditionalMana;
|
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.Mana;
|
|
||||||
import mage.abilities.Ability;
|
|
||||||
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
||||||
import mage.abilities.condition.Condition;
|
|
||||||
import mage.abilities.costs.Cost;
|
|
||||||
import mage.abilities.keyword.CraftAbility;
|
import mage.abilities.keyword.CraftAbility;
|
||||||
import mage.abilities.mana.ConditionalColorlessManaAbility;
|
import mage.abilities.mana.ConditionalColorlessManaAbility;
|
||||||
import mage.abilities.mana.builder.ConditionalManaBuilder;
|
import mage.abilities.mana.builder.common.ActivatedAbilityManaBuilder;
|
||||||
import mage.abilities.mana.conditional.ManaCondition;
|
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
|
@ -36,7 +30,7 @@ public final class TheEnigmaJewel extends CardImpl {
|
||||||
this.addAbility(new EntersBattlefieldTappedAbility());
|
this.addAbility(new EntersBattlefieldTappedAbility());
|
||||||
|
|
||||||
// {T}: Add {C}{C}. Spend this mana only to activate abilities.
|
// {T}: Add {C}{C}. Spend this mana only to activate abilities.
|
||||||
this.addAbility(new ConditionalColorlessManaAbility(2, new TheEnigmaJewelManaBuilder()));
|
this.addAbility(new ConditionalColorlessManaAbility(2, new ActivatedAbilityManaBuilder()));
|
||||||
|
|
||||||
// Craft with four or more nonlands with activated abilities {8}{U}
|
// Craft with four or more nonlands with activated abilities {8}{U}
|
||||||
this.addAbility(new CraftAbility(
|
this.addAbility(new CraftAbility(
|
||||||
|
|
@ -67,43 +61,4 @@ enum TheEnigmaJewelPredicate implements Predicate<MageObject> {
|
||||||
.stream()
|
.stream()
|
||||||
.anyMatch(a -> (a.isActivatedAbility()));
|
.anyMatch(a -> (a.isActivatedAbility()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
class TheEnigmaJewelManaBuilder extends ConditionalManaBuilder {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ConditionalMana build(Object... options) {
|
|
||||||
return new TheEnigmaJewelConditionalMana(this.mana);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getRule() {
|
|
||||||
return "Spend this mana only to activate abilities";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class TheEnigmaJewelConditionalMana extends ConditionalMana {
|
|
||||||
|
|
||||||
TheEnigmaJewelConditionalMana(Mana mana) {
|
|
||||||
super(mana);
|
|
||||||
staticText = "Spend this mana only to activate abilities";
|
|
||||||
addCondition(new TheEnigmaJewelManaCondition());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class TheEnigmaJewelManaCondition extends ManaCondition implements Condition {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
if (source != null && !source.isActivated()) {
|
|
||||||
return source.isActivatedAbility();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source, UUID originalId, Cost costsToPay) {
|
|
||||||
return apply(game, source);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -176,6 +176,7 @@ public final class Aetherdrift extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Rangers' Aetherhive", 217, Rarity.UNCOMMON, mage.cards.r.RangersAetherhive.class));
|
cards.add(new SetCardInfo("Rangers' Aetherhive", 217, Rarity.UNCOMMON, mage.cards.r.RangersAetherhive.class));
|
||||||
cards.add(new SetCardInfo("Rangers' Refueler", 55, Rarity.UNCOMMON, mage.cards.r.RangersRefueler.class));
|
cards.add(new SetCardInfo("Rangers' Refueler", 55, Rarity.UNCOMMON, mage.cards.r.RangersRefueler.class));
|
||||||
cards.add(new SetCardInfo("Reckless Velocitaur", 144, Rarity.UNCOMMON, mage.cards.r.RecklessVelocitaur.class));
|
cards.add(new SetCardInfo("Reckless Velocitaur", 144, Rarity.UNCOMMON, mage.cards.r.RecklessVelocitaur.class));
|
||||||
|
cards.add(new SetCardInfo("Redshift, Rocketeer Chief", 218, Rarity.RARE, mage.cards.r.RedshiftRocketeerChief.class));
|
||||||
cards.add(new SetCardInfo("Reef Roads", 259, Rarity.UNCOMMON, mage.cards.r.ReefRoads.class));
|
cards.add(new SetCardInfo("Reef Roads", 259, Rarity.UNCOMMON, mage.cards.r.ReefRoads.class));
|
||||||
cards.add(new SetCardInfo("Regal Imperiosaur", 177, Rarity.RARE, mage.cards.r.RegalImperiosaur.class));
|
cards.add(new SetCardInfo("Regal Imperiosaur", 177, Rarity.RARE, mage.cards.r.RegalImperiosaur.class));
|
||||||
cards.add(new SetCardInfo("Ride's End", 25, Rarity.COMMON, mage.cards.r.RidesEnd.class));
|
cards.add(new SetCardInfo("Ride's End", 25, Rarity.COMMON, mage.cards.r.RidesEnd.class));
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
package mage.abilities.mana.builder.common;
|
||||||
|
|
||||||
|
import mage.ConditionalMana;
|
||||||
|
import mage.Mana;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.condition.Condition;
|
||||||
|
import mage.abilities.costs.Cost;
|
||||||
|
import mage.abilities.mana.builder.ConditionalManaBuilder;
|
||||||
|
import mage.abilities.mana.conditional.ManaCondition;
|
||||||
|
import mage.game.Game;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TheElk801
|
||||||
|
*/
|
||||||
|
public class ActivatedAbilityManaBuilder extends ConditionalManaBuilder {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ConditionalMana build(Object... options) {
|
||||||
|
return new ActivatedAbilityConditionalMana(this.mana);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRule() {
|
||||||
|
return "Spend this mana only to activate abilities";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ActivatedAbilityConditionalMana extends ConditionalMana {
|
||||||
|
|
||||||
|
public ActivatedAbilityConditionalMana(Mana mana) {
|
||||||
|
super(mana);
|
||||||
|
staticText = "Spend this mana only to activate abilities";
|
||||||
|
addCondition(new ActivatedAbilityManaCondition());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ActivatedAbilityManaCondition extends ManaCondition implements Condition {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
return source != null
|
||||||
|
&& !source.isActivated()
|
||||||
|
&& source.isActivatedAbility();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source, UUID originalId, Cost costsToPay) {
|
||||||
|
return apply(game, source);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue