[40K] Implemented Nexos

This commit is contained in:
Evan Kranzler 2022-10-22 17:35:42 -04:00
parent b57bdfe192
commit 10076c6d8d
5 changed files with 124 additions and 67 deletions

View file

@ -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 spells total cost, an activated abilitys cost, a suspend cost, or a cost youre
asked to pay as part of the resolution of a spell or ability (such as Condescend). A spells 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 its something you can spend mana on, its 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;
}
}