mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
Fix #9636
This commit is contained in:
parent
fd281ca483
commit
0bf03d1f92
3 changed files with 4 additions and 80 deletions
|
@ -1,20 +0,0 @@
|
|||
|
||||
|
||||
package mage.abilities.mana.conditional;
|
||||
|
||||
import mage.ConditionalMana;
|
||||
import mage.Mana;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class ArtifactCastConditionalMana extends ConditionalMana {
|
||||
|
||||
public ArtifactCastConditionalMana(Mana mana) {
|
||||
super(mana);
|
||||
staticText = "Spend this mana only to cast artifact spells";
|
||||
addCondition(new ArtifactCastManaCondition());
|
||||
}
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
|
||||
package mage.abilities.mana.conditional;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class ArtifactCastManaCondition extends ManaCondition implements Condition {
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
if (source instanceof SpellAbility) {
|
||||
MageObject object = game.getObject(source);
|
||||
if (object != null && object.isArtifact(game)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source, UUID originalId, Cost costToPay) {
|
||||
return apply(game, source);
|
||||
}
|
||||
}
|
|
@ -10,14 +10,9 @@ import mage.abilities.costs.Cost;
|
|||
import mage.abilities.mana.ConditionalColorlessManaAbility;
|
||||
import mage.abilities.mana.builder.ConditionalManaBuilder;
|
||||
import mage.abilities.mana.conditional.ManaCondition;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.game.command.Commander;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.game.stack.StackAbility;
|
||||
import mage.game.stack.StackObject;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.UUID;
|
||||
|
@ -82,31 +77,13 @@ class PowerstoneTokenManaCondition extends ManaCondition implements Condition {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
if (!(source instanceof SpellAbility)) {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
MageObject object = game.getObject(source);
|
||||
if (object instanceof StackObject) {
|
||||
return object instanceof StackAbility || !object.isArtifact(game);
|
||||
if (object != null && object.isArtifact(game)) {
|
||||
return true;
|
||||
}
|
||||
if (!game.inCheckPlayableState()) {
|
||||
return false;
|
||||
}
|
||||
Spell spell;
|
||||
if (object instanceof Card) {
|
||||
spell = new Spell(
|
||||
(Card) object, (SpellAbility) source, source.getControllerId(),
|
||||
game.getState().getZone(source.getSourceId()), game
|
||||
);
|
||||
} else if (object instanceof Commander) {
|
||||
spell = new Spell(
|
||||
((Commander) object).getSourceObject(),
|
||||
(SpellAbility) source, source.getControllerId(),
|
||||
game.getState().getZone(source.getSourceId()), game
|
||||
);
|
||||
} else {
|
||||
spell = null;
|
||||
}
|
||||
return spell == null || spell.isArtifact(game);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue