Fixed Psyshic Drain and it should no longer lead to an out-of-bounds error if the x cost paid is grater than the number of cards in the target library.

This commit is contained in:
jendave
2011-08-06 04:41:46 +00:00
parent 7e8f330d95
commit 0baf0dfb63

View File

@@ -18052,7 +18052,6 @@ public class CardFactory implements NewConstants {
card.addSpellAbility(spell);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if (cardName.equals("Psychic Drain"))
{
@@ -18067,7 +18066,16 @@ public class CardFactory implements NewConstants {
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, player);
CardList libList = new CardList(lib.getCards());
for (int i = 0; i < card.getXManaCostPaid(); i++) {
int limit;
if (card.getXManaCostPaid() > lib.size()) {
limit = lib.size();
} else {
limit = card.getXManaCostPaid();
}
// for (int i = 0; i < card.getXManaCostPaid(); i++) {
for (int i = 0; i < limit; i++) {
Card c = libList.get(i);
lib.remove(c);
grave.add(c);