Merge origin/master
Conflicts: Mage.Sets/src/mage/sets/dissension/UtvaraScalper.java
|
@ -1,6 +1,6 @@
|
|||
XMage.de 1 (Europe/Germany) fast :xmage.de:17171
|
||||
woogerworks (North America/USA) :xmage.woogerworks.info:17171
|
||||
XMage.info 1 (Europe/France) new network code -> see forum :176.31.186.181:17171
|
||||
IceMage (Europe/Netherlands) :ring0.cc:17171
|
||||
XMage BR (South America/Brazil) :ec2-54-233-67-0.sa-east-1.compute.amazonaws.com:17171
|
||||
Seedds Server (Asia) :115.29.203.80:17171
|
||||
localhost -> connect to your local server (must be started):localhost:17171
|
||||
|
|
|
@ -42,9 +42,7 @@ import java.awt.event.MouseEvent;
|
|||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.prefs.BackingStoreException;
|
||||
import java.util.prefs.Preferences;
|
||||
import javax.swing.BorderFactory;
|
||||
|
@ -63,6 +61,9 @@ import mage.client.MageFrame;
|
|||
import mage.client.util.Config;
|
||||
import mage.client.util.ImageHelper;
|
||||
import mage.client.util.gui.BufferedImageBuilder;
|
||||
import static mage.constants.Constants.DEFAULT_AVATAR_ID;
|
||||
import static mage.constants.Constants.MAX_AVATAR_ID;
|
||||
import static mage.constants.Constants.MIN_AVATAR_ID;
|
||||
import mage.players.net.UserData;
|
||||
import mage.players.net.UserGroup;
|
||||
import mage.players.net.UserSkipPrioritySteps;
|
||||
|
@ -264,29 +265,12 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
public static String PHASE_ON = "on";
|
||||
public static String PHASE_OFF = "off";
|
||||
|
||||
public static final int DEFAULT_AVATAR_ID = 51;
|
||||
private static int selectedAvatarId = DEFAULT_AVATAR_ID;
|
||||
private static final Set<Integer> available_avatars = new HashSet<>();
|
||||
private static final Map<Integer, JPanel> panels = new HashMap<>();
|
||||
|
||||
private static final Border GREEN_BORDER = BorderFactory.createLineBorder(Color.GREEN, 3);
|
||||
private static final Border BLACK_BORDER = BorderFactory.createLineBorder(Color.BLACK, 3);
|
||||
|
||||
static {
|
||||
available_avatars.add(51);
|
||||
available_avatars.add(13);
|
||||
available_avatars.add(9);
|
||||
available_avatars.add(53);
|
||||
available_avatars.add(10);
|
||||
available_avatars.add(39);
|
||||
available_avatars.add(19);
|
||||
available_avatars.add(30);
|
||||
available_avatars.add(25);
|
||||
|
||||
available_avatars.add(22);
|
||||
available_avatars.add(77);
|
||||
available_avatars.add(62);
|
||||
}
|
||||
private static int selectedAvatarId = DEFAULT_AVATAR_ID;
|
||||
|
||||
private final JFileChooser fc = new JFileChooser();
|
||||
|
||||
|
@ -433,20 +417,30 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
tabAvatars = new javax.swing.JPanel();
|
||||
avatarPane = new javax.swing.JScrollPane();
|
||||
avatarPanel = new javax.swing.JPanel();
|
||||
jLabel12 = new javax.swing.JLabel();
|
||||
jPanel10 = new javax.swing.JPanel();
|
||||
jPanel13 = new javax.swing.JPanel();
|
||||
jPanel11 = new javax.swing.JPanel();
|
||||
jPanel12 = new javax.swing.JPanel();
|
||||
jPanel13 = new javax.swing.JPanel();
|
||||
jPanel14 = new javax.swing.JPanel();
|
||||
jPanel15 = new javax.swing.JPanel();
|
||||
jLabel13 = new javax.swing.JLabel();
|
||||
jPanel16 = new javax.swing.JPanel();
|
||||
jPanel17 = new javax.swing.JPanel();
|
||||
jPanel18 = new javax.swing.JPanel();
|
||||
jPanel19 = new javax.swing.JPanel();
|
||||
jPanel20 = new javax.swing.JPanel();
|
||||
jPanel21 = new javax.swing.JPanel();
|
||||
jPanel22 = new javax.swing.JPanel();
|
||||
jPanel23 = new javax.swing.JPanel();
|
||||
jPanel24 = new javax.swing.JPanel();
|
||||
jPanel25 = new javax.swing.JPanel();
|
||||
jPanel26 = new javax.swing.JPanel();
|
||||
jPanel27 = new javax.swing.JPanel();
|
||||
jPanel28 = new javax.swing.JPanel();
|
||||
jPanel29 = new javax.swing.JPanel();
|
||||
jPanel30 = new javax.swing.JPanel();
|
||||
jPanel31 = new javax.swing.JPanel();
|
||||
jPanel32 = new javax.swing.JPanel();
|
||||
jPanel33 = new javax.swing.JPanel();
|
||||
tabConnection = new javax.swing.JPanel();
|
||||
lblProxyType = new javax.swing.JLabel();
|
||||
cbProxyType = new javax.swing.JComboBox<ProxyType>();
|
||||
|
@ -608,16 +602,16 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(main_gameLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(cbAllowRequestToShowHandCards, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addGroup(main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
||||
.addComponent(showPlayerNamesPermanently, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(nonLandPermanentsInOnePile, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(showAbilityPickerForced, javax.swing.GroupLayout.Alignment.LEADING))
|
||||
.addComponent(cbShowStormCounter, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cbConfirmEmptyManaPool, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cbAskMoveToGraveOrder, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addComponent(cbConfirmEmptyManaPool, javax.swing.GroupLayout.DEFAULT_SIZE, 485, Short.MAX_VALUE)
|
||||
.addComponent(cbAllowRequestToShowHandCards, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(cbShowStormCounter, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(cbAskMoveToGraveOrder, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addContainerGap(7, Short.MAX_VALUE))
|
||||
);
|
||||
main_gameLayout.setVerticalGroup(
|
||||
main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
|
@ -666,9 +660,9 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
main_gamelogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(main_gamelogLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(main_gamelogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(cbGameLogAutoSave, javax.swing.GroupLayout.PREFERRED_SIZE, 528, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cbDraftLogAutoSave, javax.swing.GroupLayout.PREFERRED_SIZE, 528, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(main_gamelogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(cbDraftLogAutoSave, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(cbGameLogAutoSave, javax.swing.GroupLayout.DEFAULT_SIZE, 473, Short.MAX_VALUE))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
main_gamelogLayout.setVerticalGroup(
|
||||
|
@ -687,8 +681,10 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.addContainerGap()
|
||||
.addGroup(tabMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(main_card, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(main_game, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(main_gamelog, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addComponent(main_gamelog, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(tabMainLayout.createSequentialGroup()
|
||||
.addComponent(main_game, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(0, 0, Short.MAX_VALUE)))
|
||||
.addContainerGap())
|
||||
);
|
||||
tabMainLayout.setVerticalGroup(
|
||||
|
@ -915,7 +911,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.addComponent(jLabelEndOfTurn)
|
||||
.addComponent(checkBoxEndTurnOthers))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(phases_stopSettings, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(phases_stopSettings, javax.swing.GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE)
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
|
@ -962,24 +958,27 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
panelCardImages.setLayout(panelCardImagesLayout);
|
||||
panelCardImagesLayout.setHorizontalGroup(
|
||||
panelCardImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelCardImagesLayout.createSequentialGroup()
|
||||
.addGap(24, 24, 24)
|
||||
.addComponent(txtImageFolderPath)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(btnBrowseImageLocation))
|
||||
.addGroup(panelCardImagesLayout.createSequentialGroup()
|
||||
.addGroup(panelCardImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(cbUseDefaultImageFolder)
|
||||
.addComponent(cbCheckForNewImages)
|
||||
.addGroup(panelCardImagesLayout.createSequentialGroup()
|
||||
.addGroup(panelCardImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, panelCardImagesLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(labelPreferedImageLanguage))
|
||||
.addComponent(cbSaveToZipFiles, javax.swing.GroupLayout.Alignment.LEADING))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(cbPreferedImageLanguage, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
.addGroup(panelCardImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(cbUseDefaultImageFolder)
|
||||
.addComponent(cbCheckForNewImages)
|
||||
.addGroup(panelCardImagesLayout.createSequentialGroup()
|
||||
.addGroup(panelCardImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, panelCardImagesLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(labelPreferedImageLanguage))
|
||||
.addComponent(cbSaveToZipFiles, javax.swing.GroupLayout.Alignment.LEADING))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(cbPreferedImageLanguage, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addGap(0, 190, Short.MAX_VALUE))
|
||||
.addGroup(panelCardImagesLayout.createSequentialGroup()
|
||||
.addGap(24, 24, 24)
|
||||
.addComponent(txtImageFolderPath)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(btnBrowseImageLocation)))
|
||||
.addContainerGap())
|
||||
);
|
||||
panelCardImagesLayout.setVerticalGroup(
|
||||
panelCardImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
|
@ -1061,32 +1060,29 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.addGroup(panelBackgroundImagesLayout.createSequentialGroup()
|
||||
.addGroup(panelBackgroundImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelBackgroundImagesLayout.createSequentialGroup()
|
||||
.addGap(19, 19, 19)
|
||||
.addComponent(jLabel14))
|
||||
.addGroup(panelBackgroundImagesLayout.createSequentialGroup()
|
||||
.addGap(25, 25, 25)
|
||||
.addComponent(jLabel15)))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(panelBackgroundImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelBackgroundImagesLayout.createSequentialGroup()
|
||||
.addComponent(txtBattlefieldImagePath, javax.swing.GroupLayout.PREFERRED_SIZE, 336, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(panelBackgroundImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelBackgroundImagesLayout.createSequentialGroup()
|
||||
.addGap(19, 19, 19)
|
||||
.addComponent(jLabel14))
|
||||
.addGroup(panelBackgroundImagesLayout.createSequentialGroup()
|
||||
.addGap(25, 25, 25)
|
||||
.addComponent(jLabel15)))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(btnBrowseBattlefieldImage))
|
||||
.addGroup(panelBackgroundImagesLayout.createSequentialGroup()
|
||||
.addComponent(txtBackgroundImagePath, javax.swing.GroupLayout.PREFERRED_SIZE, 332, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(panelBackgroundImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(txtBackgroundImagePath)
|
||||
.addComponent(txtBattlefieldImagePath))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(btnBrowseBackgroundImage)))
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
.addGroup(panelBackgroundImagesLayout.createSequentialGroup()
|
||||
.addGroup(panelBackgroundImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(cbUseRandomBattleImage)
|
||||
.addComponent(cbUseDefaultBattleImage)
|
||||
.addComponent(cbUseDefaultBackground))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGroup(panelBackgroundImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(btnBrowseBackgroundImage, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(btnBrowseBattlefieldImage, javax.swing.GroupLayout.Alignment.TRAILING)))
|
||||
.addGroup(panelBackgroundImagesLayout.createSequentialGroup()
|
||||
.addGroup(panelBackgroundImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(cbUseRandomBattleImage)
|
||||
.addComponent(cbUseDefaultBattleImage)
|
||||
.addComponent(cbUseDefaultBackground))
|
||||
.addGap(0, 0, Short.MAX_VALUE)))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
panelBackgroundImagesLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {txtBackgroundImagePath, txtBattlefieldImagePath});
|
||||
|
||||
panelBackgroundImagesLayout.setVerticalGroup(
|
||||
panelBackgroundImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelBackgroundImagesLayout.createSequentialGroup()
|
||||
|
@ -1115,8 +1111,8 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.addGroup(tabImagesLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(tabImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(panelCardImages, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(panelBackgroundImages, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addComponent(panelCardImages, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(panelBackgroundImages, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addContainerGap())
|
||||
);
|
||||
tabImagesLayout.setVerticalGroup(
|
||||
|
@ -1248,249 +1244,459 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
|
||||
tabsPanel.addTab("Sounds", tabSounds);
|
||||
|
||||
jLabel12.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
|
||||
jLabel12.setText("Choose your avatar:");
|
||||
avatarPane.setMaximumSize(new java.awt.Dimension(508, 772));
|
||||
avatarPane.setMinimumSize(new java.awt.Dimension(508, 772));
|
||||
avatarPane.setPreferredSize(new java.awt.Dimension(508, 772));
|
||||
|
||||
avatarPanel.setMaximumSize(new java.awt.Dimension(508, 772));
|
||||
avatarPanel.setMinimumSize(new java.awt.Dimension(508, 772));
|
||||
avatarPanel.setPreferredSize(new java.awt.Dimension(508, 772));
|
||||
avatarPanel.setLayout(new java.awt.GridLayout(6, 4, 20, 20));
|
||||
|
||||
jPanel10.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
|
||||
jPanel10.setMaximumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel10.setMinimumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel10.setPreferredSize(new java.awt.Dimension(102, 102));
|
||||
|
||||
javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
|
||||
jPanel10.setLayout(jPanel10Layout);
|
||||
jPanel10Layout.setHorizontalGroup(
|
||||
jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel10Layout.setVerticalGroup(
|
||||
jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
jPanel13.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
|
||||
|
||||
javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
|
||||
jPanel13.setLayout(jPanel13Layout);
|
||||
jPanel13Layout.setHorizontalGroup(
|
||||
jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel13Layout.setVerticalGroup(
|
||||
jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
);
|
||||
avatarPanel.add(jPanel10);
|
||||
|
||||
jPanel11.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
|
||||
jPanel11.setMaximumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel11.setMinimumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel11.setPreferredSize(new java.awt.Dimension(102, 102));
|
||||
|
||||
javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
|
||||
jPanel11.setLayout(jPanel11Layout);
|
||||
jPanel11Layout.setHorizontalGroup(
|
||||
jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel11Layout.setVerticalGroup(
|
||||
jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
avatarPanel.add(jPanel11);
|
||||
|
||||
jPanel12.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
|
||||
jPanel12.setMaximumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel12.setMinimumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel12.setPreferredSize(new java.awt.Dimension(102, 102));
|
||||
|
||||
javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
|
||||
jPanel12.setLayout(jPanel12Layout);
|
||||
jPanel12Layout.setHorizontalGroup(
|
||||
jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel12Layout.setVerticalGroup(
|
||||
jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
avatarPanel.add(jPanel12);
|
||||
|
||||
jPanel13.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
|
||||
jPanel13.setMaximumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel13.setMinimumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel13.setPreferredSize(new java.awt.Dimension(102, 102));
|
||||
|
||||
javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
|
||||
jPanel13.setLayout(jPanel13Layout);
|
||||
jPanel13Layout.setHorizontalGroup(
|
||||
jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel13Layout.setVerticalGroup(
|
||||
jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
avatarPanel.add(jPanel13);
|
||||
|
||||
jPanel14.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
|
||||
jPanel14.setMaximumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel14.setMinimumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel14.setPreferredSize(new java.awt.Dimension(102, 102));
|
||||
|
||||
javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
|
||||
jPanel14.setLayout(jPanel14Layout);
|
||||
jPanel14Layout.setHorizontalGroup(
|
||||
jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel14Layout.setVerticalGroup(
|
||||
jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
avatarPanel.add(jPanel14);
|
||||
|
||||
jPanel15.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
|
||||
jPanel15.setMaximumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel15.setMinimumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel15.setPreferredSize(new java.awt.Dimension(102, 102));
|
||||
|
||||
javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
|
||||
jPanel15.setLayout(jPanel15Layout);
|
||||
jPanel15Layout.setHorizontalGroup(
|
||||
jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel15Layout.setVerticalGroup(
|
||||
jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
jLabel13.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
|
||||
jLabel13.setText("New avatars:");
|
||||
avatarPanel.add(jPanel15);
|
||||
|
||||
jPanel16.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
|
||||
jPanel16.setMaximumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel16.setMinimumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel16.setPreferredSize(new java.awt.Dimension(102, 102));
|
||||
|
||||
javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
|
||||
jPanel16.setLayout(jPanel16Layout);
|
||||
jPanel16Layout.setHorizontalGroup(
|
||||
jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel16Layout.setVerticalGroup(
|
||||
jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
avatarPanel.add(jPanel16);
|
||||
|
||||
jPanel17.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
|
||||
jPanel17.setMaximumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel17.setMinimumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel17.setPreferredSize(new java.awt.Dimension(102, 102));
|
||||
|
||||
javax.swing.GroupLayout jPanel17Layout = new javax.swing.GroupLayout(jPanel17);
|
||||
jPanel17.setLayout(jPanel17Layout);
|
||||
jPanel17Layout.setHorizontalGroup(
|
||||
jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel17Layout.setVerticalGroup(
|
||||
jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
avatarPanel.add(jPanel17);
|
||||
|
||||
jPanel18.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
|
||||
jPanel18.setMaximumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel18.setMinimumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel18.setPreferredSize(new java.awt.Dimension(102, 102));
|
||||
|
||||
javax.swing.GroupLayout jPanel18Layout = new javax.swing.GroupLayout(jPanel18);
|
||||
jPanel18.setLayout(jPanel18Layout);
|
||||
jPanel18Layout.setHorizontalGroup(
|
||||
jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel18Layout.setVerticalGroup(
|
||||
jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
avatarPanel.add(jPanel18);
|
||||
|
||||
jPanel19.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
|
||||
jPanel19.setMaximumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel19.setMinimumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel19.setPreferredSize(new java.awt.Dimension(102, 102));
|
||||
|
||||
javax.swing.GroupLayout jPanel19Layout = new javax.swing.GroupLayout(jPanel19);
|
||||
jPanel19.setLayout(jPanel19Layout);
|
||||
jPanel19Layout.setHorizontalGroup(
|
||||
jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel19Layout.setVerticalGroup(
|
||||
jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
avatarPanel.add(jPanel19);
|
||||
|
||||
jPanel20.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
|
||||
jPanel20.setMaximumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel20.setMinimumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel20.setPreferredSize(new java.awt.Dimension(102, 102));
|
||||
|
||||
javax.swing.GroupLayout jPanel20Layout = new javax.swing.GroupLayout(jPanel20);
|
||||
jPanel20.setLayout(jPanel20Layout);
|
||||
jPanel20Layout.setHorizontalGroup(
|
||||
jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel20Layout.setVerticalGroup(
|
||||
jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
avatarPanel.add(jPanel20);
|
||||
|
||||
jPanel21.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
|
||||
jPanel21.setMaximumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel21.setMinimumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel21.setPreferredSize(new java.awt.Dimension(102, 102));
|
||||
|
||||
javax.swing.GroupLayout jPanel21Layout = new javax.swing.GroupLayout(jPanel21);
|
||||
jPanel21.setLayout(jPanel21Layout);
|
||||
jPanel21Layout.setHorizontalGroup(
|
||||
jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel21Layout.setVerticalGroup(
|
||||
jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 100, Short.MAX_VALUE)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
javax.swing.GroupLayout avatarPanelLayout = new javax.swing.GroupLayout(avatarPanel);
|
||||
avatarPanel.setLayout(avatarPanelLayout);
|
||||
avatarPanelLayout.setHorizontalGroup(
|
||||
avatarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(avatarPanelLayout.createSequentialGroup()
|
||||
.addGroup(avatarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(avatarPanelLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(jLabel12))
|
||||
.addGroup(avatarPanelLayout.createSequentialGroup()
|
||||
.addGroup(avatarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(avatarPanelLayout.createSequentialGroup()
|
||||
.addGap(30, 30, 30)
|
||||
.addGroup(avatarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jPanel19, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(33, 33, 33)
|
||||
.addGroup(avatarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jPanel20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addGroup(avatarPanelLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(avatarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(avatarPanelLayout.createSequentialGroup()
|
||||
.addGap(20, 20, 20)
|
||||
.addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(33, 33, 33)
|
||||
.addComponent(jPanel17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(jLabel13))))
|
||||
.addGap(32, 32, 32)
|
||||
.addGroup(avatarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jPanel18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jPanel21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
avatarPanel.add(jPanel21);
|
||||
|
||||
jPanel22.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
|
||||
jPanel22.setMaximumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel22.setMinimumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel22.setPreferredSize(new java.awt.Dimension(102, 102));
|
||||
|
||||
javax.swing.GroupLayout jPanel22Layout = new javax.swing.GroupLayout(jPanel22);
|
||||
jPanel22.setLayout(jPanel22Layout);
|
||||
jPanel22Layout.setHorizontalGroup(
|
||||
jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
avatarPanelLayout.setVerticalGroup(
|
||||
avatarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(avatarPanelLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(jLabel12)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addGroup(avatarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(26, 26, 26)
|
||||
.addGroup(avatarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(23, 23, 23)
|
||||
.addGroup(avatarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jPanel19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jPanel20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jPanel21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(avatarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(avatarPanelLayout.createSequentialGroup()
|
||||
.addComponent(jLabel13)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(jPanel17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jPanel18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(25, 25, 25))
|
||||
jPanel22Layout.setVerticalGroup(
|
||||
jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
avatarPanel.add(jPanel22);
|
||||
|
||||
jPanel23.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
|
||||
jPanel23.setMaximumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel23.setMinimumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel23.setPreferredSize(new java.awt.Dimension(102, 102));
|
||||
|
||||
javax.swing.GroupLayout jPanel23Layout = new javax.swing.GroupLayout(jPanel23);
|
||||
jPanel23.setLayout(jPanel23Layout);
|
||||
jPanel23Layout.setHorizontalGroup(
|
||||
jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel23Layout.setVerticalGroup(
|
||||
jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
avatarPanel.add(jPanel23);
|
||||
|
||||
jPanel24.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
|
||||
jPanel24.setMaximumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel24.setMinimumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel24.setPreferredSize(new java.awt.Dimension(102, 102));
|
||||
|
||||
javax.swing.GroupLayout jPanel24Layout = new javax.swing.GroupLayout(jPanel24);
|
||||
jPanel24.setLayout(jPanel24Layout);
|
||||
jPanel24Layout.setHorizontalGroup(
|
||||
jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel24Layout.setVerticalGroup(
|
||||
jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
avatarPanel.add(jPanel24);
|
||||
|
||||
jPanel25.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
|
||||
jPanel25.setMaximumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel25.setMinimumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel25.setPreferredSize(new java.awt.Dimension(102, 102));
|
||||
|
||||
javax.swing.GroupLayout jPanel25Layout = new javax.swing.GroupLayout(jPanel25);
|
||||
jPanel25.setLayout(jPanel25Layout);
|
||||
jPanel25Layout.setHorizontalGroup(
|
||||
jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel25Layout.setVerticalGroup(
|
||||
jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
avatarPanel.add(jPanel25);
|
||||
|
||||
jPanel26.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
|
||||
jPanel26.setMaximumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel26.setMinimumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel26.setPreferredSize(new java.awt.Dimension(102, 102));
|
||||
|
||||
javax.swing.GroupLayout jPanel26Layout = new javax.swing.GroupLayout(jPanel26);
|
||||
jPanel26.setLayout(jPanel26Layout);
|
||||
jPanel26Layout.setHorizontalGroup(
|
||||
jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel26Layout.setVerticalGroup(
|
||||
jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
avatarPanel.add(jPanel26);
|
||||
|
||||
jPanel27.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
|
||||
jPanel27.setMaximumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel27.setMinimumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel27.setPreferredSize(new java.awt.Dimension(102, 102));
|
||||
|
||||
javax.swing.GroupLayout jPanel27Layout = new javax.swing.GroupLayout(jPanel27);
|
||||
jPanel27.setLayout(jPanel27Layout);
|
||||
jPanel27Layout.setHorizontalGroup(
|
||||
jPanel27Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel27Layout.setVerticalGroup(
|
||||
jPanel27Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
avatarPanel.add(jPanel27);
|
||||
|
||||
jPanel28.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
|
||||
jPanel28.setMaximumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel28.setMinimumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel28.setPreferredSize(new java.awt.Dimension(102, 102));
|
||||
|
||||
javax.swing.GroupLayout jPanel28Layout = new javax.swing.GroupLayout(jPanel28);
|
||||
jPanel28.setLayout(jPanel28Layout);
|
||||
jPanel28Layout.setHorizontalGroup(
|
||||
jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel28Layout.setVerticalGroup(
|
||||
jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
avatarPanel.add(jPanel28);
|
||||
|
||||
jPanel29.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
|
||||
jPanel29.setMaximumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel29.setMinimumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel29.setPreferredSize(new java.awt.Dimension(102, 102));
|
||||
|
||||
javax.swing.GroupLayout jPanel29Layout = new javax.swing.GroupLayout(jPanel29);
|
||||
jPanel29.setLayout(jPanel29Layout);
|
||||
jPanel29Layout.setHorizontalGroup(
|
||||
jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel29Layout.setVerticalGroup(
|
||||
jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
avatarPanel.add(jPanel29);
|
||||
|
||||
jPanel30.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
|
||||
jPanel30.setMaximumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel30.setMinimumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel30.setPreferredSize(new java.awt.Dimension(102, 102));
|
||||
|
||||
javax.swing.GroupLayout jPanel30Layout = new javax.swing.GroupLayout(jPanel30);
|
||||
jPanel30.setLayout(jPanel30Layout);
|
||||
jPanel30Layout.setHorizontalGroup(
|
||||
jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel30Layout.setVerticalGroup(
|
||||
jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
avatarPanel.add(jPanel30);
|
||||
|
||||
jPanel31.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
|
||||
jPanel31.setMaximumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel31.setMinimumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel31.setPreferredSize(new java.awt.Dimension(102, 102));
|
||||
|
||||
javax.swing.GroupLayout jPanel31Layout = new javax.swing.GroupLayout(jPanel31);
|
||||
jPanel31.setLayout(jPanel31Layout);
|
||||
jPanel31Layout.setHorizontalGroup(
|
||||
jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel31Layout.setVerticalGroup(
|
||||
jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
avatarPanel.add(jPanel31);
|
||||
|
||||
jPanel32.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
|
||||
jPanel32.setMaximumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel32.setMinimumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel32.setPreferredSize(new java.awt.Dimension(102, 102));
|
||||
|
||||
javax.swing.GroupLayout jPanel32Layout = new javax.swing.GroupLayout(jPanel32);
|
||||
jPanel32.setLayout(jPanel32Layout);
|
||||
jPanel32Layout.setHorizontalGroup(
|
||||
jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel32Layout.setVerticalGroup(
|
||||
jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
avatarPanel.add(jPanel32);
|
||||
|
||||
jPanel33.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true));
|
||||
jPanel33.setMaximumSize(new java.awt.Dimension(102, 102));
|
||||
jPanel33.setMinimumSize(new java.awt.Dimension(102, 102));
|
||||
|
||||
javax.swing.GroupLayout jPanel33Layout = new javax.swing.GroupLayout(jPanel33);
|
||||
jPanel33.setLayout(jPanel33Layout);
|
||||
jPanel33Layout.setHorizontalGroup(
|
||||
jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel33Layout.setVerticalGroup(
|
||||
jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 110, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
avatarPanel.add(jPanel33);
|
||||
|
||||
avatarPane.setViewportView(avatarPanel);
|
||||
|
||||
javax.swing.GroupLayout tabAvatarsLayout = new javax.swing.GroupLayout(tabAvatars);
|
||||
tabAvatars.setLayout(tabAvatarsLayout);
|
||||
tabAvatarsLayout.setHorizontalGroup(
|
||||
tabAvatarsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(avatarPane, javax.swing.GroupLayout.DEFAULT_SIZE, 590, Short.MAX_VALUE)
|
||||
.addGroup(tabAvatarsLayout.createSequentialGroup()
|
||||
.addComponent(avatarPane, javax.swing.GroupLayout.PREFERRED_SIZE, 527, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
);
|
||||
tabAvatarsLayout.setVerticalGroup(
|
||||
tabAvatarsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(avatarPane, javax.swing.GroupLayout.DEFAULT_SIZE, 432, Short.MAX_VALUE)
|
||||
.addComponent(avatarPane, javax.swing.GroupLayout.PREFERRED_SIZE, 418, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
tabsPanel.addTab("Avatars", tabAvatars);
|
||||
|
@ -1629,7 +1835,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.addContainerGap()
|
||||
.addComponent(lblURLServerList, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(txtURLServerList, javax.swing.GroupLayout.PREFERRED_SIZE, 421, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(txtURLServerList, javax.swing.GroupLayout.PREFERRED_SIZE, 370, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(connection_serversLayout.createSequentialGroup()
|
||||
.addGap(141, 141, 141)
|
||||
.addComponent(jLabel17)))
|
||||
|
@ -1651,15 +1857,14 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
tabConnectionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(tabConnectionLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(tabConnectionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(tabConnectionLayout.createSequentialGroup()
|
||||
.addGroup(tabConnectionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
||||
.addComponent(pnlProxySettings, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, tabConnectionLayout.createSequentialGroup()
|
||||
.addComponent(lblProxyType)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(cbProxyType, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
.addComponent(pnlProxySettings, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(cbProxyType, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(connection_servers, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addContainerGap())
|
||||
.addContainerGap(16, Short.MAX_VALUE))
|
||||
);
|
||||
tabConnectionLayout.setVerticalGroup(
|
||||
tabConnectionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
|
@ -1672,7 +1877,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.addComponent(cbProxyType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(pnlProxySettings, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap(90, Short.MAX_VALUE))
|
||||
.addContainerGap(107, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
pnlProxySettings.getAccessibleContext().setAccessibleDescription("");
|
||||
|
@ -1700,12 +1905,12 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addContainerGap(405, Short.MAX_VALUE)
|
||||
.addComponent(saveButton)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap())
|
||||
.addComponent(tabsPanel)
|
||||
.addComponent(tabsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
|
@ -1795,10 +2000,11 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
save(prefs, dialog.txtURLServerList, KEY_CONNECTION_URL_SERVER_LIST);
|
||||
|
||||
// Avatar
|
||||
if (available_avatars.contains(selectedAvatarId)) {
|
||||
prefs.put(KEY_AVATAR, String.valueOf(selectedAvatarId));
|
||||
updateCache(KEY_AVATAR, String.valueOf(selectedAvatarId));
|
||||
if (selectedAvatarId < MIN_AVATAR_ID || selectedAvatarId > MAX_AVATAR_ID) {
|
||||
selectedAvatarId = DEFAULT_AVATAR_ID;
|
||||
}
|
||||
prefs.put(KEY_AVATAR, String.valueOf(selectedAvatarId));
|
||||
updateCache(KEY_AVATAR, String.valueOf(selectedAvatarId));
|
||||
|
||||
try {
|
||||
MageFrame.getSession().updatePreferencesForServer(getUserData());
|
||||
|
@ -2275,7 +2481,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
} catch (NumberFormatException n) {
|
||||
selectedAvatarId = DEFAULT_AVATAR_ID;
|
||||
} finally {
|
||||
if (!available_avatars.contains(selectedAvatarId)) {
|
||||
if (selectedAvatarId < MIN_AVATAR_ID || selectedAvatarId > MAX_AVATAR_ID) {
|
||||
selectedAvatarId = DEFAULT_AVATAR_ID;
|
||||
}
|
||||
}
|
||||
|
@ -2359,6 +2565,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
private static void load(Preferences prefs, JCheckBox checkBox, String propName, String yesValue, String defaultValue) {
|
||||
String prop = prefs.get(propName, defaultValue);
|
||||
checkBox.setSelected(prop.equals(yesValue));
|
||||
updateCache(propName, prop);
|
||||
}
|
||||
|
||||
private static void load(Preferences prefs, JTextField field, String propName, String defaultValue) {
|
||||
|
@ -2441,26 +2648,37 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
|
||||
private void addAvatars() {
|
||||
try {
|
||||
addAvatar(jPanel10, 51, true, false);
|
||||
addAvatar(jPanel10, 10, true, false);
|
||||
addAvatar(jPanel11, 11, false, false);
|
||||
addAvatar(jPanel12, 12, false, false);
|
||||
addAvatar(jPanel13, 13, false, false);
|
||||
addAvatar(jPanel11, 9, false, false);
|
||||
addAvatar(jPanel12, 53, false, false);
|
||||
addAvatar(jPanel14, 10, false, false);
|
||||
addAvatar(jPanel15, 39, false, false);
|
||||
addAvatar(jPanel14, 14, false, false);
|
||||
addAvatar(jPanel15, 15, false, false);
|
||||
addAvatar(jPanel16, 16, false, false);
|
||||
addAvatar(jPanel17, 17, false, false);
|
||||
addAvatar(jPanel18, 18, false, false);
|
||||
addAvatar(jPanel19, 19, false, false);
|
||||
addAvatar(jPanel20, 30, false, false);
|
||||
addAvatar(jPanel21, 25, false, false);
|
||||
addAvatar(jPanel20, 20, false, false);
|
||||
addAvatar(jPanel21, 21, false, false);
|
||||
addAvatar(jPanel22, 22, false, false);
|
||||
addAvatar(jPanel23, 23, false, false);
|
||||
addAvatar(jPanel24, 24, false, false);
|
||||
addAvatar(jPanel25, 25, false, false);
|
||||
addAvatar(jPanel26, 26, false, false);
|
||||
addAvatar(jPanel27, 27, false, false);
|
||||
addAvatar(jPanel28, 28, false, false);
|
||||
addAvatar(jPanel29, 29, false, false);
|
||||
addAvatar(jPanel30, 30, false, false);
|
||||
addAvatar(jPanel31, 31, false, false);
|
||||
addAvatar(jPanel32, 32, false, false);
|
||||
|
||||
addAvatar(jPanel16, 22, false, false);
|
||||
addAvatar(jPanel17, 77, false, false);
|
||||
addAvatar(jPanel18, 62, false, false);
|
||||
} catch (Exception e) {
|
||||
log.error(e, e);
|
||||
}
|
||||
}
|
||||
|
||||
public void setSelectedId(int id) {
|
||||
if (available_avatars.contains(id)) {
|
||||
if (id >= MIN_AVATAR_ID && id <= MAX_AVATAR_ID) {
|
||||
for (JPanel panel : panels.values()) {
|
||||
panel.setBorder(BLACK_BORDER);
|
||||
}
|
||||
|
@ -2473,7 +2691,8 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
String path = "/avatars/" + String.valueOf(id) + ".jpg";
|
||||
panels.put(id, jPanel);
|
||||
Image image = ImageHelper.getImageFromResources(path);
|
||||
Rectangle r = new Rectangle(90, 90);
|
||||
|
||||
Rectangle r = new Rectangle(jPanel.getWidth() - 5, jPanel.getHeight() - 5);
|
||||
BufferedImage bufferedImage;
|
||||
if (!locked) {
|
||||
bufferedImage = BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB);
|
||||
|
@ -2571,8 +2790,6 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
private javax.swing.JCheckBox displayBigCardsInHand;
|
||||
private javax.swing.JButton exitButton;
|
||||
private javax.swing.JLabel jLabel11;
|
||||
private javax.swing.JLabel jLabel12;
|
||||
private javax.swing.JLabel jLabel13;
|
||||
private javax.swing.JLabel jLabel14;
|
||||
private javax.swing.JLabel jLabel15;
|
||||
private javax.swing.JLabel jLabel16;
|
||||
|
@ -2599,6 +2816,18 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
private javax.swing.JPanel jPanel19;
|
||||
private javax.swing.JPanel jPanel20;
|
||||
private javax.swing.JPanel jPanel21;
|
||||
private javax.swing.JPanel jPanel22;
|
||||
private javax.swing.JPanel jPanel23;
|
||||
private javax.swing.JPanel jPanel24;
|
||||
private javax.swing.JPanel jPanel25;
|
||||
private javax.swing.JPanel jPanel26;
|
||||
private javax.swing.JPanel jPanel27;
|
||||
private javax.swing.JPanel jPanel28;
|
||||
private javax.swing.JPanel jPanel29;
|
||||
private javax.swing.JPanel jPanel30;
|
||||
private javax.swing.JPanel jPanel31;
|
||||
private javax.swing.JPanel jPanel32;
|
||||
private javax.swing.JPanel jPanel33;
|
||||
private javax.swing.JLabel labelPreferedImageLanguage;
|
||||
private javax.swing.JLabel lblProxyPassword;
|
||||
private javax.swing.JLabel lblProxyPort;
|
||||
|
|
|
@ -69,6 +69,9 @@ import mage.client.util.ImageHelper;
|
|||
import mage.client.util.gui.BufferedImageBuilder;
|
||||
import mage.client.util.gui.countryBox.CountryUtil;
|
||||
import mage.components.ImagePanel;
|
||||
import static mage.constants.Constants.DEFAULT_AVATAR_ID;
|
||||
import static mage.constants.Constants.MAX_AVATAR_ID;
|
||||
import static mage.constants.Constants.MIN_AVATAR_ID;
|
||||
import mage.constants.ManaType;
|
||||
import mage.remote.Session;
|
||||
import mage.utils.timer.PriorityTimer;
|
||||
|
@ -92,7 +95,7 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
|
||||
private static final int AVATAR_COUNT = 77;
|
||||
|
||||
private static final String DEFAULT_AVATAR_PATH = "/avatars/51.jpg";
|
||||
private static final String DEFAULT_AVATAR_PATH = "/avatars/" + DEFAULT_AVATAR_ID + ".jpg";
|
||||
|
||||
private static final int PANEL_WIDTH = 94;
|
||||
private static final int PANEL_HEIGHT = 242;
|
||||
|
@ -238,8 +241,8 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
|
||||
if (!MageFrame.isLite()) {
|
||||
int id = player.getUserData().getAvatarId();
|
||||
if (id <= 0) {
|
||||
id = PreferencesDialog.DEFAULT_AVATAR_ID;
|
||||
if (!(id >= 1000) && (id <= 0 || (id <= MIN_AVATAR_ID && id > MAX_AVATAR_ID))) {
|
||||
id = DEFAULT_AVATAR_ID;
|
||||
}
|
||||
if (id != avatarId) {
|
||||
avatarId = id;
|
||||
|
|
|
@ -25,8 +25,8 @@ import org.mage.plugins.card.utils.CardImageUtils;
|
|||
|
||||
/**
|
||||
* This class stores ALL card images in a cache with soft values. this means
|
||||
* that the images may be garbage collected when they are not needed any more, but will
|
||||
* be kept as long as possible.
|
||||
* that the images may be garbage collected when they are not needed any more,
|
||||
* but will be kept as long as possible.
|
||||
*
|
||||
* Key format: "<cardname>#<setname>#<type>#<collectorID>#<param>"
|
||||
*
|
||||
|
@ -46,8 +46,7 @@ public class ImageCache {
|
|||
private static final Map<String, BufferedImage> imageCache;
|
||||
|
||||
/**
|
||||
* Common pattern for keys.
|
||||
* Format: "<cardname>#<setname>#<collectorID>"
|
||||
* Common pattern for keys. Format: "<cardname>#<setname>#<collectorID>"
|
||||
*/
|
||||
private static final Pattern KEY_PATTERN = Pattern.compile("(.*)#(.*)#(.*)#(.*)#(.*)");
|
||||
|
||||
|
@ -104,16 +103,16 @@ public class ImageCache {
|
|||
thumbnailFile = new TFile(thumbnailPath);
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
boolean exists =false;
|
||||
boolean exists = false;
|
||||
if (thumbnailFile != null) {
|
||||
try {
|
||||
exists = thumbnailFile.exists();
|
||||
} catch(Exception ex) {
|
||||
} catch (Exception ex) {
|
||||
exists = false;
|
||||
}
|
||||
}
|
||||
if (exists) {
|
||||
log.debug("loading thumbnail for " + key + ", path="+thumbnailPath);
|
||||
log.debug("loading thumbnail for " + key + ", path=" + thumbnailPath);
|
||||
return loadImage(thumbnailFile);
|
||||
} else {
|
||||
BufferedImage image = loadImage(file);
|
||||
|
@ -187,30 +186,15 @@ public class ImageCache {
|
|||
}
|
||||
|
||||
public static BufferedImage getThumbnail(CardView card) {
|
||||
String key = getKey(card) + "#thumb";
|
||||
if (card.getUsesVariousArt()) {
|
||||
key += "#usesVariousArt";
|
||||
}
|
||||
// log.debug("#key: " + key);
|
||||
return getImage(key);
|
||||
return getImage(getKey(card, card.getName(), "#thumb"));
|
||||
}
|
||||
|
||||
public static BufferedImage getImageOriginal(CardView card) {
|
||||
String key = getKey(card);
|
||||
if (card.getUsesVariousArt()) {
|
||||
key += "#usesVariousArt";
|
||||
}
|
||||
// log.warn("#key: " + key);
|
||||
return getImage(key);
|
||||
return getImage(getKey(card, card.getName(), ""));
|
||||
}
|
||||
|
||||
public static BufferedImage getImageOriginalAlternateName(CardView card) {
|
||||
String key = getKeyAlternateName(card, card.getAlternateName());
|
||||
if (card.getUsesVariousArt()) {
|
||||
key += "#usesVariousArt";
|
||||
}
|
||||
// log.warn("#key: " + key);
|
||||
return getImage(key);
|
||||
return getImage(getKey(card, card.getAlternateName(), ""));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -230,7 +214,7 @@ public class ImageCache {
|
|||
if (ex.getCause() instanceof NullPointerException) {
|
||||
return null;
|
||||
}
|
||||
log.error(ex,ex);
|
||||
log.error(ex, ex);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -238,32 +222,25 @@ public class ImageCache {
|
|||
/**
|
||||
* Returns the map key for a card, without any suffixes for the image size.
|
||||
*/
|
||||
private static String getKey(CardView card) {
|
||||
StringBuilder sb = new StringBuilder(card.getName()).append("#");
|
||||
sb.append(card.getExpansionSetCode()).append("#");
|
||||
sb.append(card.getType()).append("#");
|
||||
sb.append(card.getCardNumber()).append("#");
|
||||
sb.append(card.getTokenSetCode() == null ? "":card.getTokenSetCode());
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the map key for the flip image of a card, without any suffixes for the image size.
|
||||
*/
|
||||
private static String getKeyAlternateName(CardView card, String alternateName) {
|
||||
StringBuilder sb = new StringBuilder(alternateName).append("#");
|
||||
sb.append(card.getExpansionSetCode()).append("#");
|
||||
sb.append(card.getType()).append("#");
|
||||
sb.append(card.getCardNumber()).append("#");
|
||||
sb.append(card.getTokenSetCode() == null ? "":card.getTokenSetCode());
|
||||
return sb.toString();
|
||||
private static String getKey(CardView card, String name, String suffix) {
|
||||
return name + "#" + card.getExpansionSetCode() + "#" + card.getType() + "#" + card.getCardNumber() + "#"
|
||||
+ (card.getTokenSetCode() == null ? "" : card.getTokenSetCode())
|
||||
+ suffix
|
||||
+ (card.getUsesVariousArt() ? "#usesVariousArt" : "");
|
||||
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Returns the map key for the flip image of a card, without any suffixes for the image size.
|
||||
// */
|
||||
// private static String getKeyAlternateName(CardView card, String alternateName) {
|
||||
// return alternateName + "#" + card.getExpansionSetCode() + "#" +card.getType()+ "#" + card.getCardNumber() + "#"
|
||||
// + (card.getTokenSetCode() == null ? "":card.getTokenSetCode());
|
||||
// }
|
||||
/**
|
||||
* Load image from file
|
||||
*
|
||||
* @param file
|
||||
* file to load image from
|
||||
* @param file file to load image from
|
||||
* @return {@link BufferedImage}
|
||||
*/
|
||||
public static BufferedImage loadImage(TFile file) {
|
||||
|
@ -297,7 +274,7 @@ public class ImageCache {
|
|||
ImageIO.write(image, "jpg", outputStream);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(e,e);
|
||||
log.error(e, e);
|
||||
imageFile.delete();
|
||||
}
|
||||
return image;
|
||||
|
@ -305,6 +282,7 @@ public class ImageCache {
|
|||
|
||||
/**
|
||||
* Returns an image scaled to the size given
|
||||
*
|
||||
* @param original
|
||||
* @return
|
||||
*/
|
||||
|
@ -344,6 +322,7 @@ public class ImageCache {
|
|||
/**
|
||||
* Returns an image scaled to the size appropriate for the card picture
|
||||
* panel
|
||||
*
|
||||
* @param original
|
||||
* @param sizeNeed
|
||||
* @return
|
||||
|
@ -356,6 +335,7 @@ public class ImageCache {
|
|||
|
||||
/**
|
||||
* Returns the image appropriate to display the card in the picture panel
|
||||
*
|
||||
* @param card
|
||||
* @param width
|
||||
* @param height
|
||||
|
@ -365,11 +345,7 @@ public class ImageCache {
|
|||
if (Constants.THUMBNAIL_SIZE_FULL.width + 10 > width) {
|
||||
return getThumbnail(card);
|
||||
}
|
||||
String key = getKey(card);
|
||||
if (card.getUsesVariousArt()) {
|
||||
key += "#usesVariousArt";
|
||||
}
|
||||
// log.warn("getImage: " + key);
|
||||
String key = getKey(card, card.getName(), "");
|
||||
BufferedImage original = getImage(key);
|
||||
if (original == null) {
|
||||
log.debug(key + " not found");
|
||||
|
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 6.3 KiB |
BIN
Mage.Client/src/main/resources/avatars/11.jpg
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
Mage.Client/src/main/resources/avatars/12.jpg
Normal file
After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.4 KiB |
BIN
Mage.Client/src/main/resources/avatars/15.jpg
Normal file
After Width: | Height: | Size: 7.6 KiB |
BIN
Mage.Client/src/main/resources/avatars/16.jpg
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
Mage.Client/src/main/resources/avatars/17.jpg
Normal file
After Width: | Height: | Size: 7 KiB |
BIN
Mage.Client/src/main/resources/avatars/18.jpg
Normal file
After Width: | Height: | Size: 9 KiB |
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7 KiB |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
BIN
Mage.Client/src/main/resources/avatars/21.jpg
Normal file
After Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 6 KiB After Width: | Height: | Size: 6 KiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.5 KiB |
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 7 KiB After Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 9 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 7 KiB |
Before Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 10 KiB |
BIN
Mage.Client/src/main/resources/avatars/special/21.gif
Normal file
After Width: | Height: | Size: 23 KiB |
|
@ -67,6 +67,10 @@ public final class Constants {
|
|||
|
||||
public static final double SCALE_FACTOR = 0.5;
|
||||
|
||||
public static final int MIN_AVATAR_ID = 10;
|
||||
public static final int MAX_AVATAR_ID = 32;
|
||||
public static final int DEFAULT_AVATAR_ID = 10;
|
||||
|
||||
/**
|
||||
* Time each player has during the game to play using his\her priority.
|
||||
*/
|
||||
|
|
|
@ -41,7 +41,7 @@ public class MageVersion implements Serializable, Comparable<MageVersion> {
|
|||
public final static int MAGE_VERSION_MAJOR = 1;
|
||||
public final static int MAGE_VERSION_MINOR = 4;
|
||||
public final static int MAGE_VERSION_PATCH = 4;
|
||||
public final static String MAGE_VERSION_MINOR_PATCH = "v4";
|
||||
public final static String MAGE_VERSION_MINOR_PATCH = "v7";
|
||||
public final static String MAGE_VERSION_INFO = "";
|
||||
|
||||
private final int major;
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.deck;
|
||||
|
||||
import mage.cards.decks.Constructed;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
*/
|
||||
public class BattleForZendikarBlock extends Constructed {
|
||||
|
||||
public BattleForZendikarBlock() {
|
||||
super("Constructed - Battle for Zendikar Block");
|
||||
setCodes.add("BFZ");
|
||||
setCodes.add("OGW");
|
||||
}
|
||||
}
|
|
@ -64,11 +64,12 @@ public class DuelCommander extends Commander {
|
|||
banned.add("Mox Pearl");
|
||||
banned.add("Mox Ruby");
|
||||
banned.add("Mox Sapphire");
|
||||
banned.add("Mystical Tutor"); // banned effective July 17, 2015
|
||||
banned.add("Mystical Tutor");
|
||||
banned.add("Natural Order");
|
||||
banned.add("Necropotence");
|
||||
banned.add("Oath of Druids");
|
||||
banned.add("Protean Hulk");
|
||||
banned.add("Sensei's Divining Top");
|
||||
banned.add("Serra Ascendant");
|
||||
banned.add("Shahrazad");
|
||||
banned.add("Sol Ring");
|
||||
|
|
|
@ -46,7 +46,6 @@ public class Legacy extends Constructed {
|
|||
banned.add("Balance");
|
||||
banned.add("Bazaar of Baghdad");
|
||||
banned.add("Black Lotus");
|
||||
banned.add("Black Vise");
|
||||
banned.add("Brago's Favor");
|
||||
banned.add("Bronze Tablet");
|
||||
banned.add("Channel");
|
||||
|
@ -56,6 +55,7 @@ public class Legacy extends Constructed {
|
|||
banned.add("Demonic Attorney");
|
||||
banned.add("Demonic Consultation");
|
||||
banned.add("Demonic Tutor");
|
||||
banned.add("Dig Through Time");
|
||||
banned.add("Double Stroke");
|
||||
banned.add("Earthcraft");
|
||||
banned.add("Falling Star");
|
||||
|
@ -104,7 +104,7 @@ public class Legacy extends Constructed {
|
|||
banned.add("Timmerian Fiends");
|
||||
banned.add("Tinker");
|
||||
banned.add("Tolarian Academy");
|
||||
banned.add("Treasure Cruise"); // banned effective January 23, 2015
|
||||
banned.add("Treasure Cruise");
|
||||
banned.add("Unexpected Potential");
|
||||
banned.add("Vampiric Tutor");
|
||||
banned.add("Wheel of Fortune");
|
||||
|
|
|
@ -70,8 +70,10 @@ public class Vintage extends Constructed {
|
|||
restricted.add("Black Lotus");
|
||||
restricted.add("Brainstorm");
|
||||
restricted.add("Channel");
|
||||
restricted.add("Chalice of the Void");
|
||||
restricted.add("Demonic Consultation");
|
||||
restricted.add("Demonic Tutor");
|
||||
restricted.add("Dig Through Time");
|
||||
restricted.add("Fastbond");
|
||||
restricted.add("Flash");
|
||||
restricted.add("Imperial Seal");
|
||||
|
@ -93,13 +95,12 @@ public class Vintage extends Constructed {
|
|||
restricted.add("Ponder");
|
||||
restricted.add("Sol Ring");
|
||||
restricted.add("Strip Mine");
|
||||
restricted.add("Thirst for Knowledge");
|
||||
restricted.add("Time Vault");
|
||||
restricted.add("Time Walk");
|
||||
restricted.add("Timetwister");
|
||||
restricted.add("Tinker");
|
||||
restricted.add("Tolarian Academy");
|
||||
restricted.add("Treasure Cruise"); // banned effective January 23, 2015
|
||||
restricted.add("Treasure Cruise");
|
||||
restricted.add("Trinisphere");
|
||||
restricted.add("Vampiric Tutor");
|
||||
restricted.add("Wheel of Fortune");
|
||||
|
|
|
@ -92,6 +92,7 @@
|
|||
<deckType name="Variant Magic - Commander" jar="mage-deck-constructed.jar" className="mage.deck.Commander"/>
|
||||
<deckType name="Variant Magic - Duel Commander" jar="mage-deck-constructed.jar" className="mage.deck.DuelCommander"/>
|
||||
<deckType name="Variant Magic - Tiny Leaders" jar="mage-deck-constructed.jar" className="mage.deck.TinyLeaders"/>
|
||||
<deckType name="Block Constructed - Battle for Zendikar" jar="mage-deck-constructed.jar" className="mage.deck.BattleForZendikarBlock"/>
|
||||
<deckType name="Block Constructed - Innistrad" jar="mage-deck-constructed.jar" className="mage.deck.InnistradBlock"/>
|
||||
<deckType name="Block Constructed - Kamigawa" jar="mage-deck-constructed.jar" className="mage.deck.KamigawaBlock"/>
|
||||
<deckType name="Block Constructed - Khans of Tarkir" jar="mage-deck-constructed.jar" className="mage.deck.KhansOfTarkirBlock"/>
|
||||
|
|
|
@ -71,6 +71,7 @@
|
|||
<deckType name="Variant Magic - Commander" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.Commander"/>
|
||||
<deckType name="Variant Magic - Duel Commander" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.DuelCommander"/>
|
||||
<deckType name="Variant Magic - Tiny Leaders" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.TinyLeaders"/>
|
||||
<deckType name="Block Constructed - Battle for Zendikar" jar="mage-deck-constructed.jar" className="mage.deck.BattleForZendikarBlock"/>
|
||||
<deckType name="Block Constructed - Innistrad" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.InnistradBlock"/>
|
||||
<deckType name="Block Constructed - Kamigawa" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.KamigawaBlock"/>
|
||||
<deckType name="Block Constructed - Khans of Tarkir" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.KhansOfTarkirBlock"/>
|
||||
|
|
|
@ -36,6 +36,7 @@ import java.util.concurrent.locks.ReentrantLock;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import mage.MageException;
|
||||
import mage.constants.Constants;
|
||||
import mage.interfaces.callback.ClientCallback;
|
||||
import mage.players.net.UserData;
|
||||
import mage.players.net.UserGroup;
|
||||
|
@ -91,15 +92,15 @@ public class Session {
|
|||
return "User name Admin already in use";
|
||||
}
|
||||
if (userName.length() > ConfigSettings.getInstance().getMaxUserNameLength()) {
|
||||
return new StringBuilder("User name may not be longer than ").append(ConfigSettings.getInstance().getMaxUserNameLength()).append(" characters").toString();
|
||||
return "User name may not be longer than " + ConfigSettings.getInstance().getMaxUserNameLength() + " characters";
|
||||
}
|
||||
if (userName.length() < ConfigSettings.getInstance().getMinUserNameLength()) {
|
||||
return new StringBuilder("User name may not be shorter than ").append(ConfigSettings.getInstance().getMinUserNameLength()).append(" characters").toString();
|
||||
return "User name may not be shorter than " + ConfigSettings.getInstance().getMinUserNameLength() + " characters";
|
||||
}
|
||||
Pattern p = Pattern.compile(ConfigSettings.getInstance().getUserNamePattern(), Pattern.CASE_INSENSITIVE);
|
||||
Matcher m = p.matcher(userName);
|
||||
if (m.find()) {
|
||||
return new StringBuilder("User name '").append(userName).append("' includes not allowed characters: use a-z, A-Z and 0-9").toString();
|
||||
return "User name '" + userName + "' includes not allowed characters: use a-z, A-Z and 0-9";
|
||||
}
|
||||
User user = UserManager.getInstance().createUser(userName, host);
|
||||
boolean reconnect = false;
|
||||
|
@ -117,11 +118,11 @@ public class Session {
|
|||
SessionManager.getInstance().disconnect(user.getSessionId(), DisconnectReason.ConnectingOtherInstance);
|
||||
}
|
||||
} else {
|
||||
return new StringBuilder("User name ").append(userName).append(" already in use (or your IP address changed)").toString();
|
||||
return "User name " + userName + " already in use (or your IP address changed)";
|
||||
}
|
||||
}
|
||||
if (!UserManager.getInstance().connectToSession(sessionId, user.getId())) {
|
||||
return new StringBuilder("Error connecting ").append(userName).toString();
|
||||
return "Error connecting " + userName;
|
||||
}
|
||||
this.userId = user.getId();
|
||||
if (reconnect) { // must be connected to receive the message
|
||||
|
@ -157,7 +158,11 @@ public class Session {
|
|||
} else {
|
||||
user.getUserData().update(userData);
|
||||
}
|
||||
if (user.getUserData().getAvatarId() == 51) {
|
||||
if (user.getUserData().getAvatarId() < Constants.MIN_AVATAR_ID
|
||||
|| user.getUserData().getAvatarId() > Constants.MAX_AVATAR_ID) {
|
||||
user.getUserData().setAvatarId(Constants.DEFAULT_AVATAR_ID);
|
||||
}
|
||||
if (user.getUserData().getAvatarId() == 11) {
|
||||
user.getUserData().setAvatarId(updateAvatar(user.getName()));
|
||||
}
|
||||
return true;
|
||||
|
@ -169,22 +174,16 @@ public class Session {
|
|||
//TODO: move to separate class
|
||||
//TODO: add for checking for private key
|
||||
switch (userName) {
|
||||
case "nantuko":
|
||||
return 1000;
|
||||
case "North":
|
||||
return 1006;
|
||||
case "BetaSteward":
|
||||
return 1008;
|
||||
case "loki":
|
||||
return 1012;
|
||||
case "Ayrat":
|
||||
return 1018;
|
||||
case "Bandit":
|
||||
return 1020;
|
||||
case "Wehk":
|
||||
return 66;
|
||||
case "fireshoes":
|
||||
return 1021;
|
||||
}
|
||||
return 51;
|
||||
return 11;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
|
|
|
@ -34,7 +34,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Rarity;
|
||||
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
||||
import mage.abilities.costs.AlternativeCostSourceAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
|
||||
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.mana.BlueManaAbility;
|
||||
import mage.abilities.mana.WhiteManaAbility;
|
||||
|
@ -64,7 +64,7 @@ public class FieldmistBorderpost extends CardImpl {
|
|||
|
||||
// You may pay {1} and return a basic land you control to its owner's hand rather than pay Fieldmist Borderpost's mana cost.
|
||||
Ability ability = new AlternativeCostSourceAbility(new GenericManaCost(1));
|
||||
ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter)));
|
||||
ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter)));
|
||||
this.addAbility(ability);
|
||||
|
||||
// Fieldmist Borderpost enters the battlefield tapped.
|
||||
|
|
|
@ -32,7 +32,7 @@ import java.util.UUID;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
||||
import mage.abilities.costs.AlternativeCostSourceAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
|
||||
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.mana.GreenManaAbility;
|
||||
import mage.abilities.mana.RedManaAbility;
|
||||
|
@ -64,7 +64,7 @@ public class FirewildBorderpost extends CardImpl {
|
|||
|
||||
// You may pay {1} and return a basic land you control to its owner's hand rather than pay Firewild Borderpost's mana cost.
|
||||
Ability ability = new AlternativeCostSourceAbility(new GenericManaCost(1));
|
||||
ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter)));
|
||||
ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter)));
|
||||
this.addAbility(ability);
|
||||
|
||||
// Veinfire Firewild enters the battlefield tapped.
|
||||
|
|
|
@ -30,17 +30,14 @@ package mage.sets.alarareborn;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.filter.predicate.mageobject.MulticoloredPredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -48,17 +45,23 @@ import mage.game.stack.Spell;
|
|||
*/
|
||||
public class GloryscaleViashino extends CardImpl {
|
||||
|
||||
private static final FilterSpell filter = new FilterSpell("a multicolored spell");
|
||||
|
||||
static {
|
||||
filter.add(new MulticoloredPredicate());
|
||||
}
|
||||
|
||||
public GloryscaleViashino (UUID ownerId) {
|
||||
super(ownerId, 120, "Gloryscale Viashino", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{G}{W}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.subtype.add("Viashino");
|
||||
this.subtype.add("Soldier");
|
||||
|
||||
|
||||
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
this.addAbility(new GloryscaleViashinoAbility());
|
||||
|
||||
// Whenever you cast a multicolored spell, Gloryscale Viashino gets +3/+3 until end of turn.
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(new BoostSourceEffect(3, 3, Duration.EndOfTurn), filter, false));
|
||||
}
|
||||
|
||||
public GloryscaleViashino (final GloryscaleViashino card) {
|
||||
|
@ -69,36 +72,4 @@ public class GloryscaleViashino extends CardImpl {
|
|||
public GloryscaleViashino copy() {
|
||||
return new GloryscaleViashino(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class GloryscaleViashinoAbility extends TriggeredAbilityImpl {
|
||||
public GloryscaleViashinoAbility() {
|
||||
super(Zone.BATTLEFIELD, new BoostSourceEffect(3, 3, Duration.EndOfTurn));
|
||||
}
|
||||
|
||||
public GloryscaleViashinoAbility(final GloryscaleViashinoAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GloryscaleViashinoAbility copy() {
|
||||
return new GloryscaleViashinoAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == EventType.SPELL_CAST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
return spell != null && spell.getColor(game).isMulticolored() && event.getPlayerId().equals(getControllerId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever you cast a multicolored spell, {this} gets +3/+3 until end of turn.";
|
||||
}
|
||||
}
|
|
@ -27,21 +27,28 @@
|
|||
*/
|
||||
package mage.sets.alarareborn;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.keyword.CascadeAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.constants.WatcherScope;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.game.stack.StackObject;
|
||||
import mage.players.Player;
|
||||
import mage.watchers.Watcher;
|
||||
|
||||
/**
|
||||
|
@ -55,7 +62,7 @@ public class MaelstromNexus extends CardImpl {
|
|||
this.expansionSetCode = "ARB";
|
||||
|
||||
// The first spell you cast each turn has cascade.
|
||||
this.addAbility(new MaelstromNexusTriggeredAbility(), new FirstSpellCastThisTurnWatcher());
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MaelstromNexusGainCascadeFirstSpellEffect()), new FirstSpellCastThisTurnWatcher());
|
||||
|
||||
}
|
||||
|
||||
|
@ -69,52 +76,51 @@ public class MaelstromNexus extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class MaelstromNexusTriggeredAbility extends TriggeredAbilityImpl {
|
||||
class MaelstromNexusGainCascadeFirstSpellEffect extends ContinuousEffectImpl {
|
||||
|
||||
public MaelstromNexusTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new CascadeEffect());
|
||||
private Ability cascadeAbility = new CascadeAbility();
|
||||
|
||||
public MaelstromNexusGainCascadeFirstSpellEffect() {
|
||||
super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
|
||||
staticText = "The first spell you cast each turn has cascade";
|
||||
}
|
||||
|
||||
public MaelstromNexusTriggeredAbility(MaelstromNexusTriggeredAbility ability) {
|
||||
super(ability);
|
||||
public MaelstromNexusGainCascadeFirstSpellEffect(final MaelstromNexusGainCascadeFirstSpellEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.SPELL_CAST;
|
||||
public MaelstromNexusGainCascadeFirstSpellEffect copy() {
|
||||
return new MaelstromNexusGainCascadeFirstSpellEffect(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
FirstSpellCastThisTurnWatcher watcher = (FirstSpellCastThisTurnWatcher) game.getState().getWatchers().get("FirstSpellCastThisTurn", this.getSourceId());
|
||||
if (spell != null
|
||||
&& watcher != null
|
||||
&& watcher.conditionMet()) {
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(spell.getSourceId()));
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
for (StackObject stackObject : game.getStack()) {
|
||||
// only spells cast, so no copies of spells
|
||||
if ((stackObject instanceof Spell) && !stackObject.isCopy() && stackObject.getControllerId().equals(source.getControllerId())) {
|
||||
Spell spell = (Spell) stackObject;
|
||||
FirstSpellCastThisTurnWatcher watcher = (FirstSpellCastThisTurnWatcher) game.getState().getWatchers().get("FirstSpellCastThisTurn");
|
||||
if (watcher != null && spell.getId().equals(watcher.getIdOfFirstCastSpell(source.getControllerId()))) {
|
||||
game.getState().addOtherAbility(spell.getCard(), cascadeAbility);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaelstromNexusTriggeredAbility copy() {
|
||||
return new MaelstromNexusTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "The first spell you cast each turn has cascade.";
|
||||
}
|
||||
}
|
||||
|
||||
class FirstSpellCastThisTurnWatcher extends Watcher {
|
||||
|
||||
int spellCount = 0;
|
||||
Map<UUID, UUID> playerFirstSpellCast = new HashMap<>();
|
||||
Map<UUID, UUID> playerFirstCastSpell = new HashMap<>();
|
||||
|
||||
public FirstSpellCastThisTurnWatcher() {
|
||||
super("FirstSpellCastThisTurn", WatcherScope.CARD);
|
||||
super("FirstSpellCastThisTurn", WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public FirstSpellCastThisTurnWatcher(final FirstSpellCastThisTurnWatcher watcher) {
|
||||
|
@ -123,16 +129,18 @@ class FirstSpellCastThisTurnWatcher extends Watcher {
|
|||
|
||||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId() == controllerId) {
|
||||
Spell spell = (Spell) game.getObject(event.getTargetId());
|
||||
if (spell != null) {
|
||||
spellCount++;
|
||||
if (spellCount == 1) {
|
||||
condition = true;
|
||||
} else {
|
||||
condition = false;
|
||||
switch (event.getType()) {
|
||||
case SPELL_CAST:
|
||||
case CAST_SPELL:
|
||||
Spell spell = (Spell) game.getObject(event.getTargetId());
|
||||
if (spell != null && !playerFirstSpellCast.containsKey(spell.getControllerId())) {
|
||||
if (event.getType().equals(EventType.SPELL_CAST)) {
|
||||
playerFirstSpellCast.put(spell.getControllerId(), spell.getId());
|
||||
} else if (event.getType().equals(EventType.CAST_SPELL)) {
|
||||
playerFirstCastSpell.put(spell.getControllerId(), spell.getId());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,28 +152,15 @@ class FirstSpellCastThisTurnWatcher extends Watcher {
|
|||
@Override
|
||||
public void reset() {
|
||||
super.reset();
|
||||
spellCount = 0;
|
||||
playerFirstSpellCast.clear();
|
||||
playerFirstCastSpell.clear();
|
||||
}
|
||||
|
||||
public UUID getIdOfFirstCastSpell(UUID playerId) {
|
||||
if (playerFirstSpellCast.get(playerId) == null) {
|
||||
return playerFirstCastSpell.get(playerId);
|
||||
} else {
|
||||
return playerFirstSpellCast.get(playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class CascadeEffect extends OneShotEffect {
|
||||
|
||||
public CascadeEffect() {
|
||||
super(Outcome.PutCardInPlay);
|
||||
}
|
||||
|
||||
public CascadeEffect(CascadeEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return CascadeAbility.applyCascade(outcome, game, source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CascadeEffect copy() {
|
||||
return new CascadeEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -38,7 +38,9 @@ import mage.constants.Rarity;
|
|||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.PowerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
@ -53,13 +55,10 @@ public class MayaelsAria extends CardImpl {
|
|||
super(ownerId, 121, "Mayael's Aria", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{R}{G}{W}");
|
||||
this.expansionSetCode = "ARB";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// At the beginning of your upkeep, put a +1/+1 counter on each creature you control if you control a creature with power 5 or greater. Then you gain 10 life if you control a creature with power 10 or greater. Then you win the game if you control a creature with power 20 or greater.
|
||||
// At the beginning of your upkeep, put a +1/+1 counter on each creature you control if you control a creature with power 5 or greater.
|
||||
// Then you gain 10 life if you control a creature with power 10 or greater.
|
||||
// Then you win the game if you control a creature with power 20 or greater.
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new MayaelsAriaEffect(), TargetController.YOU, false));
|
||||
|
||||
}
|
||||
|
||||
public MayaelsAria(final MayaelsAria card) {
|
||||
|
@ -90,31 +89,32 @@ class MayaelsAriaEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
boolean condition1 = false;
|
||||
boolean condition2 = false;
|
||||
Player you = game.getPlayer(source.getControllerId());
|
||||
if (you == null) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
// put a +1/+1 counter on each creature you control if you control a creature with power 5 or greater.
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
||||
for (Permanent creature : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
|
||||
if (creature.getPower().getValue() > 4) {
|
||||
condition1 = true;
|
||||
}
|
||||
if (creature.getPower().getValue() > 9) {
|
||||
condition2 = true;
|
||||
}
|
||||
if (creature.getPower().getValue() > 19) {
|
||||
you.won(game);
|
||||
}
|
||||
}
|
||||
if (condition1) {
|
||||
filter.add(new PowerPredicate(Filter.ComparisonType.GreaterThan, 4));
|
||||
if (game.getState().getBattlefield().countAll(filter, id, game) > 0) {
|
||||
for (Permanent creature : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
|
||||
creature.addCounters(CounterType.P1P1.createInstance(), game);
|
||||
}
|
||||
}
|
||||
if (condition2) {
|
||||
you.gainLife(10, game);
|
||||
game.applyEffects(); // needed because otehrwise the +1/+1 counters wouldn't be taken into account
|
||||
|
||||
// Then you gain 10 life if you control a creature with power 10 or greater.
|
||||
filter = new FilterCreaturePermanent();
|
||||
filter.add(new PowerPredicate(Filter.ComparisonType.GreaterThan, 9));
|
||||
if (game.getState().getBattlefield().countAll(filter, id, game) > 0) {
|
||||
controller.gainLife(10, game);
|
||||
}
|
||||
|
||||
// Then you win the game if you control a creature with power 20 or greater.
|
||||
filter = new FilterCreaturePermanent();
|
||||
filter.add(new PowerPredicate(Filter.ComparisonType.GreaterThan, 19));
|
||||
if (game.getState().getBattlefield().countAll(filter, id, game) > 0) {
|
||||
controller.won(game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Rarity;
|
||||
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
||||
import mage.abilities.costs.AlternativeCostSourceAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
|
||||
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.mana.BlackManaAbility;
|
||||
import mage.abilities.mana.BlueManaAbility;
|
||||
|
@ -64,7 +64,7 @@ public class MistveinBorderpost extends CardImpl {
|
|||
|
||||
// You may pay {1} and return a basic land you control to its owner's hand rather than pay Mistvein Borderpost's mana cost.
|
||||
Ability ability = new AlternativeCostSourceAbility(new GenericManaCost(1));
|
||||
ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter)));
|
||||
ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter)));
|
||||
this.addAbility(ability);
|
||||
|
||||
// Mistvein Borderpost enters the battlefield tapped.
|
||||
|
|
|
@ -34,7 +34,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Rarity;
|
||||
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
||||
import mage.abilities.costs.AlternativeCostSourceAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
|
||||
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.mana.BlackManaAbility;
|
||||
import mage.abilities.mana.RedManaAbility;
|
||||
|
@ -64,7 +64,7 @@ public class VeinfireBorderpost extends CardImpl {
|
|||
|
||||
// You may pay {1} and return a basic land you control to its owner's hand rather than pay Veinfire Borderpost's mana cost.
|
||||
Ability ability = new AlternativeCostSourceAbility(new GenericManaCost(1));
|
||||
ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter)));
|
||||
ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter)));
|
||||
this.addAbility(ability);
|
||||
|
||||
// Veinfire Borderpost enters the battlefield tapped.
|
||||
|
|
|
@ -34,7 +34,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.Rarity;
|
||||
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
||||
import mage.abilities.costs.AlternativeCostSourceAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
|
||||
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.mana.GreenManaAbility;
|
||||
import mage.abilities.mana.WhiteManaAbility;
|
||||
|
@ -64,7 +64,7 @@ public class WildfieldBorderpost extends CardImpl {
|
|||
|
||||
// You may pay {1} and return a basic land you control to its owner's hand rather than pay Wildfield Borderpost's mana cost.
|
||||
Ability ability = new AlternativeCostSourceAbility(new GenericManaCost(1));
|
||||
ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter)));
|
||||
ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter)));
|
||||
this.addAbility(ability);
|
||||
|
||||
// Wildfield Borderpost enters the battlefield tapped.
|
||||
|
|
88
Mage.Sets/src/mage/sets/alliances/WhipVine1.java
Normal file
|
@ -0,0 +1,88 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.alliances;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SkipUntapOptionalAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.common.DontUntapAsLongAsSourceTappedEffect;
|
||||
import mage.abilities.effects.common.TapTargetEffect;
|
||||
import mage.abilities.keyword.DefenderAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.ReachAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.AbilityPredicate;
|
||||
import mage.filter.predicate.permanent.BlockedByIdPredicate;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LoneFox
|
||||
*/
|
||||
public class WhipVine1 extends CardImpl {
|
||||
|
||||
public WhipVine1(UUID ownerId) {
|
||||
super(ownerId, 89, "Whip Vine", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}");
|
||||
this.expansionSetCode = "ALL";
|
||||
this.subtype.add("Plant");
|
||||
this.subtype.add("Wall");
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Defender
|
||||
this.addAbility(DefenderAbility.getInstance());
|
||||
// Reach
|
||||
this.addAbility(ReachAbility.getInstance());
|
||||
// You may choose not to untap Whip Vine during your untap step.
|
||||
this.addAbility(new SkipUntapOptionalAbility());
|
||||
// {tap}: Tap target creature with flying blocked by Whip Vine. That creature doesn't untap during its controller's untap step for as long as Whip Vine remains tapped.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new TapSourceCost());
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with flying blocked by {this}");
|
||||
filter.add(new AbilityPredicate(FlyingAbility.class));
|
||||
filter.add(new BlockedByIdPredicate(this.getId()));
|
||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||
ability.addEffect(new DontUntapAsLongAsSourceTappedEffect());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public WhipVine1(final WhipVine1 card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WhipVine1 copy() {
|
||||
return new WhipVine1(this);
|
||||
}
|
||||
}
|
51
Mage.Sets/src/mage/sets/alliances/WhipVine2.java
Normal file
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.alliances;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LoneFox
|
||||
*/
|
||||
public class WhipVine2 extends WhipVine1 {
|
||||
|
||||
public WhipVine2(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 90;
|
||||
}
|
||||
|
||||
public WhipVine2(final WhipVine2 card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WhipVine2 copy() {
|
||||
return new WhipVine2(this);
|
||||
}
|
||||
}
|
74
Mage.Sets/src/mage/sets/antiquities/PhyrexianGremlins.java
Normal file
|
@ -0,0 +1,74 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.antiquities;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SkipUntapOptionalAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.common.DontUntapAsLongAsSourceTappedEffect;
|
||||
import mage.abilities.effects.common.TapTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.target.common.TargetArtifactPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LoneFox
|
||||
*/
|
||||
public class PhyrexianGremlins extends CardImpl {
|
||||
|
||||
public PhyrexianGremlins(UUID ownerId) {
|
||||
super(ownerId, 48, "Phyrexian Gremlins", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}");
|
||||
this.expansionSetCode = "ATQ";
|
||||
this.subtype.add("Gremlin");
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// You may choose not to untap Phyrexian Gremlins during your untap step.
|
||||
this.addAbility(new SkipUntapOptionalAbility());
|
||||
// {tap}: Tap target artifact. It doesn't untap during its controller's untap step for as long as Phyrexian Gremlins remains tapped.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new TapSourceCost());
|
||||
ability.addTarget(new TargetArtifactPermanent());
|
||||
ability.addEffect(new DontUntapAsLongAsSourceTappedEffect());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public PhyrexianGremlins(final PhyrexianGremlins card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhyrexianGremlins copy() {
|
||||
return new PhyrexianGremlins(this);
|
||||
}
|
||||
}
|
|
@ -58,7 +58,7 @@ public class FungalShambler extends CardImpl {
|
|||
// Whenever Fungal Shambler deals damage to an opponent, you draw a card and that opponent discards a card.
|
||||
Effect effect = new DrawCardSourceControllerEffect(1);
|
||||
effect.setText("you draw a card");
|
||||
Ability ability = new DealsDamageToOpponentTriggeredAbility(effect, false);
|
||||
Ability ability = new DealsDamageToOpponentTriggeredAbility(effect, false, false, true);
|
||||
effect = new DiscardTargetEffect(1);
|
||||
effect.setText("and that opponent discards a card");
|
||||
ability.addEffect(effect);
|
||||
|
|
|
@ -28,8 +28,6 @@
|
|||
package mage.sets.avacynrestored;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.*;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
|
@ -38,6 +36,13 @@ import mage.abilities.effects.common.CreateTokenEffect;
|
|||
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.AttachmentType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.permanent.token.HumanToken;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ package mage.sets.avacynrestored;
|
|||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.common.BeginningOfYourEndStepTriggeredAbility;
|
||||
|
@ -38,7 +37,7 @@ import mage.abilities.decorator.ConditionalTriggeredAbility;
|
|||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.game.permanent.token.DemonToken;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
@ -53,7 +52,6 @@ public class DemonicRising extends CardImpl {
|
|||
super(ownerId, 94, "Demonic Rising", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}{B}");
|
||||
this.expansionSetCode = "AVR";
|
||||
|
||||
|
||||
// At the beginning of your end step, if you control exactly one creature, put a 5/5 black Demon creature token with flying onto the battlefield.
|
||||
TriggeredAbility ability = new BeginningOfYourEndStepTriggeredAbility(new CreateTokenEffect(new DemonToken()), false);
|
||||
this.addAbility(new ConditionalTriggeredAbility(ability, OneControlledCreatureCondition.getInstance(), ruleText));
|
||||
|
@ -68,15 +66,3 @@ public class DemonicRising extends CardImpl {
|
|||
return new DemonicRising(this);
|
||||
}
|
||||
}
|
||||
|
||||
class DemonToken extends Token {
|
||||
public DemonToken() {
|
||||
super("Demon", "a 5/5 black Demon creature token with flying");
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setBlack(true);
|
||||
subtype.add("Demon");
|
||||
power = new MageInt(5);
|
||||
toughness = new MageInt(5);
|
||||
addAbility(FlyingAbility.getInstance());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ import mage.abilities.keyword.FlyingAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.game.permanent.token.HumanToken;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -66,15 +66,3 @@ public class VoiceOfTheProvinces extends CardImpl {
|
|||
return new VoiceOfTheProvinces(this);
|
||||
}
|
||||
}
|
||||
|
||||
class HumanToken extends Token {
|
||||
public HumanToken() {
|
||||
super("Human", "1/1 white Human creature token");
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setWhite(true);
|
||||
|
||||
subtype.add("Human");
|
||||
power = new MageInt(1);
|
||||
toughness = new MageInt(1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,20 +28,14 @@
|
|||
package mage.sets.battleforzendikar;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.ConditionalMana;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.abilities.mana.ConditionalAnyColorManaAbility;
|
||||
import mage.abilities.mana.builder.ConditionalManaBuilder;
|
||||
import mage.abilities.mana.conditional.ConditionalSpellManaBuilder;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.filter.common.FilterCreatureSpell;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -62,7 +56,7 @@ public class BeastcallerSavant extends CardImpl {
|
|||
this.addAbility(HasteAbility.getInstance());
|
||||
|
||||
// {T}: Add one mana of any color to your mana pool. Spend this mana only to cast creature spells.
|
||||
this.addAbility(new ConditionalAnyColorManaAbility(1, new BeastcallerSavantManaBuilder()));
|
||||
this.addAbility(new ConditionalAnyColorManaAbility(1, new ConditionalSpellManaBuilder(new FilterCreatureSpell("creature spells"))));
|
||||
}
|
||||
|
||||
public BeastcallerSavant(final BeastcallerSavant card) {
|
||||
|
@ -74,34 +68,3 @@ public class BeastcallerSavant extends CardImpl {
|
|||
return new BeastcallerSavant(this);
|
||||
}
|
||||
}
|
||||
|
||||
class BeastcallerSavantManaBuilder extends ConditionalManaBuilder {
|
||||
|
||||
@Override
|
||||
public ConditionalMana build(Object... options) {
|
||||
return new BeastcallerSavantConditionalMana(this.mana);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Spend this mana only to cast creature spells";
|
||||
}
|
||||
}
|
||||
|
||||
class BeastcallerSavantConditionalMana extends ConditionalMana {
|
||||
|
||||
public BeastcallerSavantConditionalMana(Mana mana) {
|
||||
super(mana);
|
||||
this.staticText = "Spend this mana only to cast creature spells";
|
||||
addCondition(new BeastcallerSavantManaCondition());
|
||||
}
|
||||
}
|
||||
|
||||
class BeastcallerSavantManaCondition implements Condition {
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
MageObject object = source.getSourceObject(game);
|
||||
return object != null && (object instanceof Spell) && object.getCardType().contains(CardType.CREATURE);
|
||||
}
|
||||
}
|
|
@ -60,7 +60,7 @@ public class GideonAllyOfZendikar extends CardImpl {
|
|||
super(ownerId, 29, "Gideon, Ally of Zendikar", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{W}{W}");
|
||||
this.expansionSetCode = "BFZ";
|
||||
this.subtype.add("Gideon");
|
||||
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false));
|
||||
|
||||
// +1: Until end of turn, Gideon, Ally of Zendikar becomes a 5/5 Human Soldier Ally creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn.
|
||||
|
@ -69,7 +69,7 @@ public class GideonAllyOfZendikar extends CardImpl {
|
|||
effect.setText("Prevent all damage that would be dealt to him this turn");
|
||||
ability.addEffect(effect);
|
||||
this.addAbility(ability);
|
||||
|
||||
|
||||
// 0: Put a 2/2 white Knight Ally creature token onto the battlefield.
|
||||
this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new KnightAllyToken()), 0));
|
||||
|
||||
|
@ -94,6 +94,7 @@ class GideonAllyOfZendikarEmblem extends Emblem {
|
|||
BoostControlledEffect effect = new BoostControlledEffect(1, 1, Duration.EndOfGame);
|
||||
Ability ability = new SimpleStaticAbility(Zone.COMMAND, effect);
|
||||
this.getAbilities().add(ability);
|
||||
this.setExpansionSetCodeForImage("BFZ");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -107,8 +108,8 @@ class GideonAllyOfZendikarToken extends Token {
|
|||
subtype.add("Ally");
|
||||
power = new MageInt(5);
|
||||
toughness = new MageInt(5);
|
||||
|
||||
addAbility(IndestructibleAbility.getInstance());
|
||||
|
||||
addAbility(IndestructibleAbility.getInstance());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -123,4 +124,4 @@ class KnightAllyToken extends Token {
|
|||
power = new MageInt(2);
|
||||
toughness = new MageInt(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,11 +105,11 @@ class GreenwardenOfMurasaEffect extends OneShotEffect {
|
|||
Card targetCard = game.getCard(getTargetPointer().getFirst(game, source));
|
||||
if (controller != null && sourceObject != null && targetCard != null) {
|
||||
if (controller.chooseUse(outcome, "Exile " + sourceObject.getLogName() + " to return card from your graveyard to your hand?", source, game)) {
|
||||
new ExileSourceEffect().apply(game, source);
|
||||
// Setting the fixed target prevents to return Greenwarden of Murasa itself (becuase it's exiled meanwhile),
|
||||
// but of course you can target it as the ability triggers I guess
|
||||
Effect effect = new ReturnToHandTargetEffect();
|
||||
effect.setTargetPointer(new FixedTarget(targetCard.getId(), targetCard.getZoneChangeCounter(game)));
|
||||
new ExileSourceEffect().apply(game, source);
|
||||
return effect.apply(game, source);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -53,7 +53,7 @@ public class InfuseWithTheElements extends CardImpl {
|
|||
|
||||
// <i>Converge</i> - Put X +1/+1 counters on target creature, where X is the number of colors of mana spent to cast Infuse with the Elements.
|
||||
this.getSpellAbility().setAbilityWord(AbilityWord.CONVERGE);
|
||||
Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(), ColorsOfManaSpentToCastCount.getInstance());
|
||||
Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(0), ColorsOfManaSpentToCastCount.getInstance());
|
||||
effect.setText("Put X +1/+1 counters on target creature, where X is the number of colors of mana spent to cast {this}");
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
|
|
|
@ -150,17 +150,16 @@ class KioraRevealEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (sourceObject != null && player != null) {
|
||||
Cards cards = new CardsImpl(Zone.PICK);
|
||||
if (sourceObject != null && controller != null) {
|
||||
Cards cards = new CardsImpl(Zone.LIBRARY);
|
||||
cards.addAll(controller.getLibrary().getTopCards(game, 4));
|
||||
boolean creatureCardFound = false;
|
||||
boolean landCardFound = false;
|
||||
int count = Math.min(player.getLibrary().size(), 4);
|
||||
for (int i = 0; i < count; i++) {
|
||||
Card card = player.getLibrary().removeFromTop(game);
|
||||
for (UUID cardId : cards) {
|
||||
Card card = game.getCard(cardId);
|
||||
if (card != null) {
|
||||
game.setZone(card.getId(), Zone.PICK);
|
||||
cards.add(card);
|
||||
if (card.getCardType().contains(CardType.CREATURE)) {
|
||||
creatureCardFound = true;
|
||||
|
@ -172,30 +171,30 @@ class KioraRevealEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
if (!cards.isEmpty()) {
|
||||
player.revealCards(sourceObject.getName(), cards, game);
|
||||
if ((creatureCardFound || landCardFound)
|
||||
&& player.chooseUse(Outcome.DrawCard,
|
||||
controller.revealCards(sourceObject.getName(), cards, game);
|
||||
if ((creatureCardFound || landCardFound)
|
||||
&& controller.chooseUse(Outcome.DrawCard,
|
||||
"Put a creature card and/or a land card into your hand?", source, game)) {
|
||||
TargetCard target = new TargetCard(Zone.PICK, new FilterCreatureCard("creature card to put into your hand"));
|
||||
if (creatureCardFound && player.choose(Outcome.DrawCard, cards, target, game)) {
|
||||
if (creatureCardFound && controller.chooseTarget(Outcome.DrawCard, cards, target, source, game)) {
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
cards.remove(card);
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||
controller.moveCards(card, null, Zone.HAND, source, game);
|
||||
}
|
||||
}
|
||||
|
||||
target = new TargetCard(Zone.PICK, new FilterLandCard("land card to put into your hand"));
|
||||
if (landCardFound && player.choose(Outcome.DrawCard, cards, target, game)) {
|
||||
target = new TargetCard(Zone.LIBRARY, new FilterLandCard("land card to put into your hand"));
|
||||
if (landCardFound && controller.chooseTarget(Outcome.DrawCard, cards, target, source, game)) {
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
cards.remove(card);
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||
controller.moveCards(card, null, Zone.HAND, source, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
player.moveCards(cards, Zone.PICK, Zone.GRAVEYARD, source, game);
|
||||
controller.moveCards(cards, null, Zone.GRAVEYARD, source, game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -208,12 +207,13 @@ class KioraMasterOfTheDepthsEmblem extends Emblem {
|
|||
|
||||
public KioraMasterOfTheDepthsEmblem() {
|
||||
this.setName("EMBLEM: Kiora, Master of the Depths");
|
||||
|
||||
|
||||
Ability ability = new EntersBattlefieldControlledTriggeredAbility(Zone.COMMAND,
|
||||
new KioraFightEffect(), filter, true, SetTargetPointer.PERMANENT,
|
||||
"Whenever a creature enters the battlefield under your control, you may have it fight target creature.");
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.getAbilities().add(ability);
|
||||
this.setExpansionSetCodeForImage("BFZ");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public class MortuaryMire extends CardImpl {
|
|||
|
||||
// When Mortuary Mire enters the battlefield, you may put target creature card from your graveyard on top of your library.
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new PutOnLibraryTargetEffect(true), true);
|
||||
ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard()));
|
||||
ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard")));
|
||||
this.addAbility(ability);
|
||||
|
||||
// {T}: Add {B} to your mana pool.
|
||||
|
|
|
@ -40,10 +40,12 @@ import mage.cards.CardsImpl;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -79,7 +81,7 @@ public class MundaAmbushLeader extends CardImpl {
|
|||
|
||||
class MundaAmbushLeaderEffect extends OneShotEffect {
|
||||
|
||||
private static final FilterCard filter = new FilterCard("Ally cards");
|
||||
private static final FilterCard filter = new FilterCard("Ally cards to reveal and put on top of your library");
|
||||
|
||||
static {
|
||||
filter.add(new SubtypePredicate("Ally"));
|
||||
|
@ -107,12 +109,16 @@ class MundaAmbushLeaderEffect extends OneShotEffect {
|
|||
Cards allCards = new CardsImpl();
|
||||
allCards.addAll(controller.getLibrary().getTopCards(game, 4));
|
||||
controller.lookAtCards(sourceObject.getIdName(), allCards, game);
|
||||
Cards allyCards = new CardsImpl();
|
||||
allyCards.addAll(allCards.getCards(filter, source.getSourceId(), source.getControllerId(), game));
|
||||
if (!allyCards.isEmpty()) {
|
||||
controller.revealCards(sourceObject.getIdName(), allyCards, game, true);
|
||||
allCards.removeAll(allyCards);
|
||||
controller.putCardsOnTopOfLibrary(allyCards, game, source, true);
|
||||
if (!allCards.isEmpty()) {
|
||||
Cards cardsToReveal = new CardsImpl();
|
||||
TargetCard target = new TargetCard(0, Integer.MAX_VALUE, Zone.LIBRARY, filter);
|
||||
controller.chooseTarget(outcome, allCards, target, source, game);
|
||||
cardsToReveal.addAll(target.getTargets());
|
||||
if (!cardsToReveal.isEmpty()) {
|
||||
controller.revealCards(sourceObject.getIdName(), cardsToReveal, game, true);
|
||||
allCards.removeAll(cardsToReveal);
|
||||
}
|
||||
controller.putCardsOnTopOfLibrary(cardsToReveal, game, source, true);
|
||||
}
|
||||
if (!allCards.isEmpty()) {
|
||||
controller.putCardsOnBottomOfLibrary(allCards, game, source, true);
|
||||
|
|
|
@ -100,6 +100,7 @@ class ObNixilisReignitedEmblem extends Emblem {
|
|||
setName("EMBLEM: Ob Nixilis Reignited");
|
||||
|
||||
this.getAbilities().add(new ObNixilisEmblemTriggeredAbility(new LoseLifeSourceControllerEffect(2), false));
|
||||
this.setExpansionSetCodeForImage("BFZ");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ package mage.sets.battleforzendikar;
|
|||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksAttachedTriggeredAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
|
||||
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.DoIfCostPaid;
|
||||
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
|
||||
|
@ -41,7 +41,6 @@ import mage.constants.Duration;
|
|||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
/**
|
||||
|
@ -58,9 +57,8 @@ public class SlabHammer extends CardImpl {
|
|||
// Whenever equipped creature attacks, you may return a land you control to its owner's hand. If you do, the creature gets +2/+2 until end of turn.
|
||||
Ability ability = new AttacksAttachedTriggeredAbility(
|
||||
new DoIfCostPaid(new BoostEquippedEffect(2, 2, Duration.EndOfTurn),
|
||||
new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(new FilterControlledLandPermanent())),
|
||||
new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(new FilterControlledLandPermanent())),
|
||||
"Return a land you control to its owner's hand? (giving +2/+2 to the equipped creature)"));
|
||||
ability.addTarget(new TargetPermanent());
|
||||
this.addAbility(ability);
|
||||
|
||||
// Equip {2}
|
||||
|
|
|
@ -47,9 +47,9 @@ import mage.filter.predicate.mageobject.SupertypePredicate;
|
|||
* @author fireshoes
|
||||
*/
|
||||
public class SunkenHollow extends CardImpl {
|
||||
|
||||
|
||||
private static final FilterLandPermanent filter = new FilterLandPermanent();
|
||||
|
||||
|
||||
static {
|
||||
filter.add(new SupertypePredicate("Basic"));
|
||||
}
|
||||
|
|
|
@ -31,7 +31,6 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.DevoidAbility;
|
||||
import mage.abilities.keyword.FlashAbility;
|
||||
|
@ -78,9 +77,7 @@ public class UlamogsNullifier extends CardImpl {
|
|||
|
||||
// When Ulamog's Nullifier enters the battlefield, you may put two cards your opponents own
|
||||
// from exile into their owners' graveyards. If you do, counter target spell.
|
||||
Effect effect = new UlamogsNullifierEffect();
|
||||
effect.setText("you may put two cards your opponents own from exile into their owners' graveyards. If you do, ");
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(effect, true);
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new UlamogsNullifierEffect(), true);
|
||||
ability.addTarget(new TargetSpell());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
@ -105,7 +102,7 @@ class UlamogsNullifierEffect extends OneShotEffect {
|
|||
|
||||
public UlamogsNullifierEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "you may put two cards your opponents own from exile into their owners' graveyards. If you do, ";
|
||||
this.staticText = "you may put two cards your opponents own from exile into their owners' graveyards. If you do, counter target spell.";
|
||||
}
|
||||
|
||||
public UlamogsNullifierEffect(final UlamogsNullifierEffect effect) {
|
||||
|
|
|
@ -102,12 +102,15 @@ class ZadaHedronGrinderTriggeredAbility extends TriggeredAbilityImpl {
|
|||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
if (isControlledInstantOrSorcery(spell)) {
|
||||
boolean targetsSource = false;
|
||||
for (Target target : spell.getSpellAbility().getTargets()) {
|
||||
for (UUID targetId : target.getTargets()) {
|
||||
if (targetId.equals(getSourceId())) {
|
||||
targetsSource = true;
|
||||
} else {
|
||||
return false;
|
||||
for (UUID modeId : spell.getSpellAbility().getModes().getSelectedModes()) {
|
||||
spell.getSpellAbility().getModes().setActiveMode(modeId);
|
||||
for (Target target : spell.getSpellAbility().getTargets()) {
|
||||
for (UUID targetId : target.getTargets()) {
|
||||
if (targetId.equals(getSourceId())) {
|
||||
targetsSource = true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -157,10 +160,15 @@ class ZadaHedronGrinderEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (spell != null && controller != null) {
|
||||
Target usedTarget = null;
|
||||
for (Target target : spell.getSpellAbility().getTargets()) {
|
||||
if (target.getFirstTarget().equals(source.getSourceId())) {
|
||||
usedTarget = target.copy();
|
||||
usedTarget.clearChosen();
|
||||
setUsedTarget:
|
||||
for (UUID modeId : spell.getSpellAbility().getModes().getSelectedModes()) {
|
||||
spell.getSpellAbility().getModes().setActiveMode(modeId);
|
||||
for (Target target : spell.getSpellAbility().getTargets()) {
|
||||
if (target.getFirstTarget().equals(source.getSourceId())) {
|
||||
usedTarget = target.copy();
|
||||
usedTarget.clearChosen();
|
||||
break setUsedTarget;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (usedTarget == null) {
|
||||
|
@ -169,11 +177,15 @@ class ZadaHedronGrinderEffect extends OneShotEffect {
|
|||
for (Permanent creature : game.getState().getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) {
|
||||
if (!creature.getId().equals(source.getSourceId()) && usedTarget.canTarget(source.getControllerId(), creature.getId(), source, game)) {
|
||||
Spell copy = spell.copySpell();
|
||||
for (Target target : spell.getSpellAbility().getTargets()) {
|
||||
if (target.getClass().equals(usedTarget.getClass()) && target.getMessage().equals(usedTarget.getMessage())) {
|
||||
target.clearChosen();
|
||||
target.add(creature.getId(), game);
|
||||
break;
|
||||
setTarget:
|
||||
for (UUID modeId : spell.getSpellAbility().getModes().getSelectedModes()) {
|
||||
copy.getSpellAbility().getModes().setActiveMode(modeId);
|
||||
for (Target target : copy.getSpellAbility().getTargets()) {
|
||||
if (target.getClass().equals(usedTarget.getClass()) && target.getMessage().equals(usedTarget.getMessage())) {
|
||||
target.clearChosen();
|
||||
target.add(creature.getId(), game);
|
||||
break setTarget;
|
||||
}
|
||||
}
|
||||
}
|
||||
copy.setControllerId(source.getControllerId());
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
|
||||
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.TapTargetEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
|
@ -64,7 +64,7 @@ public class Floodbringer extends CardImpl {
|
|||
|
||||
// {2}, Return a land you control to its owner's hand: Tap target land.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new GenericManaCost(2));
|
||||
ReturnToHandTargetPermanentCost cost = new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter));
|
||||
ReturnToHandChosenControlledPermanentCost cost = new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter));
|
||||
cost.setText("Return a land you control to its owner's hand");
|
||||
ability.addCost(cost);
|
||||
ability.addTarget(new TargetLandPermanent());
|
||||
|
|
|
@ -40,6 +40,7 @@ import mage.constants.TargetController;
|
|||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.watchers.common.AttackedThisTurnWatcher;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -63,7 +64,7 @@ public class FumikoTheLowblood extends CardImpl {
|
|||
// Creatures your opponents control attack each turn if able.
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control");
|
||||
filter.add(new ControllerPredicate(TargetController.OPPONENT));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AttacksIfAbleAllEffect(filter)));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AttacksIfAbleAllEffect(filter)), new AttackedThisTurnWatcher());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,6 @@ public class GoryosVengeance extends CardImpl {
|
|||
this.expansionSetCode = "BOK";
|
||||
this.subtype.add("Arcane");
|
||||
|
||||
|
||||
// Return target legendary creature card from your graveyard to the battlefield. That creature gains haste. Exile it at the beginning of the next end step.
|
||||
this.getSpellAbility().addEffect(new GoryosVengeanceEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter));
|
||||
|
@ -119,8 +118,8 @@ class GoryosVengeanceEffect extends OneShotEffect {
|
|||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
game.addEffect(effect, source);
|
||||
// Exile it at end of turn
|
||||
Effect exileEffect = new ExileTargetEffect(new StringBuilder("Exile ").append(permanent.getName()).append(" at the beginning of the next end step").toString());
|
||||
exileEffect.setTargetPointer(new FixedTarget(card.getId()));
|
||||
Effect exileEffect = new ExileTargetEffect("Exile " + permanent.getName() + " at the beginning of the next end step");
|
||||
exileEffect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
|
||||
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
|
@ -66,7 +66,7 @@ public class SoratamiMindsweeper extends CardImpl {
|
|||
// {2}, Return a land you control to its owner's hand: Target player puts the top two cards of his or her library into his or her graveyard.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,new PutLibraryIntoGraveTargetEffect(2), new ManaCostsImpl("{2}"));
|
||||
ability.addTarget(new TargetPlayer());
|
||||
ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter)));
|
||||
ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter)));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ package mage.sets.betrayersofkamigawa;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
|
||||
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
|
@ -71,7 +71,7 @@ public class VeilOfSecrecy extends CardImpl {
|
|||
this.getSpellAbility().addEffect(effect);
|
||||
|
||||
// Splice onto Arcane-Return a blue creature you control to its owner's hand.
|
||||
this.addAbility(new SpliceOntoArcaneAbility(new ReturnToHandTargetPermanentCost(new TargetControlledCreaturePermanent(filter))));
|
||||
this.addAbility(new SpliceOntoArcaneAbility(new ReturnToHandChosenControlledPermanentCost(new TargetControlledCreaturePermanent(filter))));
|
||||
}
|
||||
|
||||
public VeilOfSecrecy(final VeilOfSecrecy card) {
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
|
||||
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
|
||||
import mage.abilities.effects.PayCostToAttackBlockEffectImpl;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.effects.common.combat.CantAttackBlockUnlessPaysSourceEffect;
|
||||
|
@ -71,7 +71,7 @@ public class FloodtideSerpent extends CardImpl {
|
|||
|
||||
// Floodtide Serpent can't attack unless you return an enchantment you control to its owner's hand <i>(This cost is paid as attackers are declared.)</i>
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackBlockUnlessPaysSourceEffect(
|
||||
new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter)), PayCostToAttackBlockEffectImpl.RestrictType.ATTACK)));
|
||||
new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter)), PayCostToAttackBlockEffectImpl.RestrictType.ATTACK)));
|
||||
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ class FloodtideSerpentReplacementEffect extends ReplacementEffectImpl {
|
|||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Player player = game.getPlayer(event.getPlayerId());
|
||||
if (player != null) {
|
||||
ReturnToHandTargetPermanentCost attackCost = new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter));
|
||||
ReturnToHandChosenControlledPermanentCost attackCost = new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter));
|
||||
if (attackCost.canPay(source, source.getSourceId(), event.getPlayerId(), game)
|
||||
&& player.chooseUse(Outcome.Neutral, "Return an enchantment you control to hand to attack?", source, game)) {
|
||||
if (attackCost.pay(source, game, source.getSourceId(), event.getPlayerId(), true)) {
|
||||
|
|
|
@ -40,7 +40,7 @@ import mage.abilities.keyword.TributeAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.game.permanent.token.BirdToken;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -63,7 +63,7 @@ public class Ornitharch extends CardImpl {
|
|||
// When Ornitharch enters the battlefield, if tribute wasn't paid, put two 1/1 white Bird creature tokens with flying onto the battlefield.
|
||||
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new BirdToken(), 2), false);
|
||||
this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.getInstance(),
|
||||
"When {this} enters the battlefield, if its tribute wasn't paid, put two 1/1 white Bird creature tokens with flying onto the battlefield."));
|
||||
"When {this} enters the battlefield, if its tribute wasn't paid, put two 1/1 white Bird creature tokens with flying onto the battlefield."));
|
||||
}
|
||||
|
||||
public Ornitharch(final Ornitharch card) {
|
||||
|
@ -75,20 +75,3 @@ public class Ornitharch extends CardImpl {
|
|||
return new Ornitharch(this);
|
||||
}
|
||||
}
|
||||
|
||||
class BirdToken extends Token {
|
||||
|
||||
public BirdToken() {
|
||||
super("Bird", "1/1 white Bird creature tokens with flying");
|
||||
this.setOriginalExpansionSetCode("BNG");
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setWhite(true);
|
||||
|
||||
subtype.add("Bird");
|
||||
power = new MageInt(1);
|
||||
toughness = new MageInt(1);
|
||||
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
}
|
||||
|
||||
}
|
|
@ -28,20 +28,18 @@
|
|||
package mage.sets.championsofkamigawa;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DiesTriggeredAbility;
|
||||
import mage.abilities.costs.common.ExileSourceFromGraveCost;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DoIfCostPaid;
|
||||
import mage.abilities.effects.common.ExileSourceEffect;
|
||||
import mage.abilities.effects.common.ReturnToHandTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.Game;
|
||||
|
@ -107,8 +105,11 @@ class InameLifeAspectEffect extends OneShotEffect {
|
|||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (controller != null && sourceObject != null) {
|
||||
if (controller.chooseUse(outcome, "Exile " + sourceObject.getLogName() + " to return Spirit cards?", source, game)) {
|
||||
Effect effect = new ReturnToHandTargetEffect();
|
||||
effect.setTargetPointer(getTargetPointer());
|
||||
effect.getTargetPointer().init(game, source);
|
||||
new ExileSourceEffect().apply(game, source);
|
||||
return new ReturnToHandTargetEffect().apply(game, source);
|
||||
return effect.apply(game, source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ import mage.constants.Zone;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
|
||||
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
|
@ -66,7 +66,7 @@ public class MelokuTheCloudedMirror extends CardImpl {
|
|||
|
||||
// {1}, Return a land you control to its owner's hand: Put a 1/1 blue Illusion creature token with flying onto the battlefield.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new MelokuTheCloudedMirrorToken(), 1), new GenericManaCost(1));
|
||||
ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter)));
|
||||
ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter)));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
@ -25,21 +25,20 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.sets.championsofkamigawa;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
|
||||
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.DrawDiscardControllerEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
@ -65,7 +64,7 @@ public class SoratamiCloudskater extends CardImpl {
|
|||
|
||||
// {2}, Return a land you control to its owner's hand: Draw a card, then discard a card.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawDiscardControllerEffect(), new GenericManaCost(2));
|
||||
ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter)));
|
||||
ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(1, 1, filter, true)));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import mage.constants.Zone;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
|
||||
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
|
@ -74,7 +74,7 @@ public class SoratamiMirrorGuard extends CardImpl {
|
|||
|
||||
// {2}, Return a land you control to its owner's hand: Target creature with power 2 or less can't be blocked this turn.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBeBlockedTargetEffect(), new GenericManaCost(2));
|
||||
ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter)));
|
||||
ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter)));
|
||||
ability.addTarget(new TargetCreaturePermanent(filterCreature));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
@ -25,21 +25,20 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.sets.championsofkamigawa;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
|
||||
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.ReturnToHandTargetEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
@ -66,7 +65,7 @@ public class SoratamiMirrorMage extends CardImpl {
|
|||
|
||||
// {3}, Return three lands you control to their owner's hand: Return target creature to its owner's hand.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new GenericManaCost(3));
|
||||
ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(3, 3, filter, false)));
|
||||
ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(3, 3, filter, true)));
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ import mage.constants.Rarity;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
|
||||
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
|
@ -69,7 +69,7 @@ public class SoratamiRainshaper extends CardImpl {
|
|||
|
||||
// {3}, Return a land you control to its owner's hand: Target creature you control gains shroud until end of turn. (It can't be the target of spells or abilities.)
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(ShroudAbility.getInstance(), Duration.EndOfTurn), new GenericManaCost(3));
|
||||
ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter)));
|
||||
ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter)));
|
||||
ability.addTarget(new TargetControlledCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ import mage.constants.Rarity;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
|
||||
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.CounterUnlessPaysEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
|
@ -67,7 +67,7 @@ public class SoratamiSavant extends CardImpl {
|
|||
|
||||
// {3}, Return a land you control to its owner's hand: Counter target spell unless its controller pays {3}.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(new GenericManaCost(3)), new GenericManaCost(3));
|
||||
ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter)));
|
||||
ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter)));
|
||||
ability.addTarget(new TargetSpell());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ import mage.constants.Zone;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
|
||||
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
|
@ -70,7 +70,7 @@ public class SoratamiSeer extends CardImpl {
|
|||
|
||||
// {4}, Return two lands you control to their owner's hand: Discard all the cards in your hand, then draw that many cards.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SoratamiSeerEffect(), new GenericManaCost(4));
|
||||
ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(2, 2, filter, false)));
|
||||
ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(2, 2, filter, false)));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ import mage.constants.Rarity;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
|
||||
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.CopyTargetSpellEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
|
@ -75,7 +75,7 @@ public class UyoSilentProphet extends CardImpl {
|
|||
this.addAbility(FlyingAbility.getInstance());
|
||||
// {2}, Return two lands you control to their owner's hand: Copy target instant or sorcery spell. You may choose new targets for the copy.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CopyTargetSpellEffect(), new GenericManaCost(2));
|
||||
ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(2, 2, new FilterControlledLandPermanent("lands"), false)));
|
||||
ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(2, 2, new FilterControlledLandPermanent("lands"), false)));
|
||||
ability.addTarget(new TargetSpell(filter));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ import mage.constants.Duration;
|
|||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.watchers.common.AttackedThisTurnWatcher;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -62,7 +63,7 @@ public class AvatarOfSlaughter extends CardImpl {
|
|||
effect = new AttacksIfAbleAllEffect(new FilterCreaturePermanent("creatures"));
|
||||
effect.setText("and attack each turn if able");
|
||||
ability.addEffect(effect);
|
||||
this.addAbility(ability);
|
||||
this.addAbility(ability, new AttackedThisTurnWatcher());
|
||||
}
|
||||
|
||||
public AvatarOfSlaughter(final AvatarOfSlaughter card) {
|
||||
|
|
|
@ -28,16 +28,15 @@
|
|||
package mage.sets.commander;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.token.DragonToken2;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
|
@ -90,7 +89,7 @@ class DeathByDragonsEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
for (UUID playerId : controller.getInRange()) {
|
||||
if (!playerId.equals(this.getTargetPointer().getFirst(game, source))) {
|
||||
Token token = new DragonToken();
|
||||
Token token = new DragonToken2();
|
||||
token.putOntoBattlefield(1, game, source.getSourceId(), playerId);
|
||||
}
|
||||
}
|
||||
|
@ -99,18 +98,3 @@ class DeathByDragonsEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class DragonToken extends Token {
|
||||
|
||||
public DragonToken() {
|
||||
super("Dragon", "5/5 red Dragon creature token with flying");
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setRed(true);
|
||||
subtype.add("Dragon");
|
||||
power = new MageInt(5);
|
||||
toughness = new MageInt(5);
|
||||
addAbility(FlyingAbility.getInstance());
|
||||
// set a set with correct token image
|
||||
this.setOriginalExpansionSetCode("WWK");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ public class HydraOmnivore extends CardImpl {
|
|||
this.toughness = new MageInt(8);
|
||||
|
||||
// Whenever Hydra Omnivore deals combat damage to an opponent, it deals that much damage to each other opponent.
|
||||
this.addAbility(new DealsDamageToOpponentTriggeredAbility(new HydraOmnivoreEffect(), false, true));
|
||||
this.addAbility(new DealsDamageToOpponentTriggeredAbility(new HydraOmnivoreEffect(), false, true, true));
|
||||
}
|
||||
|
||||
public HydraOmnivore(final HydraOmnivore card) {
|
||||
|
|
|
@ -50,7 +50,7 @@ import mage.constants.Zone;
|
|||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.game.permanent.token.GoatToken;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
|
@ -136,17 +136,3 @@ class SpringjackPastureEffect extends OneShotEffect {
|
|||
return new SpringjackPastureEffect(this);
|
||||
}
|
||||
}
|
||||
|
||||
class GoatToken extends Token {
|
||||
|
||||
public GoatToken() {
|
||||
super("Goat", "0/1 white Goat creature token");
|
||||
setOriginalExpansionSetCode("EVE");
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setWhite(true);
|
||||
|
||||
subtype.add("Goat");
|
||||
power = new MageInt(0);
|
||||
toughness = new MageInt(1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,14 +32,14 @@ import mage.MageInt;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.abilities.effects.common.ReturnToHandTargetEffect;
|
||||
import mage.abilities.effects.common.ReturnToHandChosenControlledPermanentEffect;
|
||||
import mage.abilities.keyword.FlashAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.target.common.TargetCardInGraveyard;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -60,8 +60,8 @@ public class Stonecloaker extends CardImpl {
|
|||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
// When Stonecloaker enters the battlefield, return a creature you control to its owner's hand.
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), false);
|
||||
ability.addTarget(new TargetControlledCreaturePermanent());
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandChosenControlledPermanentEffect(new FilterControlledCreaturePermanent()), true);
|
||||
|
||||
this.addAbility(ability);
|
||||
// When Stonecloaker enters the battlefield, exile target card from a graveyard.
|
||||
ability = new EntersBattlefieldTriggeredAbility(new ExileTargetEffect(), false);
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
*/
|
||||
package mage.sets.commander2013;
|
||||
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
|
@ -51,7 +53,6 @@ public class TemptWithDiscovery extends CardImpl {
|
|||
super(ownerId, 174, "Tempt with Discovery", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{G}");
|
||||
this.expansionSetCode = "C13";
|
||||
|
||||
|
||||
// Tempting offer - Search your library for a land card and put it onto the battlefield.
|
||||
// Each opponent may search his or her library for a land card and put it onto the battlefield.
|
||||
// For each opponent who searches a library this way, search your library for a land card and put it onto the battlefield.
|
||||
|
@ -89,12 +90,14 @@ class TemptWithDiscoveryEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Set<UUID> playersShuffle = new LinkedHashSet<>();
|
||||
playersShuffle.add(controller.getId());
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(new FilterLandCard());
|
||||
if (controller.searchLibrary(target, game)) {
|
||||
for (UUID cardId: target.getTargets()) {
|
||||
for (UUID cardId : target.getTargets()) {
|
||||
Card card = game.getCard(cardId);
|
||||
if (card != null) {
|
||||
card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), controller.getId());
|
||||
controller.moveCards(card, null, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -105,11 +108,12 @@ class TemptWithDiscoveryEffect extends OneShotEffect {
|
|||
if (opponent.chooseUse(outcome, "Search your library for a land card and put it onto the battlefield?", source, game)) {
|
||||
target.clearChosen();
|
||||
opponentsUsedSearch++;
|
||||
playersShuffle.add(playerId);
|
||||
if (opponent.searchLibrary(target, game)) {
|
||||
for (UUID cardId: target.getTargets()) {
|
||||
for (UUID cardId : target.getTargets()) {
|
||||
Card card = game.getCard(cardId);
|
||||
if (card != null) {
|
||||
card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), opponent.getId());
|
||||
opponent.moveCards(card, null, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -119,17 +123,23 @@ class TemptWithDiscoveryEffect extends OneShotEffect {
|
|||
if (opponentsUsedSearch > 0) {
|
||||
target = new TargetCardInLibrary(0, opponentsUsedSearch, new FilterLandCard());
|
||||
if (controller.searchLibrary(target, game)) {
|
||||
for (UUID cardId: target.getTargets()) {
|
||||
for (UUID cardId : target.getTargets()) {
|
||||
Card card = game.getCard(cardId);
|
||||
if (card != null) {
|
||||
card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), controller.getId());
|
||||
controller.moveCards(card, null, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (UUID playerId : playersShuffle) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.shuffleLibrary(game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.Mana;
|
||||
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
|
||||
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
|
@ -66,7 +66,7 @@ public class CoralAtoll extends CardImpl {
|
|||
// Coral Atoll enters the battlefield tapped.
|
||||
this.addAbility(new EntersBattlefieldTappedAbility());
|
||||
// When Coral Atoll enters the battlefield, sacrifice it unless you return an untapped Island you control to its owner's hand.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter)))));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter)))));
|
||||
// {tap}: Add {1}{U} to your mana pool.
|
||||
this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(0, 0, 1, 0, 0, 1,0 ), new TapSourceCost()));
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.Mana;
|
||||
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
|
||||
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
|
@ -66,7 +66,7 @@ public class DormantVolcano extends CardImpl {
|
|||
this.addAbility(new EntersBattlefieldTappedAbility());
|
||||
|
||||
// When Dormant Volcano enters the battlefield, sacrifice it unless you return an untapped Mountain you control to its owner's hand.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter)))));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter)))));
|
||||
|
||||
// {tap}: Add {1}{R} to your mana pool.
|
||||
this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(1, 0, 0, 0, 0, 1,0 ), new TapSourceCost()));
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.Mana;
|
||||
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
|
||||
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
|
@ -53,7 +53,7 @@ public class Everglades extends CardImpl {
|
|||
|
||||
private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("an untapped Swamp");
|
||||
|
||||
static{
|
||||
static {
|
||||
filter.add(new SubtypePredicate("Swamp"));
|
||||
filter.add(Predicates.not(new TappedPredicate()));
|
||||
}
|
||||
|
@ -66,10 +66,10 @@ public class Everglades extends CardImpl {
|
|||
this.addAbility(new EntersBattlefieldTappedAbility());
|
||||
|
||||
// When Everglades enters the battlefield, sacrifice it unless you return an untapped Swamp you control to its owner's hand.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter)))));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(1, 1, filter, true)))));
|
||||
|
||||
// {tap}: Add {1}{B} to your mana pool.
|
||||
this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(0, 0, 0, 0, 1, 1,0 ), new TapSourceCost()));
|
||||
this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(0, 0, 0, 0, 1, 1, 0), new TapSourceCost()));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.Mana;
|
||||
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
|
||||
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
|
@ -66,7 +66,7 @@ public class JungleBasin extends CardImpl {
|
|||
this.addAbility(new EntersBattlefieldTappedAbility());
|
||||
|
||||
// When Jungle Basin enters the battlefield, sacrifice it unless you return an untapped Forest you control to its owner's hand.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter)))));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter)))));
|
||||
|
||||
// {tap}: Add {1}{G} to your mana pool.
|
||||
this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(0, 1, 0, 0, 0, 1,0 ), new TapSourceCost()));
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.Mana;
|
||||
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
|
||||
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
|
@ -66,7 +66,7 @@ public class Karoo extends CardImpl {
|
|||
this.addAbility(new EntersBattlefieldTappedAbility());
|
||||
|
||||
// When Karoo enters the battlefield, sacrifice it unless you return an untapped Plains you control to its owner's hand.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter)))));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter)))));
|
||||
|
||||
// {tap}: Add {1}{W} to your mana pool.
|
||||
this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(0, 0, 0, 1, 0, 1,0 ), new TapSourceCost()));
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
package mage.sets.commander2014;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.CanBeYourCommanderAbility;
|
||||
|
@ -55,7 +54,7 @@ import mage.constants.Zone;
|
|||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.command.Emblem;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.game.permanent.token.DemonToken;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
|
@ -77,13 +76,13 @@ public class ObNixilisOfTheBlackOath extends CardImpl {
|
|||
this.addAbility(new LoyaltyAbility(new ObNixilisOfTheBlackOathEffect1(), 2));
|
||||
|
||||
// -2: Put a 5/5 black Demon creature token with flying onto the battlefield. You lose 2 life.
|
||||
LoyaltyAbility loyaltyAbility = new LoyaltyAbility(new CreateTokenEffect(new ObNixilisDemonToken()), -2);
|
||||
LoyaltyAbility loyaltyAbility = new LoyaltyAbility(new CreateTokenEffect(new DemonToken()), -2);
|
||||
loyaltyAbility.addEffect(new LoseLifeSourceControllerEffect(2));
|
||||
this.addAbility(loyaltyAbility);
|
||||
|
||||
// -8: You get an emblem with "{1}{B}, Sacrifice a creature: You gain X life and draw X cards, where X is the sacrificed creature's power."
|
||||
this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new ObNixilisOfTheBlackOathEmblem()), -8));
|
||||
|
||||
|
||||
// Ob Nixilis of the Black Oath can be your commander.
|
||||
this.addAbility(CanBeYourCommanderAbility.getInstance());
|
||||
}
|
||||
|
@ -134,23 +133,6 @@ class ObNixilisOfTheBlackOathEffect1 extends OneShotEffect {
|
|||
|
||||
}
|
||||
|
||||
class ObNixilisDemonToken extends Token {
|
||||
|
||||
ObNixilisDemonToken() {
|
||||
super("Demon", "5/5 black Demon creature token with flying");
|
||||
setTokenType(1);
|
||||
setOriginalExpansionSetCode("C14");
|
||||
cardType.add(CardType.CREATURE);
|
||||
subtype.add("Demon");
|
||||
|
||||
color.setBlack(true);
|
||||
power = new MageInt(5);
|
||||
toughness = new MageInt(5);
|
||||
|
||||
addAbility(FlyingAbility.getInstance());
|
||||
}
|
||||
}
|
||||
|
||||
class ObNixilisOfTheBlackOathEmblem extends Emblem {
|
||||
// You get an emblem with "{1}{B}, Sacrifice a creature: You gain X life and draw X cards, where X is the sacrificed creature's power."
|
||||
public ObNixilisOfTheBlackOathEmblem() {
|
||||
|
|