diff --git a/forge-game/src/main/java/forge/game/player/PlayerProperty.java b/forge-game/src/main/java/forge/game/player/PlayerProperty.java index bafe3ebdd2b..31561624c39 100644 --- a/forge-game/src/main/java/forge/game/player/PlayerProperty.java +++ b/forge-game/src/main/java/forge/game/player/PlayerProperty.java @@ -9,6 +9,7 @@ import forge.game.card.Card; import forge.game.card.CardCollectionView; import forge.game.card.CardLists; import forge.game.card.CardPredicates; +import forge.game.spellability.SpellAbility; import forge.game.zone.ZoneType; import forge.util.Expressions; import forge.util.TextUtil; @@ -282,6 +283,14 @@ public class PlayerProperty { if (!player.maxSpeed()) { return false; } + } else if (property.equals("targetedBy")) { + if (!(spellAbility instanceof SpellAbility)) { + return false; + } + SpellAbility sp = (SpellAbility)spellAbility; + if (!sp.getRootAbility().isTargeting(player)) { + return false; + } } else if (property.startsWith("controls")) { // this allows escaping _ with \ in case of complex restrictions (used on Turf War) List type = new ArrayList<>(); diff --git a/forge-gui/res/cardsfolder/upcoming/diligent_zookeeper.txt b/forge-gui/res/cardsfolder/upcoming/diligent_zookeeper.txt index f5834ae0bf9..f35b66c606b 100644 --- a/forge-gui/res/cardsfolder/upcoming/diligent_zookeeper.txt +++ b/forge-gui/res/cardsfolder/upcoming/diligent_zookeeper.txt @@ -3,5 +3,5 @@ ManaCost:3 G Types:Creature Human Citizen Ally PT:4/4 S:Mode$ Continuous | Affected$ Creature.nonHuman+YouCtrl | AddPower$ AffectedX | AddToughness$ AffectedX | Description$ Each non-Human creature you control gets +1/+1 for each of its creature types, to a maximum of 10. -SVar:AffectedX:Count$CreatureType/LimitMax.10 +SVar:AffectedX:Count$ValidSelf Card$CreatureType/LimitMax.10 Oracle:Each non-Human creature you control gets +1/+1 for each of its creature types, to a maximum of 10. diff --git a/forge-gui/res/cardsfolder/upcoming/the_legend_of_yangchen_avatar_yangchen.txt b/forge-gui/res/cardsfolder/upcoming/the_legend_of_yangchen_avatar_yangchen.txt new file mode 100644 index 00000000000..6e174eb33a9 --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/the_legend_of_yangchen_avatar_yangchen.txt @@ -0,0 +1,25 @@ +Name:The Legend of Yangchen +ManaCost:3 W W +Types:Enchantment Saga +K:Chapter:3:DBRepeatEach,DBDraw,DBTransform +SVar:DBRepeatEach:DB$ RepeatEach | RepeatPlayers$ Player | StartingWith$ You | RepeatSubAbility$ DBChoosePermanent | SubAbility$ DBChangeZone | SpellDescription$ Starting with you, each player chooses up to one permanent with mana value 3 or greater from among permanents your opponents control. Exile those permanents. +SVar:DBChoosePermanent:DB$ ChooseCard | ChoiceTitle$ Choose up to one permanent with mana value 3 or greater | MinAmount$ 0 | Amount$ 1 | Defined$ Remembered | Choices$ Permanent.cmcGE3+OppCtrl | RememberChosen$ True +SVar:DBChangeZone:DB$ ChangeZone | Origin$ Battlefield | Destination$ Exile | Defined$ Remembered | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearChosenCard$ True | ClearRemembered$ True +SVar:DBDraw:DB$ Draw | Defined$ You | ValidTgts$ Opponent | NumCards$ 3 | UnlessCost$ Draw<3/Player.targetedBy> | UnlessPayer$ You | UnlessSwitched$ True | SpellDescription$ You may have target opponent draw three cards. If you do, draw three cards. +SVar:DBTransform:DB$ ChangeZone | Origin$ Battlefield | Destination$ Exile | RememberChanged$ True | SubAbility$ DBReturn | SpellDescription$ Exile this Saga, then return it to the battlefield transformed under your control. +SVar:DBReturn:DB$ ChangeZone | Defined$ Remembered | Origin$ Exile | Destination$ Battlefield | Transformed$ True | GainControl$ True | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +AlternateMode:DoubleFaced +Oracle:(As this Saga enters, and after your draw step, add a lore counter.)\nI — Starting with you, each player chooses up to one permanent with mana value 3 or greater from among permanents your opponents control. Exile those permanents.\nII — You may have target opponent draw three cards. If you do, draw three cards.\nIII — Exile this Saga, then return it to the battlefield transformed under your control. + +ALTERNATE + +Name:Avatar Yangchen +ManaCost:no cost +Types:Legendary Creature Avatar +PT:4/5 +K:Flying +T:Mode$ SpellCast | ValidCard$ Card.YouCtrl | ValidActivatingPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigAirbend | ActivatorThisTurnCast$ EQ2 | TriggerDescription$ Whenever you cast your second spell each turn, airbend up to one other target nonland permanent. (Exile it. While it's exiled, its owner may cast it for {2} rather than its mana cost.) +SVar:TrigAirbend:DB$ Airbend | ValidTgts$ Permanent.nonLand+Other | TgtPrompt$ Select up to one other target nonland permanent | TargetMin$ 0 | TargetMax$ 1 +Oracle:Flying\nWhenever you cast your second spell each turn, airbend up to one other target nonland permanent. (Exile it. While it's exiled, its owner may cast it for {2} rather than its mana cost.)