added Jester's Cap (from Ice Age) - not implemented for AI

This commit is contained in:
jendave
2011-08-06 07:21:24 +00:00
parent ecc3e7580d
commit 6e6ecce3fb
4 changed files with 63 additions and 0 deletions

1
.gitattributes vendored
View File

@@ -1820,6 +1820,7 @@ res/cardsfolder/jedits_dragoons.txt -text svneol=native#text/plain
res/cardsfolder/jenara_asura_of_war.txt -text svneol=native#text/plain
res/cardsfolder/jerrard_of_the_closed_fist.txt -text svneol=native#text/plain
res/cardsfolder/jeska_warrior_adept.txt -text svneol=native#text/plain
res/cardsfolder/jesters_cap.txt -text svneol=native#text/plain
res/cardsfolder/jet_medallion.txt -text svneol=native#text/plain
res/cardsfolder/jhessian_infiltrator.txt -text svneol=native#text/plain
res/cardsfolder/jhessian_lookout.txt -text svneol=native#text/plain

View File

@@ -0,0 +1,8 @@
Name:Jester's Cap
ManaCost:4
Types:Artifact
Text:2, Tap, Sacrifice Jester's Cap: Search target player's library for three cards and exile them. Then that player shuffles his or her library.
K:SVars:RemAIDeck:True
K:SVars:Rarity:Rare
K:SVars:Picture:http://www.wizards.com/global/images/magic/general/jesters_cap.txt
End

View File

@@ -381,6 +381,24 @@ public class AllZoneUtil {
}
}
public static void exileNCardsFromZone(final PlayerZone zone, final CardListFilter filter, final int n, final boolean shuffle) {
CardList cards = new CardList(zone.getCards());
if(null != filter) {
cards = cards.filter(filter);
}
int maxCards = n;
int numCards = cards.size();
maxCards = Math.min(maxCards, numCards);
for(int i = 1; i <= maxCards; i++) {
String title = "Select card to exile: " + i + "/" + maxCards;
Object o = AllZone.Display.getChoiceOptional(title, cards.toArray());
if(o == null) break;
Card card = (Card) o;
AllZone.GameAction.exile(card);
}
if(shuffle) AllZone.GameAction.shuffle(zone.getPlayer());
}
public static int CompareTypeAmountInPlay(final String player, String type)
{
// returns the difference between player's

View File

@@ -10189,6 +10189,42 @@ public class CardFactory implements NewConstants {
a1.setBeforePayMana(new Input_PayManaCost_Ability(a1.getManaCost(), paid1));
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Jester's Cap")) {
/*
* 2, Tap, Sacrifice Jester's Cap: Search target player's library
* for three cards and exile them. Then that player shuffles his
* or her library.
*/
final Ability_Tap ability = new Ability_Tap(card, "2") {
private static final long serialVersionUID = 222308932796127795L;
@Override
public boolean canPlayAI() {
//TODO
return false;
}
@Override
public void resolve() {
String target = getTargetPlayer();
String player = card.getController();
PlayerZone zone = AllZone.getZone(Constant.Zone.Library, target);
if(player.equals(Constant.Player.Human)) {
AllZoneUtil.exileNCardsFromZone(zone, null, 3, true);
}
else { //computer
}
AllZone.GameAction.sacrifice(card);
}
};//Ability
card.addSpellAbility(ability);
ability.setBeforePayMana(CardFactoryUtil.input_targetPlayer(ability));
}//*************** END ************ END **************************
// Cards with Cycling abilities