- Added Infernal Tutor.

This commit is contained in:
Sloth
2012-02-21 14:27:22 +00:00
parent daa9f63a16
commit 6eab904e43
3 changed files with 23 additions and 4 deletions

1
.gitattributes vendored
View File

@@ -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

View File

@@ -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

View File

@@ -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++) {