Merge origin/master

This commit is contained in:
fireshoes 2015-09-28 15:59:19 -05:00
commit 1efbe346b6
189 changed files with 3507 additions and 1813 deletions

View file

@ -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

View file

@ -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;
}
}
@ -2441,26 +2647,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 +2690,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 +2789,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 +2815,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;

View file

@ -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;

View file

@ -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");

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7 KiB

View file

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View file

Before

Width:  |  Height:  |  Size: 6 KiB

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View file

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

View file

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

View file

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View file

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View file

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View file

@ -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.
*/

View file

@ -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;

View file

@ -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;
@ -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() {

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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;

View file

@ -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());
}
}

View file

@ -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);
}
}

View file

@ -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);
}
}
}

View file

@ -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());

View file

@ -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");
}
}

View file

@ -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");
}
}

View file

@ -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}

View file

@ -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"));
}

View file

@ -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());

View file

@ -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());

View file

@ -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());
}

View file

@ -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());

View file

@ -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);
}

View file

@ -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) {

View file

@ -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)) {

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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) {

View file

@ -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);
}
}

View file

@ -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);

View file

@ -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;
}
}

View file

@ -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()));

View file

@ -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()));

View file

@ -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()));
}

View file

@ -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()));

View file

@ -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()));

View file

@ -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() {

View file

@ -62,7 +62,7 @@ public class WarmongerHellkite extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// All creatures attack each combat if able.
Effect effect = new AttacksIfAbleAllEffect(new FilterCreaturePermanent("creatures"));
Effect effect = new AttacksIfAbleAllEffect(new FilterCreaturePermanent("creatures"), Duration.WhileOnBattlefield, true);
effect.setText("All creatures attack each combat if able");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));

View file

@ -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.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.PutPermanentOnBattlefieldEffect;
@ -61,7 +61,7 @@ public class MasterTransmuter extends CardImpl {
// {U}, {tap}, Return an artifact you control to its owner's hand: You may put an artifact card from your hand onto the battlefield.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutPermanentOnBattlefieldEffect(new FilterArtifactCard("an artifact card")), new ManaCostsImpl("{U}"));
ability.addCost(new TapSourceCost());
ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(new FilterControlledArtifactPermanent("an artifact"))));
ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(new FilterControlledArtifactPermanent("an artifact"))));
this.addAbility(ability);
}

View file

@ -30,13 +30,12 @@ package mage.sets.darkascension;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.condition.common.FatefulHourCondition;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.HumanToken;
/**
*
@ -64,17 +63,3 @@ public class GatherTheTownsfolk extends CardImpl {
return new GatherTheTownsfolk(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);
}
}

View file

@ -28,14 +28,18 @@
package mage.sets.darkascension;
import java.util.UUID;
import mage.constants.*;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.FlashbackAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TimingRule;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.token.HumanToken;
import mage.game.stack.Spell;
/**
@ -48,7 +52,6 @@ public class IncreasingDevotion extends CardImpl {
super(ownerId, 11, "Increasing Devotion", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{W}{W}");
this.expansionSetCode = "DKA";
// Put five 1/1 white Human creature tokens onto the battlefield. If Increasing Devotion was cast from a graveyard, put ten of those tokens onto the battlefield instead.
this.getSpellAbility().addEffect(new IncreasingDevotionEffect());

View file

@ -41,6 +41,7 @@ import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.permanent.token.HumanToken;
/**
*

View file

@ -32,9 +32,7 @@ import java.util.Set;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.EntersOrLeavesTheBattlefieldSourceTriggeredAbility;
import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
@ -98,19 +96,18 @@ class SunderingTitanDestroyLandEffect extends OneShotEffect {
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
Set<UUID> lands = new HashSet<>();
if (controller != null && sourcePermanent != null) {
for (String landName : new String[] {"Forest","Island","Mountain","Plains","Swamp"}) {
FilterLandPermanent filter = new FilterLandPermanent(new StringBuilder(landName).append(" to destroy").toString());
for (String landName : new String[]{"Forest", "Island", "Mountain", "Plains", "Swamp"}) {
FilterLandPermanent filter = new FilterLandPermanent(landName + " to destroy");
filter.add(new SubtypePredicate(landName));
Target target = new TargetLandPermanent(1,1, filter, true);
Target target = new TargetLandPermanent(1, 1, filter, true);
if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) {
controller.chooseTarget(outcome, target, source, game);
lands.add(target.getFirstTarget());
}
}
if (!lands.isEmpty()) {
int destroyedLands = 0;
for (UUID landId: lands) {
for (UUID landId : lands) {
Permanent land = game.getPermanent(landId);
if (land != null) {
if (land.destroy(source.getSourceId(), game, false)) {
@ -118,9 +115,9 @@ class SunderingTitanDestroyLandEffect extends OneShotEffect {
}
}
}
game.informPlayers(new StringBuilder(sourcePermanent.getName()).append(": ").append(destroyedLands).append(destroyedLands > 1 ? " lands were destroyed":"land was destroyed").toString());
game.informPlayers(sourcePermanent.getLogName() + ": " + destroyedLands + (destroyedLands > 1 ? " lands were" : "land was") + " destroyed");
}
return true;
}
return false;
}

View file

@ -28,13 +28,12 @@
package mage.sets.dragonsoftarkir;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.WarriorToken;
/**
*
@ -47,7 +46,7 @@ public class SecureTheWastes extends CardImpl {
this.expansionSetCode = "DTK";
// Put X 1/1 white Warrior creature tokens onto the battlefield.
this.getSpellAbility().addEffect(new CreateTokenEffect(new SecureTheWastesToken(), new ManacostVariableValue()));
this.getSpellAbility().addEffect(new CreateTokenEffect(new WarriorToken(), new ManacostVariableValue()));
}
public SecureTheWastes(final SecureTheWastes card) {
@ -59,17 +58,3 @@ public class SecureTheWastes extends CardImpl {
return new SecureTheWastes(this);
}
}
class SecureTheWastesToken extends Token {
SecureTheWastesToken() {
super("Warrior", "1/1 white Warrior creature token");
this.setOriginalExpansionSetCode("DTK");
cardType.add(CardType.CREATURE);
subtype.add("Warrior");
color.setWhite(true);
power = new MageInt(1);
toughness = new MageInt(1);
}
}

View file

@ -1,116 +1,104 @@
/*
* 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.eventide;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.FilterPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.Token;
/**
*
* @author jeffwadsworth
*
*/
public class SpringjackShepherd extends CardImpl {
public SpringjackShepherd(UUID ownerId) {
super(ownerId, 15, "Springjack Shepherd", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}");
this.expansionSetCode = "EVE";
this.subtype.add("Kithkin");
this.subtype.add("Wizard");
this.power = new MageInt(1);
this.toughness = new MageInt(2);
// Chroma - When Springjack Shepherd enters the battlefield, put a 0/1 white Goat creature token onto the battlefield for each white mana symbol in the mana costs of permanents you control.
Effect effect = new CreateTokenEffect(new GoatToken(), new ChromaSpringjackShepherdCount());
effect.setText("<i>Chroma</i> - When Springjack Shepherd enters the battlefield, put a 0/1 white Goat creature token onto the battlefield for each white mana symbol in the mana costs of permanents you control.");
this.addAbility(new EntersBattlefieldTriggeredAbility(effect, false, true));
}
public SpringjackShepherd(final SpringjackShepherd card) {
super(card);
}
@Override
public SpringjackShepherd copy() {
return new SpringjackShepherd(this);
}
}
class ChromaSpringjackShepherdCount implements DynamicValue {
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
int chroma = 0;
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterPermanent(), sourceAbility.getControllerId(), game)) {
chroma += permanent.getManaCost().getMana().getWhite();
}
return chroma;
}
@Override
public DynamicValue copy() {
return new ChromaSpringjackShepherdCount();
}
@Override
public String toString() {
return "1";
}
@Override
public String getMessage() {
return "";
}
}
class GoatToken extends Token {
public GoatToken() {
super("Goat", "a 0/1 white Goat creature token");
cardType.add(CardType.CREATURE);
color.setWhite(true);
subtype.add("Goat");
power = new MageInt(0);
toughness = new MageInt(1);
}
/*
* 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.eventide;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.FilterPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.GoatToken;
/**
*
* @author jeffwadsworth
*
*/
public class SpringjackShepherd extends CardImpl {
public SpringjackShepherd(UUID ownerId) {
super(ownerId, 15, "Springjack Shepherd", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}");
this.expansionSetCode = "EVE";
this.subtype.add("Kithkin");
this.subtype.add("Wizard");
this.power = new MageInt(1);
this.toughness = new MageInt(2);
// Chroma - When Springjack Shepherd enters the battlefield, put a 0/1 white Goat creature token onto the battlefield for each white mana symbol in the mana costs of permanents you control.
Effect effect = new CreateTokenEffect(new GoatToken(), new ChromaSpringjackShepherdCount());
effect.setText("<i>Chroma</i> - When Springjack Shepherd enters the battlefield, put a 0/1 white Goat creature token onto the battlefield for each white mana symbol in the mana costs of permanents you control.");
this.addAbility(new EntersBattlefieldTriggeredAbility(effect, false, true));
}
public SpringjackShepherd(final SpringjackShepherd card) {
super(card);
}
@Override
public SpringjackShepherd copy() {
return new SpringjackShepherd(this);
}
}
class ChromaSpringjackShepherdCount implements DynamicValue {
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
int chroma = 0;
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterPermanent(), sourceAbility.getControllerId(), game)) {
chroma += permanent.getManaCost().getMana().getWhite();
}
return chroma;
}
@Override
public DynamicValue copy() {
return new ChromaSpringjackShepherdCount();
}
@Override
public String toString() {
return "1";
}
@Override
public String getMessage() {
return "";
}
}

View file

@ -0,0 +1,83 @@
/*
* 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.exodus;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.keyword.ShadowAbility;
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.target.common.TargetCreaturePermanent;
/**
*
* @author LoneFox
*/
public class DauthiCutthroat extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with shadow");
static {
filter.add(new AbilityPredicate(ShadowAbility.class));
}
public DauthiCutthroat(UUID ownerId) {
super(ownerId, 57, "Dauthi Cutthroat", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}");
this.expansionSetCode = "EXO";
this.subtype.add("Dauthi");
this.subtype.add("Minion");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// Shadow
this.addAbility(ShadowAbility.getInstance());
// {1}{B}, {tap}: Destroy target creature with shadow.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{1}{B}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent(filter));
this.addAbility(ability);
}
public DauthiCutthroat(final DauthiCutthroat card) {
super(card);
}
@Override
public DauthiCutthroat copy() {
return new DauthiCutthroat(this);
}
}

View file

@ -0,0 +1,70 @@
/*
* 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.futuresight;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.HellbentCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.keyword.ShadowAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
/**
*
* @author LoneFox
*/
public class CutthroatIlDal extends CardImpl {
public CutthroatIlDal(UUID ownerId) {
super(ownerId, 64, "Cutthroat il-Dal", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}");
this.expansionSetCode = "FUT";
this.subtype.add("Human");
this.subtype.add("Rogue");
this.power = new MageInt(4);
this.toughness = new MageInt(1);
// Hellbent - Cutthroat il-Dal has shadow as long as you have no cards in hand.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new GainAbilitySourceEffect(ShadowAbility.getInstance(), Duration.WhileOnBattlefield), HellbentCondition.getInstance(),
"<i>Hellbent</i> - {this} has shadow as long as you have no cards in hand"))); }
public CutthroatIlDal(final CutthroatIlDal card) {
super(card);
}
@Override
public CutthroatIlDal copy() {
return new CutthroatIlDal(this);
}
}

View file

@ -0,0 +1,67 @@
/*
* 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.futuresight;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.keyword.ShadowAbility;
import mage.abilities.keyword.SuspendAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
* @author LoneFox
*/
public class InfiltratorIlKor extends CardImpl {
public InfiltratorIlKor(UUID ownerId) {
super(ownerId, 37, "Infiltrator il-Kor", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{U}");
this.expansionSetCode = "FUT";
this.subtype.add("Kor");
this.subtype.add("Rogue");
this.power = new MageInt(3);
this.toughness = new MageInt(1);
// Shadow
this.addAbility(ShadowAbility.getInstance());
// Suspend 2-{1}{U}
this.addAbility(new SuspendAbility(2, new ManaCostsImpl("{1}{U}"), this));
}
public InfiltratorIlKor(final InfiltratorIlKor card) {
super(card);
}
@Override
public InfiltratorIlKor copy() {
return new InfiltratorIlKor(this);
}
}

View file

@ -44,7 +44,7 @@ import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.permanent.TappedPredicate;
import mage.game.Game;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.DemonToken;
import mage.target.common.TargetControlledCreaturePermanent;
/**
@ -111,18 +111,3 @@ class SkirsdagHighPriestCost extends CostImpl {
return paid;
}
}
class DemonToken extends Token {
DemonToken() {
super("Demon", "5/5 black Demon creature token with flying");
cardType.add(CardType.CREATURE);
subtype.add("Demon");
color.setBlack(true);
power = new MageInt(5);
toughness = new MageInt(5);
addAbility(FlyingAbility.getInstance());
}
}

View file

@ -30,7 +30,7 @@ package mage.sets.jacevschandra;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility;
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.keyword.MorphAbility;
import mage.cards.CardImpl;
@ -60,7 +60,7 @@ public class FathomSeer extends CardImpl {
this.toughness = new MageInt(3);
// Morph-Return two Islands you control to their owner's hand.
this.addAbility(new MorphAbility(this, new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(2,2, filter, true))));
this.addAbility(new MorphAbility(this, new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(2,2, filter, true))));
// When Fathom Seer is turned face up, draw two cards.
this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new DrawCardSourceControllerEffect(2)));
}

View file

@ -29,7 +29,7 @@ package mage.sets.jacevschandra;
import java.util.UUID;
import mage.abilities.costs.AlternativeCostSourceAbility;
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
@ -55,7 +55,7 @@ public class Gush extends CardImpl {
// You may return two Islands you control to their owner's hand rather than pay Gush's mana cost.
AlternativeCostSourceAbility ability;
ability = new AlternativeCostSourceAbility(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(2, 2, filter, true)));
ability = new AlternativeCostSourceAbility(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(2, 2, filter, true)));
this.addAbility(ability);
// Draw two cards.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2));

View file

@ -30,7 +30,7 @@ package mage.sets.jacevschandra;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
@ -67,7 +67,7 @@ public class WaterspoutDjinn extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// At the beginning of your upkeep, sacrifice Waterspout Djinn unless you return an untapped Island you control to its owner's hand.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
new SacrificeSourceUnlessPaysEffect(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))),
new SacrificeSourceUnlessPaysEffect(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))),
TargetController.YOU, false));
}

View file

@ -40,7 +40,7 @@ import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.WarriorToken;
import mage.game.stack.StackAbility;
/**
@ -79,7 +79,7 @@ public class HeraldOfAnafenza extends CardImpl {
class HeraldOfAnafenzaTriggeredAbility extends TriggeredAbilityImpl {
public HeraldOfAnafenzaTriggeredAbility() {
super(Zone.BATTLEFIELD, new CreateTokenEffect(new HeraldOfAnafenzaWarriorToken()), false);
super(Zone.BATTLEFIELD, new CreateTokenEffect(new WarriorToken()), false);
}
public HeraldOfAnafenzaTriggeredAbility(final HeraldOfAnafenzaTriggeredAbility ability) {
@ -90,7 +90,7 @@ class HeraldOfAnafenzaTriggeredAbility extends TriggeredAbilityImpl {
public HeraldOfAnafenzaTriggeredAbility copy() {
return new HeraldOfAnafenzaTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ACTIVATED_ABILITY;
@ -112,18 +112,3 @@ class HeraldOfAnafenzaTriggeredAbility extends TriggeredAbilityImpl {
return "Whenever you activate {this}'s outlast ability, " + super.getRule();
}
}
class HeraldOfAnafenzaWarriorToken extends Token {
public HeraldOfAnafenzaWarriorToken() {
super("Warrior", "1/1 white Warrior creature token");
this.setOriginalExpansionSetCode("KTK");
this.setTokenType(1);
cardType.add(CardType.CREATURE);
subtype.add("Warrior");
color.setWhite(true);
power = new MageInt(1);
toughness = new MageInt(1);
}
}

View file

@ -28,7 +28,6 @@
package mage.sets.khansoftarkir;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.effects.ContinuousEffect;
@ -48,7 +47,7 @@ import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.WarriorToken;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import mage.target.common.TargetOpponent;
@ -61,12 +60,12 @@ import mage.target.targetpointer.FixedTarget;
public class MarduCharm extends CardImpl {
private static final FilterCard filter = new FilterCard("a noncreature, nonland card");
static {
filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
filter.add(Predicates.not(new CardTypePredicate(CardType.LAND)));
}
public MarduCharm(UUID ownerId) {
super(ownerId, 186, "Mardu Charm", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{R}{W}{B}");
this.expansionSetCode = "KTK";
@ -76,18 +75,18 @@ public class MarduCharm extends CardImpl {
// <strong>*</strong> Mardu Charm deals 4 damage to target creature.
this.getSpellAbility().addEffect(new DamageTargetEffect(4));
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
// <strong>*</strong> Put two 1/1 white Warrior creature tokens onto the battlefield. They gain first strike until end of turn.
Mode mode = new Mode();
mode.getEffects().add(new MarduCharmCreateTokenEffect());
this.getSpellAbility().addMode(mode);
// <strong>*</strong> Target opponent reveals his or her hand. You choose a noncreature, nonland card from it. That player discards that card.
mode = new Mode();
mode.getEffects().add(new DiscardCardYouChooseTargetEffect(filter));
mode.getTargets().add(new TargetOpponent());
this.getSpellAbility().addMode(mode);
}
public MarduCharm(final MarduCharm card) {
@ -101,26 +100,26 @@ public class MarduCharm extends CardImpl {
}
class MarduCharmCreateTokenEffect extends OneShotEffect {
public MarduCharmCreateTokenEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "Put two 1/1 white Warrior creature tokens onto the battlefield. They gain first strike until end of turn";
}
public MarduCharmCreateTokenEffect(final MarduCharmCreateTokenEffect effect) {
super(effect);
}
@Override
public MarduCharmCreateTokenEffect copy() {
return new MarduCharmCreateTokenEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
CreateTokenEffect effect = new CreateTokenEffect(new MarduCharmWarriorToken(), 2);
CreateTokenEffect effect = new CreateTokenEffect(new WarriorToken(), 2);
effect.apply(game, source);
for (UUID tokenId :effect.getLastAddedTokenIds()) {
Permanent token = game.getPermanent(tokenId);
@ -135,16 +134,3 @@ class MarduCharmCreateTokenEffect extends OneShotEffect {
return false;
}
}
class MarduCharmWarriorToken extends Token {
public MarduCharmWarriorToken() {
super("Warrior", "1/1 white Warrior creature token");
this.setOriginalExpansionSetCode("KTK");
this.setTokenType(2);
cardType.add(CardType.CREATURE);
color.setWhite(true);
subtype.add("Warrior");
power = new MageInt(1);
toughness = new MageInt(1);
}
}

View file

@ -36,7 +36,7 @@ import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.WarriorToken;
import mage.watchers.common.PlayerAttackedWatcher;
/**
@ -55,7 +55,7 @@ public class MarduHordechief extends CardImpl {
this.toughness = new MageInt(3);
// <i>Raid</i> - When Mardu Hordechief enters the battlefield, if you attacked with a creature this turn, put a 1/1 white Warrior creature token onto the battlefield
this.addAbility(new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new MarduHordechiefToken())), RaidCondition.getInstance(),
this.addAbility(new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new WarriorToken())), RaidCondition.getInstance(),
"<i>Raid</i> - When {this} enters the battlefield, if you attacked with a creature this turn, put a 1/1 white Warrior creature token onto the battlefield."),
new PlayerAttackedWatcher());
}
@ -69,17 +69,3 @@ public class MarduHordechief extends CardImpl {
return new MarduHordechief(this);
}
}
class MarduHordechiefToken extends Token {
MarduHordechiefToken() {
super("Warrior", "1/1 white Warrior creature token");
this.setOriginalExpansionSetCode("KTK");
cardType.add(CardType.CREATURE);
subtype.add("Warrior");
color.setWhite(true);
power = new MageInt(1);
toughness = new MageInt(1);
}
}

View file

@ -31,7 +31,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.CantBeCounteredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost;
import mage.abilities.effects.common.ReturnToHandSourceEffect;
import mage.abilities.keyword.FlashAbility;
import mage.abilities.keyword.ProwessAbility;
@ -67,7 +67,7 @@ public class PearlLakeAncient extends CardImpl {
// Return three lands you control to their owner's hand: Return Pearl Lake Ancient to its owner's hand.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true),
new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(3, 3, new FilterControlledLandPermanent("lands"), true))));
new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(3, 3, new FilterControlledLandPermanent("lands"), true))));
}
public PearlLakeAncient(final PearlLakeAncient card) {

View file

@ -28,12 +28,11 @@
package mage.sets.khansoftarkir;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.WarriorToken;
/**
*
@ -47,7 +46,7 @@ public class TakeUpArms extends CardImpl {
// Put three 1/1 white Warrior creature tokens onto the battlefield.
this.getSpellAbility().addEffect(new CreateTokenEffect(new TakeUpArmsToken(), 3));
this.getSpellAbility().addEffect(new CreateTokenEffect(new WarriorToken(), 3));
}
public TakeUpArms(final TakeUpArms card) {
@ -59,17 +58,3 @@ public class TakeUpArms extends CardImpl {
return new TakeUpArms(this);
}
}
class TakeUpArmsToken extends Token {
TakeUpArmsToken() {
super("Warrior", "1/1 white Warrior creature token");
this.setOriginalExpansionSetCode("KTK");
cardType.add(CardType.CREATURE);
subtype.add("Warrior");
color.setWhite(true);
power = new MageInt(1);
toughness = new MageInt(1);
}
}

View file

@ -37,7 +37,7 @@ import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.SetTargetPointer;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.SliverToken;
/**
*
@ -53,12 +53,11 @@ public class BroodSliver extends CardImpl {
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Whenever a Sliver deals combat damage to a player, its controller may put a 1/1 colorless Sliver creature token onto the battlefield.
// Whenever a Sliver deals combat damage to a player, its controller may put a 1/1 colorless Sliver creature token onto the battlefield.
Effect effect = new CreateTokenTargetEffect(new SliverToken());
effect.setText("its controller may put a 1/1 colorless Sliver creature token onto the battlefield");
this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility(effect,
new FilterCreaturePermanent("Sliver", "a Sliver"),
true, SetTargetPointer.PLAYER, true));
this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility(effect,
new FilterCreaturePermanent("Sliver", "a Sliver"), true, SetTargetPointer.PLAYER, true));
}
public BroodSliver(final BroodSliver card) {
@ -70,14 +69,3 @@ public class BroodSliver extends CardImpl {
return new BroodSliver(this);
}
}
class SliverToken extends Token {
public SliverToken() {
super("Sliver", "1/1 colorless Sliver creature token");
cardType.add(CardType.CREATURE);
subtype.add("Sliver");
power = new MageInt(1);
toughness = new MageInt(1);
}
}

View file

@ -38,14 +38,14 @@ import mage.constants.Rarity;
import mage.constants.SetTargetPointer;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.GoblinRogueToken;
/**
*
* @author fireshoes
*/
public class BoggartMob extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("a Goblin you control");
static {
@ -62,10 +62,10 @@ public class BoggartMob extends CardImpl {
// Champion a Goblin
this.addAbility(new ChampionAbility(this, "Goblin"));
// Whenever a Goblin you control deals combat damage to a player, you may put a 1/1 black Goblin Rogue creature token onto the battlefield.
this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility(
new CreateTokenEffect(new BlackGoblinRogueToken()),
new CreateTokenEffect(new GoblinRogueToken()),
filter, true, SetTargetPointer.NONE, true));
}
@ -78,15 +78,3 @@ public class BoggartMob extends CardImpl {
return new BoggartMob(this);
}
}
class BlackGoblinRogueToken extends Token {
BlackGoblinRogueToken() {
super("Goblin Rogue", "1/1 black Goblin Rogue creature token");
cardType.add(CardType.CREATURE);
color.setBlack(true);
subtype.add("Goblin");
subtype.add("Rogue");
power = new MageInt(1);
toughness = new MageInt(1);
}
}

Some files were not shown because too many files have changed in this diff Show more