- Added a user preference that allows a user to choose whether a clone or copied card should use its native artwork or the artwork of the card being cloned. By default the cloned card's image will be used.

This commit is contained in:
moomarc
2013-03-20 09:34:48 +00:00
parent 9be5cc2e29
commit 906b82f3ab
5 changed files with 36 additions and 13 deletions

View File

@@ -7,10 +7,10 @@ T:Mode$ ChangesZone | Destination$ Battlefield | ValidCard$ Card.Self+AttachedTo
SVar:RememberInitialAttach:DB$ Pump | RememberObjects$ Valid Card.AttachedBy
T:Mode$ ChangesZone | Destination$ Battlefield | ValidCard$ Card.Self+AttachedTo Card | Execute$ FirstReflections | TriggerZones$ Battlefield | TriggerDescription$ When CARDNAME enters the battlefield attached to a creature, each other nontoken creature you control becomes a copy of that creature.
SVar:FirstReflections:DB$ RepeatEach | RepeatCards$ Creature.nonToken+YouCtrl | UseImprinted$ True | Zone$ Battlefield | RepeatSubAbility$ Reflect | SubAbility$ DBCleanup
SVar:Reflect:DB$ Clone | Defined$ Remembered | CloneTarget$ Imprinted | ImageSource$ Remembered
SVar:Reflect:DB$ Clone | Defined$ Remembered | CloneTarget$ Imprinted
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
K:ETBReplacement:Copy:Reflections:Mandatory:Battlefield:Creature.nonToken+YouCtrl
SVar:Reflections:DB$ Clone | Defined$ Enchanted | CloneTarget$ ReplacedCard | ImageSource$ Enchanted | SpellDescription$ Nontoken creatures you control enter the battlefield as a copy of enchanted creature.
SVar:Reflections:DB$ Clone | Defined$ Enchanted | CloneTarget$ ReplacedCard | SpellDescription$ Nontoken creatures you control enter the battlefield as a copy of enchanted creature.
SVar:Picture:http://www.wizards.com/global/images/magic/general/infinite_reflection.jpg
Oracle:Enchant creature\nWhen Infinite Reflection enters the battlefield attached to a creature, each other nontoken creature you control becomes a copy of that creature.\nNontoken creatures you control enter the battlefield as a copy of enchanted creature.
SetInfo:AVR Rare

View File

@@ -19,6 +19,7 @@ import forge.card.spellability.Target;
import forge.card.trigger.Trigger;
import forge.card.trigger.TriggerHandler;
import forge.gui.GuiDialog;
import forge.properties.ForgePreferences.FPref;
public class CloneEffect extends SpellAbilityEffect {
// TODO update this method
@@ -87,10 +88,13 @@ public class CloneEffect extends SpellAbilityEffect {
}
// determine the image to be used for the clone
String imageFileName = host.getImageKey();
List<Card> cloneImgSources = AbilityUtils.getDefinedCards(host, sa.getParam("ImageSource"), sa);
if (!cloneImgSources.isEmpty()) {
imageFileName = cloneImgSources.get(0).getImageKey();
String imageFileName = Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_CLONE_MODE_SOURCE)
? tgtCard.getImageKey() : cardToCopy.getImageKey();
if (sa.hasParam("ImageSource")) { // Allow the image to be stipulated by using a defined card source
List<Card> cloneImgSources = AbilityUtils.getDefinedCards(host, sa.getParam("ImageSource"), sa);
if (!cloneImgSources.isEmpty()) {
imageFileName = cloneImgSources.get(0).getImageKey();
}
}
boolean keepName = sa.hasParam("KeepName");

View File

@@ -99,6 +99,15 @@ public enum CSubmenuPreferences implements ICDoc {
}
});
view.getCbCloneImgSource().addItemListener(new ItemListener() {
@Override
public void itemStateChanged(final ItemEvent arg0) {
final boolean toggle = view.getCbCloneImgSource().isSelected();
prefs.setPref(FPref.UI_CLONE_MODE_SOURCE, String.valueOf(toggle));
prefs.save();
}
});
view.getCbRemoveSmall().addItemListener(new ItemListener() {
@Override
public void itemStateChanged(final ItemEvent arg0) {
@@ -207,13 +216,14 @@ public enum CSubmenuPreferences implements ICDoc {
view.getCbStackLand().setSelected(prefs.getPrefBoolean(FPref.UI_SMOOTH_LAND));
view.getCbDevMode().setSelected(prefs.getPrefBoolean(FPref.DEV_MODE_ENABLED));
view.getCbEnforceDeckLegality().setSelected(prefs.getPrefBoolean(FPref.ENFORCE_DECK_LEGALITY));
view.getCbCloneImgSource().setSelected(prefs.getPrefBoolean(FPref.UI_CLONE_MODE_SOURCE));
view.getCbRandomFoil().setSelected(prefs.getPrefBoolean(FPref.UI_RANDOM_FOIL));
view.getCbRandomizeArt().setSelected(prefs.getPrefBoolean(FPref.UI_RANDOM_CARD_ART));
view.getCbScaleLarger().setSelected(prefs.getPrefBoolean(FPref.UI_SCALE_LARGER));
view.getCbTextMana().setSelected(prefs.getPrefBoolean(FPref.UI_CARD_OVERLAY));
view.getCbEnableSounds().setSelected(prefs.getPrefBoolean(FPref.UI_ENABLE_SOUNDS));
view.reloadShortcuts();
SwingUtilities.invokeLater(new Runnable() {
@Override public void run() { view.getCbRemoveSmall().requestFocusInWindow(); }
});

View File

@@ -74,7 +74,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
private final FLabel lblTitleAIProfile = new FLabel.Builder()
.text("Choose AI Personality").fontStyle(Font.BOLD).fontSize(14).build();
private final JList lstChooseAIProfile = new FList();
private final FLabel lblChooseAIProfile = new FLabel.Builder().fontSize(12).fontStyle(Font.ITALIC)
.text("AI Opponent Personality.")
@@ -90,6 +90,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
private final JCheckBox cbManaBurn = new OptionsCheckBox("Mana Burn");
private final JCheckBox cbDevMode = new OptionsCheckBox("Developer Mode");
private final JCheckBox cbEnforceDeckLegality = new OptionsCheckBox("Deck Conformance");
private final JCheckBox cbCloneImgSource = new OptionsCheckBox("Clones use original card art");
private final JCheckBox cbTextMana = new OptionsCheckBox("Text / Mana Overlay");
private final JCheckBox cbScaleLarger = new OptionsCheckBox("Scale Image Larger");
private final JCheckBox cbRandomFoil = new OptionsCheckBox("Random Foil");
@@ -97,8 +98,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
private final JCheckBox cbEnableSounds = new OptionsCheckBox("Enable Sounds");
private final Map<FPref, KeyboardShortcutField> shortcutFields = new HashMap<FPref, KeyboardShortcutField>();
/**
* Constructor.
*/
@@ -143,6 +143,9 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
pnlPrefs.add(cbEnforceDeckLegality, regularConstraints);
pnlPrefs.add(new NoteLabel("Enforces deck legality relevant to each environment (minimum deck sizes, max card count etc)"), regularConstraints);
pnlPrefs.add(cbCloneImgSource, regularConstraints);
pnlPrefs.add(new NoteLabel("When enabled clones will use their original art instead of the cloned card's art"), regularConstraints);
// AI Personality Profile Options
pnlPrefs.add(new SectionLabel("AI Options"), sectionConstraints);
@@ -201,7 +204,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
e.getValue().reload(e.getKey());
}
}
/* (non-Javadoc)
* @see forge.view.home.IViewSubmenu#populate()
*/
@@ -320,7 +323,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
public void reload(FPref prefKey) {
this.setCodeString(Singletons.getModel().getPreferences().getPref(prefKey));
}
/**
* Gets the code string.
*
@@ -451,6 +454,11 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
return cbEnforceDeckLegality;
}
/** @return {@link javax.swing.JCheckBox} */
public JCheckBox getCbCloneImgSource() {
return cbCloneImgSource;
}
/** @return {@link javax.swing.JCheckBox} */
public JCheckBox getCbEnableSounds() {
return cbEnableSounds;

View File

@@ -51,7 +51,8 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
UI_TARGETING_OVERLAY ("false"),
UI_ENABLE_SOUNDS ("true"),
UI_RANDOM_CARD_ART ("false"),
UI_CURRENT_AI_PROFILE (AiProfileUtil.AI_PROFILE_RANDOM_MATCH), /** */
UI_CURRENT_AI_PROFILE (AiProfileUtil.AI_PROFILE_RANDOM_MATCH),
UI_CLONE_MODE_SOURCE ("false"), /** */
SUBMENU_CURRENTMENU (EMenuItem.CONSTRUCTED.toString()),
SUBMENU_SANCTIONED ("false"),