mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Fixed the Glasses of Urza bug which occurs when trying to display the cards when the target player's hand is empty.
This commit is contained in:
@@ -21438,27 +21438,33 @@ public class CardFactory implements NewConstants {
|
|||||||
card.addSpellAbility(ability);
|
card.addSpellAbility(ability);
|
||||||
}//*************** END ************ END **************************
|
}//*************** END ************ END **************************
|
||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Glasses of Urza")) {
|
else if(cardName.equals("Glasses of Urza")) {
|
||||||
final Ability_Tap ability = new Ability_Tap(card, "0") {
|
final Ability_Tap ability = new Ability_Tap(card, "0") {
|
||||||
private static final long serialVersionUID = -3857979945891501990L;
|
private static final long serialVersionUID = -3857979945891501990L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
final String player = getTargetPlayer();
|
final String player = getTargetPlayer();
|
||||||
CardList hand = AllZoneUtil.getPlayerHand(player);
|
CardList hand = AllZoneUtil.getPlayerHand(player);
|
||||||
AllZone.Display.getChoice("Target player's hand", hand.toArray());
|
if (hand.size() > 0) {
|
||||||
}
|
AllZone.Display.getChoice("Target player's hand", hand.toArray());
|
||||||
|
} else {
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
sb.append(getTargetPlayer()).append("'s hand is empty!");
|
||||||
|
javax.swing.JOptionPane.showMessageDialog(null, sb.toString(), "Target player's hand", JOptionPane.INFORMATION_MESSAGE);
|
||||||
|
}
|
||||||
|
}//resolve()
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlayAI() {
|
public boolean canPlayAI() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
};//SpellAbility
|
};//SpellAbility
|
||||||
|
|
||||||
ability.setBeforePayMana(CardFactoryUtil.input_targetPlayer(ability));
|
ability.setBeforePayMana(CardFactoryUtil.input_targetPlayer(ability));
|
||||||
card.addSpellAbility(ability);
|
card.addSpellAbility(ability);
|
||||||
}//*************** END ************ END **************************
|
}//*************** END ************ END **************************
|
||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
|
|||||||
Reference in New Issue
Block a user