- Added Fetchlands to randomly generated decks.

- Updated some SVars.
This commit is contained in:
Sloth
2011-08-29 19:33:43 +00:00
parent fdd16a28ea
commit 9314655fbc
10 changed files with 105 additions and 128 deletions

View File

@@ -21,7 +21,6 @@ public class Generate2ColorDeck {
private Random r = null;
private Map<String, String> ClrMap = null;
private ArrayList<String> notColors = null;
private ArrayList<DLnd> DualLands = null;
private ArrayList<String> DL = null;
private Map<String, Integer> CardCounts = null;
@@ -50,28 +49,6 @@ public class Generate2ColorDeck {
notColors.add("red");
notColors.add("green");
DualLands = new ArrayList<DLnd>();
DualLands.add(new DLnd("Tundra", "WU"));
DualLands.add(new DLnd("Hallowed Fountain", "WU"));
DualLands.add(new DLnd("Underground Sea", "UB"));
DualLands.add(new DLnd("Watery Grave", "UB"));
DualLands.add(new DLnd("Badlands", "BR"));
DualLands.add(new DLnd("Blood Crypt", "BR"));
DualLands.add(new DLnd("Taiga", "RG"));
DualLands.add(new DLnd("Stomping Ground", "RG"));
DualLands.add(new DLnd("Savannah", "GW"));
DualLands.add(new DLnd("Temple Garden", "GW"));
DualLands.add(new DLnd("Scrubland", "WB"));
DualLands.add(new DLnd("Godless Shrine", "WB"));
DualLands.add(new DLnd("Volcanic Island", "UR"));
DualLands.add(new DLnd("Steam Vents", "UR"));
DualLands.add(new DLnd("Bayou", "BG"));
DualLands.add(new DLnd("Overgrown Tomb", "BG"));
DualLands.add(new DLnd("Plateau", "RW"));
DualLands.add(new DLnd("Sacred Foundry", "RW"));
DualLands.add(new DLnd("Tropical Island", "GU"));
DualLands.add(new DLnd("Breeding Pool", "GU"));
if (Clr1.equals("AI")) {
// choose first color
color1 = notColors.get(r.nextInt(5));
@@ -89,13 +66,10 @@ public class Generate2ColorDeck {
notColors.remove(color1);
notColors.remove(color2);
DL = new ArrayList<String>();
for (int i = 0; i < DualLands.size(); i++) {
DLnd d = DualLands.get(i);
if (d.Mana.contains(ClrMap.get(color1)) && d.Mana.contains(ClrMap.get(color2))) {
DL.add(d.Name);
CardCounts.put(d.Name, 0);
}
DL = GenerateDeckUtil.getDualLandList(ClrMap.get(color1) + ClrMap.get(color2));
for (int i = 0; i < DL.size(); i++) {
CardCounts.put(DL.get(i), 0);
}
}
@@ -397,14 +371,4 @@ public class Generate2ColorDeck {
Count = cnt;
}
}
private class DLnd {
public String Name;
public String Mana;
public DLnd(String nm, String mn) {
Name = nm;
Mana = mn;
}
}
}

View File

@@ -22,7 +22,6 @@ public class Generate3ColorDeck {
private Random r = null;
private Map<String, String> ClrMap = null;
private ArrayList<String> notColors = null;
private ArrayList<DLnd> DualLands = null;
private ArrayList<String> DL = null;
private Map<String, Integer> CardCounts = null;
@@ -52,28 +51,6 @@ public class Generate3ColorDeck {
notColors.add("red");
notColors.add("green");
DualLands = new ArrayList<DLnd>();
DualLands.add(new DLnd("Tundra", "WU"));
DualLands.add(new DLnd("Hallowed Fountain", "WU"));
DualLands.add(new DLnd("Underground Sea", "UB"));
DualLands.add(new DLnd("Watery Grave", "UB"));
DualLands.add(new DLnd("Badlands", "BR"));
DualLands.add(new DLnd("Blood Crypt", "BR"));
DualLands.add(new DLnd("Taiga", "RG"));
DualLands.add(new DLnd("Stomping Ground", "RG"));
DualLands.add(new DLnd("Savannah", "GW"));
DualLands.add(new DLnd("Temple Garden", "GW"));
DualLands.add(new DLnd("Scrubland", "WB"));
DualLands.add(new DLnd("Godless Shrine", "WB"));
DualLands.add(new DLnd("Volcanic Island", "UR"));
DualLands.add(new DLnd("Steam Vents", "UR"));
DualLands.add(new DLnd("Bayou", "BG"));
DualLands.add(new DLnd("Overgrown Tomb", "BG"));
DualLands.add(new DLnd("Plateau", "RW"));
DualLands.add(new DLnd("Sacred Foundry", "RW"));
DualLands.add(new DLnd("Tropical Island", "GU"));
DualLands.add(new DLnd("Breeding Pool", "GU"));
if (Clr1.equals("AI")) {
// choose first color
color1 = notColors.get(r.nextInt(5));
@@ -98,15 +75,10 @@ public class Generate3ColorDeck {
notColors.remove(color2);
notColors.remove(color3);
DL = new ArrayList<String>();
for (int i = 0; i < DualLands.size(); i++) {
DLnd d = DualLands.get(i);
if ((d.Mana.contains(ClrMap.get(color1)) && d.Mana.contains(ClrMap.get(color2))) ||
(d.Mana.contains(ClrMap.get(color1)) && d.Mana.contains(ClrMap.get(color3))) ||
(d.Mana.contains(ClrMap.get(color2)) && d.Mana.contains(ClrMap.get(color3)))) {
DL.add(d.Name);
CardCounts.put(d.Name, 0);
}
DL = GenerateDeckUtil.getDualLandList(ClrMap.get(color1) + ClrMap.get(color2) + ClrMap.get(color3));
for (int i = 0; i < DL.size(); i++) {
CardCounts.put(DL.get(i), 0);
}
}
@@ -408,14 +380,4 @@ public class Generate3ColorDeck {
Count = cnt;
}
}
private class DLnd {
public String Name;
public String Mana;
public DLnd(String nm, String mn) {
Name = nm;
Mana = mn;
}
}
}

View File

@@ -31,7 +31,6 @@ public class Generate5ColorDeck {
private Random r = null;
private Map<String, String> clrMap = null;
private ArrayList<String> notColors = null;
private ArrayList<DLnd> dualLands = null;
private ArrayList<String> dl = null;
private Map<String, Integer> cardCounts = null;
@@ -72,28 +71,6 @@ public class Generate5ColorDeck {
notColors.add("red");
notColors.add("green");
dualLands = new ArrayList<DLnd>();
dualLands.add(new DLnd("Tundra", "WU"));
dualLands.add(new DLnd("Hallowed Fountain", "WU"));
dualLands.add(new DLnd("Underground Sea", "UB"));
dualLands.add(new DLnd("Watery Grave", "UB"));
dualLands.add(new DLnd("Badlands", "BR"));
dualLands.add(new DLnd("Blood Crypt", "BR"));
dualLands.add(new DLnd("Taiga", "RG"));
dualLands.add(new DLnd("Stomping Ground", "RG"));
dualLands.add(new DLnd("Savannah", "GW"));
dualLands.add(new DLnd("Temple Garden", "GW"));
dualLands.add(new DLnd("Scrubland", "WB"));
dualLands.add(new DLnd("Godless Shrine", "WB"));
dualLands.add(new DLnd("Volcanic Island", "UR"));
dualLands.add(new DLnd("Steam Vents", "UR"));
dualLands.add(new DLnd("Bayou", "BG"));
dualLands.add(new DLnd("Overgrown Tomb", "BG"));
dualLands.add(new DLnd("Plateau", "RW"));
dualLands.add(new DLnd("Sacred Foundry", "RW"));
dualLands.add(new DLnd("Tropical Island", "GU"));
dualLands.add(new DLnd("Breeding Pool", "GU"));
color1 = clr1;
color2 = clr2;
color3 = clr3;
@@ -106,11 +83,10 @@ public class Generate5ColorDeck {
notColors.remove(color4);
notColors.remove(color5);
dl = new ArrayList<String>();
for (int i = 0; i < dualLands.size(); i++) {
DLnd d = dualLands.get(i);
dl.add(d.getName());
cardCounts.put(d.getName(), 0);
dl = GenerateDeckUtil.getDualLandList("WUBRG");
for (int i = 0; i < dl.size(); i++) {
cardCounts.put(dl.get(i), 0);
}
}
@@ -478,22 +454,4 @@ public class Generate5ColorDeck {
this.count = count;
}
}
private class DLnd {
private String name;
//public String Mana;
/**
*
* @return
*/
public String getName() {
return this.name;
}
public DLnd(final String nm, final String mn) {
this.name = nm;
//Mana = mn;
}
}
}

View File

@@ -0,0 +1,87 @@
package forge.deck.generate;
import forge.*;
import forge.error.ErrorViewer;
import forge.properties.ForgeProps;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
/**
* <p>Generate2ColorDeck class.</p>
*
* @author Forge
* @version $Id: Generate2ColorDeck.java 10011 2011-08-28 12:20:52Z Sloth $
*/
public class GenerateDeckUtil {
public static ArrayList<String> getDualLandList(String colors) {
ArrayList<String> DLands = new ArrayList<String>();
if (colors.contains("W") && colors.contains("U")) {
DLands.add("Tundra");
DLands.add("Hallowed Fountain");
DLands.add("Flooded Strand");
}
if (colors.contains("U") && colors.contains("B")) {
DLands.add("Underground Sea");
DLands.add("Watery Grave");
DLands.add("Polluted Delta");
}
if (colors.contains("B") && colors.contains("R")) {
DLands.add("Badlands");
DLands.add("Blood Crypt");
DLands.add("Bloodstained Mire");
}
if (colors.contains("R") && colors.contains("G")) {
DLands.add("Taiga");
DLands.add("Stomping Ground");
DLands.add("Wooded Foothills");
}
if (colors.contains("G") && colors.contains("W")) {
DLands.add("Savannah");
DLands.add("Temple Garden");
DLands.add("Windswept Heath");
}
if (colors.contains("W") && colors.contains("B")) {
DLands.add("Scrubland");
DLands.add("Godless Shrine");
DLands.add("Marsh Flats");
}
if (colors.contains("U") && colors.contains("R")) {
DLands.add("Volcanic Island");
DLands.add("Steam Vents");
DLands.add("Scalding Tarn");
}
if (colors.contains("B") && colors.contains("G")) {
DLands.add("Bayou");
DLands.add("Overgrown Tomb");
DLands.add("Verdant Catacombs");
}
if (colors.contains("R") && colors.contains("W")) {
DLands.add("Plateau");
DLands.add("Sacred Foundry");
DLands.add("Arid Mesa");
}
if (colors.contains("G") && colors.contains("U")) {
DLands.add("Tropical Island");
DLands.add("Breeding Pool");
DLands.add("Misty Rainforest");
}
return DLands;
}
}