From 0bf03d1f9234f2442b08aa8778c7adc38f661783 Mon Sep 17 00:00:00 2001 From: "Alex W. Jackson" Date: Sun, 9 Oct 2022 11:40:39 -0400 Subject: [PATCH] Fix #9636 --- .../ArtifactCastConditionalMana.java | 20 ----------- .../ArtifactCastManaCondition.java | 33 ------------------- .../game/permanent/token/PowerstoneToken.java | 31 +++-------------- 3 files changed, 4 insertions(+), 80 deletions(-) delete mode 100644 Mage/src/main/java/mage/abilities/mana/conditional/ArtifactCastConditionalMana.java delete mode 100644 Mage/src/main/java/mage/abilities/mana/conditional/ArtifactCastManaCondition.java diff --git a/Mage/src/main/java/mage/abilities/mana/conditional/ArtifactCastConditionalMana.java b/Mage/src/main/java/mage/abilities/mana/conditional/ArtifactCastConditionalMana.java deleted file mode 100644 index d19a4286d8..0000000000 --- a/Mage/src/main/java/mage/abilities/mana/conditional/ArtifactCastConditionalMana.java +++ /dev/null @@ -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()); - } -} \ No newline at end of file diff --git a/Mage/src/main/java/mage/abilities/mana/conditional/ArtifactCastManaCondition.java b/Mage/src/main/java/mage/abilities/mana/conditional/ArtifactCastManaCondition.java deleted file mode 100644 index 573e130da1..0000000000 --- a/Mage/src/main/java/mage/abilities/mana/conditional/ArtifactCastManaCondition.java +++ /dev/null @@ -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); - } -} diff --git a/Mage/src/main/java/mage/game/permanent/token/PowerstoneToken.java b/Mage/src/main/java/mage/game/permanent/token/PowerstoneToken.java index b03c3e416c..370c16e237 100644 --- a/Mage/src/main/java/mage/game/permanent/token/PowerstoneToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/PowerstoneToken.java @@ -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