mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user