diff --git a/.gitattributes b/.gitattributes index 9e1ecec9c0e..a5c244c7a55 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4324,6 +4324,7 @@ res/cardsfolder/i/infernal_kirin.txt svneol=native#text/plain res/cardsfolder/i/infernal_medusa.txt svneol=native#text/plain res/cardsfolder/i/infernal_plunge.txt -text res/cardsfolder/i/infernal_tribute.txt svneol=native#text/plain +res/cardsfolder/i/infernal_tutor.txt -text res/cardsfolder/i/inferno.txt svneol=native#text/plain res/cardsfolder/i/inferno_elemental.txt -text res/cardsfolder/i/inferno_titan.txt svneol=native#text/plain diff --git a/res/cardsfolder/i/infernal_tutor.txt b/res/cardsfolder/i/infernal_tutor.txt new file mode 100644 index 00000000000..8412c050bc4 --- /dev/null +++ b/res/cardsfolder/i/infernal_tutor.txt @@ -0,0 +1,14 @@ +Name:Infernal Tutor +ManaCost:1 B +Types:Sorcery +Text:no text +A:SP$ Reveal | Cost$ 1 B | RememberRevealed$ True | Defined$ You | SubAbility$ DBChangeZone | ConditionCheckSVar$ X | ConditionSVarCompare$ GE1 | SpellDescription$ Reveal a card from your hand. Search your library for a card with the same name as that card, reveal it, put it into your hand, then shuffle your library. Hellbent - If you have no cards in hand, instead search your library for a card, put it into your hand, then shuffle your library. +SVar:DBChangeZone:DB$ ChangeZone | Origin$ Library | Destination$ Hand | ChangeType$ Remembered.sameName | ChangeNum$ 1 | ConditionCheckSVar$ X | ConditionSVarCompare$ GE1 | SubAbility$ DBChangeZone2 +SVar:DBChangeZone2:DB$ ChangeZone | Origin$ Library | Destination$ Hand | ChangeType$ Card | ChangeNum$ 1 | Mandatory$ True | ConditionCheckSVar$ X | ConditionSVarCompare$ LT1 +SVar:X:Count$InYourHand +SVar:RemAIDeck:True +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/infernal_tutor.jpg +SetInfo:DIS|Rare|http://magiccards.info/scans/en/di/46.jpg +Oracle:Reveal a card from your hand. Search your library for a card with the same name as that card, reveal it, put it into your hand, then shuffle your library.\nHellbent - If you have no cards in hand, instead search your library for a card, put it into your hand, then shuffle your library. +End \ No newline at end of file diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryReveal.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryReveal.java index 004cb674db6..85c3d74c0e0 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactoryReveal.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryReveal.java @@ -2216,12 +2216,16 @@ public final class AbilityFactoryReveal { if (params.containsKey("Random")) { revealed.add(CardUtil.getRandom(handChoices.toArray())); GuiUtils.getChoice("Revealed card(s)", revealed.toArray()); - } else if (params.containsKey("AnyNumber")) { + } else { CardList valid = new CardList(handChoices); + int max = 1; if (params.containsKey("RevealValid")) { valid = valid.getValidCards(params.get("RevealValid"), p, host); } - revealed.addAll(AbilityFactoryReveal.getRevealedList(host, sa, valid)); + if (params.containsKey("AnyNumber")) { + max = valid.size(); + } + revealed.addAll(AbilityFactoryReveal.getRevealedList(host, sa, valid, max)); GuiUtils.getChoice("Revealed card(s)", revealed.toArray()); } @@ -2236,9 +2240,9 @@ public final class AbilityFactoryReveal { } } - private static CardList getRevealedList(final Card card, final SpellAbility sa, final CardList valid) { + private static CardList getRevealedList(final Card card, final SpellAbility sa, final CardList valid, final int max) { final CardList chosen = new CardList(); - final int validamount = valid.size(); + final int validamount = Math.min(valid.size(), max); if (sa.getActivatingPlayer().isHuman()) { for (int i = 0; i < validamount; i++) {