mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Enable use of per-set PicCount... hopefully.
This commit is contained in:
@@ -2294,14 +2294,17 @@ public class GameAction {
|
|||||||
card.setUniqueNumber(nextUniqueNumber++);
|
card.setUniqueNumber(nextUniqueNumber++);
|
||||||
|
|
||||||
//if(card.isBasicLand()) {
|
//if(card.isBasicLand()) {
|
||||||
String PC = card.getSVar("PicCount");
|
//String PC = card.getSVar("PicCount");
|
||||||
int n = 0;
|
//if (PC.matches("[0-9][0-9]?"))
|
||||||
if (PC.matches("[0-9][0-9]?"))
|
// n = Integer.parseInt(PC);
|
||||||
n = Integer.parseInt(PC);
|
|
||||||
if (n > 1)
|
|
||||||
card.setRandomPicture(generator.nextInt(n));
|
|
||||||
if ((card.getSets().size() > 0) && card.getCurSetCode().equals(""))
|
if ((card.getSets().size() > 0) && card.getCurSetCode().equals(""))
|
||||||
card.setRandomSetCode();
|
card.setRandomSetCode();
|
||||||
|
|
||||||
|
int n = SetInfoUtil.getSetInfo_Code(card.getSets(), card.getCurSetCode()).PicCount;
|
||||||
|
if (n > 1)
|
||||||
|
card.setRandomPicture(generator.nextInt(n));
|
||||||
|
|
||||||
card.setImageFilename(CardUtil.buildFilename(card));
|
card.setImageFilename(CardUtil.buildFilename(card));
|
||||||
|
|
||||||
//System.out.println("human random number:" + card.getRandomPicture());
|
//System.out.println("human random number:" + card.getRandomPicture());
|
||||||
@@ -2321,16 +2324,21 @@ public class GameAction {
|
|||||||
card.setUniqueNumber(nextUniqueNumber++);
|
card.setUniqueNumber(nextUniqueNumber++);
|
||||||
|
|
||||||
//if(card.isBasicLand()) {
|
//if(card.isBasicLand()) {
|
||||||
String PC = card.getSVar("PicCount");
|
//String PC = card.getSVar("PicCount");
|
||||||
int n = 0;
|
//int n = 0;
|
||||||
if (PC.matches("[0-9][0-9]?"))
|
//if (PC.matches("[0-9][0-9]?"))
|
||||||
n = Integer.parseInt(PC);
|
// n = Integer.parseInt(PC);
|
||||||
if (n > 1)
|
//if (n > 1)
|
||||||
card.setRandomPicture(generator.nextInt(n));
|
// card.setRandomPicture(generator.nextInt(n));
|
||||||
//System.out.println("computer random number:" + card.getRandomPicture());
|
//System.out.println("computer random number:" + card.getRandomPicture());
|
||||||
//}
|
//}
|
||||||
if ((card.getSets().size() > 0) && card.getCurSetCode().equals(""))
|
if ((card.getSets().size() > 0) && card.getCurSetCode().equals(""))
|
||||||
card.setRandomSetCode();
|
card.setRandomSetCode();
|
||||||
|
|
||||||
|
int n = SetInfoUtil.getSetInfo_Code(card.getSets(), card.getCurSetCode()).PicCount;
|
||||||
|
if (n > 1)
|
||||||
|
card.setRandomPicture(generator.nextInt(n));
|
||||||
|
|
||||||
card.setImageFilename(CardUtil.buildFilename(card));
|
card.setImageFilename(CardUtil.buildFilename(card));
|
||||||
|
|
||||||
AllZone.Computer_Library.add(card);
|
AllZone.Computer_Library.add(card);
|
||||||
|
|||||||
@@ -507,19 +507,23 @@ public class Gui_BoosterDraft extends JFrame implements CardContainer, NewConsta
|
|||||||
c = list.get(i);
|
c = list.get(i);
|
||||||
c.setRarity(pack.getRarity(c.getName()));
|
c.setRarity(pack.getRarity(c.getName()));
|
||||||
|
|
||||||
String PC = c.getSVar("PicCount");
|
//String PC = c.getSVar("PicCount");
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
int n = 0;
|
//int n = 0;
|
||||||
if (PC.matches("[0-9][0-9]?"))
|
//if (PC.matches("[0-9][0-9]?"))
|
||||||
n = Integer.parseInt(PC);
|
// n = Integer.parseInt(PC);
|
||||||
|
//if (n > 1)
|
||||||
|
// c.setRandomPicture(r.nextInt(n));
|
||||||
|
|
||||||
|
if (c.getCurSetCode().equals(""))
|
||||||
|
c.setCurSetCode(c.getMostRecentSet());
|
||||||
|
|
||||||
|
int n = SetInfoUtil.getSetInfo_Code(c.getSets(), c.getCurSetCode()).PicCount;
|
||||||
if (n > 1)
|
if (n > 1)
|
||||||
c.setRandomPicture(r.nextInt(n));
|
c.setRandomPicture(r.nextInt(n));
|
||||||
|
|
||||||
if (c.getCurSetCode().equals(""))
|
c.setImageFilename(CardUtil.buildFilename(c));
|
||||||
{
|
|
||||||
c.setCurSetCode(c.getMostRecentSet());
|
|
||||||
c.setImageFilename(CardUtil.buildFilename(c));
|
|
||||||
}
|
|
||||||
|
|
||||||
allCardModel.addCard(c);
|
allCardModel.addCard(c);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,20 +118,23 @@ public class Gui_CardShop extends JFrame implements CardContainer, DeckDisplay,
|
|||||||
c.setRarity(pack.getRarity(cardName));
|
c.setRarity(pack.getRarity(cardName));
|
||||||
}
|
}
|
||||||
|
|
||||||
String PC = c.getSVar("PicCount");
|
//String PC = c.getSVar("PicCount");
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
int n = 0;
|
//int n = 0;
|
||||||
if (PC.matches("[0-9][0-9]?"))
|
//if (PC.matches("[0-9][0-9]?"))
|
||||||
n = Integer.parseInt(PC);
|
// n = Integer.parseInt(PC);
|
||||||
if (n > 1)
|
//if (n > 1)
|
||||||
c.setRandomPicture(r.nextInt(n));
|
// c.setRandomPicture(r.nextInt(n));
|
||||||
|
|
||||||
if (c.getCurSetCode().equals(""))
|
if (c.getCurSetCode().equals(""))
|
||||||
{
|
|
||||||
c.setCurSetCode(c.getMostRecentSet());
|
c.setCurSetCode(c.getMostRecentSet());
|
||||||
c.setImageFilename(CardUtil.buildFilename(c));
|
|
||||||
}
|
int n = SetInfoUtil.getSetInfo_Code(c.getSets(), c.getCurSetCode()).PicCount;
|
||||||
|
if (n > 1)
|
||||||
|
c.setRandomPicture(r.nextInt(n));
|
||||||
|
|
||||||
|
c.setImageFilename(CardUtil.buildFilename(c));
|
||||||
|
|
||||||
|
|
||||||
topModel.addCard(c);
|
topModel.addCard(c);
|
||||||
|
|
||||||
@@ -144,19 +147,23 @@ public class Gui_CardShop extends JFrame implements CardContainer, DeckDisplay,
|
|||||||
// add rarity to card if this is a sealed card pool
|
// add rarity to card if this is a sealed card pool
|
||||||
if(!customMenu.getGameType().equals(Constant.GameType.Constructed)) c.setRarity(pack.getRarity(c.getName()));
|
if(!customMenu.getGameType().equals(Constant.GameType.Constructed)) c.setRarity(pack.getRarity(c.getName()));
|
||||||
|
|
||||||
String PC = c.getSVar("PicCount");
|
//String PC = c.getSVar("PicCount");
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
int n = 0;
|
//int n = 0;
|
||||||
if (PC.matches("[0-9][0-9]?"))
|
//if (PC.matches("[0-9][0-9]?"))
|
||||||
n = Integer.parseInt(PC);
|
// n = Integer.parseInt(PC);
|
||||||
|
//if (n > 1)
|
||||||
|
// c.setRandomPicture(r.nextInt(n));
|
||||||
|
|
||||||
|
if (c.getCurSetCode().equals(""))
|
||||||
|
c.setCurSetCode(c.getMostRecentSet());
|
||||||
|
|
||||||
|
int n = SetInfoUtil.getSetInfo_Code(c.getSets(), c.getCurSetCode()).PicCount;
|
||||||
if (n > 1)
|
if (n > 1)
|
||||||
c.setRandomPicture(r.nextInt(n));
|
c.setRandomPicture(r.nextInt(n));
|
||||||
|
|
||||||
if (c.getCurSetCode().equals(""))
|
c.setImageFilename(CardUtil.buildFilename(c));
|
||||||
{
|
|
||||||
c.setCurSetCode(c.getMostRecentSet());
|
|
||||||
c.setImageFilename(CardUtil.buildFilename(c));
|
|
||||||
}
|
|
||||||
|
|
||||||
bottomModel.addCard(c);
|
bottomModel.addCard(c);
|
||||||
}// for
|
}// for
|
||||||
|
|||||||
@@ -182,21 +182,24 @@ public class Gui_DeckEditor extends JFrame implements CardContainer, DeckDisplay
|
|||||||
filteredOut = filterByType(c);
|
filteredOut = filterByType(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
String PC = c.getSVar("PicCount");
|
//String PC = c.getSVar("PicCount");
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
int n = 0;
|
//int n = 0;
|
||||||
if (!PC.equals("")) {
|
//if (!PC.equals("")) {
|
||||||
if (PC.matches("[0-9][0-9]?"))
|
// if (PC.matches("[0-9][0-9]?"))
|
||||||
n = Integer.parseInt(PC);
|
// n = Integer.parseInt(PC);
|
||||||
if (n > 1)
|
// if (n > 1)
|
||||||
c.setRandomPicture(r.nextInt(n));
|
// c.setRandomPicture(r.nextInt(n));
|
||||||
}
|
//}
|
||||||
|
|
||||||
if (c.getCurSetCode().equals(""))
|
if (c.getCurSetCode().equals(""))
|
||||||
{
|
|
||||||
c.setCurSetCode(c.getMostRecentSet());
|
c.setCurSetCode(c.getMostRecentSet());
|
||||||
c.setImageFilename(CardUtil.buildFilename(c));
|
|
||||||
}
|
int n = SetInfoUtil.getSetInfo_Code(c.getSets(), c.getCurSetCode()).PicCount;
|
||||||
|
if (n > 1)
|
||||||
|
c.setRandomPicture(r.nextInt(n));
|
||||||
|
|
||||||
|
c.setImageFilename(CardUtil.buildFilename(c));
|
||||||
|
|
||||||
|
|
||||||
if(!filteredOut) {
|
if(!filteredOut) {
|
||||||
@@ -211,21 +214,25 @@ public class Gui_DeckEditor extends JFrame implements CardContainer, DeckDisplay
|
|||||||
// add rarity to card if this is a sealed card pool
|
// add rarity to card if this is a sealed card pool
|
||||||
if(!customMenu.getGameType().equals(Constant.GameType.Constructed)) c.setRarity(pack.getRarity(c.getName()));
|
if(!customMenu.getGameType().equals(Constant.GameType.Constructed)) c.setRarity(pack.getRarity(c.getName()));
|
||||||
|
|
||||||
String PC = c.getSVar("PicCount");
|
//String PC = c.getSVar("PicCount");
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
int n = 0;
|
//int n = 0;
|
||||||
if (!PC.equals("")) {
|
//if (!PC.equals("")) {
|
||||||
if (PC.matches("[0-9][0-9]?"))
|
// if (PC.matches("[0-9][0-9]?"))
|
||||||
n = Integer.parseInt(PC);
|
// n = Integer.parseInt(PC);
|
||||||
if (n > 1)
|
// if (n > 1)
|
||||||
c.setRandomPicture(r.nextInt(n));
|
// c.setRandomPicture(r.nextInt(n));
|
||||||
}
|
//}
|
||||||
|
|
||||||
if (c.getCurSetCode().equals(""))
|
if (c.getCurSetCode().equals(""))
|
||||||
{
|
|
||||||
c.setCurSetCode(c.getMostRecentSet());
|
c.setCurSetCode(c.getMostRecentSet());
|
||||||
c.setImageFilename(CardUtil.buildFilename(c));
|
|
||||||
}
|
int n = SetInfoUtil.getSetInfo_Code(c.getSets(), c.getCurSetCode()).PicCount;
|
||||||
|
if (n > 1)
|
||||||
|
c.setRandomPicture(r.nextInt(n));
|
||||||
|
|
||||||
|
c.setImageFilename(CardUtil.buildFilename(c));
|
||||||
|
|
||||||
|
|
||||||
bottomModel.addCard(c);
|
bottomModel.addCard(c);
|
||||||
}// for
|
}// for
|
||||||
|
|||||||
@@ -141,21 +141,25 @@ public class Gui_Quest_DeckEditor extends JFrame implements CardContainer, DeckD
|
|||||||
|
|
||||||
if(addedList.contains(cardName)) c.setRarity("new");
|
if(addedList.contains(cardName)) c.setRarity("new");
|
||||||
|
|
||||||
String PC = c.getSVar("PicCount");
|
//String PC = c.getSVar("PicCount");
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
int n = 0;
|
//int n = 0;
|
||||||
if (!PC.equals("")) {
|
//if (!PC.equals("")) {
|
||||||
if (PC.matches("[0-9][0-9]?"))
|
// if (PC.matches("[0-9][0-9]?"))
|
||||||
n = Integer.parseInt(PC);
|
// n = Integer.parseInt(PC);
|
||||||
if (n > 1)
|
// if (n > 1)
|
||||||
c.setRandomPicture(r.nextInt(n));
|
// c.setRandomPicture(r.nextInt(n));
|
||||||
}
|
//}
|
||||||
|
|
||||||
if (c.getCurSetCode().equals(""))
|
if (c.getCurSetCode().equals(""))
|
||||||
{
|
|
||||||
c.setCurSetCode(c.getMostRecentSet());
|
c.setCurSetCode(c.getMostRecentSet());
|
||||||
c.setImageFilename(CardUtil.buildFilename(c));
|
|
||||||
}
|
int n = SetInfoUtil.getSetInfo_Code(c.getSets(), c.getCurSetCode()).PicCount;
|
||||||
|
if (n > 1)
|
||||||
|
c.setRandomPicture(r.nextInt(n));
|
||||||
|
|
||||||
|
c.setImageFilename(CardUtil.buildFilename(c));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
topModel.addCard(c);
|
topModel.addCard(c);
|
||||||
@@ -167,21 +171,25 @@ public class Gui_Quest_DeckEditor extends JFrame implements CardContainer, DeckD
|
|||||||
|
|
||||||
c.setRarity(pack.getRarity(c.getName()));;
|
c.setRarity(pack.getRarity(c.getName()));;
|
||||||
|
|
||||||
String PC = c.getSVar("PicCount");
|
//String PC = c.getSVar("PicCount");
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
int n = 0;
|
//int n = 0;
|
||||||
if (!PC.equals("")){
|
//if (!PC.equals("")){
|
||||||
if (PC.matches("[0-9][0-9]?"))
|
// if (PC.matches("[0-9][0-9]?"))
|
||||||
n = Integer.parseInt(PC);
|
// n = Integer.parseInt(PC);
|
||||||
if (n > 1)
|
// if (n > 1)
|
||||||
c.setRandomPicture(r.nextInt(n));
|
// c.setRandomPicture(r.nextInt(n));
|
||||||
}
|
//}
|
||||||
|
|
||||||
if (c.getCurSetCode().equals(""))
|
if (c.getCurSetCode().equals(""))
|
||||||
{
|
|
||||||
c.setCurSetCode(c.getMostRecentSet());
|
c.setCurSetCode(c.getMostRecentSet());
|
||||||
c.setImageFilename(CardUtil.buildFilename(c));
|
|
||||||
}
|
int n = SetInfoUtil.getSetInfo_Code(c.getSets(), c.getCurSetCode()).PicCount;
|
||||||
|
if (n > 1)
|
||||||
|
c.setRandomPicture(r.nextInt(n));
|
||||||
|
|
||||||
|
c.setImageFilename(CardUtil.buildFilename(c));
|
||||||
|
|
||||||
|
|
||||||
bottomModel.addCard(c);
|
bottomModel.addCard(c);
|
||||||
}//for
|
}//for
|
||||||
|
|||||||
@@ -4,12 +4,14 @@ public class SetInfo{
|
|||||||
public String Code;
|
public String Code;
|
||||||
public String Rarity;
|
public String Rarity;
|
||||||
public String URL;
|
public String URL;
|
||||||
|
public int PicCount;
|
||||||
|
|
||||||
public SetInfo()
|
public SetInfo()
|
||||||
{
|
{
|
||||||
Code = "";
|
Code = "";
|
||||||
Rarity = "";
|
Rarity = "";
|
||||||
URL = "";
|
URL = "";
|
||||||
|
PicCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SetInfo(String c, String r, String u)
|
public SetInfo(String c, String r, String u)
|
||||||
@@ -17,6 +19,15 @@ public class SetInfo{
|
|||||||
Code = c;
|
Code = c;
|
||||||
Rarity = r;
|
Rarity = r;
|
||||||
URL = u;
|
URL = u;
|
||||||
|
PicCount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SetInfo(String c, String r, String u, int p)
|
||||||
|
{
|
||||||
|
Code = c;
|
||||||
|
Rarity = r;
|
||||||
|
URL = u;
|
||||||
|
PicCount = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SetInfo(String parse)
|
public SetInfo(String parse)
|
||||||
@@ -25,6 +36,10 @@ public class SetInfo{
|
|||||||
Code = pp[0];
|
Code = pp[0];
|
||||||
Rarity = pp[1];
|
Rarity = pp[1];
|
||||||
URL = pp[2];
|
URL = pp[2];
|
||||||
|
if (pp.length > 3)
|
||||||
|
PicCount = Integer.parseInt(pp[3]);
|
||||||
|
else
|
||||||
|
PicCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString()
|
public String toString()
|
||||||
|
|||||||
Reference in New Issue
Block a user