mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Fixed multiple problems with Convoke.
This commit is contained in:
@@ -180,23 +180,20 @@ public class GameActionPlay {
|
|||||||
List<Card> untappedCreats = CardLists.filter(spell.getActivatingPlayer().getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.CREATURES);
|
List<Card> untappedCreats = CardLists.filter(spell.getActivatingPlayer().getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.CREATURES);
|
||||||
untappedCreats = CardLists.filter(untappedCreats, CardPredicates.Presets.UNTAPPED);
|
untappedCreats = CardLists.filter(untappedCreats, CardPredicates.Presets.UNTAPPED);
|
||||||
|
|
||||||
if (untappedCreats.size() != 0) {
|
if (!untappedCreats.isEmpty()) {
|
||||||
final List<Card> choices = new ArrayList<Card>();
|
final List<Card> choices = new ArrayList<Card>();
|
||||||
for (final Card c : untappedCreats) {
|
choices.addAll(untappedCreats);
|
||||||
choices.add(c);
|
|
||||||
}
|
|
||||||
ArrayList<String> usableColors = new ArrayList<String>();
|
ArrayList<String> usableColors = new ArrayList<String>();
|
||||||
ManaCostBeingPaid newCost = new ManaCostBeingPaid(originalCost.toString());
|
ManaCostBeingPaid newCost = new ManaCostBeingPaid(originalCost.toString());
|
||||||
Card tapForConvoke = null;
|
Card tapForConvoke = null;
|
||||||
if (sa.getActivatingPlayer().isHuman()) {
|
if (sa.getActivatingPlayer().isHuman()) {
|
||||||
tapForConvoke = GuiChoose.oneOrNone("Tap for Convoke? " + newCost.toString(),
|
tapForConvoke = GuiChoose.oneOrNone("Tap for Convoke? " + newCost.toString(), choices);
|
||||||
choices);
|
|
||||||
} else {
|
} else {
|
||||||
// TODO: AI to choose a creature to tap would go here
|
// TODO: AI to choose a creature to tap would go here
|
||||||
// Probably along with deciding how many creatures to
|
// Probably along with deciding how many creatures to
|
||||||
// tap
|
// tap
|
||||||
}
|
}
|
||||||
while (tapForConvoke != null && untappedCreats.size() != 0) {
|
while (tapForConvoke != null && !untappedCreats.isEmpty()) {
|
||||||
final Card workingCard = (Card) tapForConvoke;
|
final Card workingCard = (Card) tapForConvoke;
|
||||||
usableColors = GameActionPlay.getConvokableColors(workingCard, newCost);
|
usableColors = GameActionPlay.getConvokableColors(workingCard, newCost);
|
||||||
|
|
||||||
@@ -223,7 +220,7 @@ public class GameActionPlay {
|
|||||||
sa.addTappedForConvoke(workingCard);
|
sa.addTappedForConvoke(workingCard);
|
||||||
choices.remove(workingCard);
|
choices.remove(workingCard);
|
||||||
untappedCreats.remove(workingCard);
|
untappedCreats.remove(workingCard);
|
||||||
if ((choices.size() < 2) || (newCost.getConvertedManaCost() == 0)) {
|
if (choices.isEmpty() || (newCost.getConvertedManaCost() == 0)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -239,7 +236,7 @@ public class GameActionPlay {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// will only be null if user cancelled.
|
// will only be null if user cancelled.
|
||||||
if (tapForConvoke != null) {
|
if (!sa.getTappedForConvoke().isEmpty()) {
|
||||||
// Convoked creats are tapped here with triggers
|
// Convoked creats are tapped here with triggers
|
||||||
// suppressed,
|
// suppressed,
|
||||||
// Then again when payment is done(In
|
// Then again when payment is done(In
|
||||||
|
|||||||
Reference in New Issue
Block a user