mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
Updated some more checks to use isCreatureType.
This commit is contained in:
@@ -6077,9 +6077,7 @@ public class CardFactory implements NewConstants {
|
|||||||
input[0] = JOptionPane.showInputDialog(null, "Which creature type?", "Pick type",
|
input[0] = JOptionPane.showInputDialog(null, "Which creature type?", "Pick type",
|
||||||
JOptionPane.QUESTION_MESSAGE);
|
JOptionPane.QUESTION_MESSAGE);
|
||||||
|
|
||||||
if(input[0].equals("Legendary") || input[0].equals("Artifact")
|
if(!CardUtil.isCreatureType(input[0])) input[0] = "";
|
||||||
|| input[0].equals("Enchantment") || input[0].equals("Shrine")
|
|
||||||
|| input[0].equals("Creature")) input[0] = "";
|
|
||||||
//TODO: some more input validation, case-sensitivity, etc.
|
//TODO: some more input validation, case-sensitivity, etc.
|
||||||
|
|
||||||
input[0] = input[0].trim(); //this is to prevent "cheating", and selecting multiple creature types,eg "Goblin Soldier"
|
input[0] = input[0].trim(); //this is to prevent "cheating", and selecting multiple creature types,eg "Goblin Soldier"
|
||||||
|
|||||||
@@ -4010,9 +4010,7 @@ public class CardFactoryUtil {
|
|||||||
ArrayList<String> typeList = c.getType();
|
ArrayList<String> typeList = c.getType();
|
||||||
|
|
||||||
for(String var:typeList) {
|
for(String var:typeList) {
|
||||||
if(var.equals("Creature") || var.equals("Artifact") || var.equals("Land") || var.equals("Tribal")
|
if(CardUtil.isCreatureType(var) && !map.containsKey(var)) map.put(var, 1);
|
||||||
|| var.equals("Enchantment") || var.equals("Legendary")) ;
|
|
||||||
else if(!map.containsKey(var)) map.put(var, 1);
|
|
||||||
else {
|
else {
|
||||||
map.put(var, map.get(var) + 1);
|
map.put(var, map.get(var) + 1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user