- 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 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. 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: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 SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
K:ETBReplacement:Copy:Reflections:Mandatory:Battlefield:Creature.nonToken+YouCtrl 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 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. 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 SetInfo:AVR Rare

View File

@@ -19,6 +19,7 @@ import forge.card.spellability.Target;
import forge.card.trigger.Trigger; import forge.card.trigger.Trigger;
import forge.card.trigger.TriggerHandler; import forge.card.trigger.TriggerHandler;
import forge.gui.GuiDialog; import forge.gui.GuiDialog;
import forge.properties.ForgePreferences.FPref;
public class CloneEffect extends SpellAbilityEffect { public class CloneEffect extends SpellAbilityEffect {
// TODO update this method // TODO update this method
@@ -87,11 +88,14 @@ public class CloneEffect extends SpellAbilityEffect {
} }
// determine the image to be used for the clone // determine the image to be used for the clone
String imageFileName = host.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); List<Card> cloneImgSources = AbilityUtils.getDefinedCards(host, sa.getParam("ImageSource"), sa);
if (!cloneImgSources.isEmpty()) { if (!cloneImgSources.isEmpty()) {
imageFileName = cloneImgSources.get(0).getImageKey(); imageFileName = cloneImgSources.get(0).getImageKey();
} }
}
boolean keepName = sa.hasParam("KeepName"); boolean keepName = sa.hasParam("KeepName");
String originalName = tgtCard.getName(); String originalName = tgtCard.getName();

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() { view.getCbRemoveSmall().addItemListener(new ItemListener() {
@Override @Override
public void itemStateChanged(final ItemEvent arg0) { public void itemStateChanged(final ItemEvent arg0) {
@@ -207,6 +216,7 @@ public enum CSubmenuPreferences implements ICDoc {
view.getCbStackLand().setSelected(prefs.getPrefBoolean(FPref.UI_SMOOTH_LAND)); view.getCbStackLand().setSelected(prefs.getPrefBoolean(FPref.UI_SMOOTH_LAND));
view.getCbDevMode().setSelected(prefs.getPrefBoolean(FPref.DEV_MODE_ENABLED)); view.getCbDevMode().setSelected(prefs.getPrefBoolean(FPref.DEV_MODE_ENABLED));
view.getCbEnforceDeckLegality().setSelected(prefs.getPrefBoolean(FPref.ENFORCE_DECK_LEGALITY)); 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.getCbRandomFoil().setSelected(prefs.getPrefBoolean(FPref.UI_RANDOM_FOIL));
view.getCbRandomizeArt().setSelected(prefs.getPrefBoolean(FPref.UI_RANDOM_CARD_ART)); view.getCbRandomizeArt().setSelected(prefs.getPrefBoolean(FPref.UI_RANDOM_CARD_ART));
view.getCbScaleLarger().setSelected(prefs.getPrefBoolean(FPref.UI_SCALE_LARGER)); view.getCbScaleLarger().setSelected(prefs.getPrefBoolean(FPref.UI_SCALE_LARGER));

View File

@@ -90,6 +90,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
private final JCheckBox cbManaBurn = new OptionsCheckBox("Mana Burn"); private final JCheckBox cbManaBurn = new OptionsCheckBox("Mana Burn");
private final JCheckBox cbDevMode = new OptionsCheckBox("Developer Mode"); private final JCheckBox cbDevMode = new OptionsCheckBox("Developer Mode");
private final JCheckBox cbEnforceDeckLegality = new OptionsCheckBox("Deck Conformance"); 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 cbTextMana = new OptionsCheckBox("Text / Mana Overlay");
private final JCheckBox cbScaleLarger = new OptionsCheckBox("Scale Image Larger"); private final JCheckBox cbScaleLarger = new OptionsCheckBox("Scale Image Larger");
private final JCheckBox cbRandomFoil = new OptionsCheckBox("Random Foil"); private final JCheckBox cbRandomFoil = new OptionsCheckBox("Random Foil");
@@ -98,7 +99,6 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
private final Map<FPref, KeyboardShortcutField> shortcutFields = new HashMap<FPref, KeyboardShortcutField>(); private final Map<FPref, KeyboardShortcutField> shortcutFields = new HashMap<FPref, KeyboardShortcutField>();
/** /**
* Constructor. * Constructor.
*/ */
@@ -143,6 +143,9 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
pnlPrefs.add(cbEnforceDeckLegality, regularConstraints); 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(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 // AI Personality Profile Options
pnlPrefs.add(new SectionLabel("AI Options"), sectionConstraints); pnlPrefs.add(new SectionLabel("AI Options"), sectionConstraints);
@@ -451,6 +454,11 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
return cbEnforceDeckLegality; return cbEnforceDeckLegality;
} }
/** @return {@link javax.swing.JCheckBox} */
public JCheckBox getCbCloneImgSource() {
return cbCloneImgSource;
}
/** @return {@link javax.swing.JCheckBox} */ /** @return {@link javax.swing.JCheckBox} */
public JCheckBox getCbEnableSounds() { public JCheckBox getCbEnableSounds() {
return cbEnableSounds; return cbEnableSounds;

View File

@@ -51,7 +51,8 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
UI_TARGETING_OVERLAY ("false"), UI_TARGETING_OVERLAY ("false"),
UI_ENABLE_SOUNDS ("true"), UI_ENABLE_SOUNDS ("true"),
UI_RANDOM_CARD_ART ("false"), 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_CURRENTMENU (EMenuItem.CONSTRUCTED.toString()),
SUBMENU_SANCTIONED ("false"), SUBMENU_SANCTIONED ("false"),