Name:Forgotten Lore
ManaCost:G
Types:Sorcery
A:SP$ ChooseCard | Cost$ G | ValidTgts$ Opponent | ChoiceZone$ Graveyard | Choices$ Card.YouOwn | AILogic$ WorstCard | Mandatory$ True | RememberChosen$ True | SubAbility$ DBRepeat | SpellDescription$ Target opponent chooses a card in your graveyard. You may pay {G}. If you do, repeat this process except that opponent can't choose a card already chosen for CARDNAME. Then put the last chosen card into your hand.
SVar:DBRepeat:DB$ Repeat | RepeatSubAbility$ DBChooseAgain | ConditionCheckSVar$ ChoiceNum | ConditionSVarCompare$ GE1 | SubAbility$ DBMoveChosen | RepeatCheckSVar$ CheckRepeat | RepeatSVarCompare$ GT0 | StackDescription$ You may pay G. If you do, repeat this process except that opponent can't choose a card already chosen for CARDNAME.
SVar:DBChooseAgain:DB$ ChooseCard | Defined$ ParentTarget | ChoiceZone$ Graveyard | Choices$ Card.YouOwn+IsNotRemembered | Mandatory$ True | AILogic$ WorstCard | RememberChosen$ True | UnlessCost$ G | UnlessPayer$ You | UnlessSwitched$ True | UnlessResolveSubs$ WhenNotPaid | SubAbility$ DBStoreSVar | ShowCurrentCard$ ChosenCard
SVar:DBStoreSVar:DB$ StoreSVar | SVar$ CheckNotPaid | Type$ Number | Expression$ 0
SVar:DBMoveChosen:DB$ ChangeZone | Defined$ ChosenCard | Origin$ Graveyard | Destination$ Hand | SubAbility$ DBReset
SVar:DBReset:DB$ StoreSVar | SVar$ CheckNotPaid | Type$ Number | Expression$ 1
SVar:ChoiceNum:Count$ValidGraveyard Card.YouOwn+IsNotRemembered
SVar:CheckNotPaid:Number$1
SVar:CheckRepeat:SVar$ChoiceNum/Times.CheckNotPaid
AI:RemoveDeck:All
SVar:Picture:http://www.wizards.com/global/images/magic/general/forgotten_lore.jpg
Oracle:Target opponent chooses a card in your graveyard. You may pay {G}. If you do, repeat this process except that opponent can't choose a card already chosen for Forgotten Lore. Then put the last chosen card into your hand.
