- Randomize Card Art is no longer an option and is the default functionality instead (since there is no true support for distinguishing cards with different art in Forge, the game will randomize the card art that appears on cards with multiple available pictures, most notably basic lands, in each match).

This commit is contained in:
Agetian
2014-01-06 05:33:26 +00:00
parent dcb8c54e4c
commit 0ee95fae76
4 changed files with 10 additions and 26 deletions

View File

@@ -99,13 +99,12 @@ public class Match {
*/
public void startGame(final Game game, final CountDownLatch latch) {
final boolean canRandomFoil = Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_RANDOM_FOIL) && gameType == GameType.Constructed;
final boolean useRandomArt = Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_RANDOM_CARD_ART);
// This code could be run run from EDT.
game.getAction().invoke(new Runnable() {
@Override
public void run() {
prepareAllZones(game, canRandomFoil, useRandomArt);
prepareAllZones(game, canRandomFoil);
if (useAnte) { // Deciding which cards go to ante
Multimap<Player, Card> list = game.chooseCardsForAnte();
@@ -237,22 +236,18 @@ public class Match {
return myRemovedAnteCards;
}
private static void preparePlayerLibrary(Player player, final ZoneType zoneType, CardPool section, boolean canRandomFoil, boolean useRandomArt, Random generator) {
private static void preparePlayerLibrary(Player player, final ZoneType zoneType, CardPool section, boolean canRandomFoil, Random generator) {
PlayerZone library = player.getZone(zoneType);
List<Card> newLibrary = new ArrayList<Card>();
for (final Entry<PaperCard, Integer> stackOfCards : section) {
final PaperCard cp = stackOfCards.getKey();
for (int i = 0; i < stackOfCards.getValue(); i++) {
// apply random pictures for cards
// TODO: potentially suboptimal implementation. Do NOT randomly remove this code! If you know how to implement
// it better, feel free to do so. Until then, unfortunately, this is the best implementation thus far.
PaperCard cpi = null;
if (useRandomArt) {
cpi = Singletons.getMagicDb().getCommonCards().getCard(cp.getName(), cp.getEdition(), -1);
if ( cp.isFoil() )
cpi = Singletons.getMagicDb().getCommonCards().getFoiled(cpi);
}
// apply random art for cards with multiple pictures (basic lands, etc.) - currently always enabled
// TODO: implement true distinction between cards with different art (in deck editor, match, etc.)
PaperCard cpi = Singletons.getMagicDb().getCommonCards().getCard(cp.getName(), cp.getEdition(), -1);
if ( cp.isFoil() )
cpi = Singletons.getMagicDb().getCommonCards().getFoiled(cpi);
final Card card = cpi == null ? Card.fromPaperCard(cp, player) : Card.fromPaperCard(cpi, player);
@@ -267,7 +262,7 @@ public class Match {
library.setCards(newLibrary);
}
private void prepareAllZones(final Game game, final boolean canRandomFoil, final boolean useRandomArt) {
private void prepareAllZones(final Game game, final boolean canRandomFoil) {
// need this code here, otherwise observables fail
Trigger.resetIDs();
game.getTriggerHandler().clearDelayedTrigger();
@@ -318,9 +313,9 @@ public class Match {
Random generator = MyRandom.getRandom();
preparePlayerLibrary(player, ZoneType.Library, myDeck.getMain(), canRandomFoil, useRandomArt, generator);
preparePlayerLibrary(player, ZoneType.Library, myDeck.getMain(), canRandomFoil, generator);
if (myDeck.has(DeckSection.Sideboard)) {
preparePlayerLibrary(player, ZoneType.Sideboard, myDeck.get(DeckSection.Sideboard), canRandomFoil, useRandomArt, generator);
preparePlayerLibrary(player, ZoneType.Sideboard, myDeck.get(DeckSection.Sideboard), canRandomFoil, generator);
}
player.shuffle(null);

View File

@@ -75,7 +75,6 @@ public enum CSubmenuPreferences implements ICDoc {
lstControls.add(Pair.of(view.getCbUploadDraft(), FPref.UI_UPLOAD_DRAFT));
lstControls.add(Pair.of(view.getCbEnableAICheats(), FPref.UI_ENABLE_AI_CHEATS));
lstControls.add(Pair.of(view.getCbRandomFoil(), FPref.UI_RANDOM_FOIL));
lstControls.add(Pair.of(view.getCbRandomizeArt(), FPref.UI_RANDOM_CARD_ART));
lstControls.add(Pair.of(view.getCbEnableSounds(), FPref.UI_ENABLE_SOUNDS));
lstControls.add(Pair.of(view.getCbAltSoundSystem(), FPref.UI_ALT_SOUND_SYSTEM));
lstControls.add(Pair.of(view.getCbUiForTouchScreen(), FPref.UI_FOR_TOUCHSCREN));

View File

@@ -77,7 +77,6 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
private final JCheckBox cbCloneImgSource = new OptionsCheckBox("Clones use original card art");
private final JCheckBox cbScaleLarger = new OptionsCheckBox("Scale Image Larger");
private final JCheckBox cbRandomFoil = new OptionsCheckBox("Random Foil");
private final JCheckBox cbRandomizeArt = new OptionsCheckBox("Randomize Card Art");
private final JCheckBox cbEnableSounds = new OptionsCheckBox("Enable Sounds");
private final JCheckBox cbAltSoundSystem = new OptionsCheckBox("Use Alternate Sound System");
private final JCheckBox cbUiForTouchScreen = new OptionsCheckBox("Enchance UI for touchscreens");
@@ -188,9 +187,6 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
pnlPrefs.add(cbRandomFoil, regularConstraints);
pnlPrefs.add(new NoteLabel("Adds foiled effects to random cards."), regularConstraints);
pnlPrefs.add(cbRandomizeArt, regularConstraints);
pnlPrefs.add(new NoteLabel("Randomize the card art for cards in the human's deck."), regularConstraints);
pnlPrefs.add(cbScaleLarger, regularConstraints);
pnlPrefs.add(new NoteLabel("Allows card pictures to be expanded larger than their original size."), regularConstraints);
@@ -430,11 +426,6 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
return cbRandomFoil;
}
/** @return {@link javax.swing.JCheckBox} */
public JCheckBox getCbRandomizeArt() {
return cbRandomizeArt;
}
/** @return {@link javax.swing.JCheckBox} */
public JCheckBox getCbAnte() {
return cbAnte;

View File

@@ -69,7 +69,6 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
UI_TARGETING_OVERLAY ("false"),
UI_ENABLE_SOUNDS ("true"),
UI_ALT_SOUND_SYSTEM ("false"),
UI_RANDOM_CARD_ART ("false"),
UI_CURRENT_AI_PROFILE (AiProfileUtil.AI_PROFILE_RANDOM_MATCH),
UI_CLONE_MODE_SOURCE ("false"), /** */
UI_MATCH_IMAGE_VISIBLE ("true"),