mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08: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.
|
* @return a {@link java.util.ArrayList} object.
|
||||||
* @since 1.1.3
|
* @since 1.1.3
|
||||||
@@ -435,6 +435,20 @@ public final class CardUtil {
|
|||||||
return types;
|
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>
|
* <p>isASuperType.</p>
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -281,8 +281,19 @@ public class AbilityFactory_Choose {
|
|||||||
boolean valid = false;
|
boolean valid = false;
|
||||||
while (!valid) {
|
while (!valid) {
|
||||||
if (sa.getActivatingPlayer().isHuman()) {
|
if (sa.getActivatingPlayer().isHuman()) {
|
||||||
chosenType = JOptionPane.showInputDialog(null, "Choose a creature type:", card.getName(),
|
ArrayList<String> validChoices = CardUtil.getCreatureTypes();
|
||||||
JOptionPane.QUESTION_MESSAGE);
|
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 {
|
else {
|
||||||
String chosen = "";
|
String chosen = "";
|
||||||
@@ -303,6 +314,10 @@ public class AbilityFactory_Choose {
|
|||||||
chosen = CardFactoryUtil.getMostProminentCreatureType(
|
chosen = CardFactoryUtil.getMostProminentCreatureType(
|
||||||
AllZoneUtil.getCardsInGame().getController(AllZone.getComputerPlayer()));
|
AllZoneUtil.getCardsInGame().getController(AllZone.getComputerPlayer()));
|
||||||
}
|
}
|
||||||
|
if (logic.equals("MostProminentInComputerGraveyard")) {
|
||||||
|
chosen = CardFactoryUtil.getMostProminentCreatureType(
|
||||||
|
AllZone.getComputerPlayer().getCardsIn(Zone.Graveyard));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!CardUtil.isACreatureType(chosen) || invalidTypes.contains(chosen)) {
|
if (!CardUtil.isACreatureType(chosen) || invalidTypes.contains(chosen)) {
|
||||||
chosen = "Sliver";
|
chosen = "Sliver";
|
||||||
|
|||||||
Reference in New Issue
Block a user