mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Sure enough, the code didn't work with brand new cards lacking SetInfo.
This commit is contained in:
@@ -2301,11 +2301,13 @@ public class GameAction {
|
||||
if ((card.getSets().size() > 0) && card.getCurSetCode().equals(""))
|
||||
card.setRandomSetCode();
|
||||
|
||||
int n = SetInfoUtil.getSetInfo_Code(card.getSets(), card.getCurSetCode()).PicCount;
|
||||
if (n > 1)
|
||||
card.setRandomPicture(generator.nextInt(n));
|
||||
if (!card.getCurSetCode().equals("")) {
|
||||
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());
|
||||
//}
|
||||
@@ -2335,11 +2337,13 @@ public class GameAction {
|
||||
if ((card.getSets().size() > 0) && card.getCurSetCode().equals(""))
|
||||
card.setRandomSetCode();
|
||||
|
||||
int n = SetInfoUtil.getSetInfo_Code(card.getSets(), card.getCurSetCode()).PicCount;
|
||||
if (n > 1)
|
||||
card.setRandomPicture(generator.nextInt(n));
|
||||
if (!card.getCurSetCode().equals("")) {
|
||||
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);
|
||||
|
||||
|
||||
@@ -518,12 +518,13 @@ public class Gui_BoosterDraft extends JFrame implements CardContainer, NewConsta
|
||||
if (c.getCurSetCode().equals(""))
|
||||
c.setCurSetCode(c.getMostRecentSet());
|
||||
|
||||
int n = SetInfoUtil.getSetInfo_Code(c.getSets(), c.getCurSetCode()).PicCount;
|
||||
if (n > 1)
|
||||
c.setRandomPicture(r.nextInt(n));
|
||||
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
if (!c.getCurSetCode().equals("")) {
|
||||
int n = SetInfoUtil.getSetInfo_Code(c.getSets(), c.getCurSetCode()).PicCount;
|
||||
if (n > 1)
|
||||
c.setRandomPicture(r.nextInt(n));
|
||||
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
}
|
||||
|
||||
allCardModel.addCard(c);
|
||||
}
|
||||
|
||||
@@ -129,12 +129,13 @@ public class Gui_CardShop extends JFrame implements CardContainer, DeckDisplay,
|
||||
if (c.getCurSetCode().equals(""))
|
||||
c.setCurSetCode(c.getMostRecentSet());
|
||||
|
||||
int n = SetInfoUtil.getSetInfo_Code(c.getSets(), c.getCurSetCode()).PicCount;
|
||||
if (n > 1)
|
||||
c.setRandomPicture(r.nextInt(n));
|
||||
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
if (!c.getCurSetCode().equals("")) {
|
||||
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);
|
||||
|
||||
@@ -158,12 +159,13 @@ public class Gui_CardShop extends JFrame implements CardContainer, DeckDisplay,
|
||||
if (c.getCurSetCode().equals(""))
|
||||
c.setCurSetCode(c.getMostRecentSet());
|
||||
|
||||
int n = SetInfoUtil.getSetInfo_Code(c.getSets(), c.getCurSetCode()).PicCount;
|
||||
if (n > 1)
|
||||
c.setRandomPicture(r.nextInt(n));
|
||||
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
if (!c.getCurSetCode().equals("")) {
|
||||
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);
|
||||
}// for
|
||||
|
||||
@@ -195,12 +195,13 @@ public class Gui_DeckEditor extends JFrame implements CardContainer, DeckDisplay
|
||||
if (c.getCurSetCode().equals(""))
|
||||
c.setCurSetCode(c.getMostRecentSet());
|
||||
|
||||
int n = SetInfoUtil.getSetInfo_Code(c.getSets(), c.getCurSetCode()).PicCount;
|
||||
if (n > 1)
|
||||
c.setRandomPicture(r.nextInt(n));
|
||||
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
if (!c.getCurSetCode().equals("")) {
|
||||
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) {
|
||||
topModel.addCard(c);
|
||||
@@ -227,12 +228,13 @@ public class Gui_DeckEditor extends JFrame implements CardContainer, DeckDisplay
|
||||
if (c.getCurSetCode().equals(""))
|
||||
c.setCurSetCode(c.getMostRecentSet());
|
||||
|
||||
int n = SetInfoUtil.getSetInfo_Code(c.getSets(), c.getCurSetCode()).PicCount;
|
||||
if (n > 1)
|
||||
c.setRandomPicture(r.nextInt(n));
|
||||
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
if (!c.getCurSetCode().equals("")) {
|
||||
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);
|
||||
}// for
|
||||
|
||||
@@ -154,12 +154,13 @@ public class Gui_Quest_DeckEditor extends JFrame implements CardContainer, DeckD
|
||||
if (c.getCurSetCode().equals(""))
|
||||
c.setCurSetCode(c.getMostRecentSet());
|
||||
|
||||
int n = SetInfoUtil.getSetInfo_Code(c.getSets(), c.getCurSetCode()).PicCount;
|
||||
if (n > 1)
|
||||
c.setRandomPicture(r.nextInt(n));
|
||||
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
if (!c.getCurSetCode().equals("")) {
|
||||
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);
|
||||
@@ -184,12 +185,13 @@ public class Gui_Quest_DeckEditor extends JFrame implements CardContainer, DeckD
|
||||
if (c.getCurSetCode().equals(""))
|
||||
c.setCurSetCode(c.getMostRecentSet());
|
||||
|
||||
int n = SetInfoUtil.getSetInfo_Code(c.getSets(), c.getCurSetCode()).PicCount;
|
||||
if (n > 1)
|
||||
c.setRandomPicture(r.nextInt(n));
|
||||
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
if (!c.getCurSetCode().equals("")) {
|
||||
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);
|
||||
}//for
|
||||
|
||||
Reference in New Issue
Block a user