mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
AF_ChooseType for Creature types now uses list selection instead of free-text typing.
This commit is contained in:
@@ -413,7 +413,7 @@ public final class CardUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>getCardTypes.</p>
|
||||
* <p>getBasicTypes.</p>
|
||||
*
|
||||
* @return a {@link java.util.ArrayList} object.
|
||||
* @since 1.1.3
|
||||
@@ -434,6 +434,20 @@ public final class CardUtil {
|
||||
|
||||
return types;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>getCreatureTypes.</p>
|
||||
*
|
||||
* @return a {@link java.util.ArrayList} object.
|
||||
* @since 1.1.6
|
||||
*/
|
||||
public static ArrayList<String> getCreatureTypes() {
|
||||
ArrayList<String> types = new ArrayList<String>();
|
||||
|
||||
types.addAll(Constant.CardTypes.creatureTypes[0].list);
|
||||
|
||||
return types;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>isASuperType.</p>
|
||||
|
||||
@@ -281,8 +281,19 @@ public class AbilityFactory_Choose {
|
||||
boolean valid = false;
|
||||
while (!valid) {
|
||||
if (sa.getActivatingPlayer().isHuman()) {
|
||||
chosenType = JOptionPane.showInputDialog(null, "Choose a creature type:", card.getName(),
|
||||
JOptionPane.QUESTION_MESSAGE);
|
||||
ArrayList<String> validChoices = CardUtil.getCreatureTypes();
|
||||
for (String s : invalidTypes) {
|
||||
validChoices.remove(s);
|
||||
}
|
||||
Object o = GuiUtils.getChoice("Choose a creature type", validChoices.toArray());
|
||||
if (null == o) {
|
||||
return;
|
||||
}
|
||||
String choice = (String) o;
|
||||
if (CardUtil.isACreatureType(choice) && !invalidTypes.contains(choice)) {
|
||||
valid = true;
|
||||
card.setChosenType(choice);
|
||||
}
|
||||
}
|
||||
else {
|
||||
String chosen = "";
|
||||
@@ -303,6 +314,10 @@ public class AbilityFactory_Choose {
|
||||
chosen = CardFactoryUtil.getMostProminentCreatureType(
|
||||
AllZoneUtil.getCardsInGame().getController(AllZone.getComputerPlayer()));
|
||||
}
|
||||
if (logic.equals("MostProminentInComputerGraveyard")) {
|
||||
chosen = CardFactoryUtil.getMostProminentCreatureType(
|
||||
AllZone.getComputerPlayer().getCardsIn(Zone.Graveyard));
|
||||
}
|
||||
}
|
||||
if (!CardUtil.isACreatureType(chosen) || invalidTypes.contains(chosen)) {
|
||||
chosen = "Sliver";
|
||||
|
||||
Reference in New Issue
Block a user