diff --git a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java index 8831f22a348..99160b391ac 100644 --- a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java +++ b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java @@ -169,6 +169,14 @@ public class AbilityUtils { Iterables.addAll(cards, saTargeting.getTargets().getTargetCards()); } } + else if (defined.equals("TargetedSource") && sa instanceof SpellAbility) { + final SpellAbility saTargeting = ((SpellAbility)sa).getSATargetingSA(); + if (saTargeting != null) { + for (SpellAbility s : saTargeting.getTargets().getTargetSpells()) { + cards.add(s.getHostCard()); + } + } + } else if (defined.equals("ThisTargetedCard") && sa instanceof SpellAbility) { // do not add parent targeted if (((SpellAbility)sa).getTargets() != null) { Iterables.addAll(cards, ((SpellAbility)sa).getTargets().getTargetCards()); @@ -179,7 +187,6 @@ public class AbilityUtils { if (parent != null) { Iterables.addAll(cards, parent.getTargets().getTargetCards()); } - } else if (defined.startsWith("Triggered") && sa instanceof SpellAbility) { final SpellAbility root = ((SpellAbility)sa).getRootAbility(); diff --git a/forge-game/src/main/java/forge/game/ability/effects/ChangeZoneEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ChangeZoneEffect.java index 6c2d890c93f..057daba40f0 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ChangeZoneEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ChangeZoneEffect.java @@ -1473,7 +1473,8 @@ public class ChangeZoneEffect extends SpellAbilityEffect { } else if (srcSA.getParam("Destination").equals("BottomOfLibrary")) { movedCard = game.getAction().moveToBottomOfLibrary(tgtHost, srcSA, params); } else if (srcSA.getParam("Destination").equals("Library")) { - movedCard = game.getAction().moveToBottomOfLibrary(tgtHost, srcSA, params); + final int libraryPos = srcSA.hasParam("LibraryPosition") ? AbilityUtils.calculateAmount(tgtHost, srcSA.getParam("LibraryPosition"), srcSA) : 0; + movedCard = game.getAction().moveToLibrary(tgtHost, libraryPos, srcSA, params); if (srcSA.hasParam("Shuffle") && "True".equals(srcSA.getParam("Shuffle"))) { tgtHost.getOwner().shuffle(srcSA); } diff --git a/forge-gui/res/cardsfolder/d/dromokas_command.txt b/forge-gui/res/cardsfolder/d/dromokas_command.txt index 42575298059..afaffaf2223 100644 --- a/forge-gui/res/cardsfolder/d/dromokas_command.txt +++ b/forge-gui/res/cardsfolder/d/dromokas_command.txt @@ -2,8 +2,7 @@ Name:Dromoka's Command ManaCost:G W Types:Instant A:SP$ Charm | Cost$ G W | Choices$ DBPrevent,DBSacrifice,DBPutCounter,DBPump | CharmNum$ 2 -# The target lists a second zone to a Card is returned instead of a SA -SVar:DBPrevent:DB$ Effect | ValidTgts$ Instant,Sorcery | AILogic$ Prevent | TgtZone$ Stack,Battlefield | TgtPrompt$ Select target instant or sorcery spell to prevent damage from | StaticAbilities$ PreventDmg | Triggers$ TargetMoved | RememberObjects$ Targeted | SpellDescription$ Prevent all damage target instant or sorcery spell would deal this turn. +SVar:DBPrevent:DB$ Effect | ValidTgts$ Instant,Sorcery | AILogic$ Prevent | TgtZone$ Stack | TgtPrompt$ Select target instant or sorcery spell to prevent damage from | StaticAbilities$ PreventDmg | Triggers$ TargetMoved | RememberObjects$ TargetedSource | SpellDescription$ Prevent all damage target instant or sorcery spell would deal this turn. SVar:PreventDmg:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Stack | Affected$ Card.IsRemembered | AddKeyword$ Prevent all damage that would be dealt by CARDNAME. | Description$ Prevent all damage target instant or sorcery spell would deal this turn. SVar:TargetMoved:Mode$ ChangesZone | Origin$ Stack | Destination$ Any | ValidCard$ Card.IsRemembered | Execute$ ExileEffect | TriggerZones$ Command | Static$ True SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile @@ -11,5 +10,4 @@ SVar:DBSacrifice:DB$ Sacrifice | ValidTgts$ Player | TgtPrompt$ Select target pl SVar:DBPutCounter:DB$ PutCounter | ValidTgts$ Creature | TgtPrompt$ Select target creature to put a +1/+1 counter on | AILogic$ Good | CounterType$ P1P1 | CounterNum$ 1 | SpellDescription$ Put a +1/+1 counter on target creature. SVar:DBPump:DB$ Pump | ValidTgts$ Creature.YouCtrl | AILogic$ Fight | TgtPrompt$ Choose target creature you control to fight | StackDescription$ None | SubAbility$ DBFight | SpellDescription$ Target creature you control fights target creature you don't control. SVar:DBFight:DB$ Fight | Defined$ ParentTarget | ValidTgts$ Creature.YouDontCtrl | TgtPrompt$ Choose target creature you don't control to fight -SVar:Picture:http://www.wizards.com/global/images/magic/general/dromokas_command.jpg Oracle:Choose two —\n• Prevent all damage target instant or sorcery spell would deal this turn.\n• Target player sacrifices an enchantment.\n• Put a +1/+1 counter on target creature.\n• Target creature you control fights target creature you don't control. diff --git a/forge-gui/res/cardsfolder/h/hallow.txt b/forge-gui/res/cardsfolder/h/hallow.txt index 8ec02b3ef41..068237d7a76 100644 --- a/forge-gui/res/cardsfolder/h/hallow.txt +++ b/forge-gui/res/cardsfolder/h/hallow.txt @@ -1,12 +1,11 @@ Name:Hallow ManaCost:W Types:Instant -A:SP$ Effect | Cost$ W | ValidTgts$ Card.inZoneStack | TgtZone$ Stack,Battlefield | TgtPrompt$ Select target spell to prevent damage from | ReplacementEffects$ PreventDmg | Triggers$ TargetMoved | RememberObjects$ Targeted | SpellDescription$ Prevent all damage target spell would deal this turn. You gain life equal to the damage prevented this way. +A:SP$ Effect | Cost$ W | ValidTgts$ Card.inZoneStack | TgtZone$ Stack | TgtPrompt$ Select target spell to prevent damage from | ReplacementEffects$ PreventDmg | Triggers$ TargetMoved | RememberObjects$ TargetedSource | SpellDescription$ Prevent all damage target spell would deal this turn. You gain life equal to the damage prevented this way. SVar:PreventDmg:Event$ DamageDone | ValidSource$ Card.IsRemembered | ReplaceWith$ GainLifeYou | PreventionEffect$ True | Description$ Prevent all damage that would be dealt by targeted spell this turn. You gain life equal to the damage prevented this way. SVar:GainLifeYou:DB$ GainLife | Defined$ You | LifeAmount$ X SVar:X:ReplaceCount$DamageAmount SVar:TargetMoved:Mode$ ChangesZone | ValidCard$ Card.IsRemembered | ExcludedDestinations$ Battlefield | Execute$ ExileEffect | TriggerZones$ Command | Static$ True SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile AI:RemoveDeck:All -SVar:Picture:http://www.wizards.com/global/images/magic/general/hallow.jpg Oracle:Prevent all damage target spell would deal this turn. You gain life equal to the damage prevented this way. diff --git a/forge-gui/res/cardsfolder/h/hidden_retreat.txt b/forge-gui/res/cardsfolder/h/hidden_retreat.txt index d6346f2ef8c..3746bf12e3f 100644 --- a/forge-gui/res/cardsfolder/h/hidden_retreat.txt +++ b/forge-gui/res/cardsfolder/h/hidden_retreat.txt @@ -1,12 +1,10 @@ Name:Hidden Retreat ManaCost:2 W Types:Enchantment -# The target lists a second zone to a Card is returned instead of a SA -A:AB$ Effect | Cost$ PutCardToLibFromHand<1/0/Card> | ValidTgts$ Instant,Sorcery | AILogic$ Prevent | Stackable$ False | TgtZone$ Stack,Battlefield | TgtPrompt$ Select target instant or sorcery spell to prevent damage from | StaticAbilities$ PreventDmg | Triggers$ TargetMoved | RememberObjects$ Targeted | SpellDescription$ Prevent all damage target instant or sorcery spell would deal this turn. +A:AB$ Effect | Cost$ PutCardToLibFromHand<1/0/Card> | ValidTgts$ Instant,Sorcery | AILogic$ Prevent | Stackable$ False | TgtZone$ Stack | TgtPrompt$ Select target instant or sorcery spell to prevent damage from | StaticAbilities$ PreventDmg | Triggers$ TargetMoved | RememberObjects$ TargetedSource | SpellDescription$ Prevent all damage target instant or sorcery spell would deal this turn. SVar:PreventDmg:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Stack | Affected$ Card.IsRemembered | AddKeyword$ Prevent all damage that would be dealt by CARDNAME. | Description$ Prevent all damage target instant or sorcery spell would deal this turn. SVar:TargetMoved:Mode$ ChangesZone | Origin$ Stack | Destination$ Any | ValidCard$ Card.IsRemembered | Execute$ ExileEffect | TriggerZones$ Command | Static$ True SVar:ExileEffect:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile AI:RemoveDeck:Random SVar:NonStackingEffect:True -SVar:Picture:http://www.wizards.com/global/images/magic/general/hidden_retreat.jpg Oracle:Put a card from your hand on top of your library: Prevent all damage that would be dealt by target instant or sorcery spell this turn. diff --git a/forge-gui/res/cardsfolder/r/reverberation.txt b/forge-gui/res/cardsfolder/r/reverberation.txt index 4e370eb3755..f62d14d9c2f 100644 --- a/forge-gui/res/cardsfolder/r/reverberation.txt +++ b/forge-gui/res/cardsfolder/r/reverberation.txt @@ -1,8 +1,7 @@ Name:Reverberation ManaCost:2 U U Types:Instant -# The target lists a second zone to a Card is returned instead of a SA -A:SP$ Effect | Cost$ 2 U U | ValidTgts$ Sorcery | AILogic$ Prevent | TgtZone$ Stack,Battlefield | TgtPrompt$ Select target sorcery spell to redirect damage from | RememberObjects$ Targeted | ExileOnMoved$ Stack | ReplacementEffects$ SelflessDamage | StackDescription$ SpellDescription | SpellDescription$ All damage that would be dealt this turn by target sorcery spell is dealt to that spell's controller instead. +A:SP$ Effect | Cost$ 2 U U | ValidTgts$ Sorcery | AILogic$ Prevent | TgtZone$ Stack | TgtPrompt$ Select target sorcery spell to redirect damage from | RememberObjects$ TargetedSource | ExileOnMoved$ Stack | ReplacementEffects$ SelflessDamage | StackDescription$ SpellDescription | SpellDescription$ All damage that would be dealt this turn by target sorcery spell is dealt to that spell's controller instead. SVar:SelflessDamage:Event$ DamageDone | ValidSource$ Card.IsRemembered | ReplaceWith$ SelflessDmg | DamageTarget$ ReplacedSourceController | Description$ The next time a source of your choice would deal damage this turn, that damage is dealt to that source's controller instead. SVar:SelflessDmg:DB$ ReplaceEffect | VarName$ Affected | VarValue$ ReplacedSourceController | VarType$ Player AI:RemoveDeck:All diff --git a/forge-gui/res/cardsfolder/s/shieldmage_elder.txt b/forge-gui/res/cardsfolder/s/shieldmage_elder.txt index 068ecbcb862..fc50f1c4786 100644 --- a/forge-gui/res/cardsfolder/s/shieldmage_elder.txt +++ b/forge-gui/res/cardsfolder/s/shieldmage_elder.txt @@ -3,10 +3,8 @@ ManaCost:5 W Types:Creature Human Cleric Wizard PT:2/3 A:AB$ Pump | Cost$ tapXType<2/Cleric> | ValidTgts$ Creature | KW$ Prevent all damage that would be dealt by CARDNAME. | IsCurse$ True | TgtPrompt$ Select target creature | SpellDescription$ Prevent all damage target creature would deal this turn. -A:AB$ Effect | Cost$ tapXType<2/Wizard> | ValidTgts$ Card.inZoneStack | TgtZone$ Stack,Battlefield | IsCurse$ True | TgtPrompt$ Select target spell | RememberObjects$ Targeted | StaticAbilities$ STNoDmg | SubAbility$ DBCleanup | SpellDescription$ Prevent all damage target spell would deal this turn. +A:AB$ Effect | Cost$ tapXType<2/Wizard> | ValidTgts$ Card.inZoneStack | TgtZone$ Stack | IsCurse$ True | TgtPrompt$ Select target spell | RememberObjects$ TargetedSource | StaticAbilities$ STNoDmg | SubAbility$ DBCleanup | SpellDescription$ Prevent all damage target spell would deal this turn. SVar:STNoDmg:Mode$ Continuous | EffectZone$ Command | AffectedZone$ Battlefield,Stack | Affected$ Card.IsRemembered | AddKeyword$ Prevent all damage that would be dealt by CARDNAME. | Description$ Prevent all damage target spell would deal this turn. SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True -#Another Zone should be included currently, therefore the target would be a card, not a spell/ability AI:RemoveDeck:All -SVar:Picture:http://www.wizards.com/global/images/magic/general/shieldmage_elder.jpg Oracle:Tap two untapped Clerics you control: Prevent all damage target creature would deal this turn.\nTap two untapped Wizards you control: Prevent all damage target spell would deal this turn. diff --git a/forge-gui/res/cardsfolder/t/tayam_luminous_enigma.txt b/forge-gui/res/cardsfolder/t/tayam_luminous_enigma.txt index c4c5feea2fa..02fc90da90d 100644 --- a/forge-gui/res/cardsfolder/t/tayam_luminous_enigma.txt +++ b/forge-gui/res/cardsfolder/t/tayam_luminous_enigma.txt @@ -4,7 +4,7 @@ Types:Legendary Creature Nightmare Beast PT:3/3 K:ETBReplacement:Other:AddExtraCounter:Mandatory:Battlefield:Creature.Other+YouCtrl SVar:AddExtraCounter:DB$ PutCounter | ETB$ True | Defined$ ReplacedCard | CounterType$ Vigilance | CounterNum$ 1 | SpellDescription$ Each other creature you control enters the battlefield with an additional vigilance counter on it. -A:AB$ Mill | Cost$ 3 RemoveAnyCounter<3/Any/Permanent.YouCtrl/among permanents you control> | NumCards$ 3 | Defined$ You | SubAbility$ DBChangeZone | StackDescription$ SpellDescription | SpellDescription$ Mill three cards, then return a permanent card with converted mana cost 3 or less from your graveyard to the battlefield. +A:AB$ Mill | Cost$ 3 RemoveAnyCounter<3/Any/Creature.YouCtrl/among creatures you control> | NumCards$ 3 | Defined$ You | SubAbility$ DBChangeZone | StackDescription$ SpellDescription | SpellDescription$ Mill three cards, then return a permanent card with converted mana cost 3 or less from your graveyard to the battlefield. SVar:DBChangeZone:DB$ ChangeZone | Hidden$ True | Mandatory$ True | ChangeType$ Permanent.YouOwn+cmcLE3 | ChangeNum$ 1 | Origin$ Graveyard | Destination$ Battlefield DeckHas:Ability$Counters SVar:AIRemoveCounterCostPriority:Vigilance