diff --git a/res/cardsfolder/a/armor_of_thorns.txt b/res/cardsfolder/a/armor_of_thorns.txt index 13cde25b443..c83d5890803 100644 --- a/res/cardsfolder/a/armor_of_thorns.txt +++ b/res/cardsfolder/a/armor_of_thorns.txt @@ -4,7 +4,7 @@ Types:Enchantment Aura Text:no text K:You may cast CARDNAME as though it had flash. If you cast it any time a sorcery couldn't have been cast, the controller of the permanent it becomes sacrifices it at the beginning of the next cleanup step. K:Enchant nonblack creature -T:Mode$ SpellCast | ValidCard$ Card.Self | Execute$ TrigDelayedSac | Static$ True | Secondary$ True | TriggerDescription$ If you cast it any time a sorcery couldn't have been cast, the controller of the permanent it becomes sacrifices it at the beginning of the next cleanup step. +T:Mode$ SpellCast | ValidCard$ Card.Self | Execute$ TrigDelayedSac | Static$ True | Secondary$ True | SpellSpeed$ NotSorcerySpeed | TriggerDescription$ If you cast it any time a sorcery couldn't have been cast, the controller of the permanent it becomes sacrifices it at the beginning of the next cleanup step. SVar:TrigDelayedSac:AB$ Animate | Cost$ 0 | Defined$ Self | Triggers$ CleanupTrig | sVars$ Sac | Permanent$ True SVar:CleanupTrig:Mode$ Phase | Phase$ Cleanup | TriggerZones$ Battlefield | Execute$ Sac | TriggerDescription$ At the beginning of the next cleanup step, sacrifice CARDNAME. SVar:Sac:AB$ Sacrifice | Cost$ 0 | Defined$ Self diff --git a/src/main/java/forge/card/trigger/TriggerSpellAbilityCast.java b/src/main/java/forge/card/trigger/TriggerSpellAbilityCast.java index 3bddea95aae..5c574ad76cb 100644 --- a/src/main/java/forge/card/trigger/TriggerSpellAbilityCast.java +++ b/src/main/java/forge/card/trigger/TriggerSpellAbilityCast.java @@ -166,17 +166,22 @@ public class TriggerSpellAbilityCast extends Trigger { } if (this.getMapParams().containsKey("SpellSpeed")) { - if (this.getHostCard().hasKeyword("You may cast CARDNAME as though it had flash. If you cast it any time " - + "a sorcery couldn't have been cast, the controller of the permanent it becomes sacrifices it " - + "at the beginning of the next cleanup step.") - && (this.getHostCard().hasKeyword("Flash") || this.getHostCard().hasKeyword("HIDDEN Flash") - || this.getHostCard().getController().hasKeyword("You may cast nonland cards as though they had flash."))) { + if (this.getMapParams().get("SpellSpeed").equals("NotSorcerySpeed")) { + boolean notSorcerySpeed = true; + if (PhaseHandler.couldCastSorcery(this.getHostCard().getController(), spellAbility)) { + notSorcerySpeed = false; + } else if (this.getHostCard().hasKeyword("You may cast CARDNAME as though it had flash. If you cast it any time a " + + "sorcery couldn't have been cast, the controller of the permanent it becomes sacrifices it at the beginning" + + " of the next cleanup step.") && !PhaseHandler.couldCastSorcery(this.getHostCard().getController(), spellAbility)) { + boolean instantmentCast = true; // for these cards the trigger must only fire if using their own ability to cast at instant speed - return false; - } - else if (this.getMapParams().get("SpellSpeed").equals("NotSorcerySpeed") - && PhaseHandler.couldCastSorcery(this.getHostCard().getController(), spellAbility)) { - return false; + if (this.getHostCard().hasKeyword("Flash") || this.getHostCard().hasKeyword("HIDDEN Flash") + || this.getHostCard().getController().hasKeyword("You may cast nonland cards as though they had flash.")) { + instantmentCast = false; + } + notSorcerySpeed = instantmentCast; + } + return notSorcerySpeed; } } diff --git a/src/main/java/forge/game/phase/PhaseHandler.java b/src/main/java/forge/game/phase/PhaseHandler.java index 140431523ad..378532aaf6f 100644 --- a/src/main/java/forge/game/phase/PhaseHandler.java +++ b/src/main/java/forge/game/phase/PhaseHandler.java @@ -997,14 +997,19 @@ public class PhaseHandler extends MyObservable implements java.io.Serializable { public static boolean couldCastSorcery(final Player player, final SpellAbility sa) { PhaseHandler now = Singletons.getModel().getGameState().getPhaseHandler(); final Card source = sa.getRootSpellAbility().getSourceCard(); + boolean onlyThis = true; if (AllZone.getStack().size() != 0) { for (final Card card : AllZoneUtil.getCardsIn(ZoneType.Stack)) { if (card != source) { - return false; + onlyThis = false; + //System.out.println("StackCard: " + card + " vs SourceCard: " + source); } } } - return now.isPlayerTurn(player) && now.getPhase().isMain(); + //System.out.println("now.isPlayerTurn(player) - " + now.isPlayerTurn(player)); + //System.out.println("now.getPhase().isMain() - " + now.getPhase().isMain()); + //System.out.println("onlyThis - " + onlyThis); + return now.isPlayerTurn(player) && now.getPhase().isMain() && onlyThis; }