diff --git a/forge-game/src/main/java/forge/game/ForgeScript.java b/forge-game/src/main/java/forge/game/ForgeScript.java index 8cc37fb3987..fd84a49f73a 100644 --- a/forge-game/src/main/java/forge/game/ForgeScript.java +++ b/forge-game/src/main/java/forge/game/ForgeScript.java @@ -7,6 +7,7 @@ import forge.game.card.Card; import forge.game.card.CardState; import forge.game.player.Player; import forge.game.spellability.SpellAbility; +import forge.game.staticability.StaticAbility; import forge.util.Expressions; public class ForgeScript { @@ -179,6 +180,14 @@ public class ForgeScript { if (!sa.hasParam("Equip")) { return false; } + } else if (property.equals("MayPlaySource")) { + StaticAbility m = sa.getMayPlay(); + if (m == null) { + return false; + } + if (!source.equals(m.getHostCard())) { + return false; + } } else if (property.startsWith("IsTargeting")) { String k[] = property.split(" ", 2); boolean found = false; diff --git a/forge-game/src/main/java/forge/game/card/CardProperty.java b/forge-game/src/main/java/forge/game/card/CardProperty.java index 3a95cccc72a..8b39dcefe78 100644 --- a/forge-game/src/main/java/forge/game/card/CardProperty.java +++ b/forge-game/src/main/java/forge/game/card/CardProperty.java @@ -1683,6 +1683,15 @@ public class CardProperty { if (card.hasCounters()) { return false; } + } else if (property.startsWith("CastSa")) { + SpellAbility castSA = card.getCastSA(); + if (castSA == null) { + return false; + } + String v = property.substring(7); + if (!castSA.isValid(v, sourceController, source, spellAbility)) { + return false; + } } else if (property.equals("wasCast")) { if (null == card.getCastFrom()) { return false; diff --git a/forge-gui/res/cardsfolder/b/bosium_strip.txt b/forge-gui/res/cardsfolder/b/bosium_strip.txt index 938e8af077f..fc07fa5c43e 100644 --- a/forge-gui/res/cardsfolder/b/bosium_strip.txt +++ b/forge-gui/res/cardsfolder/b/bosium_strip.txt @@ -1,16 +1,10 @@ Name:Bosium Strip ManaCost:3 Types:Artifact -A:AB$ Effect | Cost$ 3 T | Triggers$ TrigBosiumStrip1,TrigBosiumStrip2 | ReplacementEffects$ REBosiumStrip | StaticAbilities$ STBosiumStrip | SVars$ RememberCastFromGrave,MoveExile,DBCleanup | RememberObjects$ TriggeredCard | SpellDescription$ Until end of turn, if the top card of your graveyard is an instant or sorcery card, you may cast that card. If a card cast this way would be put into a graveyard this turn, exile it instead. +A:AB$ Effect | Cost$ 3 T | ReplacementEffects$ REBosiumStrip | StaticAbilities$ STBosiumStrip | SVars$ MoveExile | SpellDescription$ Until end of turn, if the top card of your graveyard is an instant or sorcery card, you may cast that card. If a card cast this way would be put into a graveyard this turn, exile it instead. SVar:STBosiumStrip:Mode$ Continuous | Affected$ Card.TopGraveyard+Instant+YouCtrl,Card.TopGraveyard+Sorcery+YouCtrl | MayPlay$ True | EffectZone$ Command | AffectedZone$ Graveyard | Description$ Until end of turn, if the top card of your graveyard is an instant or sorcery card, you may cast that card. If a card cast this way would be put into a graveyard this turn, exile it instead. -SVar:TrigBosiumStrip1:Mode$ ChangesZone | ValidCard$ Card.Instant+YouCtrl,Card.Sorcery+YouCtrl | Origin$ Graveyard | Destination$ Stack | TriggerZones$ Command | Execute$ RememberCastFromGrave | Static$ True -SVar:TrigBosiumStrip2:Mode$ ChangesZone | ValidCard$ Instant.YouCtrl+IsRemembered,Sorcery.YouCtrl+IsRemembered | Origin$ Stack | Destination$ Hand,Library,Exile | TriggerZones$ Command | Execute$ DBCleanup | Static$ True -SVar:RememberCastFromGrave:DB$ Pump | RememberObjects$ TriggeredCard -# TODO: find a better way to check "card cast this way" to interact properly with other cards that allow you to cast cards from graveyard -# but not exile them (also relevant for Kess, Dissident Mage) -SVar:REBosiumStrip:Event$ Moved | ActiveZones$ Command | ValidCard$ Instant.YouCtrl+IsRemembered,Sorcery.YouCtrl+IsRemembered | Origin$ Stack | Destination$ Graveyard | ReplaceWith$ MoveExile -SVar:MoveExile:DB$ ChangeZone | Defined$ ReplacedCard | Origin$ Stack | Destination$ Exile | SubAbility$ DBCleanup -SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +SVar:REBosiumStrip:Event$ Moved | ValidCard$ Card.CastSa Spell.MayPlaySource | Origin$ Stack | Destination$ Graveyard | ReplaceWith$ MoveExile +SVar:MoveExile:DB$ ChangeZone | Defined$ ReplacedCard | Origin$ Stack | Destination$ Exile SVar:NeedsOrderedGraveyard:TRUE SVar:RemAIDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/bosium_strip.jpg diff --git a/forge-gui/res/cardsfolder/k/kess_dissident_mage.txt b/forge-gui/res/cardsfolder/k/kess_dissident_mage.txt index d99a34c218e..9330ded81c2 100644 --- a/forge-gui/res/cardsfolder/k/kess_dissident_mage.txt +++ b/forge-gui/res/cardsfolder/k/kess_dissident_mage.txt @@ -4,13 +4,7 @@ Types:Legendary Creature Human Wizard PT:3/4 K:Flying S:Mode$ Continuous | Affected$ Instant.YouCtrl,Sorcery.YouCtrl | Condition$ PlayerTurn | MayPlay$ True | MayPlayLimit$ 1 | EffectZone$ Battlefield | AffectedZone$ Graveyard | Description$ During each of your turns, you may cast an instant or sorcery card from your graveyard. If a card cast this way would be put into your graveyard this turn, exile it instead. -T:Mode$ ChangesZone | ValidCard$ Instant.YouCtrl,Sorcery.YouCtrl | Origin$ Graveyard | Destination$ Stack | TriggerZones$ Battlefield | Execute$ RememberCastFromGrave | Static$ True -T:Mode$ ChangesZone | ValidCard$ Instant.YouCtrl+IsRemembered,Sorcery.YouCtrl+IsRemembered | Origin$ Stack | Destination$ Hand,Library,Exile | TriggerZones$ Battlefield | Execute$ DBCleanup | Static$ True -SVar:RememberCastFromGrave:DB$ Pump | RememberObjects$ TriggeredCard -# TODO: find a better way to check "card cast this way" to interact properly with other cards that allow you to cast cards from graveyard -# but not exile them (also relevant for Bosium Strip) -R:Event$ Moved | ValidCard$ Instant.YouCtrl+IsRemembered,Sorcery.YouCtrl+IsRemembered | Origin$ Stack | Destination$ Graveyard | ReplaceWith$ MoveExile -SVar:MoveExile:DB$ ChangeZone | Defined$ ReplacedCard | Origin$ Stack | Destination$ Exile | SubAbility$ DBCleanup -SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +R:Event$ Moved | ValidCard$ Card.CastSa Spell.MayPlaySource | Origin$ Stack | Destination$ Graveyard | ReplaceWith$ MoveExile +SVar:MoveExile:DB$ ChangeZone | Defined$ ReplacedCard | Origin$ Stack | Destination$ Exile SVar:Picture:http://www.wizards.com/global/images/magic/general/kess_dissident_mage.jpg Oracle:Flying\nDuring each of your turns, you may cast an instant or sorcery card from your graveyard. If a card cast this way would be put into your graveyard this turn, exile it instead.