mirror of
https://github.com/correl/mage.git
synced 2024-11-28 19:19:55 +00:00
[40K] Implemented Nexos
This commit is contained in:
parent
b57bdfe192
commit
10076c6d8d
5 changed files with 124 additions and 67 deletions
|
@ -4,16 +4,13 @@ import mage.ConditionalMana;
|
||||||
import mage.Mana;
|
import mage.Mana;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||||
import mage.abilities.costs.Cost;
|
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.costs.mana.ManaCosts;
|
|
||||||
import mage.abilities.costs.mana.VariableManaCost;
|
|
||||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||||
import mage.abilities.effects.mana.ManaEffect;
|
import mage.abilities.effects.mana.ManaEffect;
|
||||||
import mage.abilities.mana.AnyColorManaAbility;
|
import mage.abilities.mana.AnyColorManaAbility;
|
||||||
import mage.abilities.mana.SimpleManaAbility;
|
import mage.abilities.mana.SimpleManaAbility;
|
||||||
import mage.abilities.mana.builder.ConditionalManaBuilder;
|
import mage.abilities.mana.builder.ConditionalManaBuilder;
|
||||||
import mage.abilities.mana.conditional.ManaCondition;
|
import mage.abilities.mana.conditional.XCostManaCondition;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
@ -114,14 +111,6 @@ class ElementalistsPaletteManaEffect extends ManaEffect {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ElementalistsPaletteConditionalMana extends ConditionalMana {
|
|
||||||
|
|
||||||
ElementalistsPaletteConditionalMana(Mana mana) {
|
|
||||||
super(mana);
|
|
||||||
addCondition(new ElementalistsPaletteManaCondition());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class ElementalistsPaletteManaBuilder extends ConditionalManaBuilder {
|
class ElementalistsPaletteManaBuilder extends ConditionalManaBuilder {
|
||||||
@Override
|
@Override
|
||||||
public ConditionalMana build(Object... options) {
|
public ConditionalMana build(Object... options) {
|
||||||
|
@ -134,28 +123,10 @@ class ElementalistsPaletteManaBuilder extends ConditionalManaBuilder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ElementalistsPaletteManaCondition extends ManaCondition {
|
class ElementalistsPaletteConditionalMana extends ConditionalMana {
|
||||||
|
|
||||||
/*
|
ElementalistsPaletteConditionalMana(Mana mana) {
|
||||||
A “cost that contains {X}” may be a spell’s total cost, an activated ability’s cost, a suspend cost, or a cost you’re
|
super(mana);
|
||||||
asked to pay as part of the resolution of a spell or ability (such as Condescend). A spell’s total cost includes either
|
addCondition(new XCostManaCondition());
|
||||||
its mana cost (printed in the upper right corner) or its alternative cost (such as flashback), as well as any additional
|
|
||||||
costs (such as kicker). If it’s something you can spend mana on, it’s a cost. If that cost includes the {X} symbol in it,
|
|
||||||
you can spend mana generated by Rosheen on that cost. (2017-11-17)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source, UUID originalId, Cost costToPay) {
|
|
||||||
boolean result;
|
|
||||||
if (costToPay instanceof ManaCosts) {
|
|
||||||
result = !((ManaCosts) costToPay).getVariableCosts().isEmpty();
|
|
||||||
} else {
|
|
||||||
result = costToPay instanceof VariableManaCost;
|
|
||||||
}
|
|
||||||
if (!result) {
|
|
||||||
if (game != null && game.inCheckPlayableState()) {
|
|
||||||
return true; // TODO: Check the card if there are related abilities with {X} costs.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
80
Mage.Sets/src/mage/cards/n/Nexos.java
Normal file
80
Mage.Sets/src/mage/cards/n/Nexos.java
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
package mage.cards.n;
|
||||||
|
|
||||||
|
import mage.ConditionalMana;
|
||||||
|
import mage.MageInt;
|
||||||
|
import mage.Mana;
|
||||||
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
|
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
|
||||||
|
import mage.abilities.effects.mana.BasicManaEffect;
|
||||||
|
import mage.abilities.mana.ActivatedManaAbilityImpl;
|
||||||
|
import mage.abilities.mana.conditional.XCostManaCondition;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.*;
|
||||||
|
import mage.filter.FilterPermanent;
|
||||||
|
import mage.filter.common.FilterLandPermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TheElk801
|
||||||
|
*/
|
||||||
|
public final class Nexos extends CardImpl {
|
||||||
|
|
||||||
|
private static final FilterPermanent filter = new FilterLandPermanent("basic lands");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(SuperType.BASIC.getPredicate());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Nexos(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}");
|
||||||
|
|
||||||
|
this.subtype.add(SubType.HUMAN);
|
||||||
|
this.subtype.add(SubType.TYRANID);
|
||||||
|
this.subtype.add(SubType.ADVISOR);
|
||||||
|
this.power = new MageInt(2);
|
||||||
|
this.toughness = new MageInt(2);
|
||||||
|
|
||||||
|
// Strategic Coordinator -- Basic lands you control have "{T}: Add {C}{C}. Spend this mana only on costs that contain {X}."
|
||||||
|
this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect(
|
||||||
|
new NexosManaAbility(), Duration.WhileOnBattlefield, filter
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
||||||
|
private Nexos(final Nexos card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Nexos copy() {
|
||||||
|
return new Nexos(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class NexosManaAbility extends ActivatedManaAbilityImpl {
|
||||||
|
|
||||||
|
NexosManaAbility() {
|
||||||
|
super(Zone.BATTLEFIELD, new BasicManaEffect(new NexosConditionalMana()), new TapSourceCost());
|
||||||
|
this.netMana.add(Mana.ColorlessMana(2));
|
||||||
|
}
|
||||||
|
|
||||||
|
private NexosManaAbility(NexosManaAbility ability) {
|
||||||
|
super(ability);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NexosManaAbility copy() {
|
||||||
|
return new NexosManaAbility(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class NexosConditionalMana extends ConditionalMana {
|
||||||
|
|
||||||
|
NexosConditionalMana() {
|
||||||
|
super(Mana.ColorlessMana(2));
|
||||||
|
staticText = "Spend this mana only on costs that contain {X}";
|
||||||
|
addCondition(new XCostManaCondition());
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,21 +3,16 @@ package mage.cards.r;
|
||||||
import mage.ConditionalMana;
|
import mage.ConditionalMana;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.Mana;
|
import mage.Mana;
|
||||||
import mage.abilities.Ability;
|
|
||||||
import mage.abilities.costs.Cost;
|
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.costs.mana.ManaCosts;
|
|
||||||
import mage.abilities.costs.mana.VariableManaCost;
|
|
||||||
import mage.abilities.effects.mana.BasicManaEffect;
|
import mage.abilities.effects.mana.BasicManaEffect;
|
||||||
import mage.abilities.mana.ActivatedManaAbilityImpl;
|
import mage.abilities.mana.ActivatedManaAbilityImpl;
|
||||||
import mage.abilities.mana.conditional.ManaCondition;
|
import mage.abilities.mana.conditional.XCostManaCondition;
|
||||||
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.constants.SuperType;
|
import mage.constants.SuperType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@ -70,32 +65,6 @@ class RosheenMeandererConditionalMana extends ConditionalMana {
|
||||||
RosheenMeandererConditionalMana() {
|
RosheenMeandererConditionalMana() {
|
||||||
super(Mana.ColorlessMana(4));
|
super(Mana.ColorlessMana(4));
|
||||||
staticText = "Spend this mana only on costs that contain {X}";
|
staticText = "Spend this mana only on costs that contain {X}";
|
||||||
addCondition(new RosheenMeandererManaCondition());
|
addCondition(new XCostManaCondition());
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class RosheenMeandererManaCondition extends ManaCondition {
|
|
||||||
|
|
||||||
/*
|
|
||||||
A “cost that contains {X}” may be a spell’s total cost, an activated ability’s cost, a suspend cost, or a cost you’re
|
|
||||||
asked to pay as part of the resolution of a spell or ability (such as Condescend). A spell’s total cost includes either
|
|
||||||
its mana cost (printed in the upper right corner) or its alternative cost (such as flashback), as well as any additional
|
|
||||||
costs (such as kicker). If it’s something you can spend mana on, it’s a cost. If that cost includes the {X} symbol in it,
|
|
||||||
you can spend mana generated by Rosheen on that cost. (2017-11-17)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source, UUID originalId, Cost costToPay) {
|
|
||||||
boolean result;
|
|
||||||
if (costToPay instanceof ManaCosts) {
|
|
||||||
result = !((ManaCosts) costToPay).getVariableCosts().isEmpty();
|
|
||||||
} else {
|
|
||||||
result = costToPay instanceof VariableManaCost;
|
|
||||||
}
|
|
||||||
if (!result) {
|
|
||||||
if (game != null && game.inCheckPlayableState()) {
|
|
||||||
return true; // TODO: Check the card if there are related abilities with {X} costs.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -177,6 +177,7 @@ public final class Warhammer40000 extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Necron Deathmark", 42, Rarity.RARE, mage.cards.n.NecronDeathmark.class));
|
cards.add(new SetCardInfo("Necron Deathmark", 42, Rarity.RARE, mage.cards.n.NecronDeathmark.class));
|
||||||
cards.add(new SetCardInfo("Necron Monolith", 161, Rarity.RARE, mage.cards.n.NecronMonolith.class));
|
cards.add(new SetCardInfo("Necron Monolith", 161, Rarity.RARE, mage.cards.n.NecronMonolith.class));
|
||||||
cards.add(new SetCardInfo("New Horizons", 218, Rarity.COMMON, mage.cards.n.NewHorizons.class));
|
cards.add(new SetCardInfo("New Horizons", 218, Rarity.COMMON, mage.cards.n.NewHorizons.class));
|
||||||
|
cards.add(new SetCardInfo("Nexos", 95, Rarity.RARE, mage.cards.n.Nexos.class));
|
||||||
cards.add(new SetCardInfo("Night Scythe", 162, Rarity.UNCOMMON, mage.cards.n.NightScythe.class));
|
cards.add(new SetCardInfo("Night Scythe", 162, Rarity.UNCOMMON, mage.cards.n.NightScythe.class));
|
||||||
cards.add(new SetCardInfo("Noise Marine", 82, Rarity.UNCOMMON, mage.cards.n.NoiseMarine.class));
|
cards.add(new SetCardInfo("Noise Marine", 82, Rarity.UNCOMMON, mage.cards.n.NoiseMarine.class));
|
||||||
cards.add(new SetCardInfo("Nurgle's Conscription", 44, Rarity.RARE, mage.cards.n.NurglesConscription.class));
|
cards.add(new SetCardInfo("Nurgle's Conscription", 44, Rarity.RARE, mage.cards.n.NurglesConscription.class));
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
package mage.abilities.mana.conditional;
|
||||||
|
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.costs.Cost;
|
||||||
|
import mage.abilities.costs.mana.ManaCosts;
|
||||||
|
import mage.abilities.costs.mana.VariableManaCost;
|
||||||
|
import mage.game.Game;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TheElk801
|
||||||
|
*/
|
||||||
|
public class XCostManaCondition extends ManaCondition {
|
||||||
|
|
||||||
|
/*
|
||||||
|
A “cost that contains {X}” may be a spell’s total cost, an activated ability’s cost, a suspend cost, or a cost you’re
|
||||||
|
asked to pay as part of the resolution of a spell or ability (such as Condescend). A spell’s total cost includes either
|
||||||
|
its mana cost (printed in the upper right corner) or its alternative cost (such as flashback), as well as any additional
|
||||||
|
costs (such as kicker). If it’s something you can spend mana on, it’s a cost. If that cost includes the {X} symbol in it,
|
||||||
|
you can spend mana generated by Rosheen on that cost. (2017-11-17)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source, UUID originalId, Cost costToPay) {
|
||||||
|
boolean result;
|
||||||
|
if (costToPay instanceof ManaCosts) {
|
||||||
|
result = !((ManaCosts<?>) costToPay).getVariableCosts().isEmpty();
|
||||||
|
} else {
|
||||||
|
result = costToPay instanceof VariableManaCost;
|
||||||
|
}
|
||||||
|
if (!result && game != null && game.inCheckPlayableState()) {
|
||||||
|
return true; // TODO: Check the card if there are related abilities with {X} costs.
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue