forked from External/mage
* Activate spell's ability on the stack - fixed that it can't be activated by humans (example: Lightning Storm);
This commit is contained in:
parent
3f7b26f60b
commit
0ac4a9d87a
4 changed files with 48 additions and 26 deletions
|
|
@ -143,21 +143,24 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
}
|
||||
|
||||
private boolean isCardsPlayable(Collection<CardView> cards, GameView gameView, Set<UUID> possibleTargets) {
|
||||
if (cards != null) {
|
||||
// can play
|
||||
if (gameView != null && gameView.getCanPlayObjects() != null && !gameView.getCanPlayObjects().isEmpty()) {
|
||||
for (CardView card : cards) {
|
||||
if (gameView.getCanPlayObjects().containsKey(card.getId())) {
|
||||
return true;
|
||||
}
|
||||
if (cards == null || gameView == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// can play
|
||||
if (gameView.getCanPlayObjects() != null && !gameView.getCanPlayObjects().isEmpty()) {
|
||||
for (CardView card : cards) {
|
||||
if (gameView.getCanPlayObjects().containsKey(card.getId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// can select
|
||||
if (possibleTargets != null && !possibleTargets.isEmpty()) {
|
||||
for (CardView card : cards) {
|
||||
if (possibleTargets.contains(card.getId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// can select
|
||||
if (possibleTargets != null && !possibleTargets.isEmpty()) {
|
||||
for (CardView card : cards) {
|
||||
if (possibleTargets.contains(card.getId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue