diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/SortSettingBase.java b/Mage.Client/src/main/java/mage/client/deckeditor/SortSettingBase.java index 1388359b3a..7a0f6494ec 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/SortSettingBase.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/SortSettingBase.java @@ -36,10 +36,10 @@ import mage.client.dialog.PreferencesDialog; public class SortSettingBase extends SortSetting { - private final static SortSettingBase fInstance = new SortSettingBase(); + private final static SortSettingBase instance = new SortSettingBase(); public static SortSettingBase getInstance() { - return fInstance; + return instance; } private SortSettingBase() { diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/SortSettingDeck.java b/Mage.Client/src/main/java/mage/client/deckeditor/SortSettingDeck.java index 8320e687f5..3675bc1552 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/SortSettingDeck.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/SortSettingDeck.java @@ -36,10 +36,10 @@ import mage.client.dialog.PreferencesDialog; public class SortSettingDeck extends SortSetting { - private final static SortSettingDeck fInstance = new SortSettingDeck(); + private final static SortSettingDeck instance = new SortSettingDeck(); public static SortSettingDeck getInstance() { - return fInstance; + return instance; } private SortSettingDeck() { diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/SortSettingDraft.java b/Mage.Client/src/main/java/mage/client/deckeditor/SortSettingDraft.java index 1650c64f32..ae659df52a 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/SortSettingDraft.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/SortSettingDraft.java @@ -36,10 +36,10 @@ import mage.client.dialog.PreferencesDialog; */ public class SortSettingDraft extends SortSetting { - private final static SortSettingDraft fInstance = new SortSettingDraft(); + private final static SortSettingDraft instance = new SortSettingDraft(); public static SortSettingDraft getInstance() { - return fInstance; + return instance; } private SortSettingDraft() { diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/SortSettingSideboard.java b/Mage.Client/src/main/java/mage/client/deckeditor/SortSettingSideboard.java index a0e0568e2b..8ed20dc089 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/SortSettingSideboard.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/SortSettingSideboard.java @@ -36,10 +36,10 @@ import mage.client.dialog.PreferencesDialog; public class SortSettingSideboard extends SortSetting { - private static final SortSettingSideboard fInstance = new SortSettingSideboard(); + private static final SortSettingSideboard instance = new SortSettingSideboard(); public static SortSettingSideboard getInstance() { - return fInstance; + return instance; } private SortSettingSideboard() { diff --git a/Mage.Client/src/main/java/mage/client/plugins/impl/Plugins.java b/Mage.Client/src/main/java/mage/client/plugins/impl/Plugins.java index b49551e60f..47a0ec9456 100644 --- a/Mage.Client/src/main/java/mage/client/plugins/impl/Plugins.java +++ b/Mage.Client/src/main/java/mage/client/plugins/impl/Plugins.java @@ -35,7 +35,7 @@ public class Plugins implements MagePlugins { public static final String PLUGINS_DIRECTORY = "plugins/"; - private static final MagePlugins fINSTANCE = new Plugins(); + private static final MagePlugins instance = new Plugins(); private static final Logger LOGGER = Logger.getLogger(Plugins.class); private static PluginManager pm; @@ -46,7 +46,7 @@ public class Plugins implements MagePlugins { private final Map sortingOptions = new HashMap<>(); public static MagePlugins getInstance() { - return fINSTANCE; + return instance; } @Override diff --git a/Mage.Client/src/main/java/mage/client/unusedFiles/DelayedViewerThread.java b/Mage.Client/src/main/java/mage/client/unusedFiles/DelayedViewerThread.java index 33c2071179..851bffeabe 100644 --- a/Mage.Client/src/main/java/mage/client/unusedFiles/DelayedViewerThread.java +++ b/Mage.Client/src/main/java/mage/client/unusedFiles/DelayedViewerThread.java @@ -9,10 +9,10 @@ import java.util.Map; public class DelayedViewerThread extends Thread { - private static final DelayedViewerThread fInstance = new DelayedViewerThread(); + private static final DelayedViewerThread instance = new DelayedViewerThread(); public static DelayedViewerThread getInstance() { - return fInstance; + return instance; } private final Map delayedViewers; diff --git a/Mage.Client/src/main/java/mage/client/util/GameManager.java b/Mage.Client/src/main/java/mage/client/util/GameManager.java index 731a5c8065..081014d478 100644 --- a/Mage.Client/src/main/java/mage/client/util/GameManager.java +++ b/Mage.Client/src/main/java/mage/client/util/GameManager.java @@ -8,10 +8,10 @@ import java.util.UUID; * @author nantuko */ public class GameManager { - private static final GameManager fInstance = new GameManager(); + private static final GameManager instance = new GameManager(); public static GameManager getInstance() { - return fInstance; + return instance; } public void setStackSize(int stackSize) { diff --git a/Mage.Client/src/main/java/mage/client/util/SettingsManager.java b/Mage.Client/src/main/java/mage/client/util/SettingsManager.java index 990fa556eb..bb0062f7f9 100644 --- a/Mage.Client/src/main/java/mage/client/util/SettingsManager.java +++ b/Mage.Client/src/main/java/mage/client/util/SettingsManager.java @@ -10,10 +10,10 @@ import org.mage.card.arcane.CardPanel; * @author nantuko */ public class SettingsManager { - private static final SettingsManager fInstance = new SettingsManager(); + private static final SettingsManager instance = new SettingsManager(); public static SettingsManager getInstance() { - return fInstance; + return instance; } public int getScreenWidth() { diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/utils/impl/ImageManagerImpl.java b/Mage.Client/src/main/java/org/mage/plugins/card/utils/impl/ImageManagerImpl.java index 6e4f676030..f6de00cdc1 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/utils/impl/ImageManagerImpl.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/utils/impl/ImageManagerImpl.java @@ -19,10 +19,10 @@ import org.mage.plugins.card.utils.Transparency; public class ImageManagerImpl implements ImageManager { - private static final ImageManagerImpl fInstance = new ImageManagerImpl(); + private static final ImageManagerImpl instance = new ImageManagerImpl(); public static ImageManagerImpl getInstance() { - return fInstance; + return instance; } public ImageManagerImpl() { diff --git a/Mage.Server/src/main/java/mage/server/ChatManager.java b/Mage.Server/src/main/java/mage/server/ChatManager.java index 70de72b033..c48de3f0c8 100644 --- a/Mage.Server/src/main/java/mage/server/ChatManager.java +++ b/Mage.Server/src/main/java/mage/server/ChatManager.java @@ -44,19 +44,12 @@ import java.util.regex.Pattern; /** * @author BetaSteward_at_googlemail.com */ -public class ChatManager { +public enum ChatManager { + instance; private static final Logger logger = Logger.getLogger(ChatManager.class); private static final HashMap userMessages = new HashMap<>(); - private static final ChatManager INSTANCE = new ChatManager(); - - public static ChatManager getInstance() { - return INSTANCE; - } - - private ChatManager() { - } private final ConcurrentHashMap chatSessions = new ConcurrentHashMap<>(); @@ -113,7 +106,7 @@ public class ChatManager { ChatSession chatSession = chatSessions.get(chatId); if (chatSession != null) { if (message.startsWith("\\") || message.startsWith("/")) { - User user = UserManager.getInstance().getUserByName(userName); + User user = UserManager.instance.getUserByName(userName); if (user != null) { if (!performUserCommand(user, message, chatId, false)) { performUserCommand(user, message, chatId, true); @@ -123,7 +116,7 @@ public class ChatManager { } if (messageType != MessageType.GAME) { - User user = UserManager.getInstance().getUserByName(userName); + User user = UserManager.instance.getUserByName(userName); if (message != null && userName != null && !userName.isEmpty()) { if (message.equals(userMessages.get(userName))) { @@ -205,12 +198,12 @@ public class ChatManager { } if (command.startsWith("H ") || command.startsWith("HISTORY ")) { - message += "
" + UserManager.getInstance().getUserHistory(message.substring(command.startsWith("H ") ? 3 : 9)); + message += "
" + UserManager.instance.getUserHistory(message.substring(command.startsWith("H ") ? 3 : 9)); chatSessions.get(chatId).broadcastInfoToUser(user, message); return true; } if (command.equals("ME")) { - message += "
" + UserManager.getInstance().getUserHistory(user.getName()); + message += "
" + UserManager.instance.getUserHistory(user.getName()); chatSessions.get(chatId).broadcastInfoToUser(user, message); return true; } @@ -220,7 +213,7 @@ public class ChatManager { if (first > 1) { String userToName = rest.substring(0, first); rest = rest.substring(first + 1).trim(); - User userTo = UserManager.getInstance().getUserByName(userToName); + User userTo = UserManager.instance.getUserByName(userToName); if (userTo != null) { if (!chatSessions.get(chatId).broadcastWhisperToUser(user, userTo, rest)) { message += new StringBuilder("
User ").append(userToName).append(" not found").toString(); @@ -251,7 +244,7 @@ public class ChatManager { * @param color */ public void broadcast(UUID userId, String message, MessageColor color) throws UserNotFoundException { - UserManager.getInstance().getUser(userId).ifPresent(user-> { + UserManager.instance.getUser(userId).ifPresent(user-> { chatSessions.values() .stream() .filter(chat -> chat.hasUser(userId)) @@ -261,7 +254,7 @@ public class ChatManager { } public void sendReconnectMessage(UUID userId) { - UserManager.getInstance().getUser(userId).ifPresent(user -> + UserManager.instance.getUser(userId).ifPresent(user -> chatSessions.values() .stream() .filter(chat -> chat.hasUser(userId)) diff --git a/Mage.Server/src/main/java/mage/server/ChatSession.java b/Mage.Server/src/main/java/mage/server/ChatSession.java index cb9290d84e..8abfdce334 100644 --- a/Mage.Server/src/main/java/mage/server/ChatSession.java +++ b/Mage.Server/src/main/java/mage/server/ChatSession.java @@ -61,7 +61,7 @@ public class ChatSession { } public void join(UUID userId) { - UserManager.getInstance().getUser(userId).ifPresent(user-> { + UserManager.instance.getUser(userId).ifPresent(user-> { if (!clients.containsKey(userId)) { String userName = user.getName(); clients.put(userId, userName); @@ -142,7 +142,7 @@ public class ChatSession { HashSet clientsToRemove = null; ClientCallback clientCallback = new ClientCallback("chatMessage", chatId, new ChatMessage(userName, message, (withTime ? timeFormatter.format(new Date()) : ""), color, messageType, soundToPlay)); for (UUID userId : clients.keySet()) { - Optional user = UserManager.getInstance().getUser(userId); + Optional user = UserManager.instance.getUser(userId); if (user.isPresent()) { user.get().fireCallback(clientCallback); } else { diff --git a/Mage.Server/src/main/java/mage/server/GmailClient.java b/Mage.Server/src/main/java/mage/server/GmailClient.java index 1b6e6a39f0..a091ede4d4 100644 --- a/Mage.Server/src/main/java/mage/server/GmailClient.java +++ b/Mage.Server/src/main/java/mage/server/GmailClient.java @@ -80,8 +80,8 @@ public final class GmailClient { Message message = new Message(); message.setRaw(Base64.encodeBase64URLSafeString(baos.toByteArray())); - gmail.users().messages().send(ConfigSettings.getInstance().getGoogleAccount() - + (ConfigSettings.getInstance().getGoogleAccount().endsWith("@gmail.com") ? "" : "@gmail.com"), message).execute(); + gmail.users().messages().send(ConfigSettings.instance.getGoogleAccount() + + (ConfigSettings.instance.getGoogleAccount().endsWith("@gmail.com") ? "" : "@gmail.com"), message).execute(); return true; } catch (MessagingException | IOException ex) { logger.error("Error sending message", ex); diff --git a/Mage.Server/src/main/java/mage/server/MageServerImpl.java b/Mage.Server/src/main/java/mage/server/MageServerImpl.java index 0a9e40aecc..e6ad4bf1d3 100644 --- a/Mage.Server/src/main/java/mage/server/MageServerImpl.java +++ b/Mage.Server/src/main/java/mage/server/MageServerImpl.java @@ -90,12 +90,12 @@ public class MageServerImpl implements MageServer { public MageServerImpl(String adminPassword, boolean testMode) { this.adminPassword = adminPassword; this.testMode = testMode; - ServerMessagesUtil.getInstance().getMessages(); + ServerMessagesUtil.instance.getMessages(); } @Override public boolean registerUser(String sessionId, String userName, String password, String email) throws MageException { - return SessionManager.getInstance().registerUser(sessionId, userName, password, email); + return SessionManager.instance.registerUser(sessionId, userName, password, email); } // generateAuthToken returns a uniformly distributed 6-digits string. @@ -105,7 +105,7 @@ public class MageServerImpl implements MageServer { @Override public boolean emailAuthToken(String sessionId, String email) throws MageException { - if (!ConfigSettings.getInstance().isAuthenticationActivated()) { + if (!ConfigSettings.instance.isAuthenticationActivated()) { sendErrorMessageToClient(sessionId, "Registration is disabled by the server config"); return false; } @@ -121,7 +121,7 @@ public class MageServerImpl implements MageServer { String text = "Use this auth token to reset " + authorizedUser.name + "'s password: " + authToken + '\n' + "It's valid until the next server restart."; boolean success; - if (!ConfigSettings.getInstance().getMailUser().isEmpty()) { + if (!ConfigSettings.instance.getMailUser().isEmpty()) { success = MailClient.sendMessage(email, subject, text); } else { success = MailgunClient.sendMessage(email, subject, text); @@ -135,7 +135,7 @@ public class MageServerImpl implements MageServer { @Override public boolean resetPassword(String sessionId, String email, String authToken, String password) throws MageException { - if (!ConfigSettings.getInstance().isAuthenticationActivated()) { + if (!ConfigSettings.instance.isAuthenticationActivated()) { sendErrorMessageToClient(sessionId, "Registration is disabled by the server config"); return false; } @@ -164,7 +164,7 @@ public class MageServerImpl implements MageServer { logger.info("MageVersionException: userName=" + userName + ", version=" + version); throw new MageVersionException(version, Main.getVersion()); } - return SessionManager.getInstance().connectUser(sessionId, userName, password, userIdStr); + return SessionManager.instance.connectUser(sessionId, userName, password, userIdStr); } catch (MageException ex) { if (ex instanceof MageVersionException) { throw (MageVersionException) ex; @@ -179,7 +179,7 @@ public class MageServerImpl implements MageServer { return executeWithResult("setUserData", sessionId, new ActionWithBooleanResult() { @Override public Boolean execute() throws MageException { - return SessionManager.getInstance().setUserData(userName, sessionId, userData, clientVersion, userIdStr); + return SessionManager.instance.setUserData(userName, sessionId, userData, clientVersion, userIdStr); } }); } @@ -193,7 +193,7 @@ public class MageServerImpl implements MageServer { if (!adminPassword.equals(this.adminPassword)) { throw new MageException("Wrong password"); } - return SessionManager.getInstance().connectAdmin(sessionId); + return SessionManager.instance.connectAdmin(sessionId); } catch (Exception ex) { handleException(ex); } @@ -211,8 +211,8 @@ public class MageServerImpl implements MageServer { @Override public TableView execute() throws MageException { try { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - Optional _user = UserManager.getInstance().getUser(userId); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + Optional _user = UserManager.instance.getUser(userId); if (!_user.isPresent()) { logger.error("User for session not found. session = " + sessionId); return null; @@ -225,7 +225,7 @@ public class MageServerImpl implements MageServer { throw new MageException("No message"); } // check AI players max - String maxAiOpponents = ConfigSettings.getInstance().getMaxAiOpponents(); + String maxAiOpponents = ConfigSettings.instance.getMaxAiOpponents(); if (maxAiOpponents != null) { int aiPlayers = 0; for (String playerType : options.getPlayerTypes()) { @@ -247,7 +247,7 @@ public class MageServerImpl implements MageServer { user.showUserMessage("Create tournament", message); throw new MageException("No message"); } - TableView table = GamesRoomManager.getInstance().getRoom(roomId).createTournamentTable(userId, options); + TableView table = GamesRoomManager.instance.getRoom(roomId).createTournamentTable(userId, options); logger.debug("Tournament table " + table.getTableId() + " created"); return table; } catch (Exception ex) { @@ -261,8 +261,8 @@ public class MageServerImpl implements MageServer { @Override public void removeTable(final String sessionId, final UUID roomId, final UUID tableId) throws MageException { execute("removeTable", sessionId, () -> { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - TableManager.getInstance().removeTable(userId, tableId); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + TableManager.instance.removeTable(userId, tableId); }); } @@ -271,13 +271,13 @@ public class MageServerImpl implements MageServer { return executeWithResult("joinTable", sessionId, new ActionWithBooleanResult() { @Override public Boolean execute() throws MageException { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); logger.debug(name + " joins tableId: " + tableId); if (userId == null) { logger.fatal("Got no userId from sessionId" + sessionId + " tableId" + tableId); return false; } - return GamesRoomManager.getInstance().getRoom(roomId).joinTable(userId, tableId, name, playerType, skill, deckList, password); + return GamesRoomManager.instance.getRoom(roomId).joinTable(userId, tableId, name, playerType, skill, deckList, password); } }); @@ -288,16 +288,16 @@ public class MageServerImpl implements MageServer { return executeWithResult("joinTournamentTable", sessionId, new ActionWithBooleanResult() { @Override public Boolean execute() throws MageException { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); if (logger.isTraceEnabled()) { - Optional user = UserManager.getInstance().getUser(userId); + Optional user = UserManager.instance.getUser(userId); user.ifPresent(user1 -> logger.trace("join tourn. tableId: " + tableId + ' ' + name)); } if (userId == null) { logger.fatal("Got no userId from sessionId" + sessionId + " tableId" + tableId); return false; } - return GamesRoomManager.getInstance().getRoom(roomId).joinTournamentTable(userId, tableId, name, playerType, skill, deckList, password); + return GamesRoomManager.instance.getRoom(roomId).joinTournamentTable(userId, tableId, name, playerType, skill, deckList, password); } }); @@ -308,8 +308,8 @@ public class MageServerImpl implements MageServer { return executeWithResult("submitDeck", sessionId, new ActionWithBooleanResult() { @Override public Boolean execute() throws MageException { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - boolean ret = TableManager.getInstance().submitDeck(userId, tableId, deckList); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + boolean ret = TableManager.instance.submitDeck(userId, tableId, deckList); logger.debug("Session " + sessionId + " submitted deck"); return ret; } @@ -319,8 +319,8 @@ public class MageServerImpl implements MageServer { @Override public void updateDeck(final String sessionId, final UUID tableId, final DeckCardLists deckList) throws MageException, GameException { execute("updateDeck", sessionId, () -> { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - TableManager.getInstance().updateDeck(userId, tableId, deckList); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + TableManager.instance.updateDeck(userId, tableId, deckList); logger.trace("Session " + sessionId + " updated deck"); }); } @@ -329,7 +329,7 @@ public class MageServerImpl implements MageServer { //FIXME: why no sessionId here??? public List getTables(UUID roomId) throws MageException { try { - GamesRoom room = GamesRoomManager.getInstance().getRoom(roomId); + GamesRoom room = GamesRoomManager.instance.getRoom(roomId); if (room != null) { return room.getTables(); } else { @@ -345,7 +345,7 @@ public class MageServerImpl implements MageServer { //FIXME: why no sessionId here??? public List getFinishedMatches(UUID roomId) throws MageException { try { - GamesRoom room = GamesRoomManager.getInstance().getRoom(roomId); + GamesRoom room = GamesRoomManager.instance.getRoom(roomId); if (room != null) { return room.getFinished(); } else { @@ -360,7 +360,7 @@ public class MageServerImpl implements MageServer { @Override public List getRoomUsers(UUID roomId) throws MageException { try { - GamesRoom room = GamesRoomManager.getInstance().getRoom(roomId); + GamesRoom room = GamesRoomManager.instance.getRoom(roomId); if (room != null) { return room.getRoomUsersInfo(); } else { @@ -376,7 +376,7 @@ public class MageServerImpl implements MageServer { //FIXME: why no sessionId here??? public TableView getTable(UUID roomId, UUID tableId) throws MageException { try { - GamesRoom room = GamesRoomManager.getInstance().getRoom(roomId); + GamesRoom room = GamesRoomManager.instance.getRoom(roomId); if (room != null) { return room.getTable(tableId); } else { @@ -390,7 +390,7 @@ public class MageServerImpl implements MageServer { @Override public boolean ping(String sessionId, String pingInfo) { - return SessionManager.getInstance().extendUserSession(sessionId, pingInfo); + return SessionManager.instance.extendUserSession(sessionId, pingInfo); } // @Override @@ -398,19 +398,19 @@ public class MageServerImpl implements MageServer { // execute("deregisterClient", sessionId, new Action() { // @Override // public void execute() { -// SessionManager.getInstance().disconnect(sessionId, true); +// SessionManager.instance.disconnect(sessionId, true); // logger.debug("Client deregistered ..."); // } // }); // } @Override public boolean startMatch(final String sessionId, final UUID roomId, final UUID tableId) throws MageException { - if (!TableManager.getInstance().getController(tableId).changeTableStateToStarting()) { + if (!TableManager.instance.getController(tableId).changeTableStateToStarting()) { return false; } execute("startMatch", sessionId, () -> { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - TableManager.getInstance().startMatch(userId, roomId, tableId); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + TableManager.instance.startMatch(userId, roomId, tableId); }); return true; } @@ -420,19 +420,19 @@ public class MageServerImpl implements MageServer { // execute("startChallenge", sessionId, new Action() { // @Override // public void execute() { -// UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); -// TableManager.getInstance().startChallenge(userId, roomId, tableId, challengeId); +// UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); +// TableManager.instance.startChallenge(userId, roomId, tableId, challengeId); // } // }); // } @Override public boolean startTournament(final String sessionId, final UUID roomId, final UUID tableId) throws MageException { - if (!TableManager.getInstance().getController(tableId).changeTableStateToStarting()) { + if (!TableManager.instance.getController(tableId).changeTableStateToStarting()) { return false; } execute("startTournament", sessionId, () -> { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - TableManager.getInstance().startTournament(userId, roomId, tableId); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + TableManager.instance.startTournament(userId, roomId, tableId); }); return true; } @@ -441,7 +441,7 @@ public class MageServerImpl implements MageServer { //FIXME: why no sessionId here??? public TournamentView getTournament(UUID tournamentId) throws MageException { try { - return TournamentManager.getInstance().getTournamentView(tournamentId); + return TournamentManager.instance.getTournamentView(tournamentId); } catch (Exception ex) { handleException(ex); } @@ -453,7 +453,7 @@ public class MageServerImpl implements MageServer { public void sendChatMessage(final UUID chatId, final String userName, final String message) throws MageException { try { callExecutor.execute( - () -> ChatManager.getInstance().broadcast(chatId, userName, StringEscapeUtils.escapeHtml4(message), MessageColor.BLUE, true, ChatMessage.MessageType.TALK, null) + () -> ChatManager.instance.broadcast(chatId, userName, StringEscapeUtils.escapeHtml4(message), MessageColor.BLUE, true, ChatMessage.MessageType.TALK, null) ); } catch (Exception ex) { handleException(ex); @@ -463,8 +463,8 @@ public class MageServerImpl implements MageServer { @Override public void joinChat(final UUID chatId, final String sessionId, final String userName) throws MageException { execute("joinChat", sessionId, () -> { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - ChatManager.getInstance().joinChat(chatId, userId); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + ChatManager.instance.joinChat(chatId, userId); }); } @@ -472,8 +472,8 @@ public class MageServerImpl implements MageServer { public void leaveChat(final UUID chatId, final String sessionId) throws MageException { execute("leaveChat", sessionId, () -> { if (chatId != null) { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - ChatManager.getInstance().leaveChat(chatId, userId); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + ChatManager.instance.leaveChat(chatId, userId); } else { logger.warn("The chatId is null. sessionId = " + sessionId); } @@ -484,7 +484,7 @@ public class MageServerImpl implements MageServer { //FIXME: why no sessionId here??? public UUID getMainRoomId() throws MageException { try { - return GamesRoomManager.getInstance().getMainRoomId(); + return GamesRoomManager.instance.getMainRoomId(); } catch (Exception ex) { handleException(ex); } @@ -495,7 +495,7 @@ public class MageServerImpl implements MageServer { //FIXME: why no sessionId here??? public UUID getRoomChatId(UUID roomId) throws MageException { try { - return GamesRoomManager.getInstance().getRoom(roomId).getChatId(); + return GamesRoomManager.instance.getRoom(roomId).getChatId(); } catch (Exception ex) { handleException(ex); } @@ -507,8 +507,8 @@ public class MageServerImpl implements MageServer { return executeWithResult("isTableOwner", sessionId, new ActionWithBooleanResult() { @Override public Boolean execute() { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - return TableManager.getInstance().isTableOwner(tableId, userId); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + return TableManager.instance.isTableOwner(tableId, userId); } }); } @@ -516,21 +516,21 @@ public class MageServerImpl implements MageServer { @Override public void swapSeats(final String sessionId, final UUID roomId, final UUID tableId, final int seatNum1, final int seatNum2) throws MageException { execute("swapSeats", sessionId, () -> { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - TableManager.getInstance().swapSeats(tableId, userId, seatNum1, seatNum2); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + TableManager.instance.swapSeats(tableId, userId, seatNum1, seatNum2); }); } @Override public boolean leaveTable(final String sessionId, final UUID roomId, final UUID tableId) throws MageException { - TableState tableState = TableManager.getInstance().getController(tableId).getTableState(); + TableState tableState = TableManager.instance.getController(tableId).getTableState(); if (tableState != TableState.WAITING && tableState != TableState.READY_TO_START) { // table was already started, so player can't leave anymore now return false; } execute("leaveTable", sessionId, () -> { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - GamesRoomManager.getInstance().getRoom(roomId).leaveTable(userId, tableId); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + GamesRoomManager.instance.getRoom(roomId).leaveTable(userId, tableId); }); return true; } @@ -539,7 +539,7 @@ public class MageServerImpl implements MageServer { //FIXME: why no sessionId here??? public UUID getTableChatId(UUID tableId) throws MageException { try { - return TableManager.getInstance().getChatId(tableId); + return TableManager.instance.getChatId(tableId); } catch (Exception ex) { handleException(ex); } @@ -549,24 +549,24 @@ public class MageServerImpl implements MageServer { @Override public void joinGame(final UUID gameId, final String sessionId) throws MageException { execute("joinGame", sessionId, () -> { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - GameManager.getInstance().joinGame(gameId, userId); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + GameManager.instance.joinGame(gameId, userId); }); } @Override public void joinDraft(final UUID draftId, final String sessionId) throws MageException { execute("joinDraft", sessionId, () -> { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - DraftManager.getInstance().joinDraft(draftId, userId); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + DraftManager.instance.joinDraft(draftId, userId); }); } @Override public void joinTournament(final UUID tournamentId, final String sessionId) throws MageException { execute("joinTournament", sessionId, () -> { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - TournamentManager.getInstance().joinTournament(tournamentId, userId); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + TournamentManager.instance.joinTournament(tournamentId, userId); }); } @@ -574,7 +574,7 @@ public class MageServerImpl implements MageServer { //FIXME: why no sessionId here??? public UUID getGameChatId(UUID gameId) throws MageException { try { - return GameManager.getInstance().getChatId(gameId); + return GameManager.instance.getChatId(gameId); } catch (Exception ex) { handleException(ex); } @@ -585,7 +585,7 @@ public class MageServerImpl implements MageServer { //FIXME: why no sessionId here??? public UUID getTournamentChatId(UUID tournamentId) throws MageException { try { - return TournamentManager.getInstance().getChatId(tournamentId); + return TournamentManager.instance.getChatId(tournamentId); } catch (Exception ex) { handleException(ex); } @@ -595,7 +595,7 @@ public class MageServerImpl implements MageServer { @Override public void sendPlayerUUID(final UUID gameId, final String sessionId, final UUID data) throws MageException { execute("sendPlayerUUID", sessionId, () -> { - Optional user = SessionManager.getInstance().getUser(sessionId); + Optional user = SessionManager.instance.getUser(sessionId); if (user.isPresent()) { // logger.warn("sendPlayerUUID gameId=" + gameId + " sessionId=" + sessionId + " username=" + user.getName()); user.get().sendPlayerUUID(gameId, data); @@ -608,7 +608,7 @@ public class MageServerImpl implements MageServer { @Override public void sendPlayerString(final UUID gameId, final String sessionId, final String data) throws MageException { execute("sendPlayerString", sessionId, () -> { - Optional user = SessionManager.getInstance().getUser(sessionId); + Optional user = SessionManager.instance.getUser(sessionId); if (user.isPresent()) { user.get().sendPlayerString(gameId, data); } else { @@ -620,7 +620,7 @@ public class MageServerImpl implements MageServer { @Override public void sendPlayerManaType(final UUID gameId, final UUID playerId, final String sessionId, final ManaType data) throws MageException { execute("sendPlayerManaType", sessionId, () -> { - Optional user = SessionManager.getInstance().getUser(sessionId); + Optional user = SessionManager.instance.getUser(sessionId); if (user.isPresent()) { user.get().sendPlayerManaType(gameId, playerId, data); } else { @@ -632,7 +632,7 @@ public class MageServerImpl implements MageServer { @Override public void sendPlayerBoolean(final UUID gameId, final String sessionId, final Boolean data) throws MageException { execute("sendPlayerBoolean", sessionId, () -> { - Optional user = SessionManager.getInstance().getUser(sessionId); + Optional user = SessionManager.instance.getUser(sessionId); if (user.isPresent()) { user.get().sendPlayerBoolean(gameId, data); } else { @@ -644,7 +644,7 @@ public class MageServerImpl implements MageServer { @Override public void sendPlayerInteger(final UUID gameId, final String sessionId, final Integer data) throws MageException { execute("sendPlayerInteger", sessionId, () -> { - Optional user = SessionManager.getInstance().getUser(sessionId); + Optional user = SessionManager.instance.getUser(sessionId); if (user.isPresent()) { user.get().sendPlayerInteger(gameId, data); } else { @@ -661,9 +661,9 @@ public class MageServerImpl implements MageServer { @Override public void sendCardMark(final UUID draftId, final String sessionId, final UUID cardPick) throws MageException { execute("sendCardMark", sessionId, () -> { - Session session = SessionManager.getInstance().getSession(sessionId); + Session session = SessionManager.instance.getSession(sessionId); if (session != null) { - DraftManager.getInstance().sendCardMark(draftId, session.getUserId(), cardPick); + DraftManager.instance.sendCardMark(draftId, session.getUserId(), cardPick); } else { logger.error("Session not found sessionId: " + sessionId + " draftId:" + draftId); } @@ -673,9 +673,9 @@ public class MageServerImpl implements MageServer { @Override public void quitMatch(final UUID gameId, final String sessionId) throws MageException { execute("quitMatch", sessionId, () -> { - Session session = SessionManager.getInstance().getSession(sessionId); + Session session = SessionManager.instance.getSession(sessionId); if (session != null) { - GameManager.getInstance().quitMatch(gameId, session.getUserId()); + GameManager.instance.quitMatch(gameId, session.getUserId()); } else { logger.error("Session not found sessionId: " + sessionId + " gameId:" + gameId); } @@ -685,9 +685,9 @@ public class MageServerImpl implements MageServer { @Override public void quitTournament(final UUID tournamentId, final String sessionId) throws MageException { execute("quitTournament", sessionId, () -> { - Session session = SessionManager.getInstance().getSession(sessionId); + Session session = SessionManager.instance.getSession(sessionId); if (session != null) { - TournamentManager.getInstance().quit(tournamentId, session.getUserId()); + TournamentManager.instance.quit(tournamentId, session.getUserId()); } else { logger.error("Session not found sessionId: " + sessionId + " tournamentId:" + tournamentId); } @@ -697,16 +697,16 @@ public class MageServerImpl implements MageServer { @Override public void quitDraft(final UUID draftId, final String sessionId) throws MageException { execute("quitDraft", sessionId, () -> { - Session session = SessionManager.getInstance().getSession(sessionId); + Session session = SessionManager.instance.getSession(sessionId); if (session == null) { logger.error("Session not found sessionId: " + sessionId + " draftId:" + draftId); return; } - UUID tableId = DraftManager.getInstance().getControllerByDraftId(draftId).getTableId(); - Table table = TableManager.getInstance().getTable(tableId); + UUID tableId = DraftManager.instance.getControllerByDraftId(draftId).getTableId(); + Table table = TableManager.instance.getTable(tableId); if (table.isTournament()) { UUID tournamentId = table.getTournament().getId(); - TournamentManager.getInstance().quit(tournamentId, session.getUserId()); + TournamentManager.instance.quit(tournamentId, session.getUserId()); } }); } @@ -714,12 +714,12 @@ public class MageServerImpl implements MageServer { @Override public void sendPlayerAction(final PlayerAction playerAction, final UUID gameId, final String sessionId, final Object data) throws MageException { execute("sendPlayerAction", sessionId, () -> { - Session session = SessionManager.getInstance().getSession(sessionId); + Session session = SessionManager.instance.getSession(sessionId); if (session == null) { logger.error("Session not found sessionId: " + sessionId + " gameId:" + gameId); return; } - GameManager.getInstance().sendPlayerAction(playerAction, gameId, session.getUserId(), data); + GameManager.instance.sendPlayerAction(playerAction, gameId, session.getUserId(), data); }); } @@ -728,8 +728,8 @@ public class MageServerImpl implements MageServer { return executeWithResult("setUserData", sessionId, new ActionWithBooleanResult() { @Override public Boolean execute() throws MageException { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - return GamesRoomManager.getInstance().getRoom(roomId).watchTable(userId, tableId); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + return GamesRoomManager.instance.getRoom(roomId).watchTable(userId, tableId); } }); } @@ -742,17 +742,17 @@ public class MageServerImpl implements MageServer { @Override public void watchGame(final UUID gameId, final String sessionId) throws MageException { execute("watchGame", sessionId, () -> { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - GameManager.getInstance().watchGame(gameId, userId); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + GameManager.instance.watchGame(gameId, userId); }); } @Override public void stopWatching(final UUID gameId, final String sessionId) throws MageException { execute("stopWatching", sessionId, () -> { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - UserManager.getInstance().getUser(userId).ifPresent(user -> { - GameManager.getInstance().stopWatching(gameId, userId); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + UserManager.instance.getUser(userId).ifPresent(user -> { + GameManager.instance.stopWatching(gameId, userId); user.removeGameWatchInfo(gameId); }); @@ -762,48 +762,48 @@ public class MageServerImpl implements MageServer { @Override public void replayGame(final UUID gameId, final String sessionId) throws MageException { execute("replayGame", sessionId, () -> { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - ReplayManager.getInstance().replayGame(gameId, userId); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + ReplayManager.instance.replayGame(gameId, userId); }); } @Override public void startReplay(final UUID gameId, final String sessionId) throws MageException { execute("startReplay", sessionId, () -> { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - ReplayManager.getInstance().startReplay(gameId, userId); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + ReplayManager.instance.startReplay(gameId, userId); }); } @Override public void stopReplay(final UUID gameId, final String sessionId) throws MageException { execute("stopReplay", sessionId, () -> { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - ReplayManager.getInstance().stopReplay(gameId, userId); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + ReplayManager.instance.stopReplay(gameId, userId); }); } @Override public void nextPlay(final UUID gameId, final String sessionId) throws MageException { execute("nextPlay", sessionId, () -> { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - ReplayManager.getInstance().nextPlay(gameId, userId); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + ReplayManager.instance.nextPlay(gameId, userId); }); } @Override public void previousPlay(final UUID gameId, final String sessionId) throws MageException { execute("previousPlay", sessionId, () -> { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - ReplayManager.getInstance().previousPlay(gameId, userId); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + ReplayManager.instance.previousPlay(gameId, userId); }); } @Override public void skipForward(final UUID gameId, final String sessionId, final int moves) throws MageException { execute("skipForward", sessionId, () -> { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - ReplayManager.getInstance().skipForward(gameId, userId, moves); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + ReplayManager.instance.skipForward(gameId, userId, moves); }); } @@ -832,8 +832,8 @@ public class MageServerImpl implements MageServer { public void cheat(final UUID gameId, final String sessionId, final UUID playerId, final DeckCardLists deckList) throws MageException { execute("cheat", sessionId, () -> { if (testMode) { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - GameManager.getInstance().cheat(gameId, userId, playerId, deckList); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + GameManager.instance.cheat(gameId, userId, playerId, deckList); } }); } @@ -844,8 +844,8 @@ public class MageServerImpl implements MageServer { @Override public Boolean execute() { if (testMode) { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - return GameManager.getInstance().cheat(gameId, userId, playerId, cardName); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + return GameManager.instance.cheat(gameId, userId, playerId, cardName); } return false; } @@ -878,13 +878,13 @@ public class MageServerImpl implements MageServer { @Override public void disconnectUser(final String sessionId, final String userSessionId) throws MageException { - execute("disconnectUser", sessionId, () -> SessionManager.getInstance().disconnectUser(sessionId, userSessionId)); + execute("disconnectUser", sessionId, () -> SessionManager.instance.disconnectUser(sessionId, userSessionId)); } @Override public void muteUser(final String sessionId, final String userName, final long durationMinutes) throws MageException { execute("muteUser", sessionId, () -> { - User user = UserManager.getInstance().getUserByName(userName); + User user = UserManager.instance.getUserByName(userName); if (user != null) { Date muteUntil = new Date(Calendar.getInstance().getTimeInMillis() + (durationMinutes * Timer.ONE_MINUTE)); user.showUserMessage("Admin info", "You were muted for chat messages until " + SystemUtil.dateFormat.format(muteUntil) + '.'); @@ -897,13 +897,13 @@ public class MageServerImpl implements MageServer { @Override public void lockUser(final String sessionId, final String userName, final long durationMinutes) throws MageException { execute("lockUser", sessionId, () -> { - User user = UserManager.getInstance().getUserByName(userName); + User user = UserManager.instance.getUserByName(userName); if (user != null) { Date lockUntil = new Date(Calendar.getInstance().getTimeInMillis() + (durationMinutes * Timer.ONE_MINUTE)); user.showUserMessage("Admin info", "Your user profile was locked until " + SystemUtil.dateFormat.format(lockUntil) + '.'); user.setLockedUntil(lockUntil); if (user.isConnected()) { - SessionManager.getInstance().disconnectUser(sessionId, user.getSessionId()); + SessionManager.instance.disconnectUser(sessionId, user.getSessionId()); } } @@ -914,11 +914,11 @@ public class MageServerImpl implements MageServer { public void setActivation(final String sessionId, final String userName, boolean active) throws MageException { execute("setActivation", sessionId, () -> { AuthorizedUser authorizedUser = AuthorizedUserRepository.instance.getByName(userName); - User user = UserManager.getInstance().getUserByName(userName); + User user = UserManager.instance.getUserByName(userName); if (user != null) { user.setActive(active); if (!user.isActive() && user.isConnected()) { - SessionManager.getInstance().disconnectUser(sessionId, user.getSessionId()); + SessionManager.instance.disconnectUser(sessionId, user.getSessionId()); } } else if (authorizedUser != null) { User theUser = new User(userName, "localhost", authorizedUser); @@ -931,11 +931,11 @@ public class MageServerImpl implements MageServer { @Override public void toggleActivation(final String sessionId, final String userName) throws MageException { execute("toggleActivation", sessionId, () -> { - User user = UserManager.getInstance().getUserByName(userName); + User user = UserManager.instance.getUserByName(userName); if (user != null) { user.setActive(!user.isActive()); if (!user.isActive() && user.isConnected()) { - SessionManager.getInstance().disconnectUser(sessionId, user.getSessionId()); + SessionManager.instance.disconnectUser(sessionId, user.getSessionId()); } } @@ -944,7 +944,7 @@ public class MageServerImpl implements MageServer { @Override public void endUserSession(final String sessionId, final String userSessionId) throws MageException { - execute("endUserSession", sessionId, () -> SessionManager.getInstance().endUserSession(sessionId, userSessionId)); + execute("endUserSession", sessionId, () -> SessionManager.instance.endUserSession(sessionId, userSessionId)); } /** @@ -957,8 +957,8 @@ public class MageServerImpl implements MageServer { @Override public void removeTable(final String sessionId, final UUID tableId) throws MageException { execute("removeTable", sessionId, () -> { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - TableManager.getInstance().removeTable(userId, tableId); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + TableManager.instance.removeTable(userId, tableId); }); } @@ -971,7 +971,7 @@ public class MageServerImpl implements MageServer { public void sendFeedbackMessage(final String sessionId, final String username, final String title, final String type, final String message, final String email) throws MageException { if (title != null && message != null) { execute("sendFeedbackMessage", sessionId, () -> { - String host = SessionManager.getInstance().getSession(sessionId).getHost(); + String host = SessionManager.instance.getSession(sessionId).getHost(); FeedbackServiceImpl.instance.feedback(username, title, type, message, email, host); }); } @@ -981,7 +981,7 @@ public class MageServerImpl implements MageServer { public void sendBroadcastMessage(final String sessionId, final String message) throws MageException { if (message != null) { execute("sendBroadcastMessage", sessionId, () -> { - for (User user : UserManager.getInstance().getUsers()) { + for (User user : UserManager.instance.getUsers()) { if (message.toLowerCase(Locale.ENGLISH).startsWith("warn")) { user.fireCallback(new ClientCallback("serverMessage", null, new ChatMessage("SERVER", message, null, MessageColor.RED))); } else { @@ -993,12 +993,12 @@ public class MageServerImpl implements MageServer { } private void sendErrorMessageToClient(final String sessionId, final String message) throws MageException { - execute("sendErrorMessageToClient", sessionId, () -> SessionManager.getInstance().sendErrorMessageToClient(sessionId, message)); + execute("sendErrorMessageToClient", sessionId, () -> SessionManager.instance.sendErrorMessageToClient(sessionId, message)); } protected void execute(final String actionName, final String sessionId, final Action action, boolean checkAdminRights) throws MageException { if (checkAdminRights) { - if (!SessionManager.getInstance().isAdmin(sessionId)) { + if (!SessionManager.instance.isAdmin(sessionId)) { return; } } @@ -1006,11 +1006,11 @@ public class MageServerImpl implements MageServer { } protected void execute(final String actionName, final String sessionId, final Action action) throws MageException { - if (SessionManager.getInstance().isValidSession(sessionId)) { + if (SessionManager.instance.isValidSession(sessionId)) { try { callExecutor.execute( () -> { - if (SessionManager.getInstance().isValidSession(sessionId)) { + if (SessionManager.instance.isValidSession(sessionId)) { try { action.execute(); } catch (MageException me) { @@ -1027,7 +1027,7 @@ public class MageServerImpl implements MageServer { protected T executeWithResult(String actionName, final String sessionId, final ActionWithResult action, boolean checkAdminRights) throws MageException { if (checkAdminRights) { - if (!SessionManager.getInstance().isAdmin(sessionId)) { + if (!SessionManager.instance.isAdmin(sessionId)) { return action.negativeResult(); } } @@ -1036,7 +1036,7 @@ public class MageServerImpl implements MageServer { //TODO: also run in threads with future task protected T executeWithResult(String actionName, final String sessionId, final ActionWithResult action) throws MageException { - if (SessionManager.getInstance().isValidSession(sessionId)) { + if (SessionManager.instance.isValidSession(sessionId)) { try { return action.execute(); } catch (Exception ex) { @@ -1065,7 +1065,7 @@ public class MageServerImpl implements MageServer { private static class MyActionWithNullNegativeResult extends ActionWithNullNegativeResult { @Override public Object execute() throws MageException { - return CompressUtil.compress(ServerMessagesUtil.getInstance().getMessages()); + return CompressUtil.compress(ServerMessagesUtil.instance.getMessages()); } } @@ -1073,7 +1073,7 @@ public class MageServerImpl implements MageServer { @Override public List execute() throws MageException { List users = new ArrayList<>(); - for (User user : UserManager.getInstance().getUsers()) { + for (User user : UserManager.instance.getUsers()) { users.add(new UserView( user.getName(), user.getHost(), @@ -1104,8 +1104,8 @@ public class MageServerImpl implements MageServer { @Override public GameView execute() throws MageException { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - return GameManager.getInstance().getGameView(gameId, userId, playerId); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + return GameManager.instance.getGameView(gameId, userId, playerId); } } @@ -1120,8 +1120,8 @@ public class MageServerImpl implements MageServer { @Override public Boolean execute() throws MageException { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - return TableManager.getInstance().watchTable(userId, tableId); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + return TableManager.instance.watchTable(userId, tableId); } } @@ -1140,9 +1140,9 @@ public class MageServerImpl implements MageServer { @Override public DraftPickView execute() { - Session session = SessionManager.getInstance().getSession(sessionId); + Session session = SessionManager.instance.getSession(sessionId); if (session != null) { - return DraftManager.getInstance().sendCardPick(draftId, session.getUserId(), cardPick, hiddenCards); + return DraftManager.instance.sendCardPick(draftId, session.getUserId(), cardPick, hiddenCards); } else { logger.error("Session not found sessionId: " + sessionId + " draftId:" + draftId); } @@ -1163,8 +1163,8 @@ public class MageServerImpl implements MageServer { @Override public TableView execute() throws MageException { - UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId(); - Optional _user = UserManager.getInstance().getUser(userId); + UUID userId = SessionManager.instance.getSession(sessionId).getUserId(); + Optional _user = UserManager.instance.getUser(userId); if (!_user.isPresent()) { logger.error("User for session not found. session = " + sessionId); return null; @@ -1183,11 +1183,11 @@ public class MageServerImpl implements MageServer { throw new MageException("No message"); } - TableView table = GamesRoomManager.getInstance().getRoom(roomId).createTable(userId, options); + TableView table = GamesRoomManager.instance.getRoom(roomId).createTable(userId, options); if (logger.isDebugEnabled()) { logger.debug("TABLE created - tableId: " + table.getTableId() + ' ' + table.getTableName()); logger.debug("- " + user.getName() + " userId: " + user.getId()); - logger.debug("- chatId: " + TableManager.getInstance().getChatId(table.getTableId())); + logger.debug("- chatId: " + TableManager.instance.getChatId(table.getTableId())); } return table; } diff --git a/Mage.Server/src/main/java/mage/server/MailClient.java b/Mage.Server/src/main/java/mage/server/MailClient.java index 38e9eeb6f3..69e9518b77 100644 --- a/Mage.Server/src/main/java/mage/server/MailClient.java +++ b/Mage.Server/src/main/java/mage/server/MailClient.java @@ -19,7 +19,7 @@ public final class MailClient { logger.info("Email is not sent because the address is empty"); return false; } - ConfigSettings config = ConfigSettings.getInstance(); + ConfigSettings config = ConfigSettings.instance; Properties properties = System.getProperties(); properties.setProperty("mail.smtps.host", config.getMailSmtpHost()); diff --git a/Mage.Server/src/main/java/mage/server/MailgunClient.java b/Mage.Server/src/main/java/mage/server/MailgunClient.java index 183b9e409c..6cca110a0b 100644 --- a/Mage.Server/src/main/java/mage/server/MailgunClient.java +++ b/Mage.Server/src/main/java/mage/server/MailgunClient.java @@ -19,8 +19,8 @@ public final class MailgunClient { return false; } Client client = Client.create(); - client.addFilter(new HTTPBasicAuthFilter("api", ConfigSettings.getInstance().getMailgunApiKey())); - String domain = ConfigSettings.getInstance().getMailgunDomain(); + client.addFilter(new HTTPBasicAuthFilter("api", ConfigSettings.instance.getMailgunApiKey())); + String domain = ConfigSettings.instance.getMailgunDomain(); WebResource webResource = client.resource("https://api.mailgun.net/v3/" + domain + "/messages"); MultivaluedMapImpl formData = new MultivaluedMapImpl(); formData.add("from", "XMage '); diff --git a/Mage.Server/src/main/java/mage/server/Main.java b/Mage.Server/src/main/java/mage/server/Main.java index 49d069aeaf..1e7bd375c6 100644 --- a/Mage.Server/src/main/java/mage/server/Main.java +++ b/Mage.Server/src/main/java/mage/server/Main.java @@ -107,7 +107,7 @@ public final class Main { } } - if (ConfigSettings.getInstance().isAuthenticationActivated()) { + if (ConfigSettings.instance.isAuthenticationActivated()) { logger.info("Check authorized user DB version ..."); if (!AuthorizedUserRepository.instance.checkAlterAndMigrateAuthorizedUser()) { logger.fatal("Failed to start server."); @@ -162,7 +162,7 @@ public final class Main { UserStatsRepository.instance.updateUserStats(); logger.info("Done."); deleteSavedGames(); - ConfigSettings config = ConfigSettings.getInstance(); + ConfigSettings config = ConfigSettings.instance; for (GamePlugin plugin : config.getGameTypes()) { GameFactory.getInstance().addGameType(plugin.getName(), loadGameType(plugin), loadPlugin(plugin)); } @@ -240,7 +240,7 @@ public final class Main { } static void initStatistics() { - ServerMessagesUtil.getInstance().setStartDate(System.currentTimeMillis()); + ServerMessagesUtil.instance.setStartDate(System.currentTimeMillis()); } static boolean isAlreadyRunning(InvokerLocator serverLocator) { @@ -263,11 +263,11 @@ public final class Main { @Override public void handleConnectionException(Throwable throwable, Client client) { - Session session = SessionManager.getInstance().getSession(client.getSessionId()); + Session session = SessionManager.instance.getSession(client.getSessionId()); if (session != null) { StringBuilder sessionInfo = new StringBuilder(); - Optional user = UserManager.getInstance().getUser(session.getUserId()); + Optional user = UserManager.instance.getUser(session.getUserId()); if (user.isPresent()) { sessionInfo.append(user.get().getName()).append(" [").append(user.get().getGameInfo()).append(']'); } else { @@ -277,12 +277,12 @@ public final class Main { if (throwable instanceof ClientDisconnectedException) { // Seems like the random diconnects from public server land here and should not be handled as explicit disconnects // So it should be possible to reconnect to server and continue games if DisconnectReason is set to LostConnection - //SessionManager.getInstance().disconnect(client.getSessionId(), DisconnectReason.Disconnected); - SessionManager.getInstance().disconnect(client.getSessionId(), DisconnectReason.LostConnection); + //SessionManager.instance.disconnect(client.getSessionId(), DisconnectReason.Disconnected); + SessionManager.instance.disconnect(client.getSessionId(), DisconnectReason.LostConnection); logger.info("CLIENT DISCONNECTED - " + sessionInfo); logger.debug("Stack Trace", throwable); } else { - SessionManager.getInstance().disconnect(client.getSessionId(), DisconnectReason.LostConnection); + SessionManager.instance.disconnect(client.getSessionId(), DisconnectReason.LostConnection); logger.info("LOST CONNECTION - " + sessionInfo); if (logger.isDebugEnabled()) { if (throwable == null) { @@ -305,7 +305,7 @@ public final class Main { public MageTransporterServer(InvokerLocator locator, Object target, String subsystem, MageServerInvocationHandler serverInvocationHandler) throws Exception { super(locator, target, subsystem); connector.addInvocationHandler("callback", serverInvocationHandler); - connector.setLeasePeriod(ConfigSettings.getInstance().getLeasePeriod()); + connector.setLeasePeriod(ConfigSettings.instance.getLeasePeriod()); connector.addConnectionListener(new ClientConnectionListener()); } @@ -343,9 +343,9 @@ public final class Main { @Override public void setInvoker(ServerInvoker invoker) { - ((BisocketServerInvoker) invoker).setSecondaryBindPort(ConfigSettings.getInstance().getSecondaryBindPort()); - ((BisocketServerInvoker) invoker).setBacklog(ConfigSettings.getInstance().getBacklogSize()); - ((BisocketServerInvoker) invoker).setNumAcceptThreads(ConfigSettings.getInstance().getNumAcceptThreads()); + ((BisocketServerInvoker) invoker).setSecondaryBindPort(ConfigSettings.instance.getSecondaryBindPort()); + ((BisocketServerInvoker) invoker).setBacklog(ConfigSettings.instance.getBacklogSize()); + ((BisocketServerInvoker) invoker).setNumAcceptThreads(ConfigSettings.instance.getNumAcceptThreads()); } @Override @@ -354,7 +354,7 @@ public final class Main { ServerInvokerCallbackHandler handler = (ServerInvokerCallbackHandler) callbackHandler; try { String sessionId = handler.getClientSessionId(); - SessionManager.getInstance().createSession(sessionId, callbackHandler); + SessionManager.instance.createSession(sessionId, callbackHandler); } catch (Throwable ex) { logger.fatal("", ex); } @@ -372,7 +372,7 @@ public final class Main { } else { host = "localhost"; } - SessionManager.getInstance().getSession(sessionId).setHost(host); + SessionManager.instance.getSession(sessionId).setHost(host); return null; } @@ -380,7 +380,7 @@ public final class Main { public void removeListener(InvokerCallbackHandler callbackHandler) { ServerInvokerCallbackHandler handler = (ServerInvokerCallbackHandler) callbackHandler; String sessionId = handler.getClientSessionId(); - SessionManager.getInstance().disconnect(sessionId, DisconnectReason.Disconnected); + SessionManager.instance.disconnect(sessionId, DisconnectReason.Disconnected); } } diff --git a/Mage.Server/src/main/java/mage/server/RoomImpl.java b/Mage.Server/src/main/java/mage/server/RoomImpl.java index 339a3f754b..685c634f7a 100644 --- a/Mage.Server/src/main/java/mage/server/RoomImpl.java +++ b/Mage.Server/src/main/java/mage/server/RoomImpl.java @@ -41,7 +41,7 @@ public abstract class RoomImpl implements Room { public RoomImpl() { roomId = UUID.randomUUID(); - chatId = ChatManager.getInstance().createChatSession("Room " + roomId); + chatId = ChatManager.instance.createChatSession("Room " + roomId); } /** diff --git a/Mage.Server/src/main/java/mage/server/Session.java b/Mage.Server/src/main/java/mage/server/Session.java index 60280aa7e5..61d60ccafe 100644 --- a/Mage.Server/src/main/java/mage/server/Session.java +++ b/Mage.Server/src/main/java/mage/server/Session.java @@ -76,7 +76,7 @@ public class Session { } public String registerUser(String userName, String password, String email) throws MageException { - if (!ConfigSettings.getInstance().isAuthenticationActivated()) { + if (!ConfigSettings.instance.isAuthenticationActivated()) { String returnMessage = "Registration is disabled by the server config"; sendErrorMessageToClient(returnMessage); return returnMessage; @@ -106,7 +106,7 @@ public class Session { boolean success; String subject = "XMage Registration Completed"; - if (!ConfigSettings.getInstance().getMailUser().isEmpty()) { + if (!ConfigSettings.instance.getMailUser().isEmpty()) { success = MailClient.sendMessage(email, subject, text); } else { success = MailgunClient.sendMessage(email, subject, text); @@ -133,14 +133,14 @@ public class Session { if (userName.equals("Admin")) { return "User name Admin already in use"; } - ConfigSettings config = ConfigSettings.getInstance(); + ConfigSettings config = ConfigSettings.instance; if (userName.length() < config.getMinUserNameLength()) { return "User name may not be shorter than " + config.getMinUserNameLength() + " characters"; } if (userName.length() > config.getMaxUserNameLength()) { return "User name may not be longer than " + config.getMaxUserNameLength() + " characters"; } - Pattern invalidUserNamePattern = Pattern.compile(ConfigSettings.getInstance().getInvalidUserNamePattern(), Pattern.CASE_INSENSITIVE); + Pattern invalidUserNamePattern = Pattern.compile(ConfigSettings.instance.getInvalidUserNamePattern(), Pattern.CASE_INSENSITIVE); Matcher m = invalidUserNamePattern.matcher(userName); if (m.find()) { return "User name '" + userName + "' includes not allowed characters: use a-z, A-Z and 0-9"; @@ -153,7 +153,7 @@ public class Session { } static private String validatePassword(String password, String userName) { - ConfigSettings config = ConfigSettings.getInstance(); + ConfigSettings config = ConfigSettings.instance; if (password.length() < config.getMinPasswordLength()) { return "Password may not be shorter than " + config.getMinPasswordLength() + " characters"; } @@ -198,7 +198,7 @@ public class Session { public String connectUserHandling(String userName, String password) throws MageException { this.isAdmin = false; AuthorizedUser authorizedUser = null; - if (ConfigSettings.getInstance().isAuthenticationActivated()) { + if (ConfigSettings.instance.isAuthenticationActivated()) { authorizedUser = AuthorizedUserRepository.instance.getByName(userName); String errorMsg = "Wrong username or password. In case you haven't, please register your account first."; if (authorizedUser == null) { @@ -216,19 +216,19 @@ public class Session { if (authorizedUser.lockedUntil.compareTo(Calendar.getInstance().getTime()) > 0) { return "Your profile is deactivated until " + SystemUtil.dateFormat.format(authorizedUser.lockedUntil); } else { - User user = UserManager.getInstance().createUser(userName, host, authorizedUser); + User user = UserManager.instance.createUser(userName, host, authorizedUser); if (user != null && authorizedUser.lockedUntil != null) { user.setLockedUntil(null); } } } } - User user = UserManager.getInstance().createUser(userName, host, authorizedUser); + User user = UserManager.instance.createUser(userName, host, authorizedUser); boolean reconnect = false; if (user == null) { // user already exists - user = UserManager.getInstance().getUserByName(userName); + user = UserManager.instance.getUserByName(userName); // If authentication is not activated, check the identity using IP address. - if (ConfigSettings.getInstance().isAuthenticationActivated() || user.getHost().equals(host)) { + if (ConfigSettings.instance.isAuthenticationActivated() || user.getHost().equals(host)) { user.updateLastActivity(null); // minimizes possible expiration this.userId = user.getId(); if (user.getSessionId().isEmpty()) { @@ -237,43 +237,43 @@ public class Session { } else { //disconnect previous session logger.info("Disconnecting another user instance: " + userName); - SessionManager.getInstance().disconnect(user.getSessionId(), DisconnectReason.ConnectingOtherInstance); + SessionManager.instance.disconnect(user.getSessionId(), DisconnectReason.ConnectingOtherInstance); } } else { return "User name " + userName + " already in use (or your IP address changed)"; } } - if (!UserManager.getInstance().connectToSession(sessionId, user.getId())) { + if (!UserManager.instance.connectToSession(sessionId, user.getId())) { return "Error connecting " + userName; } this.userId = user.getId(); if (reconnect) { // must be connected to receive the message - UUID chatId = GamesRoomManager.getInstance().getRoom(GamesRoomManager.getInstance().getMainRoomId()).getChatId(); + UUID chatId = GamesRoomManager.instance.getRoom(GamesRoomManager.instance.getMainRoomId()).getChatId(); if (chatId != null) { - ChatManager.getInstance().joinChat(chatId, userId); + ChatManager.instance.joinChat(chatId, userId); } - ChatManager.getInstance().sendReconnectMessage(userId); + ChatManager.instance.sendReconnectMessage(userId); } return null; } public void connectAdmin() { this.isAdmin = true; - User user = UserManager.getInstance().createUser("Admin", host, null); + User user = UserManager.instance.createUser("Admin", host, null); if (user == null) { - user = UserManager.getInstance().getUserByName("Admin"); + user = UserManager.instance.getUserByName("Admin"); } UserData adminUserData = UserData.getDefaultUserDataView(); adminUserData.setGroupId(UserGroup.ADMIN.getGroupId()); user.setUserData(adminUserData); - if (!UserManager.getInstance().connectToSession(sessionId, user.getId())) { + if (!UserManager.instance.connectToSession(sessionId, user.getId())) { logger.info("Error connecting Admin!"); } this.userId = user.getId(); } public boolean setUserData(String userName, UserData userData, String clientVersion, String userIdStr) { - User user = UserManager.getInstance().getUserByName(userName); + User user = UserManager.instance.getUserByName(userName); if (user != null) { if (clientVersion != null) { user.setClientVersion(clientVersion); @@ -326,7 +326,7 @@ public class Session { } else { logger.error("CAN'T GET LOCK - userId: " + userId + " hold count: " + lock.getHoldCount()); } - Optional _user = UserManager.getInstance().getUser(userId); + Optional _user = UserManager.instance.getUser(userId); if (!_user.isPresent()) { return; //user was already disconnected by other thread } @@ -340,7 +340,7 @@ public class Session { return; } // logger.info("LOST CONNECTION - " + user.getName() + " id: " + userId); - UserManager.getInstance().disconnect(userId, DisconnectReason.LostConnection); + UserManager.instance.disconnect(userId, DisconnectReason.LostConnection); } catch (InterruptedException ex) { logger.error("SESSION LOCK lost connection - userId: " + userId, ex); @@ -362,7 +362,7 @@ public class Session { } else { logger.error("SESSION LOCK - kill: userId " + userId); } - UserManager.getInstance().removeUser(userId, reason); + UserManager.instance.removeUser(userId, reason); } catch (InterruptedException ex) { logger.error("SESSION LOCK - kill: userId " + userId, ex); } finally { @@ -381,7 +381,7 @@ public class Session { callbackHandler.handleCallbackOneway(new Callback(call)); } catch (HandleCallbackException ex) { ex.printStackTrace(); - UserManager.getInstance().getUser(userId).ifPresent(user-> { + UserManager.instance.getUser(userId).ifPresent(user-> { logger.warn("SESSION CALLBACK EXCEPTION - " + user.getName() + " userId " + userId); logger.warn(" - method: " + call.getMethod()); logger.warn(" - cause: " + getBasicCause(ex).toString()); diff --git a/Mage.Server/src/main/java/mage/server/SessionManager.java b/Mage.Server/src/main/java/mage/server/SessionManager.java index ddd7527383..fb4032904f 100644 --- a/Mage.Server/src/main/java/mage/server/SessionManager.java +++ b/Mage.Server/src/main/java/mage/server/SessionManager.java @@ -42,20 +42,16 @@ import javax.annotation.Nonnull; /** * @author BetaSteward_at_googlemail.com */ -public class SessionManager { - +public enum SessionManager { + instance; private static final Logger logger = Logger.getLogger(SessionManager.class); - private static final SessionManager INSTANCE = new SessionManager(); - public static SessionManager getInstance() { - return INSTANCE; - } private final ConcurrentHashMap sessions = new ConcurrentHashMap<>(); public Session getSession(@Nonnull String sessionId) { Session session = sessions.get(sessionId); - if (session != null && session.getUserId() != null && UserManager.getInstance().getUser(session.getUserId()) == null) { + if (session != null && session.getUserId() != null && UserManager.instance.getUser(session.getUserId()) == null) { logger.error("User for session " + sessionId + " with userId " + session.getUserId() + " is missing. Session removed."); // can happen if user from same host signs in multiple time with multiple clients, after he disconnects with one client disconnect(sessionId, DisconnectReason.ConnectingOtherInstance); @@ -191,7 +187,7 @@ public class SessionManager { if (session == null) { return null; } - return UserManager.getInstance().getUser(session.getUserId()).get(); + return UserManager.instance.getUser(session.getUserId()).get(); } public void endUserSession(String sessionId, String userSessionId) { @@ -215,7 +211,7 @@ public class SessionManager { public Optional getUser(@Nonnull String sessionId) { Session session = sessions.get(sessionId); if (session != null) { - return UserManager.getInstance().getUser(sessions.get(sessionId).getUserId()); + return UserManager.instance.getUser(sessions.get(sessionId).getUserId()); } logger.error(String.format("Session %s could not be found", sessionId)); return Optional.empty(); @@ -224,7 +220,7 @@ public class SessionManager { public boolean extendUserSession(String sessionId, String pingInfo) { Session session = sessions.get(sessionId); if (session != null) { - return UserManager.getInstance().extendUserSession(session.getUserId(), pingInfo); + return UserManager.instance.extendUserSession(session.getUserId(), pingInfo); } return false; } diff --git a/Mage.Server/src/main/java/mage/server/TableController.java b/Mage.Server/src/main/java/mage/server/TableController.java index 81ebe3819f..40af1f89c8 100644 --- a/Mage.Server/src/main/java/mage/server/TableController.java +++ b/Mage.Server/src/main/java/mage/server/TableController.java @@ -94,14 +94,14 @@ public class TableController { this.options = options; match = GameFactory.getInstance().createMatch(options.getGameType(), options); if (userId != null) { - Optional user = UserManager.getInstance().getUser(userId); + Optional user = UserManager.instance.getUser(userId); // TODO: Handle if user == null controllerName = user.map(User::getName).orElse("undefined"); } else { controllerName = "System"; } table = new Table(roomId, options.getGameType(), options.getName(), controllerName, DeckValidatorFactory.getInstance().createDeckValidator(options.getDeckType()), options.getPlayerTypes(), TableRecorderImpl.getInstance(), match, options.getBannedUsers()); - chatId = ChatManager.getInstance().createChatSession("Match Table " + table.getId()); + chatId = ChatManager.instance.createChatSession("Match Table " + table.getId()); init(); } @@ -109,7 +109,7 @@ public class TableController { this.userId = userId; tournament = TournamentFactory.getInstance().createTournament(options.getTournamentType(), options); if (userId != null) { - Optional user = UserManager.getInstance().getUser(userId); + Optional user = UserManager.instance.getUser(userId); if (!user.isPresent()) { logger.fatal(new StringBuilder("User for userId ").append(userId).append(" could not be retrieved from UserManager").toString()); controllerName = "[unknown]"; @@ -120,7 +120,7 @@ public class TableController { controllerName = "System"; } table = new Table(roomId, options.getTournamentType(), options.getName(), controllerName, DeckValidatorFactory.getInstance().createDeckValidator(options.getMatchOptions().getDeckType()), options.getPlayerTypes(), TableRecorderImpl.getInstance(), tournament, options.getMatchOptions().getBannedUsers()); - chatId = ChatManager.getInstance().createChatSession("Tourn. table " + table.getId()); + chatId = ChatManager.instance.createChatSession("Tourn. table " + table.getId()); } private void init() { @@ -148,7 +148,7 @@ public class TableController { if (seat == null) { throw new GameException("No available seats."); } - Optional _user = UserManager.getInstance().getUser(userId); + Optional _user = UserManager.instance.getUser(userId); if (!_user.isPresent()) { logger.fatal(new StringBuilder("couldn't get user ").append(name).append(" for join tournament userId = ").append(userId).toString()); return false; @@ -182,7 +182,7 @@ public class TableController { user.showUserMessage("Join Table", sb.toString()); if (isOwner(userId)) { logger.debug("New table removed because owner submitted invalid deck tableId " + table.getId()); - TableManager.getInstance().removeTable(table.getId()); + TableManager.instance.removeTable(table.getId()); } return false; } @@ -242,12 +242,12 @@ public class TableController { newTournamentPlayer.setState(oldTournamentPlayer.getState()); newTournamentPlayer.setReplacedTournamentPlayer(oldTournamentPlayer); - DraftManager.getInstance().getController(table.getId()).replacePlayer(oldPlayer, newPlayer); + DraftManager.instance.getController(table.getId()).replacePlayer(oldPlayer, newPlayer); return true; } public synchronized boolean joinTable(UUID userId, String name, String playerType, int skill, DeckCardLists deckList, String password) throws MageException { - Optional _user = UserManager.getInstance().getUser(userId); + Optional _user = UserManager.instance.getUser(userId); if (!_user.isPresent()) { return false; } @@ -283,7 +283,7 @@ public class TableController { user.showUserMessage("Join Table", sb.toString()); if (isOwner(userId)) { logger.debug("New table removed because owner submitted invalid deck tableId " + table.getId()); - TableManager.getInstance().removeTable(table.getId()); + TableManager.instance.removeTable(table.getId()); } return false; } @@ -433,17 +433,17 @@ public class TableController { private void submitDeck(UUID userId, UUID playerId, Deck deck) { if (table.getState() == TableState.SIDEBOARDING) { match.submitDeck(playerId, deck); - UserManager.getInstance().getUser(userId).ifPresent(user -> user.removeSideboarding(table.getId())); + UserManager.instance.getUser(userId).ifPresent(user -> user.removeSideboarding(table.getId())); } else { - TournamentManager.getInstance().submitDeck(tournament.getId(), playerId, deck); - UserManager.getInstance().getUser(userId).ifPresent(user -> user.removeConstructing(playerId)); + TournamentManager.instance.submitDeck(tournament.getId(), playerId, deck); + UserManager.instance.getUser(userId).ifPresent(user -> user.removeConstructing(playerId)); } } private void updateDeck(UUID userId, UUID playerId, Deck deck) { if (table.isTournament()) { if (tournament != null) { - TournamentManager.getInstance().updateDeck(tournament.getId(), playerId, deck); + TournamentManager.instance.updateDeck(tournament.getId(), playerId, deck); } else { logger.fatal("Tournament == null table: " + table.getId() + " userId: " + userId); } @@ -456,7 +456,7 @@ public class TableController { public boolean watchTable(UUID userId) { if (table.isTournament()) { - UserManager.getInstance().getUser(userId).ifPresent(user -> user.ccShowTournament(table.getTournament().getId())); + UserManager.instance.getUser(userId).ifPresent(user -> user.ccShowTournament(table.getTournament().getId())); return true; } else { if (table.isTournamentSubTable() && !table.getTournament().getOptions().isWatchingAllowed()) { @@ -469,7 +469,7 @@ public class TableController { if (userPlayerMap.get(userId) != null) { return false; } - return UserManager.getInstance().getUser(userId).get().ccWatchGame(match.getGame().getId()); + return UserManager.instance.getUser(userId).get().ccWatchGame(match.getGame().getId()); } } @@ -477,7 +477,7 @@ public class TableController { // if (table.getState() != TableState.FINISHED) { // return false; // } -// ReplayManager.getInstance().replayGame(table.getId(), userId); +// ReplayManager.instance.replayGame(table.getId(), userId); // return true; // } private Optional createPlayer(String name, String playerType, int skill) { @@ -514,7 +514,7 @@ public class TableController { && (table.getState() == TableState.WAITING || table.getState() == TableState.READY_TO_START)) { // table not started yet and user is the owner, remove the table - TableManager.getInstance().removeTable(table.getId()); + TableManager.instance.removeTable(table.getId()); } else { UUID playerId = userPlayerMap.get(userId); if (playerId != null) { @@ -525,9 +525,9 @@ public class TableController { } else { match.quitMatch(playerId); } - Optional user = UserManager.getInstance().getUser(userId); + Optional user = UserManager.instance.getUser(userId); if (!user.isPresent()) { - ChatManager.getInstance().broadcast(chatId, user.get().getName(), "has left the table", ChatMessage.MessageColor.BLUE, true, ChatMessage.MessageType.STATUS, ChatMessage.SoundToPlay.PlayerLeft); + ChatManager.instance.broadcast(chatId, user.get().getName(), "has left the table", ChatMessage.MessageColor.BLUE, true, ChatMessage.MessageType.STATUS, ChatMessage.SoundToPlay.PlayerLeft); if (!table.isTournamentSubTable()) { user.get().removeTable(playerId); } @@ -538,9 +538,9 @@ public class TableController { } else if (table.getState() != TableState.FINISHED) { if (table.isTournament()) { logger.debug("Quit tournament sub tables for userId: " + userId); - TableManager.getInstance().userQuitTournamentSubTables(tournament.getId(), userId); + TableManager.instance.userQuitTournamentSubTables(tournament.getId(), userId); logger.debug("Quit tournament Id: " + table.getTournament().getId() + '(' + table.getTournament().getTournamentState() + ')'); - TournamentManager.getInstance().quit(tournament.getId(), userId); + TournamentManager.instance.quit(tournament.getId(), userId); } else { MatchPlayer matchPlayer = match.getPlayer(playerId); if (matchPlayer != null && !match.hasEnded() && !matchPlayer.hasQuit()) { @@ -548,7 +548,7 @@ public class TableController { if (game != null && !game.hasEnded()) { Player player = match.getPlayer(playerId).getPlayer(); if (player != null && player.isInGame()) { - GameManager.getInstance().quitMatch(game.getId(), userId); + GameManager.instance.quitMatch(game.getId(), userId); } match.quitMatch(playerId); } else { @@ -586,7 +586,7 @@ public class TableController { if (table.isTournamentSubTable()) { logger.info("Tourn. match started id:" + match.getId() + " tournId: " + table.getTournament().getId()); } else { - UserManager.getInstance().getUser(userId).ifPresent(user -> { + UserManager.instance.getUser(userId).ifPresent(user -> { logger.info("MATCH started [" + match.getName() + "] " + match.getId() + '(' + user.getName() + ')'); logger.debug("- " + match.getOptions().getGameType() + " - " + match.getOptions().getDeckType()); }); @@ -607,12 +607,12 @@ public class TableController { GameOptions gameOptions = new GameOptions(); gameOptions.rollbackTurnsAllowed = match.getOptions().isRollbackTurnsAllowed(); match.getGame().setGameOptions(gameOptions); - GameManager.getInstance().createGameSession(match.getGame(), userPlayerMap, table.getId(), choosingPlayerId, gameOptions); + GameManager.instance.createGameSession(match.getGame(), userPlayerMap, table.getId(), choosingPlayerId, gameOptions); String creator = null; StringBuilder opponent = new StringBuilder(); for (Entry entry : userPlayerMap.entrySet()) { // do only for no AI players if (match.getPlayer(entry.getValue()) != null && !match.getPlayer(entry.getValue()).hasQuit()) { - Optional _user = UserManager.getInstance().getUser(entry.getKey()); + Optional _user = UserManager.instance.getUser(entry.getKey()); if (_user.isPresent()) { User user = _user.get(); user.ccGameStarted(match.getGame().getId(), entry.getValue()); @@ -643,23 +643,23 @@ public class TableController { opponent.append(mPlayer.getName()); } } - ServerMessagesUtil.getInstance().incGamesStarted(); + ServerMessagesUtil.instance.incGamesStarted(); // log about game started logger.info("GAME started " + (match.getGame() != null ? match.getGame().getId() : "no Game") + " [" + match.getName() + "] " + creator + " - " + opponent.toString()); logger.debug("- matchId: " + match.getId() + " [" + match.getName() + ']'); if (match.getGame() != null) { - logger.debug("- chatId: " + GameManager.getInstance().getChatId(match.getGame().getId())); + logger.debug("- chatId: " + GameManager.instance.getChatId(match.getGame().getId())); } } catch (Exception ex) { logger.fatal("Error starting game table: " + table.getId(), ex); if (table != null) { - TableManager.getInstance().removeTable(table.getId()); + TableManager.instance.removeTable(table.getId()); } if (match != null) { Game game = match.getGame(); if (game != null) { - GameManager.getInstance().removeGame(game.getId()); + GameManager.instance.removeGame(game.getId()); } } } @@ -669,27 +669,27 @@ public class TableController { try { if (userId.equals(this.userId) && table.getState() == TableState.STARTING) { tournament.setStartTime(); - TournamentManager.getInstance().createTournamentSession(tournament, userPlayerMap, table.getId()); + TournamentManager.instance.createTournamentSession(tournament, userPlayerMap, table.getId()); for (Entry entry : userPlayerMap.entrySet()) { - UserManager.getInstance().getUser(entry.getKey()).ifPresent(user -> { + UserManager.instance.getUser(entry.getKey()).ifPresent(user -> { logger.info(new StringBuilder("User ").append(user.getName()).append(" tournament started: ").append(tournament.getId()).append(" userId: ").append(user.getId())); user.ccTournamentStarted(tournament.getId(), entry.getValue()); }); } - ServerMessagesUtil.getInstance().incTournamentsStarted(); + ServerMessagesUtil.instance.incTournamentsStarted(); } } catch (Exception ex) { logger.fatal("Error starting tournament", ex); - TableManager.getInstance().removeTable(table.getId()); - TournamentManager.getInstance().quit(tournament.getId(), userId); + TableManager.instance.removeTable(table.getId()); + TournamentManager.instance.quit(tournament.getId(), userId); } } public void startDraft(Draft draft) { table.initDraft(); - DraftManager.getInstance().createDraftSession(draft, userPlayerMap, table.getId()); + DraftManager.instance.createDraftSession(draft, userPlayerMap, table.getId()); for (Entry entry : userPlayerMap.entrySet()) { - Optional user = UserManager.getInstance().getUser(entry.getKey()); + Optional user = UserManager.instance.getUser(entry.getKey()); if (user.isPresent()) { logger.info(new StringBuilder("User ").append(user.get().getName()).append(" draft started: ").append(draft.getId()).append(" userId: ").append(user.get().getId())); user.get().ccDraftStarted(draft.getId(), entry.getValue()); @@ -703,7 +703,7 @@ public class TableController { for (Entry entry : userPlayerMap.entrySet()) { if (entry.getValue().equals(playerId)) { - Optional user = UserManager.getInstance().getUser(entry.getKey()); + Optional user = UserManager.instance.getUser(entry.getKey()); int remaining = (int) futureTimeout.getDelay(TimeUnit.SECONDS); user.ifPresent(user1 -> user1.ccSideboard(deck, table.getId(), remaining, options.isLimited())); break; @@ -744,12 +744,12 @@ public class TableController { } UUID choosingPlayerId = match.getChooser(); match.endGame(); - if (ConfigSettings.getInstance().isSaveGameActivated() && !game.isSimulation()) { - if (GameManager.getInstance().saveGame(game.getId())) { + if (ConfigSettings.instance.isSaveGameActivated() && !game.isSimulation()) { + if (GameManager.instance.saveGame(game.getId())) { match.setReplayAvailable(true); } } - GameManager.getInstance().removeGame(game.getId()); + GameManager.instance.removeGame(game.getId()); try { if (!match.hasEnded()) { if (match.getGame() != null && match.getGame().getGameType().isSideboardingAllowed()) { @@ -810,7 +810,7 @@ public class TableController { // opponent(s) left during sideboarding if (matchPlayer != null) { if (!matchPlayer.hasQuit()) { - UserManager.getInstance().getUser(entry.getKey()).ifPresent(user -> { + UserManager.instance.getUser(entry.getKey()).ifPresent(user -> { if (table.getState() == TableState.SIDEBOARDING) { StringBuilder sb = new StringBuilder(); if (table.isTournamentSubTable()) { @@ -835,7 +835,7 @@ public class TableController { } } // free resources no longer needed - match.cleanUpOnMatchEnd(ConfigSettings.getInstance().isSaveGameActivated(), table.isTournament()); + match.cleanUpOnMatchEnd(ConfigSettings.instance.isSaveGameActivated(), table.isTournament()); } } } @@ -907,7 +907,7 @@ public class TableController { public boolean isTournamentStillValid() { if (table.getTournament() != null) { if (table.getState() != TableState.WAITING && table.getState() != TableState.READY_TO_START && table.getState() != TableState.STARTING) { - TournamentController tournamentController = TournamentManager.getInstance().getTournamentController(table.getTournament().getId()); + TournamentController tournamentController = TournamentManager.instance.getTournamentController(table.getTournament().getId()); if (tournamentController != null) { return tournamentController.isTournamentStillValid(table.getState()); } else { @@ -915,7 +915,7 @@ public class TableController { } } else { // check if table creator is still a valid user, if not remove table - return UserManager.getInstance().getUser(userId).isPresent(); + return UserManager.instance.getUser(userId).isPresent(); } } return false; @@ -981,7 +981,7 @@ public class TableController { || table.getState() == TableState.READY_TO_START) || !match.isDoneSideboarding() || (!matchPlayer.hasQuit() && match.getGame() != null && matchPlayer.getPlayer().isInGame())) { - Optional user = UserManager.getInstance().getUser(userPlayerEntry.getKey()); + Optional user = UserManager.instance.getUser(userPlayerEntry.getKey()); if (!user.isPresent()) { logger.debug("- Active user of match is missing: " + matchPlayer.getName()); logger.debug("-- matchId:" + match.getId()); @@ -1005,12 +1005,12 @@ public class TableController { void cleanUp() { if (!table.isTournamentSubTable()) { for (Map.Entry entry : userPlayerMap.entrySet()) { - UserManager.getInstance().getUser(entry.getKey()).ifPresent(user + UserManager.instance.getUser(entry.getKey()).ifPresent(user -> user.removeTable(entry.getValue())); } } - ChatManager.getInstance().destroyChatSession(chatId); + ChatManager.instance.destroyChatSession(chatId); } public synchronized TableState getTableState() { diff --git a/Mage.Server/src/main/java/mage/server/TableManager.java b/Mage.Server/src/main/java/mage/server/TableManager.java index cadf63e4a0..135c630c3d 100644 --- a/Mage.Server/src/main/java/mage/server/TableManager.java +++ b/Mage.Server/src/main/java/mage/server/TableManager.java @@ -59,14 +59,13 @@ import org.apache.log4j.Logger; /** * @author BetaSteward_at_googlemail.com */ -public class TableManager { - - protected static final ScheduledExecutorService expireExecutor = Executors.newSingleThreadScheduledExecutor(); +public enum TableManager { + instance; + protected final ScheduledExecutorService expireExecutor = Executors.newSingleThreadScheduledExecutor(); // protected static ScheduledExecutorService expireExecutor = ThreadExecutor.getInstance().getExpireExecutor(); - private static final TableManager INSTANCE = new TableManager(); - private static final Logger logger = Logger.getLogger(TableManager.class); + private final Logger logger = Logger.getLogger(TableManager.class); private static final DateFormat formatter = new SimpleDateFormat("HH:mm:ss"); private final ConcurrentHashMap controllers = new ConcurrentHashMap<>(); @@ -79,11 +78,8 @@ public class TableManager { */ private static final int EXPIRE_CHECK_PERIOD = 10; - public static TableManager getInstance() { - return INSTANCE; - } - private TableManager() { + TableManager() { expireExecutor.scheduleAtFixedRate(() -> { try { checkTableHealthState(); @@ -151,7 +147,7 @@ public class TableManager { if (controllers.containsKey(tableId)) { return controllers.get(tableId).submitDeck(userId, deckList); } - UserManager.getInstance().getUser(userId).ifPresent(user -> { + UserManager.instance.getUser(userId).ifPresent(user -> { user.removeSideboarding(tableId); user.showUserMessage("Submit deck", "Table no longer active"); @@ -198,12 +194,12 @@ public class TableManager { } public boolean removeTable(UUID userId, UUID tableId) { - if (isTableOwner(tableId, userId) || UserManager.getInstance().isAdmin(userId)) { + if (isTableOwner(tableId, userId) || UserManager.instance.isAdmin(userId)) { logger.debug("Table remove request - userId: " + userId + " tableId: " + tableId); TableController tableController = controllers.get(tableId); if (tableController != null) { tableController.leaveTableAll(); - ChatManager.getInstance().destroyChatSession(tableController.getChatId()); + ChatManager.instance.destroyChatSession(tableController.getChatId()); removeTable(tableId); } return true; @@ -236,7 +232,7 @@ public class TableManager { if (controllers.containsKey(tableId)) { controllers.get(tableId).startMatch(userId); // chat of start dialog can be killed - ChatManager.getInstance().destroyChatSession(controllers.get(tableId).getChatId()); + ChatManager.instance.destroyChatSession(controllers.get(tableId).getChatId()); } } @@ -255,7 +251,7 @@ public class TableManager { public void startTournament(UUID userId, UUID roomId, UUID tableId) { if (controllers.containsKey(tableId)) { controllers.get(tableId).startTournament(userId); - ChatManager.getInstance().destroyChatSession(controllers.get(tableId).getChatId()); + ChatManager.instance.destroyChatSession(controllers.get(tableId).getChatId()); } } @@ -343,9 +339,9 @@ public class TableManager { // If table is not finished, the table has to be removed completly because it's not a normal state (if finished it will be removed in GamesRoomImpl.Update()) if (table.getState() != TableState.FINISHED) { if (game != null) { - GameManager.getInstance().removeGame(game.getId()); + GameManager.instance.removeGame(game.getId()); } - GamesRoomManager.getInstance().removeTable(tableId); + GamesRoomManager.instance.removeTable(tableId); } } @@ -353,12 +349,12 @@ public class TableManager { public void debugServerState() { logger.debug("--- Server state ----------------------------------------------"); - Collection users = UserManager.getInstance().getUsers(); + Collection users = UserManager.instance.getUsers(); logger.debug("--------User: " + users.size() + " [userId | since | lock | name -----------------------"); for (User user : users) { - Session session = SessionManager.getInstance().getSession(user.getSessionId()); + Session session = SessionManager.instance.getSession(user.getSessionId()); String sessionState = "N"; - if (session!=null) { + if (session != null) { if (session.isLocked()) { sessionState = "L"; } else { @@ -370,14 +366,14 @@ public class TableManager { + " | " + sessionState + " | " + user.getName() + " (" + user.getUserState().toString() + " - " + user.getPingInfo() + ')'); } - ArrayList chatSessions = ChatManager.getInstance().getChatSessions(); + ArrayList chatSessions = ChatManager.instance.getChatSessions(); logger.debug("------- ChatSessions: " + chatSessions.size() + " ----------------------------------"); for (ChatSession chatSession : chatSessions) { logger.debug(chatSession.getChatId() + " " + formatter.format(chatSession.getCreateTime()) + ' ' + chatSession.getInfo() + ' ' + chatSession.getClients().values().toString()); } - logger.debug("------- Games: " + GameManager.getInstance().getNumberActiveGames() + " --------------------------------------------"); + logger.debug("------- Games: " + GameManager.instance.getNumberActiveGames() + " --------------------------------------------"); logger.debug(" Active Game Worker: " + ThreadExecutor.getInstance().getActiveThreads(ThreadExecutor.getInstance().getGameExecutor())); - for (Entry entry : GameManager.getInstance().getGameController().entrySet()) { + for (Entry entry : GameManager.instance.getGameController().entrySet()) { logger.debug(entry.getKey() + entry.getValue().getPlayerNameList()); } logger.debug("--- Server state END ------------------------------------------"); diff --git a/Mage.Server/src/main/java/mage/server/User.java b/Mage.Server/src/main/java/mage/server/User.java index e8ec726df0..f6d6b06375 100644 --- a/Mage.Server/src/main/java/mage/server/User.java +++ b/Mage.Server/src/main/java/mage/server/User.java @@ -210,10 +210,10 @@ public class User { // Because watched games don't get restored after reconnection call stop watching for (Iterator iterator = watchedGames.iterator(); iterator.hasNext();) { UUID gameId = iterator.next(); - GameManager.getInstance().stopWatching(gameId, userId); + GameManager.instance.stopWatching(gameId, userId); iterator.remove(); } - ServerMessagesUtil.getInstance().incLostConnection(); + ServerMessagesUtil.instance.incLostConnection(); } public boolean isConnected() { @@ -246,7 +246,7 @@ public class User { public void fireCallback(final ClientCallback call) { if (isConnected()) { - Session session = SessionManager.getInstance().getSession(sessionId); + Session session = SessionManager.instance.getSession(sessionId); if (session != null) { session.fireCallback(call); } @@ -304,27 +304,27 @@ public class User { public void sendPlayerUUID(final UUID gameId, final UUID data) { lastActivity = new Date(); - GameManager.getInstance().sendPlayerUUID(gameId, userId, data); + GameManager.instance.sendPlayerUUID(gameId, userId, data); } public void sendPlayerString(final UUID gameId, final String data) { lastActivity = new Date(); - GameManager.getInstance().sendPlayerString(gameId, userId, data); + GameManager.instance.sendPlayerString(gameId, userId, data); } public void sendPlayerManaType(final UUID gameId, final UUID playerId, final ManaType data) { lastActivity = new Date(); - GameManager.getInstance().sendPlayerManaType(gameId, playerId, userId, data); + GameManager.instance.sendPlayerManaType(gameId, playerId, userId, data); } public void sendPlayerBoolean(final UUID gameId, final Boolean data) { lastActivity = new Date(); - GameManager.getInstance().sendPlayerBoolean(gameId, userId, data); + GameManager.instance.sendPlayerBoolean(gameId, userId, data); } public void sendPlayerInteger(final UUID gameId, final Integer data) { lastActivity = new Date(); - GameManager.getInstance().sendPlayerInteger(gameId, userId, data); + GameManager.instance.sendPlayerInteger(gameId, userId, data); } public void updateLastActivity(String pingInfo) { @@ -355,7 +355,7 @@ public class User { ccJoinedTable(entry.getValue().getRoomId(), entry.getValue().getId(), entry.getValue().isTournament()); } for (Entry entry : userTournaments.entrySet()) { - TournamentController tournamentController = TournamentManager.getInstance().getTournamentController(entry.getValue()); + TournamentController tournamentController = TournamentManager.instance.getTournamentController(entry.getValue()); if (tournamentController != null) { ccTournamentStarted(entry.getValue(), entry.getKey()); tournamentController.rejoin(entry.getKey()); @@ -365,7 +365,7 @@ public class User { for (Entry entry : gameSessions.entrySet()) { ccGameStarted(entry.getValue().getGameId(), entry.getKey()); entry.getValue().init(); - GameManager.getInstance().sendPlayerString(entry.getValue().getGameId(), userId, ""); + GameManager.instance.sendPlayerString(entry.getValue().getGameId(), userId, ""); } for (Entry entry : draftSessions.entrySet()) { @@ -378,10 +378,10 @@ public class User { entry.getValue().construct(0); // TODO: Check if this is correct } for (Entry entry : sideboarding.entrySet()) { - TableController controller = TableManager.getInstance().getController(entry.getKey()); + TableController controller = TableManager.instance.getController(entry.getKey()); ccSideboard(entry.getValue(), entry.getKey(), controller.getRemainingTime(), controller.getOptions().isLimited()); } - ServerMessagesUtil.getInstance().incReconnects(); + ServerMessagesUtil.instance.incReconnects(); logger.trace(userName + " ended reconnect"); } @@ -437,29 +437,29 @@ public class User { draftSessions.clear(); logger.trace("REMOVE " + userName + " Tournament sessions " + userTournaments.size()); for (UUID tournamentId : userTournaments.values()) { - TournamentManager.getInstance().quit(tournamentId, userId); + TournamentManager.instance.quit(tournamentId, userId); } userTournaments.clear(); logger.trace("REMOVE " + userName + " Tables " + tables.size()); for (Entry entry : tables.entrySet()) { logger.debug("-- leave tableId: " + entry.getValue().getId()); - TableManager.getInstance().leaveTable(userId, entry.getValue().getId()); + TableManager.instance.leaveTable(userId, entry.getValue().getId()); } tables.clear(); logger.trace("REMOVE " + userName + " Game sessions: " + gameSessions.size()); for (GameSessionPlayer gameSessionPlayer : gameSessions.values()) { logger.debug("-- kill game session of gameId: " + gameSessionPlayer.getGameId()); - GameManager.getInstance().quitMatch(gameSessionPlayer.getGameId(), userId); + GameManager.instance.quitMatch(gameSessionPlayer.getGameId(), userId); gameSessionPlayer.quitGame(); } gameSessions.clear(); logger.trace("REMOVE " + userName + " watched Games " + watchedGames.size()); for (UUID gameId : watchedGames) { - GameManager.getInstance().stopWatching(gameId, userId); + GameManager.instance.stopWatching(gameId, userId); } watchedGames.clear(); logger.trace("REMOVE " + userName + " Chats "); - ChatManager.getInstance().removeUser(userId, reason); + ChatManager.instance.removeUser(userId, reason); } public void setUserData(UserData userData) { @@ -784,7 +784,7 @@ public class User { if (table.getState() == TableState.FINISHED) { number++; } else { - TableController tableController = TableManager.getInstance().getController(table.getId()); + TableController tableController = TableManager.instance.getController(table.getId()); if (tableController != null && tableController.isUserStillActive(userId)) { number++; } diff --git a/Mage.Server/src/main/java/mage/server/UserManager.java b/Mage.Server/src/main/java/mage/server/UserManager.java index fff58df8d9..bd7634435b 100644 --- a/Mage.Server/src/main/java/mage/server/UserManager.java +++ b/Mage.Server/src/main/java/mage/server/UserManager.java @@ -42,9 +42,10 @@ import java.util.concurrent.*; * * @author BetaSteward_at_googlemail.com */ -public class UserManager { +public enum UserManager { + instance; - protected static final ScheduledExecutorService expireExecutor = Executors.newSingleThreadScheduledExecutor(); + protected final ScheduledExecutorService expireExecutor = Executors.newSingleThreadScheduledExecutor(); private static final Logger LOGGER = Logger.getLogger(UserManager.class); @@ -53,13 +54,7 @@ public class UserManager { private static final ExecutorService USER_EXECUTOR = ThreadExecutor.getInstance().getCallExecutor(); - private static final UserManager INSTANCE = new UserManager(); - - public static UserManager getInstance() { - return INSTANCE; - } - - private UserManager() { + UserManager() { expireExecutor.scheduleAtFixedRate(this::checkExpired, 60, 60, TimeUnit.SECONDS); } @@ -112,7 +107,7 @@ public class UserManager { if (user != null) { user.setSessionId(""); // Session will be set again with new id if user reconnects } - ChatManager.getInstance().removeUser(userId, reason); + ChatManager.instance.removeUser(userId, reason); } } diff --git a/Mage.Server/src/main/java/mage/server/challenge/ChallengeManager.java b/Mage.Server/src/main/java/mage/server/challenge/ChallengeManager.java index 341e593cf3..e239dbbb81 100644 --- a/Mage.Server/src/main/java/mage/server/challenge/ChallengeManager.java +++ b/Mage.Server/src/main/java/mage/server/challenge/ChallengeManager.java @@ -14,10 +14,10 @@ import mage.game.match.Match; */ public class ChallengeManager { - public static final ChallengeManager fInstance = new ChallengeManager(); + public static final ChallengeManager instance = new ChallengeManager(); public static ChallengeManager getInstance() { - return fInstance; + return instance; } public void prepareChallenge(UUID playerId, Match match) { diff --git a/Mage.Server/src/main/java/mage/server/draft/DraftController.java b/Mage.Server/src/main/java/mage/server/draft/DraftController.java index a0baa1a460..24aa15760d 100644 --- a/Mage.Server/src/main/java/mage/server/draft/DraftController.java +++ b/Mage.Server/src/main/java/mage/server/draft/DraftController.java @@ -121,7 +121,7 @@ public class DraftController { UUID playerId = userPlayerMap.get(userId); DraftSession draftSession = new DraftSession(draft, userId, playerId); draftSessions.put(playerId, draftSession); - UserManager.getInstance().getUser(userId).ifPresent(user-> { + UserManager.instance.getUser(userId).ifPresent(user-> { user.addDraft(playerId, draftSession); logger.debug("User " + user.getName() + " has joined draft " + draft.getId()); draft.getPlayer(playerId).setJoined(); @@ -187,8 +187,8 @@ public class DraftController { draftSession.draftOver(); draftSession.removeDraft(); } - TableManager.getInstance().endDraft(tableId, draft); - DraftManager.getInstance().removeDraft(draft.getId()); + TableManager.instance.endDraft(tableId, draft); + DraftManager.instance.removeDraft(draft.getId()); } public void kill(UUID userId) { diff --git a/Mage.Server/src/main/java/mage/server/draft/DraftManager.java b/Mage.Server/src/main/java/mage/server/draft/DraftManager.java index 943d2e673d..b566475855 100644 --- a/Mage.Server/src/main/java/mage/server/draft/DraftManager.java +++ b/Mage.Server/src/main/java/mage/server/draft/DraftManager.java @@ -38,14 +38,8 @@ import mage.view.DraftPickView; * * @author BetaSteward_at_googlemail.com */ -public class DraftManager { - private static final DraftManager INSTANCE = new DraftManager(); - - public static DraftManager getInstance() { - return INSTANCE; - } - - private DraftManager() {} +public enum DraftManager { + instance; private final ConcurrentHashMap draftControllers = new ConcurrentHashMap<>(); diff --git a/Mage.Server/src/main/java/mage/server/draft/DraftSession.java b/Mage.Server/src/main/java/mage/server/draft/DraftSession.java index ac41973d9b..9b25134c4b 100644 --- a/Mage.Server/src/main/java/mage/server/draft/DraftSession.java +++ b/Mage.Server/src/main/java/mage/server/draft/DraftSession.java @@ -71,7 +71,7 @@ public class DraftSession { public boolean init() { if (!killed) { - Optional user = UserManager.getInstance().getUser(userId); + Optional user = UserManager.instance.getUser(userId); if (user.isPresent()) { if (futureTimeout != null && !futureTimeout.isDone()) { int remaining = (int) futureTimeout.getDelay(TimeUnit.SECONDS); @@ -85,7 +85,7 @@ public class DraftSession { public void update() { if (!killed) { - UserManager.getInstance() + UserManager.instance .getUser(userId). ifPresent(user -> user.fireCallback( new ClientCallback("draftUpdate", draft.getId(), getDraftView()))); @@ -96,7 +96,7 @@ public class DraftSession { // public void inform(final String message) { if (!killed) { - UserManager.getInstance() + UserManager.instance .getUser(userId) .ifPresent(user -> user.fireCallback(new ClientCallback("draftInform", draft.getId(), new DraftClientMessage(getDraftView(), message)))); } @@ -105,7 +105,7 @@ public class DraftSession { public void draftOver() { if (!killed) { - UserManager.getInstance() + UserManager.instance .getUser(userId) .ifPresent(user -> user.fireCallback(new ClientCallback("draftOver", draft.getId()))); @@ -115,7 +115,7 @@ public class DraftSession { public void pickCard(int timeout) { if (!killed) { setupTimeout(timeout); - UserManager.getInstance() + UserManager.instance .getUser(userId) .ifPresent(user -> user.fireCallback(new ClientCallback("draftPick", draft.getId(), new DraftClientMessage(getDraftPickView(timeout))))); @@ -126,7 +126,7 @@ public class DraftSession { cancelTimeout(); if (seconds > 0) { futureTimeout = timeoutExecutor.schedule( - () -> DraftManager.getInstance().timeout(draft.getId(), userId), + () -> DraftManager.instance.timeout(draft.getId(), userId), seconds, TimeUnit.SECONDS ); } @@ -140,7 +140,7 @@ public class DraftSession { protected void handleRemoteException(RemoteException ex) { logger.fatal("DraftSession error ", ex); - DraftManager.getInstance().kill(draft.getId(), userId); + DraftManager.instance.kill(draft.getId(), userId); } public void setKilled() { @@ -156,7 +156,7 @@ public class DraftSession { } public void removeDraft() { - UserManager.getInstance().getUser(userId).ifPresent(user -> user.removeDraft(playerId)); + UserManager.instance.getUser(userId).ifPresent(user -> user.removeDraft(playerId)); } diff --git a/Mage.Server/src/main/java/mage/server/game/GameController.java b/Mage.Server/src/main/java/mage/server/game/GameController.java index 4ab7ab0c5b..4ed4720c7f 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameController.java +++ b/Mage.Server/src/main/java/mage/server/game/GameController.java @@ -119,10 +119,10 @@ public class GameController implements GameCallback { public GameController(Game game, ConcurrentHashMap userPlayerMap, UUID tableId, UUID choosingPlayerId, GameOptions gameOptions) { gameSessionId = UUID.randomUUID(); this.userPlayerMap = userPlayerMap; - chatId = ChatManager.getInstance().createChatSession("Game " + game.getId()); + chatId = ChatManager.instance.createChatSession("Game " + game.getId()); this.userReqestingRollback = null; this.game = game; - this.game.setSaveGame(ConfigSettings.getInstance().isSaveGameActivated()); + this.game.setSaveGame(ConfigSettings.instance.isSaveGameActivated()); this.tableId = tableId; this.choosingPlayerId = choosingPlayerId; this.gameOptions = gameOptions; @@ -141,7 +141,7 @@ public class GameController implements GameCallback { for (GameSessionPlayer gameSessionPlayer : gameSessions.values()) { gameSessionPlayer.cleanUp(); } - ChatManager.getInstance().destroyChatSession(chatId); + ChatManager.instance.destroyChatSession(chatId); for (PriorityTimer priorityTimer : timers.values()) { priorityTimer.cancel(); } @@ -158,11 +158,11 @@ public class GameController implements GameCallback { updateGame(); break; case INFO: - ChatManager.getInstance().broadcast(chatId, "", event.getMessage(), MessageColor.BLACK, true, MessageType.GAME, null); + ChatManager.instance.broadcast(chatId, "", event.getMessage(), MessageColor.BLACK, true, MessageType.GAME, null); logger.trace(game.getId() + " " + event.getMessage()); break; case STATUS: - ChatManager.getInstance().broadcast(chatId, "", event.getMessage(), MessageColor.ORANGE, event.getWithTime(), MessageType.GAME, null); + ChatManager.instance.broadcast(chatId, "", event.getMessage(), MessageColor.ORANGE, event.getWithTime(), MessageType.GAME, null); logger.trace(game.getId() + " " + event.getMessage()); break; case ERROR: @@ -305,7 +305,7 @@ public class GameController implements GameCallback { public void join(UUID userId) { UUID playerId = userPlayerMap.get(userId); - Optional user = UserManager.getInstance().getUser(userId); + Optional user = UserManager.instance.getUser(userId); if (userId == null || playerId == null) { logger.fatal("Join game failed!"); logger.fatal("- gameId: " + game.getId()); @@ -332,7 +332,7 @@ public class GameController implements GameCallback { } user.get().addGame(playerId, gameSession); logger.debug("Player " + player.getName() + ' ' + playerId + " has " + joinType + " gameId: " + game.getId()); - ChatManager.getInstance().broadcast(chatId, "", game.getPlayer(playerId).getLogName() + " has " + joinType + " the game", MessageColor.ORANGE, true, MessageType.GAME, null); + ChatManager.instance.broadcast(chatId, "", game.getPlayer(playerId).getLogName() + " has " + joinType + " the game", MessageColor.ORANGE, true, MessageType.GAME, null); checkStart(); } @@ -356,10 +356,10 @@ public class GameController implements GameCallback { if (gameSessions.get(player.getId()) == null) { // join the game because player has not joined are was removed because of disconnect user.removeConstructing(player.getId()); - GameManager.getInstance().joinGame(game.getId(), user.getId()); + GameManager.instance.joinGame(game.getId(), user.getId()); logger.debug("Player " + player.getName() + " (disconnected) has joined gameId: " + game.getId()); } - ChatManager.getInstance().broadcast(chatId, player.getName(), user.getPingInfo() + " is pending to join the game", MessageColor.BLUE, true, ChatMessage.MessageType.STATUS, null); + ChatManager.instance.broadcast(chatId, player.getName(), user.getPingInfo() + " is pending to join the game", MessageColor.BLUE, true, ChatMessage.MessageType.STATUS, null); if (user.getSecondsDisconnected() > 240) { // Cancel player join possibility lately after 4 minutes logger.debug("Player " + player.getName() + " - canceled game (after 240 seconds) gameId: " + game.getId()); @@ -379,7 +379,7 @@ public class GameController implements GameCallback { private Optional getUserByPlayerId(UUID playerId) { for (Map.Entry entry : userPlayerMap.entrySet()) { if (entry.getValue().equals(playerId)) { - return UserManager.getInstance().getUser(entry.getKey()); + return UserManager.instance.getUser(entry.getKey()); } } return Optional.empty(); @@ -418,19 +418,19 @@ public class GameController implements GameCallback { // You can't watch a game if you already watch it return; } - UserManager.getInstance().getUser(userId).ifPresent(user -> { + UserManager.instance.getUser(userId).ifPresent(user -> { GameSessionWatcher gameWatcher = new GameSessionWatcher(userId, game, false); watchers.put(userId, gameWatcher); gameWatcher.init(); user.addGameWatchInfo(game.getId()); - ChatManager.getInstance().broadcast(chatId, user.getName(), " has started watching", MessageColor.BLUE, true, ChatMessage.MessageType.STATUS, null); + ChatManager.instance.broadcast(chatId, user.getName(), " has started watching", MessageColor.BLUE, true, ChatMessage.MessageType.STATUS, null); }); } public void stopWatching(UUID userId) { watchers.remove(userId); - UserManager.getInstance().getUser(userId).ifPresent(user -> { - ChatManager.getInstance().broadcast(chatId, user.getName(), " has stopped watching", MessageColor.BLUE, true, ChatMessage.MessageType.STATUS, null); + UserManager.instance.getUser(userId).ifPresent(user -> { + ChatManager.instance.broadcast(chatId, user.getName(), " has stopped watching", MessageColor.BLUE, true, ChatMessage.MessageType.STATUS, null); }); } @@ -599,7 +599,7 @@ public class GameController implements GameCallback { gameSession.requestPermissionToSeeHandCards(userIdRequester); } else { // player does not allow the request - UserManager.getInstance().getUser(userIdRequester).ifPresent(requester -> { + UserManager.instance.getUser(userIdRequester).ifPresent(requester -> { requester.showUserMessage("Request to show hand cards", "Player " + grantingPlayer.getName() + " does not allow to request to show hand cards!"); }); } @@ -611,7 +611,7 @@ public class GameController implements GameCallback { } } else { // user can already see the cards - UserManager.getInstance().getUser(userIdRequester).ifPresent(requester -> { + UserManager.instance.getUser(userIdRequester).ifPresent(requester -> { requester.showUserMessage("Request to show hand cards", "You can see already the hand cards of player " + grantingPlayer.getName() + '!'); }); @@ -653,8 +653,8 @@ public class GameController implements GameCallback { if (player != null) { String sb = player.getLogName() + " has timed out (player had priority and was not active for " - + ConfigSettings.getInstance().getMaxSecondsIdle() + " seconds ) - Auto concede."; - ChatManager.getInstance().broadcast(chatId, "", sb, MessageColor.BLACK, true, MessageType.STATUS, null); + + ConfigSettings.instance.getMaxSecondsIdle() + " seconds ) - Auto concede."; + ChatManager.instance.broadcast(chatId, "", sb, MessageColor.BLACK, true, MessageType.STATUS, null); game.idleTimeout(playerId); } } @@ -667,7 +667,7 @@ public class GameController implements GameCallback { for (final GameSessionWatcher gameWatcher : watchers.values()) { gameWatcher.gameOver(message); } - TableManager.getInstance().endGame(tableId); + TableManager.instance.endGame(tableId); } public UUID getSessionId() { @@ -718,7 +718,7 @@ public class GameController implements GameCallback { } private synchronized void endGameInfo() { - Table table = TableManager.getInstance().getTable(tableId); + Table table = TableManager.instance.getTable(tableId); if (table != null) { if (table.getMatch() != null) { for (final GameSessionPlayer gameSession : gameSessions.values()) { @@ -967,7 +967,7 @@ public class GameController implements GameCallback { cancelTimeout(); futureTimeout = timeoutIdleExecutor.schedule( () -> idleTimeout(playerId), - Main.isTestMode() ? 3600 : ConfigSettings.getInstance().getMaxSecondsIdle(), + Main.isTestMode() ? 3600 : ConfigSettings.instance.getMaxSecondsIdle(), TimeUnit.SECONDS ); } diff --git a/Mage.Server/src/main/java/mage/server/game/GameManager.java b/Mage.Server/src/main/java/mage/server/game/GameManager.java index 0b4b2e9c37..59fe34a923 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameManager.java +++ b/Mage.Server/src/main/java/mage/server/game/GameManager.java @@ -41,14 +41,8 @@ import mage.view.GameView; * * @author BetaSteward_at_googlemail.com */ -public class GameManager { - private static final GameManager INSTANCE = new GameManager(); - - public static GameManager getInstance() { - return INSTANCE; - } - - private GameManager() {} +public enum GameManager { + instance; private final ConcurrentHashMap gameControllers = new ConcurrentHashMap<>(); diff --git a/Mage.Server/src/main/java/mage/server/game/GameSessionPlayer.java b/Mage.Server/src/main/java/mage/server/game/GameSessionPlayer.java index ad1cd8022f..f3f1146967 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameSessionPlayer.java +++ b/Mage.Server/src/main/java/mage/server/game/GameSessionPlayer.java @@ -68,14 +68,14 @@ public class GameSessionPlayer extends GameSessionWatcher { public void ask(final String question, final Map options) { if (!killed) { - UserManager.getInstance().getUser(userId).ifPresent(user -> user.fireCallback(new ClientCallback("gameAsk", game.getId(), new GameClientMessage(getGameView(), question, options))) + UserManager.instance.getUser(userId).ifPresent(user -> user.fireCallback(new ClientCallback("gameAsk", game.getId(), new GameClientMessage(getGameView(), question, options))) ); } } public void target(final String question, final CardsView cardView, final Set targets, final boolean required, final Map options) { if (!killed) { - UserManager.getInstance().getUser(userId).ifPresent(user -> { + UserManager.instance.getUser(userId).ifPresent(user -> { user.fireCallback(new ClientCallback("gameTarget", game.getId(), new GameClientMessage(getGameView(), question, cardView, targets, required, options))); }); @@ -84,13 +84,13 @@ public class GameSessionPlayer extends GameSessionWatcher { public void select(final String message, final Map options) { if (!killed) { - UserManager.getInstance().getUser(userId).ifPresent(user -> user.fireCallback(new ClientCallback("gameSelect", game.getId(), new GameClientMessage(getGameView(), message, options)))); + UserManager.instance.getUser(userId).ifPresent(user -> user.fireCallback(new ClientCallback("gameSelect", game.getId(), new GameClientMessage(getGameView(), message, options)))); } } public void chooseAbility(final AbilityPickerView abilities) { if (!killed) { - UserManager.getInstance().getUser(userId).ifPresent(user + UserManager.instance.getUser(userId).ifPresent(user -> user.fireCallback(new ClientCallback("gameChooseAbility", game.getId(), abilities))); } @@ -98,7 +98,7 @@ public class GameSessionPlayer extends GameSessionWatcher { public void choosePile(final String message, final CardsView pile1, final CardsView pile2) { if (!killed) { - UserManager.getInstance().getUser(userId).ifPresent(user + UserManager.instance.getUser(userId).ifPresent(user -> user.fireCallback(new ClientCallback("gameChoosePile", game.getId(), new GameClientMessage(message, pile1, pile2)))); } @@ -106,7 +106,7 @@ public class GameSessionPlayer extends GameSessionWatcher { public void chooseChoice(final Choice choice) { if (!killed) { - UserManager.getInstance().getUser(userId).ifPresent(user + UserManager.instance.getUser(userId).ifPresent(user -> user.fireCallback(new ClientCallback("gameChooseChoice", game.getId(), new GameClientMessage(choice)))); } @@ -114,14 +114,14 @@ public class GameSessionPlayer extends GameSessionWatcher { public void playMana(final String message, final Map options) { if (!killed) { - UserManager.getInstance().getUser(userId).ifPresent(user + UserManager.instance.getUser(userId).ifPresent(user -> user.fireCallback(new ClientCallback("gamePlayMana", game.getId(), new GameClientMessage(getGameView(), message, options)))); } } public void playXMana(final String message) { if (!killed) { - UserManager.getInstance().getUser(userId).ifPresent(user + UserManager.instance.getUser(userId).ifPresent(user -> user.fireCallback(new ClientCallback("gamePlayXMana", game.getId(), new GameClientMessage(getGameView(), message)))); } @@ -129,7 +129,7 @@ public class GameSessionPlayer extends GameSessionWatcher { public void getAmount(final String message, final int min, final int max) { if (!killed) { - UserManager.getInstance().getUser(userId).ifPresent(user -> { + UserManager.instance.getUser(userId).ifPresent(user -> { user.fireCallback(new ClientCallback("gameSelectAmount", game.getId(), new GameClientMessage(message, min, max))); }); } @@ -137,15 +137,15 @@ public class GameSessionPlayer extends GameSessionWatcher { public void endGameInfo(Table table) { if (!killed) { - UserManager.getInstance().getUser(userId).ifPresent(user -> user.fireCallback(new ClientCallback("endGameInfo", game.getId(), getGameEndView(playerId, table)))); + UserManager.instance.getUser(userId).ifPresent(user -> user.fireCallback(new ClientCallback("endGameInfo", game.getId(), getGameEndView(playerId, table)))); } } public void requestPermissionToRollbackTurn(UUID requestingUserId, int numberTurns) { if (!killed) { - Optional requestingUser = UserManager.getInstance().getUser(requestingUserId); - Optional requestedUser = UserManager.getInstance().getUser(userId); + Optional requestingUser = UserManager.instance.getUser(requestingUserId); + Optional requestedUser = UserManager.instance.getUser(userId); if (requestedUser.isPresent() && requestingUser.isPresent()) { String message; switch (numberTurns) { @@ -171,8 +171,8 @@ public class GameSessionPlayer extends GameSessionWatcher { public void requestPermissionToSeeHandCards(UUID watcherId) { if (!killed) { - Optional watcher = UserManager.getInstance().getUser(watcherId); - Optional user = UserManager.getInstance().getUser(userId); + Optional watcher = UserManager.instance.getUser(watcherId); + Optional user = UserManager.instance.getUser(userId); if (user.isPresent() && watcher.isPresent()) { UserRequestMessage userRequestMessage = new UserRequestMessage( "User request", @@ -241,7 +241,7 @@ public class GameSessionPlayer extends GameSessionWatcher { } public void removeGame() { - UserManager.getInstance().getUser(userId).ifPresent(user -> user.removeGame(playerId)); + UserManager.instance.getUser(userId).ifPresent(user -> user.removeGame(playerId)); } diff --git a/Mage.Server/src/main/java/mage/server/game/GameSessionWatcher.java b/Mage.Server/src/main/java/mage/server/game/GameSessionWatcher.java index e386f7c244..59c7718929 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameSessionWatcher.java +++ b/Mage.Server/src/main/java/mage/server/game/GameSessionWatcher.java @@ -65,7 +65,7 @@ public class GameSessionWatcher { public boolean init() { if (!killed) { - Optional user = UserManager.getInstance().getUser(userId); + Optional user = UserManager.instance.getUser(userId); if (user.isPresent()) { user.get().fireCallback(new ClientCallback("gameInit", game.getId(), getGameView())); return true; @@ -76,28 +76,28 @@ public class GameSessionWatcher { public void update() { if (!killed) { - UserManager.getInstance().getUser(userId).ifPresent(user -> user.fireCallback(new ClientCallback("gameUpdate", game.getId(), getGameView()))); + UserManager.instance.getUser(userId).ifPresent(user -> user.fireCallback(new ClientCallback("gameUpdate", game.getId(), getGameView()))); } } public void inform(final String message) { if (!killed) { - UserManager.getInstance().getUser(userId).ifPresent(user -> user.fireCallback(new ClientCallback("gameInform", game.getId(), new GameClientMessage(getGameView(), message)))); + UserManager.instance.getUser(userId).ifPresent(user -> user.fireCallback(new ClientCallback("gameInform", game.getId(), new GameClientMessage(getGameView(), message)))); } } public void informPersonal(final String message) { if (!killed) { - UserManager.getInstance().getUser(userId).ifPresent(user -> user.fireCallback(new ClientCallback("gameInformPersonal", game.getId(), new GameClientMessage(getGameView(), message)))); + UserManager.instance.getUser(userId).ifPresent(user -> user.fireCallback(new ClientCallback("gameInformPersonal", game.getId(), new GameClientMessage(getGameView(), message)))); } } public void gameOver(final String message) { if (!killed) { - UserManager.getInstance().getUser(userId).ifPresent(user -> { + UserManager.instance.getUser(userId).ifPresent(user -> { user.removeGameWatchInfo(game.getId()); user.fireCallback(new ClientCallback("gameOver", game.getId(), message)); }); @@ -113,7 +113,7 @@ public class GameSessionWatcher { public void gameError(final String message) { if (!killed) { - UserManager.getInstance().getUser(userId).ifPresent(user -> user.fireCallback(new ClientCallback("gameError", game.getId(), message))); + UserManager.instance.getUser(userId).ifPresent(user -> user.fireCallback(new ClientCallback("gameError", game.getId(), message))); } } diff --git a/Mage.Server/src/main/java/mage/server/game/GamesRoomImpl.java b/Mage.Server/src/main/java/mage/server/game/GamesRoomImpl.java index adc697bdb8..6d70bf273c 100644 --- a/Mage.Server/src/main/java/mage/server/game/GamesRoomImpl.java +++ b/Mage.Server/src/main/java/mage/server/game/GamesRoomImpl.java @@ -100,7 +100,7 @@ public class GamesRoomImpl extends RoomImpl implements GamesRoom, Serializable { } else { // more since 50 matches finished since this match so remove it if (table.isTournament()) { - TournamentManager.getInstance().removeTournament(table.getTournament().getId()); + TournamentManager.instance.removeTournament(table.getTournament().getId()); } this.removeTable(table.getId()); } @@ -108,7 +108,7 @@ public class GamesRoomImpl extends RoomImpl implements GamesRoom, Serializable { tableView = tableList; matchView = matchList; List users = new ArrayList<>(); - for (User user : UserManager.getInstance().getUsers()) { + for (User user : UserManager.instance.getUsers()) { try { users.add(new UsersView(user.getUserData().getFlagName(), user.getName(), user.getMatchHistory(), user.getMatchQuitRatio(), user.getTourneyHistory(), @@ -135,9 +135,9 @@ public class GamesRoomImpl extends RoomImpl implements GamesRoom, Serializable { users.sort((one, two) -> one.getUserName().compareToIgnoreCase(two.getUserName())); List roomUserInfo = new ArrayList<>(); roomUserInfo.add(new RoomUsersView(users, - GameManager.getInstance().getNumberActiveGames(), + GameManager.instance.getNumberActiveGames(), ThreadExecutor.getInstance().getActiveThreads(ThreadExecutor.getInstance().getGameExecutor()), - ConfigSettings.getInstance().getMaxGameThreads() + ConfigSettings.instance.getMaxGameThreads() )); roomUsersView = roomUserInfo; } @@ -150,7 +150,7 @@ public class GamesRoomImpl extends RoomImpl implements GamesRoom, Serializable { @Override public boolean joinTable(UUID userId, UUID tableId, String name, String playerType, int skill, DeckCardLists deckList, String password) throws MageException { if (tables.containsKey(tableId)) { - return TableManager.getInstance().joinTable(userId, tableId, name, playerType, skill, deckList, password); + return TableManager.instance.joinTable(userId, tableId, name, playerType, skill, deckList, password); } else { return false; } @@ -158,7 +158,7 @@ public class GamesRoomImpl extends RoomImpl implements GamesRoom, Serializable { @Override public TableView createTable(UUID userId, MatchOptions options) { - Table table = TableManager.getInstance().createTable(this.getRoomId(), userId, options); + Table table = TableManager.instance.createTable(this.getRoomId(), userId, options); tables.put(table.getId(), table); return new TableView(table); } @@ -166,7 +166,7 @@ public class GamesRoomImpl extends RoomImpl implements GamesRoom, Serializable { @Override public boolean joinTournamentTable(UUID userId, UUID tableId, String name, String playerType, int skill, DeckCardLists deckList, String password) throws GameException { if (tables.containsKey(tableId)) { - return TableManager.getInstance().joinTournament(userId, tableId, name, playerType, skill, deckList, password); + return TableManager.instance.joinTournament(userId, tableId, name, playerType, skill, deckList, password); } else { return false; } @@ -174,7 +174,7 @@ public class GamesRoomImpl extends RoomImpl implements GamesRoom, Serializable { @Override public TableView createTournamentTable(UUID userId, TournamentOptions options) { - Table table = TableManager.getInstance().createTournamentTable(this.getRoomId(), userId, options); + Table table = TableManager.instance.createTournamentTable(this.getRoomId(), userId, options); tables.put(table.getId(), table); return new TableView(table); } @@ -206,12 +206,12 @@ public class GamesRoomImpl extends RoomImpl implements GamesRoom, Serializable { @Override public void leaveTable(UUID userId, UUID tableId) { - TableManager.getInstance().leaveTable(userId, tableId); + TableManager.instance.leaveTable(userId, tableId); } @Override public boolean watchTable(UUID userId, UUID tableId) throws MageException { - return TableManager.getInstance().watchTable(userId, tableId); + return TableManager.instance.watchTable(userId, tableId); } @Override diff --git a/Mage.Server/src/main/java/mage/server/game/GamesRoomManager.java b/Mage.Server/src/main/java/mage/server/game/GamesRoomManager.java index a771eed2cf..9c392ed707 100644 --- a/Mage.Server/src/main/java/mage/server/game/GamesRoomManager.java +++ b/Mage.Server/src/main/java/mage/server/game/GamesRoomManager.java @@ -32,22 +32,16 @@ import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; /** - * * @author BetaSteward_at_googlemail.com */ -public class GamesRoomManager { - - private static final GamesRoomManager INSTANCE = new GamesRoomManager(); -// private static final Logger logger = Logger.getLogger(GamesRoomManager.class); +public enum GamesRoomManager { + instance; private final ConcurrentHashMap rooms = new ConcurrentHashMap<>(); private final UUID mainRoomId; - public static GamesRoomManager getInstance() { - return INSTANCE; - } - private GamesRoomManager() { + GamesRoomManager() { GamesRoom mainRoom = new GamesRoomImpl(); mainRoomId = mainRoom.getRoomId(); rooms.put(mainRoomId, mainRoom); @@ -68,7 +62,7 @@ public class GamesRoomManager { } public void removeTable(UUID tableId) { - for (GamesRoom room: rooms.values()) { + for (GamesRoom room : rooms.values()) { room.removeTable(tableId); } } diff --git a/Mage.Server/src/main/java/mage/server/game/ReplayManager.java b/Mage.Server/src/main/java/mage/server/game/ReplayManager.java index c57dcbc311..77ea5cb067 100644 --- a/Mage.Server/src/main/java/mage/server/game/ReplayManager.java +++ b/Mage.Server/src/main/java/mage/server/game/ReplayManager.java @@ -36,21 +36,15 @@ import mage.server.UserManager; * * @author BetaSteward_at_googlemail.com */ -public class ReplayManager { - private static final ReplayManager INSTANCE = new ReplayManager(); - - public static ReplayManager getInstance() { - return INSTANCE; - } - - private ReplayManager() {} +public enum ReplayManager { + instance; private final ConcurrentHashMap replaySessions = new ConcurrentHashMap<>(); public void replayGame(UUID gameId, UUID userId) { ReplaySession replaySession = new ReplaySession(gameId, userId); replaySessions.put(gameId.toString() + userId.toString(), replaySession); - UserManager.getInstance().getUser(userId).ifPresent(user->user.ccReplayGame(gameId)); + UserManager.instance.getUser(userId).ifPresent(user->user.ccReplayGame(gameId)); } public void startReplay(UUID gameId, UUID userId) { diff --git a/Mage.Server/src/main/java/mage/server/game/ReplaySession.java b/Mage.Server/src/main/java/mage/server/game/ReplaySession.java index b1c68f0665..c19d9a1788 100644 --- a/Mage.Server/src/main/java/mage/server/game/ReplaySession.java +++ b/Mage.Server/src/main/java/mage/server/game/ReplaySession.java @@ -51,7 +51,7 @@ public class ReplaySession implements GameCallback { public void replay() { replay.start(); - UserManager.getInstance().getUser(userId).ifPresent(user -> + UserManager.instance.getUser(userId).ifPresent(user -> user.fireCallback(new ClientCallback("replayInit", replay.getGame().getId(), new GameView(replay.next(), replay.getGame(), null, null)))); } @@ -77,17 +77,17 @@ public class ReplaySession implements GameCallback { @Override public void gameResult(final String result) { - UserManager.getInstance().getUser(userId).ifPresent(user -> + UserManager.instance.getUser(userId).ifPresent(user -> user.fireCallback(new ClientCallback("replayDone", replay.getGame().getId(), result))); - ReplayManager.getInstance().endReplay(replay.getGame().getId(), userId); + ReplayManager.instance.endReplay(replay.getGame().getId(), userId); } private void updateGame(final GameState state, Game game) { if (state == null) { gameResult("game ended"); } else { - UserManager.getInstance().getUser(userId).ifPresent(user -> + UserManager.instance.getUser(userId).ifPresent(user -> user.fireCallback(new ClientCallback("replayUpdate", replay.getGame().getId(), new GameView(state, game, null, null)))); } diff --git a/Mage.Server/src/main/java/mage/server/record/TableRecorderImpl.java b/Mage.Server/src/main/java/mage/server/record/TableRecorderImpl.java index 5d65ffe7f8..119ea846a8 100644 --- a/Mage.Server/src/main/java/mage/server/record/TableRecorderImpl.java +++ b/Mage.Server/src/main/java/mage/server/record/TableRecorderImpl.java @@ -17,6 +17,6 @@ public class TableRecorderImpl implements TableRecorder { public void record(Table table) { TableProto proto = table.toProto(); TableRecordRepository.instance.add(new TableRecord(proto, proto.getEndTimeMs())); - UserManager.getInstance().updateUserHistory(); + UserManager.instance.updateUserHistory(); } } diff --git a/Mage.Server/src/main/java/mage/server/tournament/TournamentController.java b/Mage.Server/src/main/java/mage/server/tournament/TournamentController.java index 03e980e319..e3c26f57b9 100644 --- a/Mage.Server/src/main/java/mage/server/tournament/TournamentController.java +++ b/Mage.Server/src/main/java/mage/server/tournament/TournamentController.java @@ -77,7 +77,7 @@ public class TournamentController { public TournamentController(Tournament tournament, ConcurrentHashMap userPlayerMap, UUID tableId) { this.userPlayerMap = userPlayerMap; - chatId = ChatManager.getInstance().createChatSession("Tournament " + tournament.getId()); + chatId = ChatManager.instance.createChatSession("Tournament " + tournament.getId()); this.tournament = tournament; this.tableId = tableId; init(); @@ -91,7 +91,7 @@ public class TournamentController { checkPlayersState(); break; case INFO: - ChatManager.getInstance().broadcast(chatId, "", event.getMessage(), MessageColor.BLACK, true, MessageType.STATUS, null); + ChatManager.instance.broadcast(chatId, "", event.getMessage(), MessageColor.BLACK, true, MessageType.STATUS, null); logger.debug(tournament.getId() + " " + event.getMessage()); break; case START_DRAFT: @@ -146,7 +146,7 @@ public class TournamentController { if (!player.getPlayer().isHuman()) { player.setJoined(); logger.debug("player " + player.getPlayer().getId() + " has joined tournament " + tournament.getId()); - ChatManager.getInstance().broadcast(chatId, "", player.getPlayer().getLogName() + " has joined the tournament", MessageColor.BLACK, true, MessageType.STATUS, null); + ChatManager.instance.broadcast(chatId, "", player.getPlayer().getLogName() + " has joined the tournament", MessageColor.BLACK, true, MessageType.STATUS, null); } } checkStart(); @@ -156,7 +156,7 @@ public class TournamentController { UUID playerId = userPlayerMap.get(userId); if (playerId == null) { if (logger.isDebugEnabled()) { - UserManager.getInstance().getUser(userId).ifPresent(user -> + UserManager.instance.getUser(userId).ifPresent(user -> logger.debug(user.getName() + " shows tournament panel tournamentId: " + tournament.getId())); } @@ -169,14 +169,14 @@ public class TournamentController { // first join of player TournamentSession tournamentSession = new TournamentSession(tournament, userId, tableId, playerId); tournamentSessions.put(playerId, tournamentSession); - Optional _user = UserManager.getInstance().getUser(userId); + Optional _user = UserManager.instance.getUser(userId); if (_user.isPresent()) { User user = _user.get(); user.addTournament(playerId, tournament.getId()); TournamentPlayer player = tournament.getPlayer(playerId); player.setJoined(); logger.debug("player " + player.getPlayer().getName() + " - client has joined tournament " + tournament.getId()); - ChatManager.getInstance().broadcast(chatId, "", player.getPlayer().getLogName() + " has joined the tournament", MessageColor.BLACK, true, MessageType.STATUS, null); + ChatManager.instance.broadcast(chatId, "", player.getPlayer().getLogName() + " has joined the tournament", MessageColor.BLACK, true, MessageType.STATUS, null); checkStart(); } else { logger.error("User not found userId: " + userId + " tournamentId: " + tournament.getId()); @@ -235,15 +235,15 @@ public class TournamentController { tournamentSession.tournamentOver(); } this.tournamentSessions.clear(); - TableManager.getInstance().endTournament(tableId, tournament); + TableManager.instance.endTournament(tableId, tournament); tournament.cleanUpOnTournamentEnd(); } private void startMatch(TournamentPairing pair, MatchOptions matchOptions) { try { - TableManager tableManager = TableManager.getInstance(); - Table table = tableManager.createTable(GamesRoomManager.getInstance().getMainRoomId(), matchOptions); + TableManager tableManager = TableManager.instance; + Table table = tableManager.createTable(GamesRoomManager.instance.getMainRoomId(), matchOptions); table.setTournamentSubTable(true); table.setTournament(tournament); table.setState(TableState.WAITING); @@ -266,8 +266,8 @@ public class TournamentController { private void startMultiplayerMatch(MultiplayerRound round, MatchOptions matchOptions) { try { - TableManager tableManager = TableManager.getInstance(); - Table table = tableManager.createTable(GamesRoomManager.getInstance().getMainRoomId(), matchOptions); + TableManager tableManager = TableManager.instance; + Table table = tableManager.createTable(GamesRoomManager.instance.getMainRoomId(), matchOptions); table.setTournamentSubTable(true); table.setTournament(tournament); table.setState(TableState.WAITING); @@ -290,16 +290,16 @@ public class TournamentController { } private void startDraft(Draft draft) { - TableManager.getInstance().startDraft(tableId, draft); + TableManager.instance.startDraft(tableId, draft); } private void construct() { - TableManager.getInstance().construct(tableId); + TableManager.instance.construct(tableId); } private void initTournament() { - if (TableManager.getInstance().getTable(tableId).getState() != TableState.DUELING) { - TableManager.getInstance().initTournament(tableId); + if (TableManager.instance.getTable(tableId).getState() != TableState.DUELING) { + TableManager.instance.initTournament(tableId); } } @@ -307,7 +307,7 @@ public class TournamentController { if (tournamentSessions.containsKey(playerId)) { TournamentSession tournamentSession = tournamentSessions.get(playerId); tournamentSession.construct(timeout); - UserManager.getInstance().getUser(getPlayerUserId(playerId)).get().addConstructing(playerId, tournamentSession); + UserManager.instance.getUser(getPlayerUserId(playerId)).get().addConstructing(playerId, tournamentSession); TournamentPlayer player = tournament.getPlayer(playerId); player.setState(TournamentPlayerState.CONSTRUCTING); } @@ -318,7 +318,7 @@ public class TournamentController { TournamentPlayer player = tournament.getPlayer(playerId); if (player != null && !player.hasQuit()) { tournamentSessions.get(playerId).submitDeck(deck); - ChatManager.getInstance().broadcast(chatId, "", player.getPlayer().getLogName() + " has submitted his or her tournament deck", MessageColor.BLACK, true, MessageType.STATUS, SoundToPlay.PlayerSubmittedDeck); + ChatManager.instance.broadcast(chatId, "", player.getPlayer().getLogName() + " has submitted his or her tournament deck", MessageColor.BLACK, true, MessageType.STATUS, SoundToPlay.PlayerSubmittedDeck); } } } @@ -336,7 +336,7 @@ public class TournamentController { tournament.autoSubmit(userPlayerMap.get(userId), tournamentPlayer.generateDeck()); } else { StringBuilder sb = new StringBuilder(); - UserManager.getInstance().getUser(userId).ifPresent(user -> + UserManager.instance.getUser(userId).ifPresent(user -> sb.append(user.getName())); sb.append(" - no deck found for auto submit"); @@ -378,18 +378,18 @@ public class TournamentController { if (tournament.isDoneConstructing()) { info = new StringBuilder("during round ").append(tournament.getRounds().size()).toString(); // quit active matches of that tournament - TableManager.getInstance().userQuitTournamentSubTables(tournament.getId(), userId); + TableManager.instance.userQuitTournamentSubTables(tournament.getId(), userId); status = TourneyQuitStatus.DURING_ROUND; } else if (tournamentPlayer.getState() == TournamentPlayerState.DRAFTING) { info = "during Draft phase"; if (!checkToReplaceDraftPlayerByAi(userId, tournamentPlayer)) { this.abortDraftTournament(); } else { - DraftController draftController = DraftManager.getInstance().getController(tableId); + DraftController draftController = DraftManager.instance.getController(tableId); if (draftController != null) { DraftSession draftSession = draftController.getDraftSession(playerId); if (draftSession != null) { - DraftManager.getInstance().kill(draftSession.getDraftId(), userId); + DraftManager.instance.kill(draftSession.getDraftId(), userId); } } } @@ -404,7 +404,7 @@ public class TournamentController { tournamentPlayer.setQuit(info, status); tournament.quit(playerId); tournamentSession.quit(); - ChatManager.getInstance().broadcast(chatId, "", tournamentPlayer.getPlayer().getLogName() + " has quit the tournament", MessageColor.BLACK, true, MessageType.STATUS, SoundToPlay.PlayerQuitTournament); + ChatManager.instance.broadcast(chatId, "", tournamentPlayer.getPlayer().getLogName() + " has quit the tournament", MessageColor.BLACK, true, MessageType.STATUS, SoundToPlay.PlayerQuitTournament); } } @@ -418,8 +418,8 @@ public class TournamentController { } // replace player that quits with draft bot if (humans > 1) { - Optional user = UserManager.getInstance().getUser(userId); - TableController tableController = TableManager.getInstance().getController(tableId); + Optional user = UserManager.instance.getUser(userId); + TableController tableController = TableManager.instance.getController(tableId); if (tableController != null) { String replacePlayerName = "Draftbot"; if (user.isPresent()) { @@ -431,7 +431,7 @@ public class TournamentController { user.get().removeTable(leavingPlayer.getPlayer().getId()); user.get().removeTournament(leavingPlayer.getPlayer().getId()); } - ChatManager.getInstance().broadcast(chatId, "", leavingPlayer.getPlayer().getLogName() + " was replaced by draftbot", MessageColor.BLACK, true, MessageType.STATUS, null); + ChatManager.instance.broadcast(chatId, "", leavingPlayer.getPlayer().getLogName() + " was replaced by draftbot", MessageColor.BLACK, true, MessageType.STATUS, null); } return true; } @@ -453,7 +453,7 @@ public class TournamentController { private void abortDraftTournament() { tournament.setAbort(true); - DraftManager.getInstance().getController(tableId).abortDraft(); + DraftManager.instance.getController(tableId).abortDraft(); } public boolean isAbort() { @@ -478,7 +478,7 @@ public class TournamentController { } public void cleanUpOnRemoveTournament() { - ChatManager.getInstance().destroyChatSession(chatId); + ChatManager.instance.destroyChatSession(chatId); } /** @@ -496,7 +496,7 @@ public class TournamentController { if (tournamentPlayer != null) { if (!tournamentPlayer.hasQuit()) { if (tournamentPlayer.getPlayer().isHuman()) { - Optional user = UserManager.getInstance().getUser(entry.getKey()); + Optional user = UserManager.instance.getUser(entry.getKey()); if (!user.isPresent()) { logger.debug("Tournament user is missing but player active -> start quit - tournamentId: " + tournament.getId() + " state: " + tableState.toString()); // active tournament player but the user is no longer online diff --git a/Mage.Server/src/main/java/mage/server/tournament/TournamentManager.java b/Mage.Server/src/main/java/mage/server/tournament/TournamentManager.java index 3954e63301..8015e52615 100644 --- a/Mage.Server/src/main/java/mage/server/tournament/TournamentManager.java +++ b/Mage.Server/src/main/java/mage/server/tournament/TournamentManager.java @@ -30,29 +30,23 @@ package mage.server.tournament; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; + import mage.cards.decks.Deck; import mage.game.tournament.Tournament; import mage.view.TournamentView; import org.apache.log4j.Logger; /** - * * @author BetaSteward_at_googlemail.com */ -public class TournamentManager { - - private static final TournamentManager INSTANCE = new TournamentManager(); - +public enum TournamentManager { + instance; private final ConcurrentHashMap controllers = new ConcurrentHashMap<>(); - public static TournamentManager getInstance() { - return INSTANCE; - } - public TournamentController getTournamentController(UUID tournamentId) { return controllers.get(tournamentId); } - + public void createTournamentSession(Tournament tournament, ConcurrentHashMap userPlayerMap, UUID tableId) { TournamentController tournamentController = new TournamentController(tournament, userPlayerMap, tableId); controllers.put(tournament.getId(), tournamentController); @@ -84,7 +78,7 @@ public class TournamentManager { } public TournamentView getTournamentView(UUID tournamentId) { - TournamentController tournamentController = controllers.get(tournamentId); + TournamentController tournamentController = controllers.get(tournamentId); if (tournamentController != null) { return tournamentController.getTournamentView(); } @@ -94,13 +88,13 @@ public class TournamentManager { public UUID getChatId(UUID tournamentId) { return controllers.get(tournamentId).getChatId(); } - + public void removeTournament(UUID tournamentId) { TournamentController tournamentController = controllers.get(tournamentId); if (tournamentController != null) { controllers.remove(tournamentId); tournamentController.cleanUpOnRemoveTournament(); - + } } diff --git a/Mage.Server/src/main/java/mage/server/tournament/TournamentSession.java b/Mage.Server/src/main/java/mage/server/tournament/TournamentSession.java index 0eb57bde61..89eda7df68 100644 --- a/Mage.Server/src/main/java/mage/server/tournament/TournamentSession.java +++ b/Mage.Server/src/main/java/mage/server/tournament/TournamentSession.java @@ -67,7 +67,7 @@ public class TournamentSession { public boolean init() { if (!killed) { - Optional user = UserManager.getInstance().getUser(userId); + Optional user = UserManager.instance.getUser(userId); if (user.isPresent()) { user.get().fireCallback(new ClientCallback("tournamentInit", tournament.getId(), getTournamentView())); return true; @@ -78,7 +78,7 @@ public class TournamentSession { public void update() { if (!killed) { - UserManager.getInstance().getUser(userId).ifPresent(user -> + UserManager.instance.getUser(userId).ifPresent(user -> user.fireCallback(new ClientCallback("tournamentUpdate", tournament.getId(), getTournamentView()))); } @@ -86,7 +86,7 @@ public class TournamentSession { public void gameOver(final String message) { if (!killed) { - UserManager.getInstance().getUser(userId).ifPresent(user -> + UserManager.instance.getUser(userId).ifPresent(user -> user.fireCallback(new ClientCallback("tournamentOver", tournament.getId(), message))); } @@ -95,7 +95,7 @@ public class TournamentSession { public void construct(int timeout) { if (!killed) { setupTimeout(timeout); - UserManager.getInstance().getUser(userId).ifPresent(user -> { + UserManager.instance.getUser(userId).ifPresent(user -> { int remaining = (int) futureTimeout.getDelay(TimeUnit.SECONDS); user.ccConstruct(tournament.getPlayer(playerId).getDeck(), tableId, remaining); }); @@ -128,7 +128,7 @@ public class TournamentSession { futureTimeout = timeoutExecutor.schedule( () -> { try { - TournamentManager.getInstance().timeout(tournament.getId(), userId); + TournamentManager.instance.timeout(tournament.getId(), userId); } catch (Exception e) { logger.fatal("TournamentSession error - userId " + userId + " tId " + tournament.getId(), e); } @@ -170,7 +170,7 @@ public class TournamentSession { } private void removeTournamentForUser() { - UserManager.getInstance().getUser(userId).ifPresent(user -> + UserManager.instance.getUser(userId).ifPresent(user -> user.removeTournament(playerId)); diff --git a/Mage.Server/src/main/java/mage/server/util/ConfigSettings.java b/Mage.Server/src/main/java/mage/server/util/ConfigSettings.java index d472b0a8ce..4acf8c98b0 100644 --- a/Mage.Server/src/main/java/mage/server/util/ConfigSettings.java +++ b/Mage.Server/src/main/java/mage/server/util/ConfigSettings.java @@ -33,27 +33,23 @@ import java.util.List; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; + import mage.server.util.config.Config; import mage.server.util.config.GamePlugin; import mage.server.util.config.Plugin; import org.apache.log4j.Logger; /** - * * @author BetaSteward_at_googlemail.com */ -public class ConfigSettings { - - private static final Logger logger = Logger.getLogger(ConfigSettings.class); - private static final ConfigSettings INSTANCE = new ConfigSettings(); +public enum ConfigSettings { + instance; + private final Logger logger = Logger.getLogger(ConfigSettings.class); private Config config; - public static ConfigSettings getInstance() { - return INSTANCE; - } - private ConfigSettings() { + ConfigSettings() { try { JAXBContext jaxbContext = JAXBContext.newInstance("mage.server.util.config"); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); diff --git a/Mage.Server/src/main/java/mage/server/util/ServerMessagesUtil.java b/Mage.Server/src/main/java/mage/server/util/ServerMessagesUtil.java index 74eefda2a0..d596f8a653 100644 --- a/Mage.Server/src/main/java/mage/server/util/ServerMessagesUtil.java +++ b/Mage.Server/src/main/java/mage/server/util/ServerMessagesUtil.java @@ -48,13 +48,11 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; * * @author nantuko */ -public class ServerMessagesUtil { - - private static final ServerMessagesUtil instance = new ServerMessagesUtil(); - +public enum ServerMessagesUtil { +instance; private static final Logger log = Logger.getLogger(ServerMessagesUtil.class); private static final String SERVER_MSG_TXT_FILE = "server.msg.txt"; - private static ScheduledExecutorService updateExecutor; + private ScheduledExecutorService updateExecutor; private final List messages = new ArrayList<>(); private final ReadWriteLock lock = new ReentrantReadWriteLock(); @@ -73,14 +71,12 @@ public class ServerMessagesUtil { pathToExternalMessages = System.getProperty("messagesPath"); } - public ServerMessagesUtil() { + ServerMessagesUtil() { updateExecutor = Executors.newSingleThreadScheduledExecutor(); updateExecutor.scheduleAtFixedRate(this::reloadMessages, 5, 5 * 60, TimeUnit.SECONDS); } - public static ServerMessagesUtil getInstance() { - return instance; - } + public List getMessages() { lock.readLock().lock(); diff --git a/Mage.Server/src/main/java/mage/server/util/ThreadExecutor.java b/Mage.Server/src/main/java/mage/server/util/ThreadExecutor.java index 60f3e56c95..3517add455 100644 --- a/Mage.Server/src/main/java/mage/server/util/ThreadExecutor.java +++ b/Mage.Server/src/main/java/mage/server/util/ThreadExecutor.java @@ -42,7 +42,7 @@ public class ThreadExecutor { private static final ExecutorService callExecutor = Executors.newCachedThreadPool(); private static final ExecutorService userExecutor = Executors.newCachedThreadPool(); - private static final ExecutorService gameExecutor = Executors.newFixedThreadPool(ConfigSettings.getInstance().getMaxGameThreads()); + private static final ExecutorService gameExecutor = Executors.newFixedThreadPool(ConfigSettings.instance.getMaxGameThreads()); private static final ScheduledExecutorService timeoutExecutor = Executors.newScheduledThreadPool(4); private static final ScheduledExecutorService timeoutIdleExecutor = Executors.newScheduledThreadPool(4); diff --git a/Mage.Sets/src/mage/cards/a/AbzanBeastmaster.java b/Mage.Sets/src/mage/cards/a/AbzanBeastmaster.java index 4c3c8e0e79..57b347675b 100644 --- a/Mage.Sets/src/mage/cards/a/AbzanBeastmaster.java +++ b/Mage.Sets/src/mage/cards/a/AbzanBeastmaster.java @@ -54,7 +54,7 @@ public class AbzanBeastmaster extends CardImpl { // At the beginning of your upkeep, draw a card if you control the creature with the greatest toughness or tied for the greatest toughness. this.addAbility(new ConditionalTriggeredAbility( new BeginningOfUpkeepTriggeredAbility(new DrawCardSourceControllerEffect(1), TargetController.YOU, false), - ControlsCreatureGreatestToughnessCondition.getInstance(), + ControlsCreatureGreatestToughnessCondition.instance, "At the beginning of your upkeep, draw a card if you control the creature with the greatest toughness or tied for the greatest toughness." )); } diff --git a/Mage.Sets/src/mage/cards/a/AetherFigment.java b/Mage.Sets/src/mage/cards/a/AetherFigment.java index f41c57084e..691ebf27d9 100644 --- a/Mage.Sets/src/mage/cards/a/AetherFigment.java +++ b/Mage.Sets/src/mage/cards/a/AetherFigment.java @@ -61,7 +61,7 @@ public class AetherFigment extends CardImpl { // If Aether Figment was kicked, it enters the battlefield with two +1/+1 counters on it Ability ability = new EntersBattlefieldAbility( new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), - KickedCondition.getInstance(), + KickedCondition.instance, "If {this} was kicked, it enters the battlefield with two +1/+1 counters on it", ""); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/a/AfflictedDeserter.java b/Mage.Sets/src/mage/cards/a/AfflictedDeserter.java index fd439ae80b..bb19cc0352 100644 --- a/Mage.Sets/src/mage/cards/a/AfflictedDeserter.java +++ b/Mage.Sets/src/mage/cards/a/AfflictedDeserter.java @@ -61,7 +61,7 @@ public class AfflictedDeserter extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Afflicted Deserter. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public AfflictedDeserter(final AfflictedDeserter card) { diff --git a/Mage.Sets/src/mage/cards/a/AgonizingDemise.java b/Mage.Sets/src/mage/cards/a/AgonizingDemise.java index 9de2d4ec72..75920cd7f2 100644 --- a/Mage.Sets/src/mage/cards/a/AgonizingDemise.java +++ b/Mage.Sets/src/mage/cards/a/AgonizingDemise.java @@ -67,7 +67,7 @@ public class AgonizingDemise extends CardImpl { //If Agonizing Demise was kicked, it deals damage equal to that creature's power to the creature's controller. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DamageTargetControllerEffect(new TargetPermanentPowerCount()), - KickedCondition.getInstance(), + KickedCondition.instance, "If {this} was kicked, it deals damage equal to that creature's power to the creature's controller.")); } diff --git a/Mage.Sets/src/mage/cards/a/AidFromTheCowl.java b/Mage.Sets/src/mage/cards/a/AidFromTheCowl.java index 3111731406..c6c2344523 100644 --- a/Mage.Sets/src/mage/cards/a/AidFromTheCowl.java +++ b/Mage.Sets/src/mage/cards/a/AidFromTheCowl.java @@ -63,7 +63,7 @@ public class AidFromTheCowl extends CardImpl { // Revolt — At the beginning of your end step, if a permanent you controlled left the battlefield this turn, // reveal the top card of your library. If it is a permanent card, you may put it onto the battlefield. Otherwise, put it on the bottom of your library. TriggeredAbility ability = new BeginningOfYourEndStepTriggeredAbility(new AidFromTheCowlEffect(), false); - this.addAbility(new ConditionalTriggeredAbility(ability, RevoltCondition.getInstance(), ruleText), new RevoltWatcher()); + this.addAbility(new ConditionalTriggeredAbility(ability, RevoltCondition.instance, ruleText), new RevoltWatcher()); } public AidFromTheCowl(final AidFromTheCowl card) { diff --git a/Mage.Sets/src/mage/cards/a/AirdropAeronauts.java b/Mage.Sets/src/mage/cards/a/AirdropAeronauts.java index 8a87624a65..302257eb7d 100644 --- a/Mage.Sets/src/mage/cards/a/AirdropAeronauts.java +++ b/Mage.Sets/src/mage/cards/a/AirdropAeronauts.java @@ -60,7 +60,7 @@ public class AirdropAeronauts extends CardImpl { // Revolt — When Airdrop Aeronauts enters the battlefield, if a permanent you controlled left the battlefield this turn, you gain 5 life. Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility( - new GainLifeEffect(5), false), RevoltCondition.getInstance(), + new GainLifeEffect(5), false), RevoltCondition.instance, "Revolt — When {this} enters the battlefield, if a permanent you controlled left" + " the battlefield this turn, you gain 5 life." ); diff --git a/Mage.Sets/src/mage/cards/a/Aleatory.java b/Mage.Sets/src/mage/cards/a/Aleatory.java index c6598d5aa9..6caeeea06d 100644 --- a/Mage.Sets/src/mage/cards/a/Aleatory.java +++ b/Mage.Sets/src/mage/cards/a/Aleatory.java @@ -57,7 +57,7 @@ public class Aleatory extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{R}"); // Cast Aleatory only during combat after blockers are declared. - this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(TurnPhase.COMBAT, AfterBlockersAreDeclaredCondition.getInstance())); + this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(TurnPhase.COMBAT, AfterBlockersAreDeclaredCondition.instance)); // Flip a coin. If you win the flip, target creature gets +1/+1 until end of turn. this.getSpellAbility().addEffect(new AleatoryEffect()); diff --git a/Mage.Sets/src/mage/cards/a/Aluren.java b/Mage.Sets/src/mage/cards/a/Aluren.java index b312b2b2e6..68730e3ed5 100644 --- a/Mage.Sets/src/mage/cards/a/Aluren.java +++ b/Mage.Sets/src/mage/cards/a/Aluren.java @@ -102,7 +102,7 @@ class AlurenRuleEffect extends ContinuousEffectImpl { filter.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, 4)); } - static AlternativeCostSourceAbility alternativeCastingCostAbility = new AlternativeCostSourceAbility(null, SourceIsSpellCondition.getInstance(), null, filter, true); + static AlternativeCostSourceAbility alternativeCastingCostAbility = new AlternativeCostSourceAbility(null, SourceIsSpellCondition.instance, null, filter, true); public AlurenRuleEffect() { super(Duration.WhileOnBattlefield, Outcome.Detriment); diff --git a/Mage.Sets/src/mage/cards/a/AngelOfDeliverance.java b/Mage.Sets/src/mage/cards/a/AngelOfDeliverance.java index 1d89458334..75dc0cec44 100644 --- a/Mage.Sets/src/mage/cards/a/AngelOfDeliverance.java +++ b/Mage.Sets/src/mage/cards/a/AngelOfDeliverance.java @@ -73,7 +73,7 @@ public class AngelOfDeliverance extends CardImpl { // exile target creature an opponent controls. Ability ability = new ConditionalTriggeredAbility( new AngelOfDeliveranceDealsDamageTriggeredAbility(), - new DeliriumCondition(), + DeliriumCondition.instance, "Delirium — Whenever {this} deals damage, if there are four or more card types among cards in your graveyard, exile target creature an opponent controls" ); ability.addTarget(new TargetCreaturePermanent(filter)); diff --git a/Mage.Sets/src/mage/cards/a/AngryMob.java b/Mage.Sets/src/mage/cards/a/AngryMob.java index 11ec049153..45258ad1f2 100644 --- a/Mage.Sets/src/mage/cards/a/AngryMob.java +++ b/Mage.Sets/src/mage/cards/a/AngryMob.java @@ -72,7 +72,7 @@ public class AngryMob extends CardImpl { PermanentsOnBattlefieldCount swamps = new PermanentsOnBattlefieldCount(filter); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( new BoostSourceEffect(swamps, swamps, Duration.WhileOnBattlefield), - MyTurnCondition.getInstance(), + MyTurnCondition.instance, "As long as it's your turn, Angry Mob's power and toughness are each equal to 2 plus the number of Swamps your opponents control. As long as it's not your turn, Angry Mob's power and toughness are each 2"))); } diff --git a/Mage.Sets/src/mage/cards/a/AngusMackenzie.java b/Mage.Sets/src/mage/cards/a/AngusMackenzie.java index 3d41af5cbd..e933e4cb05 100644 --- a/Mage.Sets/src/mage/cards/a/AngusMackenzie.java +++ b/Mage.Sets/src/mage/cards/a/AngusMackenzie.java @@ -83,10 +83,10 @@ public class AngusMackenzie extends CardImpl { } class BeforeCombatDamageCondition implements Condition { - private static final BeforeCombatDamageCondition fInstance = new BeforeCombatDamageCondition(); + private static final BeforeCombatDamageCondition instance = new BeforeCombatDamageCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/a/AnimistsAwakening.java b/Mage.Sets/src/mage/cards/a/AnimistsAwakening.java index fdd8295e4f..79749f37c0 100644 --- a/Mage.Sets/src/mage/cards/a/AnimistsAwakening.java +++ b/Mage.Sets/src/mage/cards/a/AnimistsAwakening.java @@ -103,7 +103,7 @@ class AnimistsAwakeningEffect extends OneShotEffect { controller.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game, true, false, true, null); controller.putCardsOnBottomOfLibrary(cards, game, source, true); - if (SpellMasteryCondition.getInstance().apply(game, source)) { + if (SpellMasteryCondition.instance.apply(game, source)) { for (Card card : toBattlefield) { Permanent land = game.getPermanent(card.getId()); if (land != null) { diff --git a/Mage.Sets/src/mage/cards/a/AnthemOfRakdos.java b/Mage.Sets/src/mage/cards/a/AnthemOfRakdos.java index db51d96ecc..177cb5bfca 100644 --- a/Mage.Sets/src/mage/cards/a/AnthemOfRakdos.java +++ b/Mage.Sets/src/mage/cards/a/AnthemOfRakdos.java @@ -28,6 +28,7 @@ package mage.cards.a; import java.util.UUID; + import mage.abilities.Ability; import mage.abilities.common.AttacksCreatureYouControlTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; @@ -46,13 +47,12 @@ import mage.game.Game; import mage.game.events.GameEvent; /** - * * @author JotaPeRL */ public class AnthemOfRakdos extends CardImpl { public AnthemOfRakdos(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{B}{R}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{R}{R}"); // Whenever a creature you control attacks, it gets +2/+0 until end of turn and Anthem of Rakdos deals 1 damage to you. Effect effect = new BoostTargetEffect(2, 0, Duration.EndOfTurn); @@ -101,7 +101,7 @@ class AnthemOfRakdosHellbentEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - return game.getControllerId(event.getSourceId()).equals(source.getControllerId()) && HellbentCondition.getInstance().apply(game, source); + return game.getControllerId(event.getSourceId()).equals(source.getControllerId()) && HellbentCondition.instance.apply(game, source); } @Override diff --git a/Mage.Sets/src/mage/cards/a/AnyaMercilessAngel.java b/Mage.Sets/src/mage/cards/a/AnyaMercilessAngel.java index 66f9bdd063..45197ed337 100644 --- a/Mage.Sets/src/mage/cards/a/AnyaMercilessAngel.java +++ b/Mage.Sets/src/mage/cards/a/AnyaMercilessAngel.java @@ -73,7 +73,7 @@ public class AnyaMercilessAngel extends CardImpl { // As long as an opponent's life total is less than half his or her starting life total, Anya has indestructible. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield), - AnyaMercilessAngelCondition.getInstance(), + AnyaMercilessAngelCondition.instance, "As long as an opponent's life total is less than half his or her starting life total, {this} has indestructible"))); } @@ -121,16 +121,9 @@ class AnyaMercilessAngelDynamicValue implements DynamicValue { } } -class AnyaMercilessAngelCondition implements Condition { - - private static final AnyaMercilessAngelCondition fInstance = new AnyaMercilessAngelCondition(); - - public static AnyaMercilessAngelCondition getInstance() { - return fInstance; - } - - private AnyaMercilessAngelCondition() {} +enum AnyaMercilessAngelCondition implements Condition { + instance; @Override public boolean apply(Game game, Ability source) { return new AnyaMercilessAngelDynamicValue().calculate(game, source, null) > 0; diff --git a/Mage.Sets/src/mage/cards/a/ArcTrail.java b/Mage.Sets/src/mage/cards/a/ArcTrail.java index acb2e5b94e..c41608f025 100644 --- a/Mage.Sets/src/mage/cards/a/ArcTrail.java +++ b/Mage.Sets/src/mage/cards/a/ArcTrail.java @@ -84,14 +84,14 @@ public class ArcTrail extends CardImpl { class ArcTrailEffect extends OneShotEffect { - private static final ArcTrailEffect fINSTANCE = new ArcTrailEffect(); + private static final ArcTrailEffect instance = new ArcTrailEffect(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static ArcTrailEffect getInstance() { - return fINSTANCE; + return instance; } private ArcTrailEffect ( ) { @@ -128,7 +128,7 @@ class ArcTrailEffect extends OneShotEffect { @Override public Effect copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage.Sets/src/mage/cards/a/ArchiveTrap.java b/Mage.Sets/src/mage/cards/a/ArchiveTrap.java index 924278348e..9bea0d1ec8 100644 --- a/Mage.Sets/src/mage/cards/a/ArchiveTrap.java +++ b/Mage.Sets/src/mage/cards/a/ArchiveTrap.java @@ -113,10 +113,10 @@ class ArchiveTrapWatcher extends Watcher { class OpponentSearchesLibCondition implements Condition { - private static final OpponentSearchesLibCondition fInstance = new OpponentSearchesLibCondition(); + private static final OpponentSearchesLibCondition instance = new OpponentSearchesLibCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/a/ArcticMerfolk.java b/Mage.Sets/src/mage/cards/a/ArcticMerfolk.java index 4fafeeabb2..37e2e90064 100644 --- a/Mage.Sets/src/mage/cards/a/ArcticMerfolk.java +++ b/Mage.Sets/src/mage/cards/a/ArcticMerfolk.java @@ -60,7 +60,7 @@ public class ArcticMerfolk extends CardImpl { // If Arctic Merfolk was kicked, it enters the battlefield with a +1/+1 counter on it. this.addAbility(new EntersBattlefieldAbility( new AddCountersSourceEffect(CounterType.P1P1.createInstance()), - KickedCondition.getInstance(),"If Arctic Merfolk was kicked, it enters the battlefield with a +1/+1 counter on it.","")); + KickedCondition.instance,"If Arctic Merfolk was kicked, it enters the battlefield with a +1/+1 counter on it.","")); } public ArcticMerfolk(final ArcticMerfolk card) { diff --git a/Mage.Sets/src/mage/cards/a/ArdentRecruit.java b/Mage.Sets/src/mage/cards/a/ArdentRecruit.java index 4b53d2d0cb..55306054ae 100644 --- a/Mage.Sets/src/mage/cards/a/ArdentRecruit.java +++ b/Mage.Sets/src/mage/cards/a/ArdentRecruit.java @@ -57,7 +57,7 @@ public class ArdentRecruit extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); ContinuousEffect boostSource = new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield); - ConditionalContinuousEffect effect = new ConditionalContinuousEffect(boostSource, MetalcraftCondition.getInstance(), "Ardent Recruit gets +2/+2 as long as you control three or more artifacts"); + ConditionalContinuousEffect effect = new ConditionalContinuousEffect(boostSource, MetalcraftCondition.instance, "Ardent Recruit gets +2/+2 as long as you control three or more artifacts"); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); ability.setAbilityWord(AbilityWord.METALCRAFT); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/a/ArdentSoldier.java b/Mage.Sets/src/mage/cards/a/ArdentSoldier.java index 0b64a3fbd1..e1da72f29a 100644 --- a/Mage.Sets/src/mage/cards/a/ArdentSoldier.java +++ b/Mage.Sets/src/mage/cards/a/ArdentSoldier.java @@ -59,7 +59,7 @@ public class ArdentSoldier extends CardImpl { this.addAbility(VigilanceAbility.getInstance()); // If Ardent Soldier was kicked, it enters the battlefield with a +1/+1 counter on it. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), - KickedCondition.getInstance(), "If {this} was kicked, it enters the battlefield with a +1/+1 counter on it.", "")); + KickedCondition.instance, "If {this} was kicked, it enters the battlefield with a +1/+1 counter on it.", "")); } public ArdentSoldier(final ArdentSoldier card) { diff --git a/Mage.Sets/src/mage/cards/a/ArgentSphinx.java b/Mage.Sets/src/mage/cards/a/ArgentSphinx.java index bbe5400dfe..1e0b8ac2f8 100644 --- a/Mage.Sets/src/mage/cards/a/ArgentSphinx.java +++ b/Mage.Sets/src/mage/cards/a/ArgentSphinx.java @@ -66,7 +66,7 @@ public class ArgentSphinx extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Metalcraft - {U}: Exile Argent Sphinx. Return it to the battlefield under your control at the beginning of the next end step. Activate this ability only if you control three or more artifacts. - Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new ArgentSphinxEffect(), new ManaCostsImpl("{U}"), MetalcraftCondition.getInstance()); + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new ArgentSphinxEffect(), new ManaCostsImpl("{U}"), MetalcraftCondition.instance); ability.setAbilityWord(AbilityWord.METALCRAFT); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/a/ArrowStorm.java b/Mage.Sets/src/mage/cards/a/ArrowStorm.java index d3674424b8..4783ceb255 100644 --- a/Mage.Sets/src/mage/cards/a/ArrowStorm.java +++ b/Mage.Sets/src/mage/cards/a/ArrowStorm.java @@ -51,13 +51,13 @@ public class ArrowStorm extends CardImpl { // Arrow Storm deals 4 damage to target creature or player. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DamageTargetEffect(4), - new InvertCondition(RaidCondition.getInstance()), + new InvertCondition(RaidCondition.instance), "{this} deals 4 damage to target creature or player")); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); // Raid - If you attacked with a creature this turn, instead Arrow Storm deals 5 damage to that creature or player and the damage can't be prevented. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DamageTargetEffect(5, false), - RaidCondition.getInstance(), + RaidCondition.instance, "

Raid - If you attacked with a creature this turn, instead {this} deals 5 damage to that creature or player and the damage can't be prevented")); this.getSpellAbility().addWatcher(new PlayerAttackedWatcher()); } diff --git a/Mage.Sets/src/mage/cards/a/ArrowVolleyTrap.java b/Mage.Sets/src/mage/cards/a/ArrowVolleyTrap.java index 2f73834d84..b21376b4f0 100644 --- a/Mage.Sets/src/mage/cards/a/ArrowVolleyTrap.java +++ b/Mage.Sets/src/mage/cards/a/ArrowVolleyTrap.java @@ -70,10 +70,10 @@ public class ArrowVolleyTrap extends CardImpl { class ArrowVolleyTrapCondition implements Condition { - private static final ArrowVolleyTrapCondition fInstance = new ArrowVolleyTrapCondition(); + private static final ArrowVolleyTrapCondition instance = new ArrowVolleyTrapCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/a/AsajjVentress.java b/Mage.Sets/src/mage/cards/a/AsajjVentress.java index 40a01cdfaf..e156023c60 100644 --- a/Mage.Sets/src/mage/cards/a/AsajjVentress.java +++ b/Mage.Sets/src/mage/cards/a/AsajjVentress.java @@ -28,6 +28,7 @@ package mage.cards.a; import java.util.UUID; + import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.AttacksTriggeredAbility; @@ -47,13 +48,12 @@ import mage.target.common.TargetCreaturePermanent; import mage.watchers.common.LifeLossOtherFromCombatWatcher; /** - * * @author Styxo */ public class AsajjVentress extends CardImpl { public AsajjVentress(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}{B}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{B}{R}"); this.supertype.add("Legendary"); this.subtype.add("Dathomirian"); this.subtype.add("Sith"); @@ -72,7 +72,7 @@ public class AsajjVentress extends CardImpl { // Hate — Whenever Asajj Ventress attacks, if an opponent lost life from a source other than combat damage this turn, target creature blocks this turn if able. Ability ability = new ConditionalTriggeredAbility( new AttacksTriggeredAbility(new BlocksIfAbleTargetEffect(Duration.EndOfTurn), false), - HateCondition.getInstance(), + HateCondition.instance, "Hate — Whenever Asajj Ventress attacks, if an opponent lost life from a source other than combat damage this turn, target creature blocks this turn if able"); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability, new LifeLossOtherFromCombatWatcher()); diff --git a/Mage.Sets/src/mage/cards/a/AshnodsBattleGear.java b/Mage.Sets/src/mage/cards/a/AshnodsBattleGear.java index cb9e31d2e3..b2689e741a 100644 --- a/Mage.Sets/src/mage/cards/a/AshnodsBattleGear.java +++ b/Mage.Sets/src/mage/cards/a/AshnodsBattleGear.java @@ -28,6 +28,7 @@ package mage.cards.a; import java.util.UUID; + import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SkipUntapOptionalAbility; @@ -44,20 +45,19 @@ import mage.constants.Zone; import mage.target.common.TargetControlledCreaturePermanent; /** - * * @author LoneFox */ public class AshnodsBattleGear extends CardImpl { public AshnodsBattleGear(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); // You may choose not to untap Ashnod's Battle Gear during your untap step. this.addAbility(new SkipUntapOptionalAbility()); // {2}, {tap}: Target creature you control gets +2/-2 for as long as Ashnod's Battle Gear remains tapped. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( - new BoostTargetEffect(2, -2, Duration.Custom), SourceTappedCondition.getInstance(), - "target creature you control gets +2/-2 for as long as {this} remains tapped"), new ManaCostsImpl("{2}")); + new BoostTargetEffect(2, -2, Duration.Custom), SourceTappedCondition.instance, + "target creature you control gets +2/-2 for as long as {this} remains tapped"), new ManaCostsImpl("{2}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetControlledCreaturePermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/a/AtarkaBeastbreaker.java b/Mage.Sets/src/mage/cards/a/AtarkaBeastbreaker.java index 27d39de530..619e5b3c61 100644 --- a/Mage.Sets/src/mage/cards/a/AtarkaBeastbreaker.java +++ b/Mage.Sets/src/mage/cards/a/AtarkaBeastbreaker.java @@ -59,7 +59,7 @@ public class AtarkaBeastbreaker extends CardImpl { Zone.BATTLEFIELD, new BoostSourceEffect(4,4, Duration.EndOfTurn), new ManaCostsImpl("{4}{G}"), - FormidableCondition.getInstance()); + FormidableCondition.instance); ability.setAbilityWord(AbilityWord.FORMIDABLE); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/a/AtarkaPummeler.java b/Mage.Sets/src/mage/cards/a/AtarkaPummeler.java index 5a7411fb67..6679f0442a 100644 --- a/Mage.Sets/src/mage/cards/a/AtarkaPummeler.java +++ b/Mage.Sets/src/mage/cards/a/AtarkaPummeler.java @@ -69,7 +69,7 @@ public class AtarkaPummeler extends CardImpl { Zone.BATTLEFIELD, new GainAbilityAllEffect(new MenaceAbility(), Duration.EndOfTurn, filter), new ManaCostsImpl("{3}{R}{R}"), - FormidableCondition.getInstance()); + FormidableCondition.instance); ability.setAbilityWord(AbilityWord.FORMIDABLE); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/a/AuriokEdgewright.java b/Mage.Sets/src/mage/cards/a/AuriokEdgewright.java index 58eeba5b31..785e330830 100644 --- a/Mage.Sets/src/mage/cards/a/AuriokEdgewright.java +++ b/Mage.Sets/src/mage/cards/a/AuriokEdgewright.java @@ -58,7 +58,7 @@ public class AuriokEdgewright extends CardImpl { this.toughness = new MageInt(2); ContinuousEffect effect = new GainAbilitySourceEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(effect, MetalcraftCondition.getInstance(), effectText))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(effect, MetalcraftCondition.instance, effectText))); } public AuriokEdgewright(final AuriokEdgewright card) { diff --git a/Mage.Sets/src/mage/cards/a/AuriokSunchaser.java b/Mage.Sets/src/mage/cards/a/AuriokSunchaser.java index efb1f662f8..075f7f9aa1 100644 --- a/Mage.Sets/src/mage/cards/a/AuriokSunchaser.java +++ b/Mage.Sets/src/mage/cards/a/AuriokSunchaser.java @@ -60,9 +60,9 @@ public class AuriokSunchaser extends CardImpl { this.toughness = new MageInt(1); ContinuousEffect effect1 = new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(effect1, MetalcraftCondition.getInstance(), effect1Text))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(effect1, MetalcraftCondition.instance, effect1Text))); ContinuousEffect effect2 = new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(effect2, MetalcraftCondition.getInstance(), effect2Text))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(effect2, MetalcraftCondition.instance, effect2Text))); } public AuriokSunchaser(final AuriokSunchaser card) { diff --git a/Mage.Sets/src/mage/cards/a/AutumnalGloom.java b/Mage.Sets/src/mage/cards/a/AutumnalGloom.java index 95c52ec292..5f1706be55 100644 --- a/Mage.Sets/src/mage/cards/a/AutumnalGloom.java +++ b/Mage.Sets/src/mage/cards/a/AutumnalGloom.java @@ -59,7 +59,7 @@ public class AutumnalGloom extends CardImpl { // Delirium — At the beginning of your end step, if there are four or more card types among cards in your graveyard, transform Autumnal Gloom. this.addAbility(new TransformAbility()); - Ability ability = new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new TransformSourceEffect(true), TargetController.YOU, DeliriumCondition.getInstance(), false); + Ability ability = new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new TransformSourceEffect(true), TargetController.YOU, DeliriumCondition.instance, false); ability.setAbilityWord(AbilityWord.DELIRIUM); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/b/BackwoodsSurvivalists.java b/Mage.Sets/src/mage/cards/b/BackwoodsSurvivalists.java index b66a1851fd..f4e0995ddd 100644 --- a/Mage.Sets/src/mage/cards/b/BackwoodsSurvivalists.java +++ b/Mage.Sets/src/mage/cards/b/BackwoodsSurvivalists.java @@ -56,9 +56,9 @@ public class BackwoodsSurvivalists extends CardImpl { this.toughness = new MageInt(3); // Delirium — Backwoods Survivalists gets +1/+1 and has trample as long as there are four or more card types among cards in your graveyard. - ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new BoostSourceEffect(1, 1, Duration.WhileOnBattlefield), DeliriumCondition.getInstance(), "Delirium — {this} gets +1/+1"); + ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new BoostSourceEffect(1, 1, Duration.WhileOnBattlefield), DeliriumCondition.instance, "Delirium — {this} gets +1/+1"); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); - ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance()), DeliriumCondition.getInstance(), "and has trample as long as there are four or more card types among cards in your graveyard.")); + ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance()), DeliriumCondition.instance, "and has trample as long as there are four or more card types among cards in your graveyard.")); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/b/BalothCageTrap.java b/Mage.Sets/src/mage/cards/b/BalothCageTrap.java index 6486573989..54d837071c 100644 --- a/Mage.Sets/src/mage/cards/b/BalothCageTrap.java +++ b/Mage.Sets/src/mage/cards/b/BalothCageTrap.java @@ -71,10 +71,10 @@ public class BalothCageTrap extends CardImpl { class BalothCageTrapCondition implements Condition { - private static final BalothCageTrapCondition fInstance = new BalothCageTrapCondition(); + private static final BalothCageTrapCondition instance = new BalothCageTrapCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/b/BaneOfHanweir.java b/Mage.Sets/src/mage/cards/b/BaneOfHanweir.java index 14e2022dee..6bdbe808a2 100644 --- a/Mage.Sets/src/mage/cards/b/BaneOfHanweir.java +++ b/Mage.Sets/src/mage/cards/b/BaneOfHanweir.java @@ -64,7 +64,7 @@ public class BaneOfHanweir extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Bane of Hanweir. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public BaneOfHanweir(final BaneOfHanweir card) { diff --git a/Mage.Sets/src/mage/cards/b/BarrageOfBoulders.java b/Mage.Sets/src/mage/cards/b/BarrageOfBoulders.java index 6d846cf635..3b9f6ad076 100644 --- a/Mage.Sets/src/mage/cards/b/BarrageOfBoulders.java +++ b/Mage.Sets/src/mage/cards/b/BarrageOfBoulders.java @@ -64,7 +64,7 @@ public class BarrageOfBoulders extends CardImpl { Effect effect = new ConditionalRestrictionEffect( Duration.EndOfTurn, new CantBlockAllEffect(new FilterCreaturePermanent("creatures"), Duration.EndOfTurn), - new LockedInCondition(FerociousCondition.getInstance()), null); + new LockedInCondition(FerociousCondition.instance), null); effect.setText("
Ferocious — If you control a creature with power 4 or greater, creatures can't block this turn"); this.getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/cards/b/BatheInBacta.java b/Mage.Sets/src/mage/cards/b/BatheInBacta.java index de3ee9df8a..794aaca644 100644 --- a/Mage.Sets/src/mage/cards/b/BatheInBacta.java +++ b/Mage.Sets/src/mage/cards/b/BatheInBacta.java @@ -49,7 +49,7 @@ public class BatheInBacta extends CardImpl { // You gain 6 life. If you lost life from a source other than combat damage this turn, you gain 9 life instead. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new GainLifeEffect(6), new GainLifeEffect(9), - new InvertCondition(HateCondition.getInstance()), + new InvertCondition(HateCondition.instance), "You gain 6 life. If you lost life from a source other than combat damage this turn, you gain 9 life instead")); this.getSpellAbility().addWatcher(new LifeLossOtherFromCombatWatcher()); } diff --git a/Mage.Sets/src/mage/cards/b/BellowingSaddlebrute.java b/Mage.Sets/src/mage/cards/b/BellowingSaddlebrute.java index 1fa74e7254..1fdb503a40 100644 --- a/Mage.Sets/src/mage/cards/b/BellowingSaddlebrute.java +++ b/Mage.Sets/src/mage/cards/b/BellowingSaddlebrute.java @@ -56,7 +56,7 @@ public class BellowingSaddlebrute extends CardImpl { // Raid - When Bellowing Saddlebrute enters the battlefield, you lose 4 life unless you attacked with a creature this turn this.addAbility(new ConditionalTriggeredAbility( new EntersBattlefieldTriggeredAbility(new LoseLifeSourceControllerEffect(4)), - new InvertCondition(RaidCondition.getInstance()), + new InvertCondition(RaidCondition.instance), "Raid - When {this} enters the battlefield, you lose 4 life unless you attacked with a creature this turn" ), new PlayerAttackedWatcher()); } diff --git a/Mage.Sets/src/mage/cards/b/BenalishEmissary.java b/Mage.Sets/src/mage/cards/b/BenalishEmissary.java index 1057235658..b49a8650a9 100644 --- a/Mage.Sets/src/mage/cards/b/BenalishEmissary.java +++ b/Mage.Sets/src/mage/cards/b/BenalishEmissary.java @@ -59,7 +59,7 @@ public class BenalishEmissary extends CardImpl { // When Benalish Emissary enters the battlefield, if it was kicked, destroy target land. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect()); ability.addTarget(new TargetLandPermanent()); - this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, destroy target land.")); } diff --git a/Mage.Sets/src/mage/cards/b/BenalishLancer.java b/Mage.Sets/src/mage/cards/b/BenalishLancer.java index 31c03d6d46..d8fd25dd1b 100644 --- a/Mage.Sets/src/mage/cards/b/BenalishLancer.java +++ b/Mage.Sets/src/mage/cards/b/BenalishLancer.java @@ -60,7 +60,7 @@ public class BenalishLancer extends CardImpl { // If Benalish Lancer was kicked, it enters the battlefield with two +1/+1 counters on it and with first strike. Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), - KickedCondition.getInstance(), + KickedCondition.instance, "If {this} was kicked, it enters the battlefield with two +1/+1 counters on it and with first strike.", ""); ability.addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.WhileOnBattlefield)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/b/BladeTribeBerserkers.java b/Mage.Sets/src/mage/cards/b/BladeTribeBerserkers.java index aa30f51f6d..ae34244fdc 100644 --- a/Mage.Sets/src/mage/cards/b/BladeTribeBerserkers.java +++ b/Mage.Sets/src/mage/cards/b/BladeTribeBerserkers.java @@ -59,7 +59,7 @@ public class BladeTribeBerserkers extends CardImpl { TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new BoostSourceEffect(3, 3, Duration.EndOfTurn), false); ability.addEffect(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.EndOfTurn)); - this.addAbility(new ConditionalTriggeredAbility(ability, MetalcraftCondition.getInstance(), effectText)); + this.addAbility(new ConditionalTriggeredAbility(ability, MetalcraftCondition.instance, effectText)); } public BladeTribeBerserkers(final BladeTribeBerserkers card) { diff --git a/Mage.Sets/src/mage/cards/b/BleakCovenVampires.java b/Mage.Sets/src/mage/cards/b/BleakCovenVampires.java index 8ab4ec9bd9..416c289588 100644 --- a/Mage.Sets/src/mage/cards/b/BleakCovenVampires.java +++ b/Mage.Sets/src/mage/cards/b/BleakCovenVampires.java @@ -62,7 +62,7 @@ public class BleakCovenVampires extends CardImpl { Target target = new TargetPlayer(); ability.addTarget(target); - this.addAbility(new ConditionalTriggeredAbility(ability, MetalcraftCondition.getInstance(), effectText)); + this.addAbility(new ConditionalTriggeredAbility(ability, MetalcraftCondition.instance, effectText)); } public BleakCovenVampires(final BleakCovenVampires card) { diff --git a/Mage.Sets/src/mage/cards/b/BloodLust.java b/Mage.Sets/src/mage/cards/b/BloodLust.java index 147c184712..835f436c06 100644 --- a/Mage.Sets/src/mage/cards/b/BloodLust.java +++ b/Mage.Sets/src/mage/cards/b/BloodLust.java @@ -105,10 +105,10 @@ class TargetMatchesFilterCondition implements Condition { class TargetPermanentToughnessMinus1Value implements DynamicValue { - private static final TargetPermanentToughnessMinus1Value fINSTANCE = new TargetPermanentToughnessMinus1Value(); + private static final TargetPermanentToughnessMinus1Value instance = new TargetPermanentToughnessMinus1Value(); public static TargetPermanentToughnessMinus1Value getInstance() { - return fINSTANCE; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/b/BloodTribute.java b/Mage.Sets/src/mage/cards/b/BloodTribute.java index 241bcd68de..75e34cd69f 100644 --- a/Mage.Sets/src/mage/cards/b/BloodTribute.java +++ b/Mage.Sets/src/mage/cards/b/BloodTribute.java @@ -74,7 +74,7 @@ public class BloodTribute extends CardImpl { // If Blood Tribute was kicked, you gain life equal to the life lost this way. Effect effect = new ConditionalOneShotEffect( new BloodTributeGainLifeEffect(), - KickedCondition.getInstance(), + KickedCondition.instance, "If {this} was kicked, you gain life equal to the life lost this way"); this.getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/cards/b/BloodhallPriest.java b/Mage.Sets/src/mage/cards/b/BloodhallPriest.java index e4feffc12d..470e643c6d 100644 --- a/Mage.Sets/src/mage/cards/b/BloodhallPriest.java +++ b/Mage.Sets/src/mage/cards/b/BloodhallPriest.java @@ -59,7 +59,7 @@ public class BloodhallPriest extends CardImpl { triggeredAbility.addTarget(new TargetCreatureOrPlayer()); this.addAbility(new ConditionalTriggeredAbility( triggeredAbility, - HellbentCondition.getInstance(), + HellbentCondition.instance, "Whenever {this} enters the battlefield or attacks, if you have no cards in hand, {this} deals 2 damage to target creature or player" )); diff --git a/Mage.Sets/src/mage/cards/b/BloodsoakedChampion.java b/Mage.Sets/src/mage/cards/b/BloodsoakedChampion.java index 244d63ed9e..79bba0a691 100644 --- a/Mage.Sets/src/mage/cards/b/BloodsoakedChampion.java +++ b/Mage.Sets/src/mage/cards/b/BloodsoakedChampion.java @@ -63,7 +63,7 @@ public class BloodsoakedChampion extends CardImpl { Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(), new ManaCostsImpl<>("{1}{B}"), - RaidCondition.getInstance(), + RaidCondition.instance, "Raid - {1}{B}: Return {this} from your graveyard to the battlefield. Activate this ability only if you attacked with a creature this turn"); this.addAbility(ability, new PlayerAttackedWatcher()); } diff --git a/Mage.Sets/src/mage/cards/b/BogDown.java b/Mage.Sets/src/mage/cards/b/BogDown.java index 31a954d67b..79f1cf5b91 100644 --- a/Mage.Sets/src/mage/cards/b/BogDown.java +++ b/Mage.Sets/src/mage/cards/b/BogDown.java @@ -54,7 +54,7 @@ public class BogDown extends CardImpl { this.addAbility(new KickerAbility(new SacrificeTargetCost(new TargetControlledPermanent(2, 2, new FilterControlledLandPermanent("two lands"), true)))); // Target player discards two cards. If Bog Down was kicked, that player discards three cards instead. this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new DiscardTargetEffect(3), - new DiscardTargetEffect(2), KickedCondition.getInstance(), + new DiscardTargetEffect(2), KickedCondition.instance, "Target player discards two cards. If {this} was kicked, that player discards three cards instead.")); this.getSpellAbility().addTarget(new TargetPlayer()); } diff --git a/Mage.Sets/src/mage/cards/b/BoldDefense.java b/Mage.Sets/src/mage/cards/b/BoldDefense.java index 62cf96d969..3f309ee321 100644 --- a/Mage.Sets/src/mage/cards/b/BoldDefense.java +++ b/Mage.Sets/src/mage/cards/b/BoldDefense.java @@ -55,10 +55,10 @@ public class BoldDefense extends CardImpl { // Creatures you control get +1/+1 until end of turn. If Bold Defense was kicked, instead creatures you control get +2/+2 and gain first strike until end of turn. this.getSpellAbility().addEffect(new ConditionalContinuousEffect(new BoostControlledEffect(2, 2, Duration.EndOfTurn), - new BoostTargetEffect(1, 1, Duration.EndOfTurn), new LockedInCondition(KickedCondition.getInstance()), + new BoostTargetEffect(1, 1, Duration.EndOfTurn), new LockedInCondition(KickedCondition.instance), "Creatures you control get +1/+1 until end of turn. If {this} was kicked, instead creatures you control get +2/+2")); this.getSpellAbility().addEffect(new ConditionalContinuousEffect(new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent(), false), - null, new LockedInCondition(KickedCondition.getInstance()), + null, new LockedInCondition(KickedCondition.instance), "and gain first strike until end of turn")); } diff --git a/Mage.Sets/src/mage/cards/b/BottomlessVault.java b/Mage.Sets/src/mage/cards/b/BottomlessVault.java index c89a735644..e04d74b3a7 100644 --- a/Mage.Sets/src/mage/cards/b/BottomlessVault.java +++ b/Mage.Sets/src/mage/cards/b/BottomlessVault.java @@ -65,7 +65,7 @@ public class BottomlessVault extends CardImpl { this.addAbility(new SkipUntapOptionalAbility()); // At the beginning of your upkeep, if Bottomless Vault is tapped, put a storage counter on it. OneShotEffect addStorageCounter = new AddCountersSourceEffect(CounterType.STORAGE.createInstance()); - Effect effect = new ConditionalOneShotEffect(addStorageCounter, SourceTappedCondition.getInstance(), "if {this} is tapped, put a storage counter on it"); + Effect effect = new ConditionalOneShotEffect(addStorageCounter, SourceTappedCondition.instance, "if {this} is tapped, put a storage counter on it"); this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.YOU, false)); // {tap}, Remove any number of storage counters from Bottomless Vault: Add {B} to your mana pool for each storage counter removed this way. Ability ability = new DynamicManaAbility( diff --git a/Mage.Sets/src/mage/cards/b/BrandedHowler.java b/Mage.Sets/src/mage/cards/b/BrandedHowler.java index e2de65e396..556002ee6f 100644 --- a/Mage.Sets/src/mage/cards/b/BrandedHowler.java +++ b/Mage.Sets/src/mage/cards/b/BrandedHowler.java @@ -59,7 +59,7 @@ public class BrandedHowler extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Branded Howler. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public BrandedHowler(final BrandedHowler card) { diff --git a/Mage.Sets/src/mage/cards/b/BreakOfDay.java b/Mage.Sets/src/mage/cards/b/BreakOfDay.java index 0d65af654d..fc8f4611c2 100644 --- a/Mage.Sets/src/mage/cards/b/BreakOfDay.java +++ b/Mage.Sets/src/mage/cards/b/BreakOfDay.java @@ -56,7 +56,7 @@ public class BreakOfDay extends CardImpl { // Fateful hour - If you have 5 or less life, those creatures also are indestructible this turn. this.getSpellAbility().addEffect(new ConditionalContinuousEffect( new GainAbilityAllEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn, new FilterControlledCreaturePermanent("creatures you control"), false), - new LockedInCondition(FatefulHourCondition.getInstance()), + new LockedInCondition(FatefulHourCondition.instance), "If you have 5 or less life, those creatures also are indestructible this turn")); } diff --git a/Mage.Sets/src/mage/cards/b/BreakneckRider.java b/Mage.Sets/src/mage/cards/b/BreakneckRider.java index d66cd3e7c3..3836d9492d 100644 --- a/Mage.Sets/src/mage/cards/b/BreakneckRider.java +++ b/Mage.Sets/src/mage/cards/b/BreakneckRider.java @@ -61,7 +61,7 @@ public class BreakneckRider extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Breakneck Rider. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public BreakneckRider(final BreakneckRider card) { diff --git a/Mage.Sets/src/mage/cards/b/BreathOfDarigaaz.java b/Mage.Sets/src/mage/cards/b/BreathOfDarigaaz.java index 13e1ba2b13..dd872e0929 100644 --- a/Mage.Sets/src/mage/cards/b/BreathOfDarigaaz.java +++ b/Mage.Sets/src/mage/cards/b/BreathOfDarigaaz.java @@ -60,7 +60,7 @@ public class BreathOfDarigaaz extends CardImpl { // Breath of Darigaaz deals 1 damage to each creature without flying and each player. If Breath of Darigaaz was kicked, it deals 4 damage to each creature without flying and each player instead. this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new DamageEverythingEffect(4, filter), - new DamageEverythingEffect(1, filter), KickedCondition.getInstance(), + new DamageEverythingEffect(1, filter), KickedCondition.instance, "{this} deals 1 damage to each creature without flying and each player. If {this} was kicked, it deals 4 damage to each creature without flying and each player instead.")); } diff --git a/Mage.Sets/src/mage/cards/b/BriarbridgePatrol.java b/Mage.Sets/src/mage/cards/b/BriarbridgePatrol.java index a744275119..91bb60491d 100644 --- a/Mage.Sets/src/mage/cards/b/BriarbridgePatrol.java +++ b/Mage.Sets/src/mage/cards/b/BriarbridgePatrol.java @@ -79,10 +79,10 @@ public class BriarbridgePatrol extends CardImpl { class BriarbridgePatrolCondition implements Condition { - private static final BriarbridgePatrolCondition fInstance = new BriarbridgePatrolCondition(); + private static final BriarbridgePatrolCondition instance = new BriarbridgePatrolCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/b/BullRancor.java b/Mage.Sets/src/mage/cards/b/BullRancor.java index 5efd0bfd38..6a8105600d 100644 --- a/Mage.Sets/src/mage/cards/b/BullRancor.java +++ b/Mage.Sets/src/mage/cards/b/BullRancor.java @@ -59,7 +59,7 @@ public class BullRancor extends CardImpl { // As long as Bull Rancor is monstrous, creatures you control have menace. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( new GainAbilityControlledEffect(new MenaceAbility(), Duration.WhileOnBattlefield), - MonstrousCondition.getInstance(), + MonstrousCondition.instance, "As long as Bull Rancor is monstrous, creatures you control have menace") )); } diff --git a/Mage.Sets/src/mage/cards/b/BurstLightning.java b/Mage.Sets/src/mage/cards/b/BurstLightning.java index 4a33bab5ee..95ef098148 100644 --- a/Mage.Sets/src/mage/cards/b/BurstLightning.java +++ b/Mage.Sets/src/mage/cards/b/BurstLightning.java @@ -54,7 +54,7 @@ public class BurstLightning extends CardImpl { // Burst Lightning deals 2 damage to target creature or player. If Burst Lightning was kicked, it deals 4 damage to that creature or player instead. this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new DamageTargetEffect(4), - new DamageTargetEffect(2), KickedCondition.getInstance(), "{this} deals 2 damage to target creature or player. If {this} was kicked, it deals 4 damage to that creature or player instead")); + new DamageTargetEffect(2), KickedCondition.instance, "{this} deals 2 damage to target creature or player. If {this} was kicked, it deals 4 damage to that creature or player instead")); } public BurstLightning(final BurstLightning card) { diff --git a/Mage.Sets/src/mage/cards/c/CacklingFlames.java b/Mage.Sets/src/mage/cards/c/CacklingFlames.java index 55645f2085..e4946b1444 100644 --- a/Mage.Sets/src/mage/cards/c/CacklingFlames.java +++ b/Mage.Sets/src/mage/cards/c/CacklingFlames.java @@ -51,12 +51,12 @@ public class CacklingFlames extends CardImpl { // Cackling Flames deals 3 damage to target creature or player. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DamageTargetEffect(3), - new InvertCondition(HellbentCondition.getInstance()), + new InvertCondition(HellbentCondition.instance), "{this} deals 3 damage to target creature or player")); // Hellbent - Cackling Flames deals 5 damage to that creature or player instead if you have no cards in hand. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DamageTargetEffect(5), - HellbentCondition.getInstance(), + HellbentCondition.instance, "

Hellbent - {this} deals 5 damage to that creature or player instead if you have no cards in hand.")); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); diff --git a/Mage.Sets/src/mage/cards/c/CalculatedDismissal.java b/Mage.Sets/src/mage/cards/c/CalculatedDismissal.java index 77a794294d..e269a5690a 100644 --- a/Mage.Sets/src/mage/cards/c/CalculatedDismissal.java +++ b/Mage.Sets/src/mage/cards/c/CalculatedDismissal.java @@ -51,7 +51,7 @@ public class CalculatedDismissal extends CardImpl { this.getSpellAbility().addTarget(new TargetSpell()); this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new GenericManaCost(3))); // Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, scry 2. - this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new ScryEffect(2), SpellMasteryCondition.getInstance(), + this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new ScryEffect(2), SpellMasteryCondition.instance, "
Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, scry 2")); } diff --git a/Mage.Sets/src/mage/cards/c/CallForUnity.java b/Mage.Sets/src/mage/cards/c/CallForUnity.java index 75e42d4422..b5391cd15a 100644 --- a/Mage.Sets/src/mage/cards/c/CallForUnity.java +++ b/Mage.Sets/src/mage/cards/c/CallForUnity.java @@ -60,7 +60,7 @@ public class CallForUnity extends CardImpl { // Revolt — At the beginning of your end step, if a permanent you controlled left the battlefield this turn, put a unity counter on Call for Unity. TriggeredAbility ability = new BeginningOfYourEndStepTriggeredAbility(new AddCountersSourceEffect(CounterType.UNITY.createInstance(), true), false); - this.addAbility(new ConditionalTriggeredAbility(ability, RevoltCondition.getInstance(), ruleText), new RevoltWatcher()); + this.addAbility(new ConditionalTriggeredAbility(ability, RevoltCondition.instance, ruleText), new RevoltWatcher()); // Creatures you control get +1/+1 for each unity counter on Call for Unity. Effect effect = new BoostControlledEffect(new CountersSourceCount(CounterType.UNITY), new CountersSourceCount(CounterType.UNITY), Duration.WhileOnBattlefield, diff --git a/Mage.Sets/src/mage/cards/c/CallOfTheFullMoon.java b/Mage.Sets/src/mage/cards/c/CallOfTheFullMoon.java index 98810f49fb..7ee6412aa1 100644 --- a/Mage.Sets/src/mage/cards/c/CallOfTheFullMoon.java +++ b/Mage.Sets/src/mage/cards/c/CallOfTheFullMoon.java @@ -78,7 +78,7 @@ public class CallOfTheFullMoon extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, sacrifice Call of the Full Moon. TriggeredAbility ability2 = new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceEffect(), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability2, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(ability2, TwoOrMoreSpellsWereCastLastTurnCondition.instance, "At the beginning of each upkeep, if a player cast two or more spells last turn, sacrifice {this}.")); } diff --git a/Mage.Sets/src/mage/cards/c/CanopySurge.java b/Mage.Sets/src/mage/cards/c/CanopySurge.java index b743cd7b06..bc96e24697 100644 --- a/Mage.Sets/src/mage/cards/c/CanopySurge.java +++ b/Mage.Sets/src/mage/cards/c/CanopySurge.java @@ -58,7 +58,7 @@ public class CanopySurge extends CardImpl { this.addAbility(new KickerAbility("{2}")); // Canopy Surge deals 1 damage to each creature with flying and each player. If Canopy Surge was kicked, it deals 4 damage to each creature with flying and each player instead. this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new DamageEverythingEffect(4, filter), - new DamageEverythingEffect(1, filter), KickedCondition.getInstance(), + new DamageEverythingEffect(1, filter), KickedCondition.instance, "{this} deals 1 damage to each creature with flying and each player. If {this} was kicked, it deals 4 damage to each creature with flying and each player instead.")); } diff --git a/Mage.Sets/src/mage/cards/c/CarapaceForger.java b/Mage.Sets/src/mage/cards/c/CarapaceForger.java index 612df14054..407e612bc2 100644 --- a/Mage.Sets/src/mage/cards/c/CarapaceForger.java +++ b/Mage.Sets/src/mage/cards/c/CarapaceForger.java @@ -56,7 +56,7 @@ public class CarapaceForger extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); ContinuousEffect boostSource = new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield); - ConditionalContinuousEffect effect = new ConditionalContinuousEffect(boostSource, MetalcraftCondition.getInstance(), text); + ConditionalContinuousEffect effect = new ConditionalContinuousEffect(boostSource, MetalcraftCondition.instance, text); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); } diff --git a/Mage.Sets/src/mage/cards/c/CaravanVigil.java b/Mage.Sets/src/mage/cards/c/CaravanVigil.java index 4f6b6379a5..097593f20d 100644 --- a/Mage.Sets/src/mage/cards/c/CaravanVigil.java +++ b/Mage.Sets/src/mage/cards/c/CaravanVigil.java @@ -96,7 +96,7 @@ class CaravanVigilEffect extends OneShotEffect { Card card = controller.getLibrary().getCard(target.getFirstTarget(), game); if (card != null) { Cards cards = new CardsImpl(card); - if (MorbidCondition.getInstance().apply(game, source) + if (MorbidCondition.instance.apply(game, source) && controller.chooseUse(Outcome.PutLandInPlay, "Do you wish to put the card onto the battlefield instead?", source, game)) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); } else { diff --git a/Mage.Sets/src/mage/cards/c/CarefulConsideration.java b/Mage.Sets/src/mage/cards/c/CarefulConsideration.java index 3eee787387..e07c2e07e9 100644 --- a/Mage.Sets/src/mage/cards/c/CarefulConsideration.java +++ b/Mage.Sets/src/mage/cards/c/CarefulConsideration.java @@ -50,7 +50,7 @@ public class CarefulConsideration extends CardImpl { this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DrawDiscardTargetEffect(4,2), new DrawDiscardTargetEffect(4,3), - MyMainPhaseCondition.getInstance(), + MyMainPhaseCondition.instance, "Target player draws four cards, then discards three cards. If you cast this spell during your main phase, instead that player draws four cards, then discards two cards")); this.getSpellAbility().addTarget(new TargetPlayer()); } diff --git a/Mage.Sets/src/mage/cards/c/CastleRaptors.java b/Mage.Sets/src/mage/cards/c/CastleRaptors.java index 9ad7b889b7..230642715b 100644 --- a/Mage.Sets/src/mage/cards/c/CastleRaptors.java +++ b/Mage.Sets/src/mage/cards/c/CastleRaptors.java @@ -58,7 +58,7 @@ public class CastleRaptors extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // As long as Castle Raptors is untapped, it gets +0/+2. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( - new BoostSourceEffect(0, 2, Duration.WhileOnBattlefield), new InvertCondition(new SourceTappedCondition()), + new BoostSourceEffect(0, 2, Duration.WhileOnBattlefield), new InvertCondition(SourceTappedCondition.instance), "As long as {this} is untapped, it gets +0/+2."))); } diff --git a/Mage.Sets/src/mage/cards/c/ChaoticStrike.java b/Mage.Sets/src/mage/cards/c/ChaoticStrike.java index 8b092793aa..fb504ea0b7 100644 --- a/Mage.Sets/src/mage/cards/c/ChaoticStrike.java +++ b/Mage.Sets/src/mage/cards/c/ChaoticStrike.java @@ -55,7 +55,7 @@ public class ChaoticStrike extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{R}"); // Cast Chaotic Strike only during combat after blockers are declared. - this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(TurnPhase.COMBAT, AfterBlockersAreDeclaredCondition.getInstance())); + this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(TurnPhase.COMBAT, AfterBlockersAreDeclaredCondition.instance)); // Flip a coin. If you win the flip, target creature gets +1/+1 until end of turn. this.getSpellAbility().addEffect(new ChaoticStrikeEffect()); diff --git a/Mage.Sets/src/mage/cards/c/ChromeSteed.java b/Mage.Sets/src/mage/cards/c/ChromeSteed.java index 4c2e556b69..e80e55ec94 100644 --- a/Mage.Sets/src/mage/cards/c/ChromeSteed.java +++ b/Mage.Sets/src/mage/cards/c/ChromeSteed.java @@ -54,7 +54,7 @@ public class ChromeSteed extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); ContinuousEffect boostSource = new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield); - ConditionalContinuousEffect effect = new ConditionalContinuousEffect(boostSource, MetalcraftCondition.getInstance(), text); + ConditionalContinuousEffect effect = new ConditionalContinuousEffect(boostSource, MetalcraftCondition.instance, text); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); } diff --git a/Mage.Sets/src/mage/cards/c/Chronozoa.java b/Mage.Sets/src/mage/cards/c/Chronozoa.java index f863ad679e..fd0e4bc1b5 100644 --- a/Mage.Sets/src/mage/cards/c/Chronozoa.java +++ b/Mage.Sets/src/mage/cards/c/Chronozoa.java @@ -70,7 +70,7 @@ public class Chronozoa extends CardImpl { Effect effect = new PutTokenOntoBattlefieldCopySourceEffect(2); effect.setText("create two tokens that are copies of it"); this.addAbility(new ConditionalTriggeredAbility(new DiesCreatureTriggeredAbility(effect, false), - new LastTimeCounterRemovedCondition(), + LastTimeCounterRemovedCondition.instance, "When {this} dies, if it had no time counters on it, create two tokens that are copies of it.")); } diff --git a/Mage.Sets/src/mage/cards/c/CinderhazeWretch.java b/Mage.Sets/src/mage/cards/c/CinderhazeWretch.java index 018589f669..d6c6e13503 100644 --- a/Mage.Sets/src/mage/cards/c/CinderhazeWretch.java +++ b/Mage.Sets/src/mage/cards/c/CinderhazeWretch.java @@ -60,7 +60,7 @@ public class CinderhazeWretch extends CardImpl { this.toughness = new MageInt(2); // {tap}: Target player discards a card. Activate this ability only during your turn. - Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new DiscardTargetEffect(1), new TapSourceCost(), MyTurnCondition.getInstance()); + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new DiscardTargetEffect(1), new TapSourceCost(), MyTurnCondition.instance); ability.addTarget(new TargetPlayer()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/c/CircleOfElders.java b/Mage.Sets/src/mage/cards/c/CircleOfElders.java index 79581325e7..9378b27aad 100644 --- a/Mage.Sets/src/mage/cards/c/CircleOfElders.java +++ b/Mage.Sets/src/mage/cards/c/CircleOfElders.java @@ -63,7 +63,7 @@ public class CircleOfElders extends CardImpl { Zone.BATTLEFIELD, new BasicManaEffect(Mana.ColorlessMana(3)), new TapSourceCost(), - FormidableCondition.getInstance()); + FormidableCondition.instance); ability.setAbilityWord(AbilityWord.FORMIDABLE); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/c/CitanulWoodreaders.java b/Mage.Sets/src/mage/cards/c/CitanulWoodreaders.java index 57db0b5596..1a5828e6e2 100644 --- a/Mage.Sets/src/mage/cards/c/CitanulWoodreaders.java +++ b/Mage.Sets/src/mage/cards/c/CitanulWoodreaders.java @@ -57,7 +57,7 @@ public class CitanulWoodreaders extends CardImpl { // When Citanul Woodreaders enters the battlefield, if it was kicked, draw two cards. this.addAbility(new ConditionalTriggeredAbility( new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(2)), - KickedCondition.getInstance(),"When Citanul Woodreaders enters the battlefield, if it was kicked, draw two cards.")); + KickedCondition.instance,"When Citanul Woodreaders enters the battlefield, if it was kicked, draw two cards.")); } public CitanulWoodreaders(final CitanulWoodreaders card) { diff --git a/Mage.Sets/src/mage/cards/c/ClingingMists.java b/Mage.Sets/src/mage/cards/c/ClingingMists.java index 1c3204a612..686382183f 100644 --- a/Mage.Sets/src/mage/cards/c/ClingingMists.java +++ b/Mage.Sets/src/mage/cards/c/ClingingMists.java @@ -61,7 +61,7 @@ public class ClingingMists extends CardImpl { // Fateful hour - If you have 5 or less life, tap all attacking creatures. Those creatures don't untap during their controller's next untap step. this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new ClingingMistsEffect(), - FatefulHourCondition.getInstance(), "If you have 5 or less life, tap all attacking creatures. Those creatures don't untap during their controller's next untap step.")); + FatefulHourCondition.instance, "If you have 5 or less life, tap all attacking creatures. Those creatures don't untap during their controller's next untap step.")); } diff --git a/Mage.Sets/src/mage/cards/c/ClockworkAvian.java b/Mage.Sets/src/mage/cards/c/ClockworkAvian.java index d37ecbc70d..3dbea9f041 100644 --- a/Mage.Sets/src/mage/cards/c/ClockworkAvian.java +++ b/Mage.Sets/src/mage/cards/c/ClockworkAvian.java @@ -74,7 +74,7 @@ public class ClockworkAvian extends CardImpl { // At end of combat, if Clockwork Avian attacked or blocked this combat, remove a +1/+0 counter from it. this.addAbility(new ConditionalTriggeredAbility( new EndOfCombatTriggeredAbility(new RemoveCounterSourceEffect(CounterType.P1P0.createInstance()), false), - new AttackedOrBlockedThisCombatSourceCondition(), + AttackedOrBlockedThisCombatSourceCondition.instance, "At end of combat, if {this} attacked or blocked this combat, remove a +1/+0 counter from it."), new AttackedOrBlockedThisCombatWatcher()); diff --git a/Mage.Sets/src/mage/cards/c/ClockworkBeast.java b/Mage.Sets/src/mage/cards/c/ClockworkBeast.java index b91879d6b3..0a1c06eaf8 100644 --- a/Mage.Sets/src/mage/cards/c/ClockworkBeast.java +++ b/Mage.Sets/src/mage/cards/c/ClockworkBeast.java @@ -71,7 +71,7 @@ public class ClockworkBeast extends CardImpl { // At end of combat, if Clockwork Beast attacked or blocked this combat, remove a +1/+0 counter from it. this.addAbility(new ConditionalTriggeredAbility( new EndOfCombatTriggeredAbility(new RemoveCounterSourceEffect(CounterType.P1P0.createInstance()), false), - new AttackedOrBlockedThisCombatSourceCondition(), + AttackedOrBlockedThisCombatSourceCondition.instance, "At end of combat, if {this} attacked or blocked this combat, remove a +1/+0 counter from it."), new AttackedOrBlockedThisCombatWatcher()); diff --git a/Mage.Sets/src/mage/cards/c/CobraTrap.java b/Mage.Sets/src/mage/cards/c/CobraTrap.java index e37b6c2796..fa858a096e 100644 --- a/Mage.Sets/src/mage/cards/c/CobraTrap.java +++ b/Mage.Sets/src/mage/cards/c/CobraTrap.java @@ -76,10 +76,10 @@ public class CobraTrap extends CardImpl { class CobraTrapCondition implements Condition { - private static final CobraTrapCondition fInstance = new CobraTrapCondition(); + private static final CobraTrapCondition instance = new CobraTrapCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/c/ColossusOfAkros.java b/Mage.Sets/src/mage/cards/c/ColossusOfAkros.java index 14b336a82b..a1dccd72bb 100644 --- a/Mage.Sets/src/mage/cards/c/ColossusOfAkros.java +++ b/Mage.Sets/src/mage/cards/c/ColossusOfAkros.java @@ -70,10 +70,10 @@ public class ColossusOfAkros extends CardImpl { Ability ability = new SimpleStaticAbility( Zone.BATTLEFIELD, new ConditionalContinuousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield), - MonstrousCondition.getInstance(), + MonstrousCondition.instance, "As long as {this} is monstrous, it has trample")); Effect effect = new ConditionalAsThoughEffect(new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield), - MonstrousCondition.getInstance()); + MonstrousCondition.instance); effect.setText("and can attack as though it didn't have defender"); ability.addEffect(effect); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/c/ConcussiveBolt.java b/Mage.Sets/src/mage/cards/c/ConcussiveBolt.java index e1a62031e1..681f12932a 100644 --- a/Mage.Sets/src/mage/cards/c/ConcussiveBolt.java +++ b/Mage.Sets/src/mage/cards/c/ConcussiveBolt.java @@ -88,7 +88,7 @@ class ConcussiveBoltEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - source.getEffects().get(2).setValue("MetalcraftConcussiveBolt", MetalcraftCondition.getInstance().apply(game, source)); + source.getEffects().get(2).setValue("MetalcraftConcussiveBolt", MetalcraftCondition.instance.apply(game, source)); return true; } } diff --git a/Mage.Sets/src/mage/cards/c/ConquerorsPledge.java b/Mage.Sets/src/mage/cards/c/ConquerorsPledge.java index aab64c6880..68ae1dd59d 100644 --- a/Mage.Sets/src/mage/cards/c/ConquerorsPledge.java +++ b/Mage.Sets/src/mage/cards/c/ConquerorsPledge.java @@ -49,7 +49,7 @@ public class ConquerorsPledge extends CardImpl { this.addAbility(new KickerAbility("{6}")); this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new CreateTokenEffect(new KorSoldierToken(), 12), - new CreateTokenEffect(new KorSoldierToken(), 6), KickedCondition.getInstance(), + new CreateTokenEffect(new KorSoldierToken(), 6), KickedCondition.instance, "Create six 1/1 white Kor Soldier creature tokens. If {this} was kicked, create twelve of those tokens instead")); } diff --git a/Mage.Sets/src/mage/cards/c/ConsulsLieutenant.java b/Mage.Sets/src/mage/cards/c/ConsulsLieutenant.java index 9683772d98..805ab0cb21 100644 --- a/Mage.Sets/src/mage/cards/c/ConsulsLieutenant.java +++ b/Mage.Sets/src/mage/cards/c/ConsulsLieutenant.java @@ -61,7 +61,7 @@ public class ConsulsLieutenant extends CardImpl { // Whenever Consul's Lieutenant attacks, if it's renowned, other attacking creatures you control get +1/+1 until end of turn. this.addAbility(new ConditionalTriggeredAbility(new AttacksTriggeredAbility( new BoostControlledEffect(1, 1, Duration.EndOfTurn, new FilterAttackingCreature("other attacking creatures you control"), true), false), - RenownedSourceCondition.getInstance(), + RenownedSourceCondition.instance, "Whenever Consul's Lieutenant attacks, if it's renowned, other attacking creatures you control get +1/+1 until end of turn.")); } diff --git a/Mage.Sets/src/mage/cards/c/ConvictedKiller.java b/Mage.Sets/src/mage/cards/c/ConvictedKiller.java index 923cdac856..0b2fb1c505 100644 --- a/Mage.Sets/src/mage/cards/c/ConvictedKiller.java +++ b/Mage.Sets/src/mage/cards/c/ConvictedKiller.java @@ -60,7 +60,7 @@ public class ConvictedKiller extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Convicted Killer. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public ConvictedKiller(final ConvictedKiller card) { diff --git a/Mage.Sets/src/mage/cards/c/CountlessGearsRenegade.java b/Mage.Sets/src/mage/cards/c/CountlessGearsRenegade.java index 7c11d16303..07aa488d00 100644 --- a/Mage.Sets/src/mage/cards/c/CountlessGearsRenegade.java +++ b/Mage.Sets/src/mage/cards/c/CountlessGearsRenegade.java @@ -57,7 +57,7 @@ public class CountlessGearsRenegade extends CardImpl { // Revolt — When Countless Gears Renegade enters the battlefield, if a permanent you controlled // left the battlefield this turn, create a 1/1 colorless Servo artifact creature token. Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility( - new CreateTokenEffect(new ServoToken(), 1), false), RevoltCondition.getInstance(), + new CreateTokenEffect(new ServoToken(), 1), false), RevoltCondition.instance, "Revolt — When {this} enters the battlefield, if a permanent you controlled left" + " the battlefield this turn, create a 1/1 colorless Servo artifact creature token."); ability.setAbilityWord(AbilityWord.REVOLT); diff --git a/Mage.Sets/src/mage/cards/c/CraterElemental.java b/Mage.Sets/src/mage/cards/c/CraterElemental.java index d02bab0786..38615fc135 100644 --- a/Mage.Sets/src/mage/cards/c/CraterElemental.java +++ b/Mage.Sets/src/mage/cards/c/CraterElemental.java @@ -71,7 +71,7 @@ public class CraterElemental extends CardImpl { Zone.BATTLEFIELD, new SetPowerSourceEffect(new StaticValue(8), Duration.EndOfTurn), new ManaCostsImpl("{2}{R}"), - FormidableCondition.getInstance()); + FormidableCondition.instance); ability.setAbilityWord(AbilityWord.FORMIDABLE); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/c/CratersClaws.java b/Mage.Sets/src/mage/cards/c/CratersClaws.java index bdfc87ffe1..266f2ac8ee 100644 --- a/Mage.Sets/src/mage/cards/c/CratersClaws.java +++ b/Mage.Sets/src/mage/cards/c/CratersClaws.java @@ -52,7 +52,7 @@ public class CratersClaws extends CardImpl { this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DamageTargetEffect(new IntPlusDynamicValue(2, new ManacostVariableValue())), new DamageTargetEffect(new ManacostVariableValue()), - FerociousCondition.getInstance(), + FerociousCondition.instance, "{this} deals X damage to target creature or player." + "
Ferocious — {this} deals X plus 2 damage to that creature or player instead if you control a creature with power 4 or greater")); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); diff --git a/Mage.Sets/src/mage/cards/c/CropSigil.java b/Mage.Sets/src/mage/cards/c/CropSigil.java index 05ba71d1fd..9d610ffe42 100644 --- a/Mage.Sets/src/mage/cards/c/CropSigil.java +++ b/Mage.Sets/src/mage/cards/c/CropSigil.java @@ -68,7 +68,7 @@ public class CropSigil extends CardImpl { // Delirium — {2}{G}, Sacrifice Crop Sigil: Return up to one target creature card and up to one target land card from your graveyard to your hand. // Activate this ability only if there are four or more card types among cards in your graveyard. Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(true), new ManaCostsImpl<>("{2}{G}"), - DeliriumCondition.getInstance(), + DeliriumCondition.instance, "Delirium — {2}{G}, Sacrifice {this}: Return up to one target creature card and up to one target land card from your graveyard to your hand. " + "Activate this ability only if there are four or more card types among cards in your graveyard"); ability.addCost(new SacrificeSourceCost()); diff --git a/Mage.Sets/src/mage/cards/c/CrownOfDoom.java b/Mage.Sets/src/mage/cards/c/CrownOfDoom.java index 5c6dfd3212..7595fbc035 100644 --- a/Mage.Sets/src/mage/cards/c/CrownOfDoom.java +++ b/Mage.Sets/src/mage/cards/c/CrownOfDoom.java @@ -73,7 +73,7 @@ public class CrownOfDoom extends CardImpl { this.addAbility(new AttacksAllTriggeredAbility(effect, false, new FilterCreaturePermanent(), SetTargetPointer.PERMANENT, true)); // {2}: Target player other than Crown of Doom's owner gains control of it. Activate this ability only during your turn. - Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new CrownOfDoomEffect(), new ManaCostsImpl("{2}"), MyTurnCondition.getInstance()); + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new CrownOfDoomEffect(), new ManaCostsImpl("{2}"), MyTurnCondition.instance); ability.addTarget(new TargetPlayer(1, 1, false, new FilterPlayer("player other than Crown of Doom's owner"))); abilityId = ability.getOriginalId(); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/c/CrushOfTentacles.java b/Mage.Sets/src/mage/cards/c/CrushOfTentacles.java index 8e6c16fdf5..d506b7cb29 100644 --- a/Mage.Sets/src/mage/cards/c/CrushOfTentacles.java +++ b/Mage.Sets/src/mage/cards/c/CrushOfTentacles.java @@ -52,7 +52,7 @@ public class CrushOfTentacles extends CardImpl { // Return all nonland permanents to their owners' hands. If Crush of Tentacles surge cost was paid, create an 8/8 blue Octopus creature token. getSpellAbility().addEffect(new ReturnToHandFromBattlefieldAllEffect(new FilterNonlandPermanent("nonland permanents"))); - Effect effect = new ConditionalOneShotEffect(new CreateTokenEffect(new CrushOfTentaclesToken()), SurgedCondition.getInstance()); + Effect effect = new ConditionalOneShotEffect(new CreateTokenEffect(new CrushOfTentaclesToken()), SurgedCondition.instance); effect.setText("If {this} surge cost was paid, create an 8/8 blue Octopus creature token"); getSpellAbility().addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/c/CurtainOfLight.java b/Mage.Sets/src/mage/cards/c/CurtainOfLight.java index 5615a3f2a4..6f7211f921 100644 --- a/Mage.Sets/src/mage/cards/c/CurtainOfLight.java +++ b/Mage.Sets/src/mage/cards/c/CurtainOfLight.java @@ -65,7 +65,7 @@ public class CurtainOfLight extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{W}"); // Cast Curtain of Light only during combat after blockers are declared. - this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(TurnPhase.COMBAT, AfterBlockersAreDeclaredCondition.getInstance())); + this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(TurnPhase.COMBAT, AfterBlockersAreDeclaredCondition.instance)); // Target unblocked attacking creature becomes blocked. this.getSpellAbility().addEffect(new CurtainOfLightEffect()); diff --git a/Mage.Sets/src/mage/cards/c/CutthroatIlDal.java b/Mage.Sets/src/mage/cards/c/CutthroatIlDal.java index eb06895ea0..e934700160 100644 --- a/Mage.Sets/src/mage/cards/c/CutthroatIlDal.java +++ b/Mage.Sets/src/mage/cards/c/CutthroatIlDal.java @@ -55,7 +55,7 @@ public class CutthroatIlDal extends CardImpl { // 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(), + new GainAbilitySourceEffect(ShadowAbility.getInstance(), Duration.WhileOnBattlefield), HellbentCondition.instance, "Hellbent - {this} has shadow as long as you have no cards in hand"))); } public CutthroatIlDal(final CutthroatIlDal card) { diff --git a/Mage.Sets/src/mage/cards/d/DagobahMawSlug.java b/Mage.Sets/src/mage/cards/d/DagobahMawSlug.java index a47cd78d36..7dda04e67d 100644 --- a/Mage.Sets/src/mage/cards/d/DagobahMawSlug.java +++ b/Mage.Sets/src/mage/cards/d/DagobahMawSlug.java @@ -58,7 +58,7 @@ public class DagobahMawSlug extends CardImpl { // As long as Dagobah Maw Slug is monstrous it has swampwalk. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( new GainAbilitySourceEffect(new SwampwalkAbility()), - MonstrousCondition.getInstance(), + MonstrousCondition.instance, "As long as Dagobah Maw Slug is monstrous it has swampwalk") )); } diff --git a/Mage.Sets/src/mage/cards/d/DaredevilDragster.java b/Mage.Sets/src/mage/cards/d/DaredevilDragster.java index b1e570577e..f6cc4f5d96 100644 --- a/Mage.Sets/src/mage/cards/d/DaredevilDragster.java +++ b/Mage.Sets/src/mage/cards/d/DaredevilDragster.java @@ -61,7 +61,7 @@ public class DaredevilDragster extends CardImpl { // At end of combat, if Daredevil Dragster attacked or blocked this combat, put a velocity counter on it. Then if it has two or more velocity counters on it, sacrifice it and draw two cards. this.addAbility(new ConditionalTriggeredAbility( new EndOfCombatTriggeredAbility(new DaredevilDragsterEffect(), false), - new AttackedOrBlockedThisCombatSourceCondition(), + AttackedOrBlockedThisCombatSourceCondition.instance, "At end of combat, if {this} attacked or blocked this combat, put a velocity counter on it. Then if it has two or more velocity counters on it, sacrifice it and draw two cards."), new AttackedOrBlockedThisCombatWatcher()); diff --git a/Mage.Sets/src/mage/cards/d/DarkApprenticeship.java b/Mage.Sets/src/mage/cards/d/DarkApprenticeship.java index 333e9a2f3f..a622bca32f 100644 --- a/Mage.Sets/src/mage/cards/d/DarkApprenticeship.java +++ b/Mage.Sets/src/mage/cards/d/DarkApprenticeship.java @@ -52,7 +52,7 @@ public class DarkApprenticeship extends CardImpl { // Hate — At the beggining of your end step, if an opponent lost life from source other than combat damage this turn, Dark Apprenticeship deals 2 damage to target player. Ability ability = new ConditionalTriggeredAbility( new BeginningOfEndStepTriggeredAbility(new DamageTargetEffect(2), TargetController.YOU, false), - HateCondition.getInstance(), + HateCondition.instance, "Hate — At the beggining of your end step, if an opponent lost life from source other than combat damage this turn, Dark Apprenticeship deals 2 damage to target player."); ability.addTarget(new TargetPlayer()); this.addAbility(ability, new LifeLossOtherFromCombatWatcher()); diff --git a/Mage.Sets/src/mage/cards/d/DarkDabbling.java b/Mage.Sets/src/mage/cards/d/DarkDabbling.java index 88901d17e1..78fa1d99be 100644 --- a/Mage.Sets/src/mage/cards/d/DarkDabbling.java +++ b/Mage.Sets/src/mage/cards/d/DarkDabbling.java @@ -88,7 +88,7 @@ class DarkDabblingEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - if (SpellMasteryCondition.getInstance().apply(game, source)) { + if (SpellMasteryCondition.instance.apply(game, source)) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { if (!permanent.getId().equals(getTargetPointer().getFirst(game, source))) { RegenerateTargetEffect regenEffect = new RegenerateTargetEffect(); diff --git a/Mage.Sets/src/mage/cards/d/DarkPetition.java b/Mage.Sets/src/mage/cards/d/DarkPetition.java index f30e6fb1f6..5bb744c33c 100644 --- a/Mage.Sets/src/mage/cards/d/DarkPetition.java +++ b/Mage.Sets/src/mage/cards/d/DarkPetition.java @@ -53,7 +53,7 @@ public class DarkPetition extends CardImpl { // Spell mastery - If there are two or more instant and/or sorcery cards in your graveyard, add {B}{B}{B} to your mana pool. Effect effect = new ConditionalOneShotEffect(new AddManaToManaPoolSourceControllerEffect(Mana.BlackMana(3)), - SpellMasteryCondition.getInstance(), "
Spell mastery - If there are two or more instant and/or sorcery cards in your graveyard, add {B}{B}{B} to your mana pool"); + SpellMasteryCondition.instance, "
Spell mastery - If there are two or more instant and/or sorcery cards in your graveyard, add {B}{B}{B} to your mana pool"); this.getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/cards/d/DarthMaul.java b/Mage.Sets/src/mage/cards/d/DarthMaul.java index 5868c8e8ef..28c6fc7a70 100644 --- a/Mage.Sets/src/mage/cards/d/DarthMaul.java +++ b/Mage.Sets/src/mage/cards/d/DarthMaul.java @@ -66,7 +66,7 @@ public class DarthMaul extends CardImpl { // Hate — Whenever Darth Maul attacks, if an opponent loses life from a source other than combat damage this turn, target creature can't block this turn. Ability ability = new ConditionalTriggeredAbility( new AttacksTriggeredAbility(new CantBeBlockedByTargetSourceEffect(Duration.EndOfTurn), false), - HateCondition.getInstance(), + HateCondition.instance, "Hate — Whenever Darth Maul attacks, if an opponent loses life from a source other than combat damage this turn, target creature can't block this turn."); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability, new LifeLossOtherFromCombatWatcher()); diff --git a/Mage.Sets/src/mage/cards/d/DaybreakRanger.java b/Mage.Sets/src/mage/cards/d/DaybreakRanger.java index baf518b656..aea3252e05 100644 --- a/Mage.Sets/src/mage/cards/d/DaybreakRanger.java +++ b/Mage.Sets/src/mage/cards/d/DaybreakRanger.java @@ -81,7 +81,7 @@ public class DaybreakRanger extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Daybreak Ranger. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public DaybreakRanger(final DaybreakRanger card) { diff --git a/Mage.Sets/src/mage/cards/d/DaysUndoing.java b/Mage.Sets/src/mage/cards/d/DaysUndoing.java index 7a0f8d86b0..7093c385dc 100644 --- a/Mage.Sets/src/mage/cards/d/DaysUndoing.java +++ b/Mage.Sets/src/mage/cards/d/DaysUndoing.java @@ -57,7 +57,7 @@ public class DaysUndoing extends CardImpl { Effect effect = new DrawCardAllEffect(7); effect.setText(", then draws seven cards"); this.getSpellAbility().addEffect(effect); - this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new EndTurnEffect(), MyTurnCondition.getInstance(), "If it's your turn, end the turn")); + this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new EndTurnEffect(), MyTurnCondition.instance, "If it's your turn, end the turn")); } public DaysUndoing(final DaysUndoing card) { diff --git a/Mage.Sets/src/mage/cards/d/DeadeyeHarpooner.java b/Mage.Sets/src/mage/cards/d/DeadeyeHarpooner.java index bf07e3ace7..7a609b7fb5 100644 --- a/Mage.Sets/src/mage/cards/d/DeadeyeHarpooner.java +++ b/Mage.Sets/src/mage/cards/d/DeadeyeHarpooner.java @@ -65,7 +65,7 @@ public class DeadeyeHarpooner extends CardImpl { // Revolt — When Deadeye Harpooner enters the battlefield, if a permanent you controlled left the battlefield this turn, destroy target tapped creature an opponent controls. Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility( - new DestroyTargetEffect(), false), RevoltCondition.getInstance(), + new DestroyTargetEffect(), false), RevoltCondition.instance, "Revolt — When {this} enters the battlefield, if a permanent you controlled left" + " the battlefield this turn, destroy target tapped creature an opponent controls." ); diff --git a/Mage.Sets/src/mage/cards/d/DeadlyGrub.java b/Mage.Sets/src/mage/cards/d/DeadlyGrub.java index 3b84c9388a..1cfa87e8aa 100644 --- a/Mage.Sets/src/mage/cards/d/DeadlyGrub.java +++ b/Mage.Sets/src/mage/cards/d/DeadlyGrub.java @@ -65,7 +65,7 @@ public class DeadlyGrub extends CardImpl { this.addAbility(new VanishingSacrificeAbility()); // When Deadly Grub dies, if it had no time counters on it, create a 6/1 green Insect creature token with shroud. this.addAbility(new ConditionalTriggeredAbility(new DiesTriggeredAbility(new CreateTokenEffect(new DeadlyGrubToken(), 1)), - new LastTimeCounterRemovedCondition(), "When {this} dies, if it had no time counters on it, create a 6/1 green Insect creature token with shroud.")); + LastTimeCounterRemovedCondition.instance, "When {this} dies, if it had no time counters on it, create a 6/1 green Insect creature token with shroud.")); } public DeadlyGrub(final DeadlyGrub card) { diff --git a/Mage.Sets/src/mage/cards/d/DeathSpark.java b/Mage.Sets/src/mage/cards/d/DeathSpark.java index d6f005fc05..a5cd714480 100644 --- a/Mage.Sets/src/mage/cards/d/DeathSpark.java +++ b/Mage.Sets/src/mage/cards/d/DeathSpark.java @@ -83,10 +83,10 @@ public class DeathSpark extends CardImpl { class DeathSparkCondition implements Condition { - private static final DeathSparkCondition fInstance = new DeathSparkCondition(); + private static final DeathSparkCondition instance = new DeathSparkCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/d/DeathcapCultivator.java b/Mage.Sets/src/mage/cards/d/DeathcapCultivator.java index 76826a86a5..0a9368901f 100644 --- a/Mage.Sets/src/mage/cards/d/DeathcapCultivator.java +++ b/Mage.Sets/src/mage/cards/d/DeathcapCultivator.java @@ -62,7 +62,7 @@ public class DeathcapCultivator extends CardImpl { // Delirium — Deathcap Cultivator has deathtouch as long as there are four or more card types among cards in your graveyard. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new GainAbilitySourceEffect(DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield), - new DeliriumCondition(), "Delirium — {this} has deathtouch as long as there are four or more card types among cards in your graveyard"))); + DeliriumCondition.instance, "Delirium — {this} has deathtouch as long as there are four or more card types among cards in your graveyard"))); } public DeathcapCultivator(final DeathcapCultivator card) { diff --git a/Mage.Sets/src/mage/cards/d/DeathreapRitual.java b/Mage.Sets/src/mage/cards/d/DeathreapRitual.java index 72164d4f53..7b61a71590 100644 --- a/Mage.Sets/src/mage/cards/d/DeathreapRitual.java +++ b/Mage.Sets/src/mage/cards/d/DeathreapRitual.java @@ -48,7 +48,7 @@ public class DeathreapRitual extends CardImpl { // Morbid - At the beginning of each end step, if a creature died this turn, you may draw a card. this.addAbility(new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), - TargetController.ANY, MorbidCondition.getInstance(), true)); + TargetController.ANY, MorbidCondition.instance, true)); } public DeathreapRitual(final DeathreapRitual card) { diff --git a/Mage.Sets/src/mage/cards/d/Decommission.java b/Mage.Sets/src/mage/cards/d/Decommission.java index 2faa52550e..a7e5ed8c67 100644 --- a/Mage.Sets/src/mage/cards/d/Decommission.java +++ b/Mage.Sets/src/mage/cards/d/Decommission.java @@ -53,7 +53,7 @@ public class Decommission extends CardImpl { this.getSpellAbility().addTarget(new TargetPermanent(new FilterArtifactOrEnchantmentPermanent())); // Revolt — If a permanent you controlled left the battlefield this turn, you gain 3 life. - this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new GainLifeEffect(3), RevoltCondition.getInstance(), "
Revolt — If a permanent you controlled left the battlefield this turn, you gain 3 life.")); + this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new GainLifeEffect(3), RevoltCondition.instance, "
Revolt — If a permanent you controlled left the battlefield this turn, you gain 3 life.")); this.getSpellAbility().addWatcher(new RevoltWatcher()); } diff --git a/Mage.Sets/src/mage/cards/d/DementiaSliver.java b/Mage.Sets/src/mage/cards/d/DementiaSliver.java index f1ba7513f5..a199b17ff3 100644 --- a/Mage.Sets/src/mage/cards/d/DementiaSliver.java +++ b/Mage.Sets/src/mage/cards/d/DementiaSliver.java @@ -72,7 +72,7 @@ public class DementiaSliver extends CardImpl { this.toughness = new MageInt(3); // All Slivers have "{T}: Name a card. Target opponent reveals a card at random from his or her hand. If it's the named card, that player discards it. Activate this ability only during your turn." - Ability gainedAbility = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new NameACardEffect(NameACardEffect.TypeOfName.ALL), new TapSourceCost(), MyTurnCondition.getInstance()); + Ability gainedAbility = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new NameACardEffect(NameACardEffect.TypeOfName.ALL), new TapSourceCost(), MyTurnCondition.instance); gainedAbility.addEffect(new DementiaSliverEffect()); gainedAbility.addTarget(new TargetOpponent()); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, diff --git a/Mage.Sets/src/mage/cards/d/Demonfire.java b/Mage.Sets/src/mage/cards/d/Demonfire.java index 3c27c8530c..b994ca89c4 100644 --- a/Mage.Sets/src/mage/cards/d/Demonfire.java +++ b/Mage.Sets/src/mage/cards/d/Demonfire.java @@ -58,7 +58,7 @@ public class Demonfire extends CardImpl { // Demonfire deals X damage to target creature or player. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DamageTargetEffect(new ManacostVariableValue()), - new InvertCondition(HellbentCondition.getInstance()), + new InvertCondition(HellbentCondition.instance), "{this} deals X damage to target creature or player")); // If a creature dealt damage this way would die this turn, exile it instead. @@ -68,14 +68,14 @@ public class Demonfire extends CardImpl { // Hellbent - If you have no cards in hand, Demonfire can't be countered by spells or abilities and the damage can't be prevented. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DamageTargetEffect(new ManacostVariableValue(), false), - HellbentCondition.getInstance(), + HellbentCondition.instance, "
Hellbent - If you have no cards in hand, {this} can't be countered by spells or abilities and the damage can't be prevented.")); // can't be countered Effect effect = new CantBeCounteredSourceEffect(); effect.setText(""); this.addAbility(new SimpleStaticAbility(Zone.STACK, new ConditionalContinuousRuleModifyingEffect( (CantBeCounteredSourceEffect) effect, - HellbentCondition.getInstance()))); + HellbentCondition.instance))); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); } diff --git a/Mage.Sets/src/mage/cards/d/DemonsJester.java b/Mage.Sets/src/mage/cards/d/DemonsJester.java index 8294853f41..13c1f1873e 100644 --- a/Mage.Sets/src/mage/cards/d/DemonsJester.java +++ b/Mage.Sets/src/mage/cards/d/DemonsJester.java @@ -57,7 +57,7 @@ public class DemonsJester extends CardImpl { // Hellbent - Demon's Jester gets +2/+1 as long as you have no cards in hand. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( - new BoostSourceEffect(2,1,Duration.WhileOnBattlefield), HellbentCondition.getInstance(), + new BoostSourceEffect(2,1,Duration.WhileOnBattlefield), HellbentCondition.instance, "Hellbent - {this} gets +2/+1 as long as you have no cards in hand"))); } diff --git a/Mage.Sets/src/mage/cards/d/DescendUponTheSinful.java b/Mage.Sets/src/mage/cards/d/DescendUponTheSinful.java index 939fa14e80..f3b4094cf9 100644 --- a/Mage.Sets/src/mage/cards/d/DescendUponTheSinful.java +++ b/Mage.Sets/src/mage/cards/d/DescendUponTheSinful.java @@ -52,7 +52,7 @@ public class DescendUponTheSinful extends CardImpl { this.getSpellAbility().addEffect(new ExileAllEffect(new FilterCreaturePermanent())); // Delirium — Create a 4/4 white Angel creature token with flying if there are four or more card types among cards in your graveyard. - Effect effect = new ConditionalOneShotEffect(new CreateTokenEffect(new AngelToken()), DeliriumCondition.getInstance()); + Effect effect = new ConditionalOneShotEffect(new CreateTokenEffect(new AngelToken()), DeliriumCondition.instance); effect.setText("
Delirium — Create a 4/4 white Angel creature token with flying if there are four or more card types among cards in your graveyard"); this.getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/cards/d/DesolationAngel.java b/Mage.Sets/src/mage/cards/d/DesolationAngel.java index 8a733ec23d..d834bae7c6 100644 --- a/Mage.Sets/src/mage/cards/d/DesolationAngel.java +++ b/Mage.Sets/src/mage/cards/d/DesolationAngel.java @@ -69,7 +69,7 @@ public class DesolationAngel extends CardImpl { // When Desolation Angel enters the battlefield, destroy all lands you control. If it was kicked, destroy all lands instead. this.addAbility(new EntersBattlefieldTriggeredAbility(new ConditionalOneShotEffect(new DestroyAllEffect(filter), - new DestroyAllEffect(filter2), KickedCondition.getInstance(), "destroy all lands you control. If it was kicked, destroy all lands instead."))); + new DestroyAllEffect(filter2), KickedCondition.instance, "destroy all lands you control. If it was kicked, destroy all lands instead."))); } public DesolationAngel(final DesolationAngel card) { diff --git a/Mage.Sets/src/mage/cards/d/DesolationGiant.java b/Mage.Sets/src/mage/cards/d/DesolationGiant.java index 81f219f4de..bd07f232f7 100644 --- a/Mage.Sets/src/mage/cards/d/DesolationGiant.java +++ b/Mage.Sets/src/mage/cards/d/DesolationGiant.java @@ -67,7 +67,7 @@ public class DesolationGiant extends CardImpl { this.addAbility(new KickerAbility("{W}{W}")); // When Desolation Giant enters the battlefield, destroy all other creatures you control. If it was kicked, destroy all other creatures instead. this.addAbility(new EntersBattlefieldTriggeredAbility(new ConditionalOneShotEffect(new DestroyAllEffect(filter), - new DestroyAllEffect(filter2), KickedCondition.getInstance(), "destroy all other creatures you control. If it was kicked, destroy all other creatures instead."))); + new DestroyAllEffect(filter2), KickedCondition.instance, "destroy all other creatures you control. If it was kicked, destroy all other creatures instead."))); } public DesolationGiant(final DesolationGiant card) { diff --git a/Mage.Sets/src/mage/cards/d/DesperateSentry.java b/Mage.Sets/src/mage/cards/d/DesperateSentry.java index eaba165343..b7c891fb5f 100644 --- a/Mage.Sets/src/mage/cards/d/DesperateSentry.java +++ b/Mage.Sets/src/mage/cards/d/DesperateSentry.java @@ -61,7 +61,7 @@ public class DesperateSentry extends CardImpl { // Delirium — Desperate Sentry gets +3/+0 as long as there are four or more card types among cards in your graveyard. ConditionalContinuousEffect effect = new ConditionalContinuousEffect( - new BoostSourceEffect(3, 0, Duration.WhileOnBattlefield), DeliriumCondition.getInstance(), + new BoostSourceEffect(3, 0, Duration.WhileOnBattlefield), DeliriumCondition.instance, "Delirium — {this} gets +3/+0 as long as there are four or more card types among cards in your graveyard."); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/d/DismantlingBlow.java b/Mage.Sets/src/mage/cards/d/DismantlingBlow.java index 7e823afbb9..c6c820e46f 100644 --- a/Mage.Sets/src/mage/cards/d/DismantlingBlow.java +++ b/Mage.Sets/src/mage/cards/d/DismantlingBlow.java @@ -56,7 +56,7 @@ public class DismantlingBlow extends CardImpl { // If Dismantling Blow was kicked, draw two cards. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DrawCardSourceControllerEffect(2), - KickedCondition.getInstance(), + KickedCondition.instance, "If {this} was kicked, draw two cards")); } diff --git a/Mage.Sets/src/mage/cards/d/Dispatch.java b/Mage.Sets/src/mage/cards/d/Dispatch.java index 4739d018ec..27e6308346 100644 --- a/Mage.Sets/src/mage/cards/d/Dispatch.java +++ b/Mage.Sets/src/mage/cards/d/Dispatch.java @@ -48,7 +48,7 @@ public class Dispatch extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{W}"); this.getSpellAbility().addEffect(new TapTargetEffect()); - this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new ExileTargetEffect(), MetalcraftCondition.getInstance(), "Metalcraft - If you control three or more artifacts, exile that creature")); + this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new ExileTargetEffect(), MetalcraftCondition.instance, "Metalcraft - If you control three or more artifacts, exile that creature")); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/cards/d/DispenseJustice.java b/Mage.Sets/src/mage/cards/d/DispenseJustice.java index 3fb08e8bff..e97d2be04c 100644 --- a/Mage.Sets/src/mage/cards/d/DispenseJustice.java +++ b/Mage.Sets/src/mage/cards/d/DispenseJustice.java @@ -84,7 +84,7 @@ class DispenseJusticeEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - if ( MetalcraftCondition.getInstance().apply(game, source) ) { + if ( MetalcraftCondition.instance.apply(game, source) ) { return new SacrificeEffect(filter, 2, effectText).apply(game, source); } else { diff --git a/Mage.Sets/src/mage/cards/d/DisruptingScepter.java b/Mage.Sets/src/mage/cards/d/DisruptingScepter.java index 95902d9783..cafd4a3f88 100644 --- a/Mage.Sets/src/mage/cards/d/DisruptingScepter.java +++ b/Mage.Sets/src/mage/cards/d/DisruptingScepter.java @@ -51,7 +51,7 @@ public class DisruptingScepter extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}"); // {3}, {tap}: Target player discards a card. Activate this ability only during your turn. - Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new DiscardTargetEffect(1), new ManaCostsImpl("{3}"), new MyTurnCondition()); + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new DiscardTargetEffect(1), new ManaCostsImpl("{3}"), MyTurnCondition.instance); ability.addTarget(new TargetPlayer()); ability.addCost(new TapSourceCost()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/d/DomesticatedHydra.java b/Mage.Sets/src/mage/cards/d/DomesticatedHydra.java index cc90e7d7f1..20f3d4e1b6 100644 --- a/Mage.Sets/src/mage/cards/d/DomesticatedHydra.java +++ b/Mage.Sets/src/mage/cards/d/DomesticatedHydra.java @@ -61,7 +61,7 @@ public class DomesticatedHydra extends CardImpl { Ability ability = new SimpleStaticAbility( Zone.BATTLEFIELD, new ConditionalContinuousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield), - MonstrousCondition.getInstance(), + MonstrousCondition.instance, "As long as {this} is monstrous, it has trample")); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/d/DragonGrip.java b/Mage.Sets/src/mage/cards/d/DragonGrip.java index 0178bb86f3..320f1cf701 100644 --- a/Mage.Sets/src/mage/cards/d/DragonGrip.java +++ b/Mage.Sets/src/mage/cards/d/DragonGrip.java @@ -64,7 +64,7 @@ public class DragonGrip extends CardImpl { AsThoughEffect effect = new CastAsThoughItHadFlashSourceEffect(Duration.EndOfGame); effect.setText("Ferocious — If you control a creature with power 4 or greater, you may cast Dragon Grip as though it had flash"); this.addAbility(new SimpleStaticAbility(Zone.ALL, new ConditionalAsThoughEffect(effect, - FerociousCondition.getInstance()))); + FerociousCondition.instance))); // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); diff --git a/Mage.Sets/src/mage/cards/d/DragonScarredBear.java b/Mage.Sets/src/mage/cards/d/DragonScarredBear.java index 12b92f1d45..5323b6518e 100644 --- a/Mage.Sets/src/mage/cards/d/DragonScarredBear.java +++ b/Mage.Sets/src/mage/cards/d/DragonScarredBear.java @@ -57,7 +57,7 @@ public class DragonScarredBear extends CardImpl { Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{1}{G}"), - FormidableCondition.getInstance()); + FormidableCondition.instance); ability.setAbilityWord(AbilityWord.FORMIDABLE); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/d/DragonWhisperer.java b/Mage.Sets/src/mage/cards/d/DragonWhisperer.java index 437df52af8..8683df206e 100644 --- a/Mage.Sets/src/mage/cards/d/DragonWhisperer.java +++ b/Mage.Sets/src/mage/cards/d/DragonWhisperer.java @@ -74,7 +74,7 @@ public class DragonWhisperer extends CardImpl { Zone.BATTLEFIELD, new CreateTokenEffect(new DragonToken()), new ManaCostsImpl("{4}{R}{R}"), - FormidableCondition.getInstance()); + FormidableCondition.instance); ability.setAbilityWord(AbilityWord.FORMIDABLE); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/d/DragonlordOjutai.java b/Mage.Sets/src/mage/cards/d/DragonlordOjutai.java index ef30979150..50571ff433 100644 --- a/Mage.Sets/src/mage/cards/d/DragonlordOjutai.java +++ b/Mage.Sets/src/mage/cards/d/DragonlordOjutai.java @@ -66,7 +66,7 @@ public class DragonlordOjutai extends CardImpl { // Dragonlord Ojutai has hexproof as long as it's untapped. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( new GainAbilitySourceEffect(HexproofAbility.getInstance(), Duration.WhileOnBattlefield), - new InvertCondition(new SourceTappedCondition()), + new InvertCondition(SourceTappedCondition.instance), "{this} has hexproof as long as it's untapped"))); // Whenever Dragonlord Ojutai deals combat damage to a player, look at the top three cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order. diff --git a/Mage.Sets/src/mage/cards/d/DralnusPet.java b/Mage.Sets/src/mage/cards/d/DralnusPet.java index ba5aa71a8e..f50bc56778 100644 --- a/Mage.Sets/src/mage/cards/d/DralnusPet.java +++ b/Mage.Sets/src/mage/cards/d/DralnusPet.java @@ -75,7 +75,7 @@ public class DralnusPet extends CardImpl { kickerCosts.add(new DiscardCardCost(new FilterCreatureCard())); this.addAbility(new KickerAbility(kickerCosts)); // If Dralnu's Pet was kicked, it enters the battlefield with flying and with X +1/+1 counters on it, where X is the discarded card's converted mana cost. - Ability ability = new EntersBattlefieldAbility(new DralnusPetEffect(), KickedCondition.getInstance(), + Ability ability = new EntersBattlefieldAbility(new DralnusPetEffect(), KickedCondition.instance, "If {this} was kicked, it enters the battlefield with flying and with X +1/+1 counters on it, where X is the discarded card's converted mana cost", ""); ability.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/d/DreamHalls.java b/Mage.Sets/src/mage/cards/d/DreamHalls.java index 1045da61b5..6cb8130c67 100644 --- a/Mage.Sets/src/mage/cards/d/DreamHalls.java +++ b/Mage.Sets/src/mage/cards/d/DreamHalls.java @@ -80,7 +80,7 @@ class DreamHallsEffect extends ContinuousEffectImpl { filter.add(new SharesColorWithSourcePredicate()); } - static AlternativeCostSourceAbility alternativeCastingCostAbility = new AlternativeCostSourceAbility(new DiscardCardCost(filter), SourceIsSpellCondition.getInstance()); + static AlternativeCostSourceAbility alternativeCastingCostAbility = new AlternativeCostSourceAbility(new DiscardCardCost(filter), SourceIsSpellCondition.instance); public DreamHallsEffect() { super(Duration.WhileOnBattlefield, Outcome.Detriment); diff --git a/Mage.Sets/src/mage/cards/d/DreamspoilerWitches.java b/Mage.Sets/src/mage/cards/d/DreamspoilerWitches.java index 9cc9cd322b..12c44dbb53 100644 --- a/Mage.Sets/src/mage/cards/d/DreamspoilerWitches.java +++ b/Mage.Sets/src/mage/cards/d/DreamspoilerWitches.java @@ -58,7 +58,7 @@ public class DreamspoilerWitches extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); // Whenever you cast a spell during an opponent's turn, you may have target creature get -1/-1 until end of turn. - Ability ability = new ConditionalTriggeredAbility(new SpellCastControllerTriggeredAbility(new BoostTargetEffect(-1, -1, Duration.EndOfTurn), true), OnOpponentsTurnCondition.getInstance(), + Ability ability = new ConditionalTriggeredAbility(new SpellCastControllerTriggeredAbility(new BoostTargetEffect(-1, -1, Duration.EndOfTurn), true), OnOpponentsTurnCondition.instance, "Whenever you cast a spell during an opponent's turn, you may have target creature get -1/-1 until end of turn."); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/d/Duskwalker.java b/Mage.Sets/src/mage/cards/d/Duskwalker.java index 9bb9ceb8ce..360c478e75 100644 --- a/Mage.Sets/src/mage/cards/d/Duskwalker.java +++ b/Mage.Sets/src/mage/cards/d/Duskwalker.java @@ -60,7 +60,7 @@ public class Duskwalker extends CardImpl { // If Duskwalker was kicked, it enters the battlefield with two +1/+1 counters on it and with fear. Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), - KickedCondition.getInstance(), + KickedCondition.instance, "If {this} was kicked, it enters the battlefield with two +1/+1 counters on it and with fear.", ""); ability.addEffect(new GainAbilitySourceEffect(FearAbility.getInstance(), Duration.WhileOnBattlefield)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/d/DuskwatchRecruiter.java b/Mage.Sets/src/mage/cards/d/DuskwatchRecruiter.java index ac7299a391..868b00a176 100644 --- a/Mage.Sets/src/mage/cards/d/DuskwatchRecruiter.java +++ b/Mage.Sets/src/mage/cards/d/DuskwatchRecruiter.java @@ -75,7 +75,7 @@ public class DuskwatchRecruiter extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Duskwatch Recruiter. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public DuskwatchRecruiter(final DuskwatchRecruiter card) { diff --git a/Mage.Sets/src/mage/cards/d/DwarvenHold.java b/Mage.Sets/src/mage/cards/d/DwarvenHold.java index d13c44ee88..27195fa6e6 100644 --- a/Mage.Sets/src/mage/cards/d/DwarvenHold.java +++ b/Mage.Sets/src/mage/cards/d/DwarvenHold.java @@ -65,7 +65,7 @@ public class DwarvenHold extends CardImpl { this.addAbility(new SkipUntapOptionalAbility()); // At the beginning of your upkeep, if Dwarven Hold is tapped, put a storage counter on it. OneShotEffect addStorageCounter = new AddCountersSourceEffect(CounterType.STORAGE.createInstance()); - Effect effect = new ConditionalOneShotEffect(addStorageCounter, SourceTappedCondition.getInstance(), "if {this} is tapped, put a storage counter on it"); + Effect effect = new ConditionalOneShotEffect(addStorageCounter, SourceTappedCondition.instance, "if {this} is tapped, put a storage counter on it"); this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.YOU, false)); // {tap}, Remove any number of storage counters from Dwarven Hold: Add {R} to your mana pool for each storage counter removed this way. Ability ability = new DynamicManaAbility( diff --git a/Mage.Sets/src/mage/cards/d/DwarvenLandslide.java b/Mage.Sets/src/mage/cards/d/DwarvenLandslide.java index cae767d2f2..6676dcb5f4 100644 --- a/Mage.Sets/src/mage/cards/d/DwarvenLandslide.java +++ b/Mage.Sets/src/mage/cards/d/DwarvenLandslide.java @@ -72,7 +72,7 @@ public class DwarvenLandslide extends CardImpl { @Override public void adjustTargets(Ability ability, Game game) { if (ability instanceof SpellAbility) { - if (KickedCondition.getInstance().apply(game, ability)) { + if (KickedCondition.instance.apply(game, ability)) { ability.getTargets().clear(); getSpellAbility().addTarget(new TargetLandPermanent(2)); } diff --git a/Mage.Sets/src/mage/cards/e/EarwigSquad.java b/Mage.Sets/src/mage/cards/e/EarwigSquad.java index 6e67ad4e6c..9eee178d31 100644 --- a/Mage.Sets/src/mage/cards/e/EarwigSquad.java +++ b/Mage.Sets/src/mage/cards/e/EarwigSquad.java @@ -67,7 +67,7 @@ public class EarwigSquad extends CardImpl { // When Earwig Squad enters the battlefield, if its prowl cost was paid, search target opponent's library for three cards and exile them. Then that player shuffles his or her library. EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new EarwigSquadEffect(), false); ability.addTarget(new TargetOpponent()); - this.addAbility(new ConditionalTriggeredAbility(ability, ProwlCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(ability, ProwlCondition.instance, "When {this} enters the battlefield, if its prowl cost was paid, search target opponent's library for three cards and exile them. Then that player shuffles his or her library.")); } diff --git a/Mage.Sets/src/mage/cards/e/ElementalAppeal.java b/Mage.Sets/src/mage/cards/e/ElementalAppeal.java index a24643e3b4..1c6b468ff7 100644 --- a/Mage.Sets/src/mage/cards/e/ElementalAppeal.java +++ b/Mage.Sets/src/mage/cards/e/ElementalAppeal.java @@ -68,7 +68,7 @@ public class ElementalAppeal extends CardImpl { // If Elemental Appeal was kicked, that creature gets +7/+0 until end of turn. this.getSpellAbility().addEffect(new ConditionalContinuousEffect( new BoostTargetEffect(7, 0, Duration.EndOfTurn), - new LockedInCondition(KickedCondition.getInstance()), + new LockedInCondition(KickedCondition.instance), "If {this} was kicked, that creature gets +7/+0 until end of turn")); } diff --git a/Mage.Sets/src/mage/cards/e/EmissaryOfTheSleepless.java b/Mage.Sets/src/mage/cards/e/EmissaryOfTheSleepless.java index b296b567ed..9a59d2b726 100644 --- a/Mage.Sets/src/mage/cards/e/EmissaryOfTheSleepless.java +++ b/Mage.Sets/src/mage/cards/e/EmissaryOfTheSleepless.java @@ -57,7 +57,7 @@ public class EmissaryOfTheSleepless extends CardImpl { // When Emissary of the Sleepless enters the battlefield, if a creature died this turn, create a 1/1 white Spirit creature token with flying. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new SpiritWhiteToken())); - this.addAbility(new ConditionalTriggeredAbility(ability, MorbidCondition.getInstance(), "When {this} enters the battlefield, if a creature died this turn, create a 1/1 white Spirit creature token with flying.")); + this.addAbility(new ConditionalTriggeredAbility(ability, MorbidCondition.instance, "When {this} enters the battlefield, if a creature died this turn, create a 1/1 white Spirit creature token with flying.")); } public EmissaryOfTheSleepless(final EmissaryOfTheSleepless card) { diff --git a/Mage.Sets/src/mage/cards/e/Endoskeleton.java b/Mage.Sets/src/mage/cards/e/Endoskeleton.java index eee54d4e48..53a52af8eb 100644 --- a/Mage.Sets/src/mage/cards/e/Endoskeleton.java +++ b/Mage.Sets/src/mage/cards/e/Endoskeleton.java @@ -56,7 +56,7 @@ public class Endoskeleton extends CardImpl { this.addAbility(new SkipUntapOptionalAbility()); // {2}, {tap}: Target creature gets +0/+3 for as long as Endoskeleton remains tapped. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( - new BoostTargetEffect(0, 3, Duration.Custom), SourceTappedCondition.getInstance(), + new BoostTargetEffect(0, 3, Duration.Custom), SourceTappedCondition.instance, "target creature gets +0/+3 for as long as {this} remains tapped"), new ManaCostsImpl("{2}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/cards/e/EpharaGodOfThePolis.java b/Mage.Sets/src/mage/cards/e/EpharaGodOfThePolis.java index 363b918417..8dc079c67c 100644 --- a/Mage.Sets/src/mage/cards/e/EpharaGodOfThePolis.java +++ b/Mage.Sets/src/mage/cards/e/EpharaGodOfThePolis.java @@ -72,7 +72,7 @@ public class EpharaGodOfThePolis extends CardImpl { // At the beginning of each upkeep, if you had another creature enter the battlefield under your control last turn, draw a card. this.addAbility(new ConditionalTriggeredAbility( new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), TargetController.ANY, false, false), - HadAnotherCreatureEnterTheBattlefieldCondition.getInstance(), + HadAnotherCreatureEnterTheBattlefieldCondition.instance, "At the beginning of each upkeep, if you had another creature enter the battlefield under your control last turn, draw a card."), new PermanentsEnteredBattlefieldWatcher()); @@ -88,13 +88,11 @@ public class EpharaGodOfThePolis extends CardImpl { } } -class HadAnotherCreatureEnterTheBattlefieldCondition implements Condition { +enum HadAnotherCreatureEnterTheBattlefieldCondition implements Condition { + + instance; - private final static HadAnotherCreatureEnterTheBattlefieldCondition fInstance = new HadAnotherCreatureEnterTheBattlefieldCondition(); - public static HadAnotherCreatureEnterTheBattlefieldCondition getInstance() { - return fInstance; - } @Override public boolean apply(Game game, Ability source) { diff --git a/Mage.Sets/src/mage/cards/e/ErtaisTrickery.java b/Mage.Sets/src/mage/cards/e/ErtaisTrickery.java index 2de4f4d333..ea0b655c62 100644 --- a/Mage.Sets/src/mage/cards/e/ErtaisTrickery.java +++ b/Mage.Sets/src/mage/cards/e/ErtaisTrickery.java @@ -81,7 +81,7 @@ class ErtaisTrickeryEffect extends CounterTargetEffect { @Override public boolean apply(Game game, Ability source) { Spell targetSpell = game.getStack().getSpell(source.getFirstTarget()); - if(targetSpell != null && KickedCondition.getInstance().apply(game, targetSpell.getSpellAbility())) { + if(targetSpell != null && KickedCondition.instance.apply(game, targetSpell.getSpellAbility())) { return super.apply(game, source); } return false; diff --git a/Mage.Sets/src/mage/cards/e/EtchedChampion.java b/Mage.Sets/src/mage/cards/e/EtchedChampion.java index 05e54beb7c..65cb1edbb7 100644 --- a/Mage.Sets/src/mage/cards/e/EtchedChampion.java +++ b/Mage.Sets/src/mage/cards/e/EtchedChampion.java @@ -71,7 +71,7 @@ public class EtchedChampion extends CardImpl { this.toughness = new MageInt(2); ContinuousEffect effect = new GainAbilitySourceEffect(new ProtectionAbility(filter), Duration.WhileOnBattlefield); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(effect, MetalcraftCondition.getInstance(), ruleText))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(effect, MetalcraftCondition.instance, ruleText))); } public EtchedChampion(final EtchedChampion card) { diff --git a/Mage.Sets/src/mage/cards/e/EvergloveCourier.java b/Mage.Sets/src/mage/cards/e/EvergloveCourier.java index d1b85bce56..b7fb7a0981 100644 --- a/Mage.Sets/src/mage/cards/e/EvergloveCourier.java +++ b/Mage.Sets/src/mage/cards/e/EvergloveCourier.java @@ -70,10 +70,10 @@ public class EvergloveCourier extends CardImpl { this.addAbility(new SkipUntapOptionalAbility()); // {2}{G}, {tap}: Target Elf creature gets +2/+2 and has trample for as long as Everglove Courier remains tapped. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( - new BoostTargetEffect(2, 2, Duration.Custom), SourceTappedCondition.getInstance(), + new BoostTargetEffect(2, 2, Duration.Custom), SourceTappedCondition.instance, "target Elf creature gets +2/+2"), new ManaCostsImpl("{2}{G}")); ability.addEffect(new ConditionalContinuousEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(), - Duration.Custom), SourceTappedCondition.getInstance(),"and has trample for as long as {this} remains tapped")); + Duration.Custom), SourceTappedCondition.instance,"and has trample for as long as {this} remains tapped")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/e/ExplosiveGrowth.java b/Mage.Sets/src/mage/cards/e/ExplosiveGrowth.java index a0c14bade6..747905ea16 100644 --- a/Mage.Sets/src/mage/cards/e/ExplosiveGrowth.java +++ b/Mage.Sets/src/mage/cards/e/ExplosiveGrowth.java @@ -54,7 +54,7 @@ public class ExplosiveGrowth extends CardImpl { // Target creature gets +2/+2 until end of turn. If Explosive Growth was kicked, that creature gets +5/+5 until end of turn instead. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new ConditionalContinuousEffect(new BoostTargetEffect(5, 5, Duration.EndOfTurn), - new BoostTargetEffect(2, 2, Duration.EndOfTurn), new LockedInCondition(KickedCondition.getInstance()), + new BoostTargetEffect(2, 2, Duration.EndOfTurn), new LockedInCondition(KickedCondition.instance), "Target creature gets +2/+2 until end of turn. If {this} was kicked, that creature gets +5/+5 until end of turn instead.")); } diff --git a/Mage.Sets/src/mage/cards/e/ExquisiteFirecraft.java b/Mage.Sets/src/mage/cards/e/ExquisiteFirecraft.java index f4f74ed37e..4bff2b57bb 100644 --- a/Mage.Sets/src/mage/cards/e/ExquisiteFirecraft.java +++ b/Mage.Sets/src/mage/cards/e/ExquisiteFirecraft.java @@ -56,7 +56,7 @@ public class ExquisiteFirecraft extends CardImpl { // Spell mastery - If there are two or more instant and/or sorcery cards in your graveyard, Exquisite Firecraft can't be countered by spells or abilities. ContinuousRuleModifyingEffect cantBeCountered = new CantBeCounteredSourceEffect(); - ConditionalContinuousRuleModifyingEffect conditionalCantBeCountered = new ConditionalContinuousRuleModifyingEffect(cantBeCountered, SpellMasteryCondition.getInstance()); + ConditionalContinuousRuleModifyingEffect conditionalCantBeCountered = new ConditionalContinuousRuleModifyingEffect(cantBeCountered, SpellMasteryCondition.instance); conditionalCantBeCountered.setText("
If there are two or more instant and/or sorcery cards in your graveyard, {this} can't be countered by spells or abilities"); Ability ability = new SimpleStaticAbility(Zone.STACK, conditionalCantBeCountered); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/e/ExtricatorOfSin.java b/Mage.Sets/src/mage/cards/e/ExtricatorOfSin.java index 15fae037c3..ee80a4ba15 100644 --- a/Mage.Sets/src/mage/cards/e/ExtricatorOfSin.java +++ b/Mage.Sets/src/mage/cards/e/ExtricatorOfSin.java @@ -78,7 +78,7 @@ public class ExtricatorOfSin extends CardImpl { this.addAbility(new TransformAbility()); this.addAbility(new ConditionalTriggeredAbility( new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new TransformSourceEffect(true), TargetController.YOU, false), - DeliriumCondition.getInstance(), + DeliriumCondition.instance, "Delirium — At the beginning of your upkeep, if there are four or more card types among cards in your graveyard, " + " transform {this}.")); } diff --git a/Mage.Sets/src/mage/cards/e/EyesOfTheWisent.java b/Mage.Sets/src/mage/cards/e/EyesOfTheWisent.java index c9c43801f2..2dcebd98b0 100644 --- a/Mage.Sets/src/mage/cards/e/EyesOfTheWisent.java +++ b/Mage.Sets/src/mage/cards/e/EyesOfTheWisent.java @@ -60,7 +60,7 @@ public class EyesOfTheWisent extends CardImpl { // Whenever an opponent casts a blue spell during your turn, you may create a 4/4 green Elemental creature token. this.addAbility(new ConditionalTriggeredAbility( new SpellCastOpponentTriggeredAbility(new CreateTokenEffect(new EyesOfTheWisentElementalToken()), filter, true), - new MyTurnCondition(), + MyTurnCondition.instance, "Whenever an opponent casts a blue spell during your turn, you may create a 4/4 green Elemental creature token." )); } diff --git a/Mage.Sets/src/mage/cards/e/EzurisBrigade.java b/Mage.Sets/src/mage/cards/e/EzurisBrigade.java index 4d64ff2b74..4a964c7459 100644 --- a/Mage.Sets/src/mage/cards/e/EzurisBrigade.java +++ b/Mage.Sets/src/mage/cards/e/EzurisBrigade.java @@ -59,9 +59,9 @@ public class EzurisBrigade extends CardImpl { this.power = new MageInt(4); this.toughness = new MageInt(4); ContinuousEffect boostSource = new BoostSourceEffect(4, 4, Duration.WhileOnBattlefield); - ConditionalContinuousEffect effect = new ConditionalContinuousEffect(boostSource, MetalcraftCondition.getInstance(), text); + ConditionalContinuousEffect effect = new ConditionalContinuousEffect(boostSource, MetalcraftCondition.instance, text); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); - ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield), MetalcraftCondition.getInstance(), "")); + ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield), MetalcraftCondition.instance, "")); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/f/FaerieSquadron.java b/Mage.Sets/src/mage/cards/f/FaerieSquadron.java index 93f16a0895..4a4310fc09 100644 --- a/Mage.Sets/src/mage/cards/f/FaerieSquadron.java +++ b/Mage.Sets/src/mage/cards/f/FaerieSquadron.java @@ -60,7 +60,7 @@ public class FaerieSquadron extends CardImpl { this.addAbility(new KickerAbility("{3}{U}")); // If Faerie Squadron was kicked, it enters the battlefield with two +1/+1 counters on it and with flying. Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), - KickedCondition.getInstance(), "If {this} was kicked, it enters the battlefield with two +1/+1 counters on it and with flying.", ""); + KickedCondition.instance, "If {this} was kicked, it enters the battlefield with two +1/+1 counters on it and with flying.", ""); ability.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/f/FaerieTauntings.java b/Mage.Sets/src/mage/cards/f/FaerieTauntings.java index a4532c344c..96d8db2c69 100644 --- a/Mage.Sets/src/mage/cards/f/FaerieTauntings.java +++ b/Mage.Sets/src/mage/cards/f/FaerieTauntings.java @@ -47,7 +47,7 @@ public class FaerieTauntings extends CardImpl { this.subtype.add("Faerie"); // Whenever you cast a spell during an opponent's turn, you may have each opponent lose 1 life - this.addAbility(new ConditionalTriggeredAbility(new SpellCastControllerTriggeredAbility(new LoseLifeOpponentsEffect(1), true), OnOpponentsTurnCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(new SpellCastControllerTriggeredAbility(new LoseLifeOpponentsEffect(1), true), OnOpponentsTurnCondition.instance, "Whenever you cast a spell during an opponent's turn, you may have each opponent lose 1 life.")); } diff --git a/Mage.Sets/src/mage/cards/f/FairgroundsTrumpeter.java b/Mage.Sets/src/mage/cards/f/FairgroundsTrumpeter.java index 21831facd9..e0fcb44c3d 100644 --- a/Mage.Sets/src/mage/cards/f/FairgroundsTrumpeter.java +++ b/Mage.Sets/src/mage/cards/f/FairgroundsTrumpeter.java @@ -79,10 +79,10 @@ public class FairgroundsTrumpeter extends CardImpl { class FairgroundsTrumpeterCondition implements Condition { - private static final FairgroundsTrumpeterCondition fInstance = new FairgroundsTrumpeterCondition(); + private static final FairgroundsTrumpeterCondition instance = new FairgroundsTrumpeterCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/f/FaithsShield.java b/Mage.Sets/src/mage/cards/f/FaithsShield.java index a11bc50c44..1d290833c4 100644 --- a/Mage.Sets/src/mage/cards/f/FaithsShield.java +++ b/Mage.Sets/src/mage/cards/f/FaithsShield.java @@ -90,7 +90,7 @@ class FaithsShieldEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - if (FatefulHourCondition.getInstance().apply(game, source)) { + if (FatefulHourCondition.instance.apply(game, source)) { ChoiceColor choice = new ChoiceColor(); while (!choice.isChosen()) { controller.choose(Outcome.Protect, choice, game); diff --git a/Mage.Sets/src/mage/cards/f/FallingTimber.java b/Mage.Sets/src/mage/cards/f/FallingTimber.java index 7887fd471e..50d0543256 100644 --- a/Mage.Sets/src/mage/cards/f/FallingTimber.java +++ b/Mage.Sets/src/mage/cards/f/FallingTimber.java @@ -67,7 +67,7 @@ public class FallingTimber extends CardImpl { @Override public void adjustTargets(Ability ability, Game game) { if(ability.getOriginalId().equals(originalId)) { - ability.addTarget(new TargetCreaturePermanent(KickedCondition.getInstance().apply(game, ability) ? 2 : 1)); + ability.addTarget(new TargetCreaturePermanent(KickedCondition.instance.apply(game, ability) ? 2 : 1)); } } diff --git a/Mage.Sets/src/mage/cards/f/FanaticOfXenagos.java b/Mage.Sets/src/mage/cards/f/FanaticOfXenagos.java index 6c6803c380..7883b85642 100644 --- a/Mage.Sets/src/mage/cards/f/FanaticOfXenagos.java +++ b/Mage.Sets/src/mage/cards/f/FanaticOfXenagos.java @@ -64,7 +64,7 @@ public class FanaticOfXenagos extends CardImpl { // When Fanatic of Xenagos enters the battlefield, if its tribute wasn't paid, it gets +1/+1 and gains haste until end of turn. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new BoostSourceEffect(1,1, Duration.EndOfTurn)); ability.addEffect( new GainAbilitySourceEffect(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.EndOfTurn))); - this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.instance, "When {this} enters the battlefield, if its tribute wasn't paid, it gets +1/+1 and gains haste until end of turn.")); } diff --git a/Mage.Sets/src/mage/cards/f/FatalPush.java b/Mage.Sets/src/mage/cards/f/FatalPush.java index 9ff7c18c23..7d6678a062 100644 --- a/Mage.Sets/src/mage/cards/f/FatalPush.java +++ b/Mage.Sets/src/mage/cards/f/FatalPush.java @@ -90,7 +90,7 @@ class FatalPushEffect extends OneShotEffect { Permanent targetCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source)); if (targetCreature != null) { int cmc = targetCreature.getConvertedManaCost(); - if (cmc <= 2 || (RevoltCondition.getInstance().apply(game, source) && cmc <= 4)) { + if (cmc <= 2 || (RevoltCondition.instance.apply(game, source) && cmc <= 4)) { targetCreature.destroy(source.getSourceId(), game, false); } } diff --git a/Mage.Sets/src/mage/cards/f/FatedConflagration.java b/Mage.Sets/src/mage/cards/f/FatedConflagration.java index 826ffc0f20..5c16d58bd1 100644 --- a/Mage.Sets/src/mage/cards/f/FatedConflagration.java +++ b/Mage.Sets/src/mage/cards/f/FatedConflagration.java @@ -50,7 +50,7 @@ public class FatedConflagration extends CardImpl { // Fated Conflagration deals 5 damage to target creature or planewalker. If it's your turn, scry 2. this.getSpellAbility().addEffect(new DamageTargetEffect(5)); this.getSpellAbility().addTarget(new TargetCreatureOrPlaneswalker()); - this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new ScryEffect(2), MyTurnCondition.getInstance(), "If it's your turn, scry 2")); + this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new ScryEffect(2), MyTurnCondition.instance, "If it's your turn, scry 2")); } public FatedConflagration(final FatedConflagration card) { diff --git a/Mage.Sets/src/mage/cards/f/FatedInfatuation.java b/Mage.Sets/src/mage/cards/f/FatedInfatuation.java index d1e66b9015..db36763b33 100644 --- a/Mage.Sets/src/mage/cards/f/FatedInfatuation.java +++ b/Mage.Sets/src/mage/cards/f/FatedInfatuation.java @@ -50,7 +50,7 @@ public class FatedInfatuation extends CardImpl { // Create a token that's a copy of target creature you control. If it's your turn, scry 2. this.getSpellAbility().addEffect(new PutTokenOntoBattlefieldCopyTargetEffect()); this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); - this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new ScryEffect(2), MyTurnCondition.getInstance(), "If it's your turn, scry 2")); + this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new ScryEffect(2), MyTurnCondition.instance, "If it's your turn, scry 2")); } public FatedInfatuation(final FatedInfatuation card) { diff --git a/Mage.Sets/src/mage/cards/f/FatedIntervention.java b/Mage.Sets/src/mage/cards/f/FatedIntervention.java index cadf53377f..3acd2b4cfe 100644 --- a/Mage.Sets/src/mage/cards/f/FatedIntervention.java +++ b/Mage.Sets/src/mage/cards/f/FatedIntervention.java @@ -49,7 +49,7 @@ public class FatedIntervention extends CardImpl { // Create two 3/3 green Centaur enchantment creature tokens. If it's your turn, scry 2. this.getSpellAbility().addEffect(new CreateTokenEffect(new CentaurEnchantmentCreatureToken(), 2)); - this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new ScryEffect(2), MyTurnCondition.getInstance(), "If it's your turn, scry 2")); + this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new ScryEffect(2), MyTurnCondition.instance, "If it's your turn, scry 2")); } public FatedIntervention(final FatedIntervention card) { diff --git a/Mage.Sets/src/mage/cards/f/FatedRetribution.java b/Mage.Sets/src/mage/cards/f/FatedRetribution.java index b0faafd483..ab01ef0a90 100644 --- a/Mage.Sets/src/mage/cards/f/FatedRetribution.java +++ b/Mage.Sets/src/mage/cards/f/FatedRetribution.java @@ -57,7 +57,7 @@ public class FatedRetribution extends CardImpl { // Destroy all creatures and planeswalkers. If it's your turn, scry 2. this.getSpellAbility().addEffect(new DestroyAllEffect(filter, false)); - this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new ScryEffect(2), MyTurnCondition.getInstance(), "If it's your turn, scry 2")); + this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new ScryEffect(2), MyTurnCondition.instance, "If it's your turn, scry 2")); } public FatedRetribution(final FatedRetribution card) { diff --git a/Mage.Sets/src/mage/cards/f/FatedReturn.java b/Mage.Sets/src/mage/cards/f/FatedReturn.java index 789d39a180..269b35e0d5 100644 --- a/Mage.Sets/src/mage/cards/f/FatedReturn.java +++ b/Mage.Sets/src/mage/cards/f/FatedReturn.java @@ -56,7 +56,7 @@ public class FatedReturn extends CardImpl { this.getSpellAbility().addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card from a graveyard"))); this.getSpellAbility().addEffect(new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Duration.Custom, "It gains indestructible")); - this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new ScryEffect(2), MyTurnCondition.getInstance(), + this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new ScryEffect(2), MyTurnCondition.instance, "If it's your turn, scry 2 (Look at the top two cards of your library, then put any number of them on the bottom of your library and the rest on top in any order.)")); } diff --git a/Mage.Sets/src/mage/cards/f/FeastOnTheFallen.java b/Mage.Sets/src/mage/cards/f/FeastOnTheFallen.java index 4f8c445116..d43c0cc093 100644 --- a/Mage.Sets/src/mage/cards/f/FeastOnTheFallen.java +++ b/Mage.Sets/src/mage/cards/f/FeastOnTheFallen.java @@ -76,10 +76,10 @@ public class FeastOnTheFallen extends CardImpl { class FeastOnTheFallenCondition implements Condition { - private static final FeastOnTheFallenCondition fInstance = new FeastOnTheFallenCondition(); + private static final FeastOnTheFallenCondition instance = new FeastOnTheFallenCondition(); public static FeastOnTheFallenCondition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/f/FeedTheClan.java b/Mage.Sets/src/mage/cards/f/FeedTheClan.java index f712aadcee..e8c1f7368a 100644 --- a/Mage.Sets/src/mage/cards/f/FeedTheClan.java +++ b/Mage.Sets/src/mage/cards/f/FeedTheClan.java @@ -49,7 +49,7 @@ public class FeedTheClan extends CardImpl { this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new GainLifeEffect(10), new GainLifeEffect(5), - FerociousCondition.getInstance(), + FerociousCondition.instance, "You gain 5 life.
Ferocious — You gain 10 life instead if you control a creature with power 4 or greater")); } diff --git a/Mage.Sets/src/mage/cards/f/FesterhideBoar.java b/Mage.Sets/src/mage/cards/f/FesterhideBoar.java index 6cef6317d9..9ab90e0107 100644 --- a/Mage.Sets/src/mage/cards/f/FesterhideBoar.java +++ b/Mage.Sets/src/mage/cards/f/FesterhideBoar.java @@ -55,7 +55,7 @@ public class FesterhideBoar extends CardImpl { this.addAbility(TrampleAbility.getInstance()); // Morbid - Festerhide Boar enters the battlefield with two +1/+1 counters on it if a creature died this turn. this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), - MorbidCondition.getInstance(), ""), "with two +1/+1 counters on it if a creature died this turn")); + MorbidCondition.instance, ""), "with two +1/+1 counters on it if a creature died this turn")); } public FesterhideBoar(final FesterhideBoar card) { diff --git a/Mage.Sets/src/mage/cards/f/Festival.java b/Mage.Sets/src/mage/cards/f/Festival.java index 162ea8a167..5155043017 100644 --- a/Mage.Sets/src/mage/cards/f/Festival.java +++ b/Mage.Sets/src/mage/cards/f/Festival.java @@ -48,7 +48,7 @@ public class Festival extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{W}"); // Cast Festival only during an opponent's upkeep. - this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(null, PhaseStep.UPKEEP, OnOpponentsTurnCondition.getInstance(), + this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(null, PhaseStep.UPKEEP, OnOpponentsTurnCondition.instance, "Cast {this} only during an opponent's upkeep")); // Creatures can't attack this turn. diff --git a/Mage.Sets/src/mage/cards/f/FieryImpulse.java b/Mage.Sets/src/mage/cards/f/FieryImpulse.java index 749f9b0d82..e848725aa1 100644 --- a/Mage.Sets/src/mage/cards/f/FieryImpulse.java +++ b/Mage.Sets/src/mage/cards/f/FieryImpulse.java @@ -48,7 +48,7 @@ public class FieryImpulse extends CardImpl { // Fiery Impulse deals 2 damage to target creature. // Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, Fiery Impulse deals 3 damage to that creature instead. this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new DamageTargetEffect(3), - new DamageTargetEffect(2), SpellMasteryCondition.getInstance(), + new DamageTargetEffect(2), SpellMasteryCondition.instance, "{this} deals 2 damage to target creature. Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, {this} deals 3 damage to that creature instead")); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/cards/f/FiremaneAngel.java b/Mage.Sets/src/mage/cards/f/FiremaneAngel.java index b6f8f19e17..4d766e4b93 100644 --- a/Mage.Sets/src/mage/cards/f/FiremaneAngel.java +++ b/Mage.Sets/src/mage/cards/f/FiremaneAngel.java @@ -88,10 +88,10 @@ public class FiremaneAngel extends CardImpl { class SourceOnBattelfieldOrGraveyardCondition implements Condition { - private static final SourceOnBattelfieldOrGraveyardCondition fInstance = new SourceOnBattelfieldOrGraveyardCondition(); + private static final SourceOnBattelfieldOrGraveyardCondition instance = new SourceOnBattelfieldOrGraveyardCondition(); public static SourceOnBattelfieldOrGraveyardCondition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/f/FistOfSuns.java b/Mage.Sets/src/mage/cards/f/FistOfSuns.java index 3f32820ebc..c3928f05d0 100644 --- a/Mage.Sets/src/mage/cards/f/FistOfSuns.java +++ b/Mage.Sets/src/mage/cards/f/FistOfSuns.java @@ -71,7 +71,7 @@ public class FistOfSuns extends CardImpl { class FistOfSunsRuleEffect extends ContinuousEffectImpl { - static AlternativeCostSourceAbility alternativeCastingCostAbility = new AlternativeCostSourceAbility(new ManaCostsImpl("{W}{U}{B}{R}{G}"), SourceIsSpellCondition.getInstance()); + static AlternativeCostSourceAbility alternativeCastingCostAbility = new AlternativeCostSourceAbility(new ManaCostsImpl("{W}{U}{B}{R}{G}"), SourceIsSpellCondition.instance); public FistOfSunsRuleEffect() { super(Duration.WhileOnBattlefield, Outcome.Detriment); diff --git a/Mage.Sets/src/mage/cards/f/FlameWreathedPhoenix.java b/Mage.Sets/src/mage/cards/f/FlameWreathedPhoenix.java index 06eb83ac63..36edda4f20 100644 --- a/Mage.Sets/src/mage/cards/f/FlameWreathedPhoenix.java +++ b/Mage.Sets/src/mage/cards/f/FlameWreathedPhoenix.java @@ -66,7 +66,7 @@ public class FlameWreathedPhoenix extends CardImpl { TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield)); Effect effect = new GainAbilitySourceEffect(new DiesTriggeredAbility(new ReturnToHandSourceEffect())); ability.addEffect(effect); - this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.instance, "When {this} enters the battlefield, if its tribute wasn't paid, it gains haste and \"When this creature dies, return it to its owner's hand.\"")); } diff --git a/Mage.Sets/src/mage/cards/f/FlameheartWerewolf.java b/Mage.Sets/src/mage/cards/f/FlameheartWerewolf.java index a7fa3dd5d6..5c249df45a 100644 --- a/Mage.Sets/src/mage/cards/f/FlameheartWerewolf.java +++ b/Mage.Sets/src/mage/cards/f/FlameheartWerewolf.java @@ -66,7 +66,7 @@ public class FlameheartWerewolf extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Flameheart Werewolf. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public FlameheartWerewolf(final FlameheartWerewolf card) { diff --git a/Mage.Sets/src/mage/cards/f/FlamestickCourier.java b/Mage.Sets/src/mage/cards/f/FlamestickCourier.java index 2097ca0dec..9d67a4a4b7 100644 --- a/Mage.Sets/src/mage/cards/f/FlamestickCourier.java +++ b/Mage.Sets/src/mage/cards/f/FlamestickCourier.java @@ -70,10 +70,10 @@ public class FlamestickCourier extends CardImpl { this.addAbility(new SkipUntapOptionalAbility()); // {2}{R}, {tap}: Target Goblin creature gets +2/+2 and has haste for as long as Flamestick Courier remains tapped. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( - new BoostTargetEffect(2, 2, Duration.Custom), SourceTappedCondition.getInstance(), + new BoostTargetEffect(2, 2, Duration.Custom), SourceTappedCondition.instance, "target Goblin creature gets +2/+2"), new ManaCostsImpl("{2}{R}")); ability.addEffect(new ConditionalContinuousEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), - Duration.Custom), SourceTappedCondition.getInstance(),"and has haste for as long as {this} remains tapped")); + Duration.Custom), SourceTappedCondition.instance,"and has haste for as long as {this} remains tapped")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/f/FlamewakePhoenix.java b/Mage.Sets/src/mage/cards/f/FlamewakePhoenix.java index b7f972b8e8..d032d39a62 100644 --- a/Mage.Sets/src/mage/cards/f/FlamewakePhoenix.java +++ b/Mage.Sets/src/mage/cards/f/FlamewakePhoenix.java @@ -69,7 +69,7 @@ public class FlamewakePhoenix extends CardImpl { Zone.GRAVEYARD, new DoIfCostPaid(new ReturnToBattlefieldUnderOwnerControlSourceEffect(), new ManaCostsImpl("{R")), TargetController.YOU, false, false), - FerociousCondition.getInstance(), + FerociousCondition.instance, "Ferocious — At the beginning of combat on your turn, if you control a creature with power 4 or greater, you may pay {R}. If you do, return {this} from your graveyard to the battlefield." )); } diff --git a/Mage.Sets/src/mage/cards/f/FleecemaneLion.java b/Mage.Sets/src/mage/cards/f/FleecemaneLion.java index c68463ba6f..0beb45d628 100644 --- a/Mage.Sets/src/mage/cards/f/FleecemaneLion.java +++ b/Mage.Sets/src/mage/cards/f/FleecemaneLion.java @@ -62,12 +62,12 @@ public class FleecemaneLion extends CardImpl { // As long as Fleecemane Lion is monstrous, it has hexproof and indestructible. Effect effect = new ConditionalContinuousEffect( new GainAbilitySourceEffect(HexproofAbility.getInstance(), Duration.WhileOnBattlefield), - MonstrousCondition.getInstance(), + MonstrousCondition.instance, "As long as {this} is monstrous, it has hexproof"); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); effect = new ConditionalContinuousEffect( new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield), - MonstrousCondition.getInstance(), + MonstrousCondition.instance, "and indestructible"); ability.addEffect(effect); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/f/Fleshformer.java b/Mage.Sets/src/mage/cards/f/Fleshformer.java index b8194aef45..e3430b2606 100644 --- a/Mage.Sets/src/mage/cards/f/Fleshformer.java +++ b/Mage.Sets/src/mage/cards/f/Fleshformer.java @@ -62,7 +62,7 @@ public class Fleshformer extends CardImpl { // {W}{U}{B}{R}{G}: Fleshformer gets +2/+2 and gains fear until end of turn. Target creature gets -2/-2 until end of turn. Activate this ability only during your turn. Effect effect = new BoostSourceEffect(2, 2, Duration.EndOfTurn); effect.setText("{this} gets +2/+2"); - Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{W}{U}{B}{R}{G}"), MyTurnCondition.getInstance()); + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{W}{U}{B}{R}{G}"), MyTurnCondition.instance); effect = new GainAbilitySourceEffect(FearAbility.getInstance(), Duration.EndOfTurn); effect.setText("and gains fear until end of turn"); ability.addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/f/FlowstoneArmor.java b/Mage.Sets/src/mage/cards/f/FlowstoneArmor.java index 2d5e7b8cba..b73d1da0e2 100644 --- a/Mage.Sets/src/mage/cards/f/FlowstoneArmor.java +++ b/Mage.Sets/src/mage/cards/f/FlowstoneArmor.java @@ -56,7 +56,7 @@ public class FlowstoneArmor extends CardImpl { this.addAbility(new SkipUntapOptionalAbility()); // {3}, {tap}: Target creature gets +1/-1 for as long as Flowstone Armor remains tapped. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( - new BoostTargetEffect(1, -1, Duration.Custom), SourceTappedCondition.getInstance(), + new BoostTargetEffect(1, -1, Duration.Custom), SourceTappedCondition.instance, "target creature gets +1/-1 for as long as {this} remains tapped"), new ManaCostsImpl("{3}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/cards/f/FoolsTome.java b/Mage.Sets/src/mage/cards/f/FoolsTome.java index b30b2d526c..01676cc376 100644 --- a/Mage.Sets/src/mage/cards/f/FoolsTome.java +++ b/Mage.Sets/src/mage/cards/f/FoolsTome.java @@ -50,7 +50,7 @@ public class FoolsTome extends CardImpl { // {2}, {tap}: Draw a card. Activate this ability only if you have no cards in hand. Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), - new ManaCostsImpl("{2}"), HellbentCondition.getInstance()); + new ManaCostsImpl("{2}"), HellbentCondition.instance); ability.addCost(new TapSourceCost()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/f/ForceAway.java b/Mage.Sets/src/mage/cards/f/ForceAway.java index 11cd848282..d1b31da3f5 100644 --- a/Mage.Sets/src/mage/cards/f/ForceAway.java +++ b/Mage.Sets/src/mage/cards/f/ForceAway.java @@ -53,7 +53,7 @@ public class ForceAway extends CardImpl { // Ferocious - If you control a creature with power 4 or greater, you may draw a card. If you do, discard a card. Effect effect = new ConditionalOneShotEffect(new DrawDiscardControllerEffect(1,1, true), - FerociousCondition.getInstance() , "
Ferocious — If you control a creature with power 4 or greater, you may draw a card. If you do, discard a card"); + FerociousCondition.instance , "
Ferocious — If you control a creature with power 4 or greater, you may draw a card. If you do, discard a card"); this.getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/cards/f/ForceDenial.java b/Mage.Sets/src/mage/cards/f/ForceDenial.java index 73f8238fd6..4832efee6b 100644 --- a/Mage.Sets/src/mage/cards/f/ForceDenial.java +++ b/Mage.Sets/src/mage/cards/f/ForceDenial.java @@ -53,13 +53,13 @@ public class ForceDenial extends CardImpl { // Counter target spell unless its controller pays {1}. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new CounterUnlessPaysEffect(new GenericManaCost(1)), - new InvertCondition(HateCondition.getInstance()), + new InvertCondition(HateCondition.instance), "Counter target spell unless its controller pays {1}.")); // Hate — If an opponent lost life from a source other then combat damage this turn, counter that spell instead. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new CounterTargetEffect(), - HateCondition.getInstance(), + HateCondition.instance, "
Hate - If an opponent lost life from a source other than combat damage this turn, counter that spell instead.")); this.getSpellAbility().addTarget(new TargetSpell()); this.getSpellAbility().addWatcher(new LifeLossOtherFromCombatWatcher()); diff --git a/Mage.Sets/src/mage/cards/f/FrightshroudCourier.java b/Mage.Sets/src/mage/cards/f/FrightshroudCourier.java index 4ae4fa5d72..1be6bbfc54 100644 --- a/Mage.Sets/src/mage/cards/f/FrightshroudCourier.java +++ b/Mage.Sets/src/mage/cards/f/FrightshroudCourier.java @@ -70,10 +70,10 @@ public class FrightshroudCourier extends CardImpl { this.addAbility(new SkipUntapOptionalAbility()); // {2}{B}, {tap}: Target Zombie creature gets +2/+2 and has fear for as long as Frightshroud Courier remains tapped. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( - new BoostTargetEffect(2, 2, Duration.Custom), SourceTappedCondition.getInstance(), + new BoostTargetEffect(2, 2, Duration.Custom), SourceTappedCondition.instance, "target Zombie creature gets +2/+2"), new ManaCostsImpl("{2}{B}")); ability.addEffect(new ConditionalContinuousEffect(new GainAbilityTargetEffect(FearAbility.getInstance(), - Duration.Custom), SourceTappedCondition.getInstance(),"and has fear for as long as {this} remains tapped")); + Duration.Custom), SourceTappedCondition.instance,"and has fear for as long as {this} remains tapped")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/f/FrontierMastodon.java b/Mage.Sets/src/mage/cards/f/FrontierMastodon.java index 4642b8544f..be476d413e 100644 --- a/Mage.Sets/src/mage/cards/f/FrontierMastodon.java +++ b/Mage.Sets/src/mage/cards/f/FrontierMastodon.java @@ -52,7 +52,7 @@ public class FrontierMastodon extends CardImpl { // Ferocious - Frontier Mastodon enters the battlefield with a +1/+1 counter on it if you control a creature with power 4 or greater. this.addAbility(new EntersBattlefieldAbility( new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), - FerociousCondition.getInstance(), + FerociousCondition.instance, "Ferocious — {this} enters the battlefield with a +1/+1 counter on it if you control a creature with power 4 or greater.","" )); } diff --git a/Mage.Sets/src/mage/cards/g/GalvanicBlast.java b/Mage.Sets/src/mage/cards/g/GalvanicBlast.java index ac1d677110..e5c807f1d3 100644 --- a/Mage.Sets/src/mage/cards/g/GalvanicBlast.java +++ b/Mage.Sets/src/mage/cards/g/GalvanicBlast.java @@ -50,7 +50,7 @@ public class GalvanicBlast extends CardImpl { // Galvanic Blast deals 2 damage to target creature or player. // Metalcraft - Galvanic Blast deals 4 damage to that creature or player instead if you control three or more artifacts. - this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new DamageTargetEffect(4), new DamageTargetEffect(2), MetalcraftCondition.getInstance(), effectText)); + this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new DamageTargetEffect(4), new DamageTargetEffect(2), MetalcraftCondition.instance, effectText)); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); } diff --git a/Mage.Sets/src/mage/cards/g/GatekeeperOfMalakir.java b/Mage.Sets/src/mage/cards/g/GatekeeperOfMalakir.java index 103ce874ee..7ec3b3182b 100644 --- a/Mage.Sets/src/mage/cards/g/GatekeeperOfMalakir.java +++ b/Mage.Sets/src/mage/cards/g/GatekeeperOfMalakir.java @@ -69,7 +69,7 @@ public class GatekeeperOfMalakir extends CardImpl { // When Gatekeeper of Malakir enters the battlefield, if it was kicked, target player sacrifices a creature. EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new SacrificeEffect(filter, 1, "target player")); - Ability conditionalAbility = new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), "When {this} enters the battlefield, if it was kicked, target player sacrifices a creature."); + Ability conditionalAbility = new ConditionalTriggeredAbility(ability, KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, target player sacrifices a creature."); conditionalAbility.addTarget(new TargetPlayer()); this.addAbility(conditionalAbility); } diff --git a/Mage.Sets/src/mage/cards/g/GathanRaiders.java b/Mage.Sets/src/mage/cards/g/GathanRaiders.java index 0e6aaad1b6..a38b24948f 100644 --- a/Mage.Sets/src/mage/cards/g/GathanRaiders.java +++ b/Mage.Sets/src/mage/cards/g/GathanRaiders.java @@ -57,7 +57,7 @@ public class GathanRaiders extends CardImpl { // Hellbent - Gathan Raiders gets +2/+2 as long as you have no cards in hand. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( - new BoostSourceEffect(2,2,Duration.WhileOnBattlefield), HellbentCondition.getInstance(), + new BoostSourceEffect(2,2,Duration.WhileOnBattlefield), HellbentCondition.instance, "Hellbent - {this} gets +2/+2 as long as you have no cards in hand"))); // Morph-Discard a card. this.addAbility(new MorphAbility(this, new DiscardCardCost())); diff --git a/Mage.Sets/src/mage/cards/g/GatherThePack.java b/Mage.Sets/src/mage/cards/g/GatherThePack.java index cb9f66ad2a..c0ca44edcf 100644 --- a/Mage.Sets/src/mage/cards/g/GatherThePack.java +++ b/Mage.Sets/src/mage/cards/g/GatherThePack.java @@ -94,7 +94,7 @@ class GatherThePackEffect extends OneShotEffect { int creatures = cards.count(new FilterCreatureCard(), source.getSourceId(), source.getControllerId(), game); if (creatures > 0) { int max = 1; - if (SpellMasteryCondition.getInstance().apply(game, source) && creatures > 1) { + if (SpellMasteryCondition.instance.apply(game, source) && creatures > 1) { max++; } TargetCard target = new TargetCard(0, max, Zone.LIBRARY, new FilterCreatureCard("creature card" + (max > 1 ? "s" : "") + " to put into your hand")); diff --git a/Mage.Sets/src/mage/cards/g/GatherTheTownsfolk.java b/Mage.Sets/src/mage/cards/g/GatherTheTownsfolk.java index c55a05dc48..d95e638191 100644 --- a/Mage.Sets/src/mage/cards/g/GatherTheTownsfolk.java +++ b/Mage.Sets/src/mage/cards/g/GatherTheTownsfolk.java @@ -49,7 +49,7 @@ public class GatherTheTownsfolk extends CardImpl { // Create two 1/1 white Human creature tokens. // Fateful hour - If you have 5 or less life, create five of those tokens instead. this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new CreateTokenEffect(new HumanToken(), 5), new CreateTokenEffect(new HumanToken(), 2), - FatefulHourCondition.getInstance(), "Create two 1/1 white Human creature tokens. If you have 5 or less life, create five of those tokens instead")); + FatefulHourCondition.instance, "Create two 1/1 white Human creature tokens. If you have 5 or less life, create five of those tokens instead")); } public GatherTheTownsfolk(final GatherTheTownsfolk card) { diff --git a/Mage.Sets/src/mage/cards/g/GatstafArsonists.java b/Mage.Sets/src/mage/cards/g/GatstafArsonists.java index e191845e86..c11628265e 100644 --- a/Mage.Sets/src/mage/cards/g/GatstafArsonists.java +++ b/Mage.Sets/src/mage/cards/g/GatstafArsonists.java @@ -59,7 +59,7 @@ public class GatstafArsonists extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Gatstaf Arsonists. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public GatstafArsonists(final GatstafArsonists card) { diff --git a/Mage.Sets/src/mage/cards/g/GatstafHowler.java b/Mage.Sets/src/mage/cards/g/GatstafHowler.java index f2af830fbb..1af7d7fc38 100644 --- a/Mage.Sets/src/mage/cards/g/GatstafHowler.java +++ b/Mage.Sets/src/mage/cards/g/GatstafHowler.java @@ -63,7 +63,7 @@ public class GatstafHowler extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Gatstaf Howler. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public GatstafHowler(final GatstafHowler card) { diff --git a/Mage.Sets/src/mage/cards/g/GatstafRavagers.java b/Mage.Sets/src/mage/cards/g/GatstafRavagers.java index e4b9bb0b8c..f457507824 100644 --- a/Mage.Sets/src/mage/cards/g/GatstafRavagers.java +++ b/Mage.Sets/src/mage/cards/g/GatstafRavagers.java @@ -62,7 +62,7 @@ public class GatstafRavagers extends CardImpl { this.addAbility(new MenaceAbility()); // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Gatstaf Ravagers. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public GatstafRavagers(final GatstafRavagers card) { diff --git a/Mage.Sets/src/mage/cards/g/GatstafShepherd.java b/Mage.Sets/src/mage/cards/g/GatstafShepherd.java index c5589cd480..28e1f33428 100644 --- a/Mage.Sets/src/mage/cards/g/GatstafShepherd.java +++ b/Mage.Sets/src/mage/cards/g/GatstafShepherd.java @@ -60,7 +60,7 @@ public class GatstafShepherd extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Gatstaf Shepherd. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public GatstafShepherd(final GatstafShepherd card) { diff --git a/Mage.Sets/src/mage/cards/g/GavonyIronwright.java b/Mage.Sets/src/mage/cards/g/GavonyIronwright.java index 93fd8317f9..b0d8e10cc6 100644 --- a/Mage.Sets/src/mage/cards/g/GavonyIronwright.java +++ b/Mage.Sets/src/mage/cards/g/GavonyIronwright.java @@ -57,7 +57,7 @@ public class GavonyIronwright extends CardImpl { // Fateful hour - As long as you have 5 or less life, other creatures you control get +1/+4. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new BoostControlledEffect(1, 4, Duration.WhileOnBattlefield, false), - FatefulHourCondition.getInstance(), "As long as you have 5 or less life, other creatures you control get +1/+4"))); + FatefulHourCondition.instance, "As long as you have 5 or less life, other creatures you control get +1/+4"))); } public GavonyIronwright(final GavonyIronwright card) { diff --git a/Mage.Sets/src/mage/cards/g/GeierReachBandit.java b/Mage.Sets/src/mage/cards/g/GeierReachBandit.java index d0434a6938..aaa7c979e3 100644 --- a/Mage.Sets/src/mage/cards/g/GeierReachBandit.java +++ b/Mage.Sets/src/mage/cards/g/GeierReachBandit.java @@ -65,7 +65,7 @@ public class GeierReachBandit extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Geier Reach Bandit. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public GeierReachBandit(final GeierReachBandit card) { diff --git a/Mage.Sets/src/mage/cards/g/GeistOfTheLonelyVigil.java b/Mage.Sets/src/mage/cards/g/GeistOfTheLonelyVigil.java index bd78130e92..b039ef7eee 100644 --- a/Mage.Sets/src/mage/cards/g/GeistOfTheLonelyVigil.java +++ b/Mage.Sets/src/mage/cards/g/GeistOfTheLonelyVigil.java @@ -63,7 +63,7 @@ public class GeistOfTheLonelyVigil extends CardImpl { // Delirium — Geist of the Lonely Vigil can attack as though it didn't have defender as long as there are four or more card types among cards in your graveyard. Effect effect = new ConditionalAsThoughEffect( new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield), - DeliriumCondition.getInstance()); + DeliriumCondition.instance); effect.setText("Delirium - {this} can attack as though it didn't have defender as long as there are four or more card types among cards in your graveyard"); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); } diff --git a/Mage.Sets/src/mage/cards/g/GhalmasWarden.java b/Mage.Sets/src/mage/cards/g/GhalmasWarden.java index 36f58f3af1..a48fe4138b 100644 --- a/Mage.Sets/src/mage/cards/g/GhalmasWarden.java +++ b/Mage.Sets/src/mage/cards/g/GhalmasWarden.java @@ -57,7 +57,7 @@ public class GhalmasWarden extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(4); ContinuousEffect boostSource = new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield); - ConditionalContinuousEffect effect = new ConditionalContinuousEffect(boostSource, MetalcraftCondition.getInstance(), text); + ConditionalContinuousEffect effect = new ConditionalContinuousEffect(boostSource, MetalcraftCondition.instance, text); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); } diff --git a/Mage.Sets/src/mage/cards/g/GhostTown.java b/Mage.Sets/src/mage/cards/g/GhostTown.java index 7785824ae3..a3ef00aeb8 100644 --- a/Mage.Sets/src/mage/cards/g/GhostTown.java +++ b/Mage.Sets/src/mage/cards/g/GhostTown.java @@ -52,7 +52,7 @@ public class GhostTown extends CardImpl { this.addAbility(new ColorlessManaAbility()); // {0}: Return Ghost Town to its owner's hand. Activate this ability only if it's not your turn. - this.addAbility(new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), new GenericManaCost(0), new InvertCondition(MyTurnCondition.getInstance()))); + this.addAbility(new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), new GenericManaCost(0), new InvertCondition(MyTurnCondition.instance))); } public GhostTown(final GhostTown card) { diff --git a/Mage.Sets/src/mage/cards/g/GhosthelmCourier.java b/Mage.Sets/src/mage/cards/g/GhosthelmCourier.java index f02e32bbce..12a396b46e 100644 --- a/Mage.Sets/src/mage/cards/g/GhosthelmCourier.java +++ b/Mage.Sets/src/mage/cards/g/GhosthelmCourier.java @@ -71,10 +71,10 @@ public class GhosthelmCourier extends CardImpl { this.addAbility(new SkipUntapOptionalAbility()); // {2}{U}, {tap}: Target Wizard creature gets +2/+2 and has shroud for as long as Ghosthelm Courier remains tapped. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( - new BoostTargetEffect(2, 2, Duration.Custom), SourceTappedCondition.getInstance(), + new BoostTargetEffect(2, 2, Duration.Custom), SourceTappedCondition.instance, "target Wizard creature gets +2/+2"), new ManaCostsImpl("{2}{U}")); ability.addEffect(new ConditionalContinuousEffect(new GainAbilityTargetEffect(ShroudAbility.getInstance(), - Duration.Custom), SourceTappedCondition.getInstance(),"and has shroud for as long as {this} remains tapped")); + Duration.Custom), SourceTappedCondition.instance,"and has shroud for as long as {this} remains tapped")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/g/GiantTortoise.java b/Mage.Sets/src/mage/cards/g/GiantTortoise.java index 1c7b7b5743..88b3d5bffc 100644 --- a/Mage.Sets/src/mage/cards/g/GiantTortoise.java +++ b/Mage.Sets/src/mage/cards/g/GiantTortoise.java @@ -56,7 +56,7 @@ public class GiantTortoise extends CardImpl { // Giant Tortoise gets +0/+3 as long as it's untapped. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( new BoostSourceEffect(0,3, Duration.WhileOnBattlefield), - new InvertCondition(new SourceTappedCondition()), + new InvertCondition(SourceTappedCondition.instance), "{this} gets +0/+3 as long as it's untapped"))); } diff --git a/Mage.Sets/src/mage/cards/g/GibberingDescent.java b/Mage.Sets/src/mage/cards/g/GibberingDescent.java index 65af48fb09..a7676a3656 100644 --- a/Mage.Sets/src/mage/cards/g/GibberingDescent.java +++ b/Mage.Sets/src/mage/cards/g/GibberingDescent.java @@ -72,7 +72,7 @@ public class GibberingDescent extends CardImpl { // Hellbent - Skip your upkeep step if you have no cards in hand. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousRuleModifyingEffect( new GibberingDescentSkipUpkeepEffect(), - HellbentCondition.getInstance()))); + HellbentCondition.instance))); // Madness {2}{B}{B} this.addAbility(new MadnessAbility(this, new ManaCostsImpl<>("{2}{B}{B}"))); diff --git a/Mage.Sets/src/mage/cards/g/GibberingFiend.java b/Mage.Sets/src/mage/cards/g/GibberingFiend.java index 1c1c9f1325..1cc08becfc 100644 --- a/Mage.Sets/src/mage/cards/g/GibberingFiend.java +++ b/Mage.Sets/src/mage/cards/g/GibberingFiend.java @@ -60,7 +60,7 @@ public class GibberingFiend extends CardImpl { // Gibbering Fiend deals 1 damage to that player. this.addAbility(new ConditionalTriggeredAbility( new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), TargetController.OPPONENT, false, true), - DeliriumCondition.getInstance(), + DeliriumCondition.instance, "Delirium — At the beginning of each opponent's upkeep, if there are four or more card types among cards in your graveyard, " + "{this} deals 1 damage to that player.")); } diff --git a/Mage.Sets/src/mage/cards/g/GideonsPhalanx.java b/Mage.Sets/src/mage/cards/g/GideonsPhalanx.java index bf569c9787..3ed8c94bc0 100644 --- a/Mage.Sets/src/mage/cards/g/GideonsPhalanx.java +++ b/Mage.Sets/src/mage/cards/g/GideonsPhalanx.java @@ -57,7 +57,7 @@ public class GideonsPhalanx extends CardImpl { // Spell mastery - If there are two or more instant and/or sorcery cards in your graveyard, creatures you control gain indestructible until end of turn. Effect effect = new ConditionalOneShotEffect( new AddContinuousEffectToGame(new GainAbilityAllEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn, new FilterControlledCreaturePermanent())), - SpellMasteryCondition.getInstance(), + SpellMasteryCondition.instance, "
Spell mastery - If there are two or more instant and/or sorcery cards in your graveyard, creatures you control gain indestructible until end of turn"); this.getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/cards/g/Gigantiform.java b/Mage.Sets/src/mage/cards/g/Gigantiform.java index c8e6671d5d..68c12f6106 100644 --- a/Mage.Sets/src/mage/cards/g/Gigantiform.java +++ b/Mage.Sets/src/mage/cards/g/Gigantiform.java @@ -82,7 +82,7 @@ public class Gigantiform extends CardImpl { // When Gigantiform enters the battlefield, if it was kicked, you may search your library for a card named Gigantiform, put it onto the battlefield, then shuffle your library. this.addAbility(new ConditionalTriggeredAbility( new EntersBattlefieldTriggeredAbility(new GigantiformEffect(), true), - KickedCondition.getInstance(), + KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, you may search your library for a card named Gigantiform, put it onto the battlefield, then shuffle your library.")); } diff --git a/Mage.Sets/src/mage/cards/g/GladeWatcher.java b/Mage.Sets/src/mage/cards/g/GladeWatcher.java index 11899dec35..2657406267 100644 --- a/Mage.Sets/src/mage/cards/g/GladeWatcher.java +++ b/Mage.Sets/src/mage/cards/g/GladeWatcher.java @@ -61,7 +61,7 @@ public class GladeWatcher extends CardImpl { Zone.BATTLEFIELD, new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{G}"), - FormidableCondition.getInstance()); + FormidableCondition.instance); ability.setAbilityWord(AbilityWord.FORMIDABLE); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/g/GlenElendraPranksters.java b/Mage.Sets/src/mage/cards/g/GlenElendraPranksters.java index 1bb4d852ca..e7cfdfaa03 100644 --- a/Mage.Sets/src/mage/cards/g/GlenElendraPranksters.java +++ b/Mage.Sets/src/mage/cards/g/GlenElendraPranksters.java @@ -56,7 +56,7 @@ public class GlenElendraPranksters extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); // Whenever you cast a spell during an opponent's turn, you may return target creature you control to its owner's hand. - Ability ability = new ConditionalTriggeredAbility(new SpellCastControllerTriggeredAbility(new ReturnToHandTargetEffect(), true), OnOpponentsTurnCondition.getInstance(), + Ability ability = new ConditionalTriggeredAbility(new SpellCastControllerTriggeredAbility(new ReturnToHandTargetEffect(), true), OnOpponentsTurnCondition.instance, "Whenever you cast a spell during an opponent's turn, you may have target creature get -1/-1 until end of turn."); ability.addTarget(new TargetControlledCreaturePermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/g/GloryOfWarfare.java b/Mage.Sets/src/mage/cards/g/GloryOfWarfare.java index 0f584a5b54..54375c13c7 100644 --- a/Mage.Sets/src/mage/cards/g/GloryOfWarfare.java +++ b/Mage.Sets/src/mage/cards/g/GloryOfWarfare.java @@ -55,11 +55,11 @@ public class GloryOfWarfare extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( new BoostControlledEffect(2, 0, Duration.WhileOnBattlefield), - MyTurnCondition.getInstance(), + MyTurnCondition.instance, "As long as it's your turn, creatures you control get +2/+0"))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( new BoostControlledEffect(0, 2, Duration.WhileOnBattlefield), - NotMyTurnCondition.getInstance(), + NotMyTurnCondition.instance, "As long as it's not your turn, creatures you control get +0/+2"))); } diff --git a/Mage.Sets/src/mage/cards/g/GnarlwoodDryad.java b/Mage.Sets/src/mage/cards/g/GnarlwoodDryad.java index 79f92d175e..28b6619c96 100644 --- a/Mage.Sets/src/mage/cards/g/GnarlwoodDryad.java +++ b/Mage.Sets/src/mage/cards/g/GnarlwoodDryad.java @@ -59,7 +59,7 @@ public class GnarlwoodDryad extends CardImpl { // Delirium &mdash Gnarlwood Dryad gets +2/+2 as long as there are four or more card types among cards in your graveyard. ConditionalContinuousEffect effect = new ConditionalContinuousEffect( - new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), DeliriumCondition.getInstance(), + new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), DeliriumCondition.instance, "Delirium — {this} gets +2/+2 as long as there are four or more card types among cards in your graveyard."); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/g/GobhobblerRats.java b/Mage.Sets/src/mage/cards/g/GobhobblerRats.java index bc8d5b1c59..77333a1ba0 100644 --- a/Mage.Sets/src/mage/cards/g/GobhobblerRats.java +++ b/Mage.Sets/src/mage/cards/g/GobhobblerRats.java @@ -59,10 +59,10 @@ public class GobhobblerRats extends CardImpl { // Hellbent - As long as you have no cards in hand, Gobhobbler Rats gets +1/+0 and has "{B}: Regenerate Gobhobbler Rats." Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( - new BoostSourceEffect(1,0, Duration.WhileOnBattlefield), HellbentCondition.getInstance(), "Hellbent - As long as you have no cards in hand, {this} gets +1/+0")); + new BoostSourceEffect(1,0, Duration.WhileOnBattlefield), HellbentCondition.instance, "Hellbent - As long as you have no cards in hand, {this} gets +1/+0")); Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}")); ability.addEffect(new ConditionalContinuousEffect( - new GainAbilitySourceEffect(gainedAbility, Duration.WhileOnBattlefield), HellbentCondition.getInstance(), "and has \"{B}: Regenerate {this}.\"")); + new GainAbilitySourceEffect(gainedAbility, Duration.WhileOnBattlefield), HellbentCondition.instance, "and has \"{B}: Regenerate {this}.\"")); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/g/GoblinBushwhacker.java b/Mage.Sets/src/mage/cards/g/GoblinBushwhacker.java index a3f595886f..3efb2e8b43 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinBushwhacker.java +++ b/Mage.Sets/src/mage/cards/g/GoblinBushwhacker.java @@ -61,7 +61,7 @@ public class GoblinBushwhacker extends CardImpl { // When Goblin Bushwhacker enters the battlefield, if it was kicked, creatures you control get +1/+0 and gain haste until end of turn. EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new BoostControlledEffect(1, 0, Duration.EndOfTurn), false); ability.addEffect(new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.EndOfTurn)); - this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), "When {this} enters the battlefield, if it was kicked, creatures you control get +1/+0 and gain haste until end of turn.")); + this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, creatures you control get +1/+0 and gain haste until end of turn.")); } public GoblinBushwhacker(final GoblinBushwhacker card) { diff --git a/Mage.Sets/src/mage/cards/g/GoblinGloryChaser.java b/Mage.Sets/src/mage/cards/g/GoblinGloryChaser.java index f7b894c001..18891f770b 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinGloryChaser.java +++ b/Mage.Sets/src/mage/cards/g/GoblinGloryChaser.java @@ -62,7 +62,7 @@ public class GoblinGloryChaser extends CardImpl { // As long as Goblin Glory Chaser is renowned, it has menace. Effect effect = new ConditionalContinuousEffect( new GainAbilitySourceEffect(new MenaceAbility(), Duration.WhileOnBattlefield), - RenownedSourceCondition.getInstance(), + RenownedSourceCondition.instance, "As long as {this} is renowned, it has menace"); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/g/GoblinRuinblaster.java b/Mage.Sets/src/mage/cards/g/GoblinRuinblaster.java index a49871e9c4..51577ae0e7 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinRuinblaster.java +++ b/Mage.Sets/src/mage/cards/g/GoblinRuinblaster.java @@ -65,7 +65,7 @@ public class GoblinRuinblaster extends CardImpl { // When Goblin Ruinblaster enters the battlefield, if it was kicked, destroy target nonbasic land. EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false); ability.addTarget(new TargetNonBasicLandPermanent()); - this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), "When {this} enters the battlefield, if it was kicked, destroy target nonbasic land.")); + this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, destroy target nonbasic land.")); } public GoblinRuinblaster(final GoblinRuinblaster card) { diff --git a/Mage.Sets/src/mage/cards/g/GraveScrabbler.java b/Mage.Sets/src/mage/cards/g/GraveScrabbler.java index 0271e969d7..80cfba14ca 100644 --- a/Mage.Sets/src/mage/cards/g/GraveScrabbler.java +++ b/Mage.Sets/src/mage/cards/g/GraveScrabbler.java @@ -1,6 +1,7 @@ package mage.cards.g; import java.util.UUID; + import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbility; @@ -21,7 +22,7 @@ import mage.target.common.TargetCardInGraveyard; public class GraveScrabbler extends CardImpl { public GraveScrabbler(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}"); this.subtype.add("Zombie"); this.power = new MageInt(2); @@ -34,7 +35,7 @@ public class GraveScrabbler extends CardImpl { //you may return target creature card from a graveyard to its owner's hand. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), true); ability.addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card in a graveyard"))); - this.addAbility(new ConditionalTriggeredAbility(ability, MadnessPaidCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(ability, MadnessPaidCondition.instance, "When {this} enters the battlefield, if its madness cost was paid, you may return target creature card from a graveyard to its owner's hand.")); } @@ -49,19 +50,8 @@ public class GraveScrabbler extends CardImpl { } -class MadnessPaidCondition implements Condition { - - private static MadnessPaidCondition fInstance = null; - - private MadnessPaidCondition() { - } - - public static Condition getInstance() { - if (fInstance == null) { - fInstance = new MadnessPaidCondition(); - } - return fInstance; - } +enum MadnessPaidCondition implements Condition { + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage.Sets/src/mage/cards/g/GravetillerWurm.java b/Mage.Sets/src/mage/cards/g/GravetillerWurm.java index b5bf364d1b..2e2f0d3c3c 100644 --- a/Mage.Sets/src/mage/cards/g/GravetillerWurm.java +++ b/Mage.Sets/src/mage/cards/g/GravetillerWurm.java @@ -55,7 +55,7 @@ public class GravetillerWurm extends CardImpl { this.addAbility(TrampleAbility.getInstance()); // Morbid - Gravetiller Wurm enters the battlefield with four +1/+1 counters on it if a creature died this turn. this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance(4)), - MorbidCondition.getInstance(), ""), "with four +1/+1 counters on it if a creature died this turn")); + MorbidCondition.instance, ""), "with four +1/+1 counters on it if a creature died this turn")); } public GravetillerWurm(final GravetillerWurm card) { diff --git a/Mage.Sets/src/mage/cards/g/GreenwheelLiberator.java b/Mage.Sets/src/mage/cards/g/GreenwheelLiberator.java index 35bc6b1247..bb2cd8a5fe 100644 --- a/Mage.Sets/src/mage/cards/g/GreenwheelLiberator.java +++ b/Mage.Sets/src/mage/cards/g/GreenwheelLiberator.java @@ -57,7 +57,7 @@ public class GreenwheelLiberator extends CardImpl { // Revolt — Greenbelt Liberator enters the battlefield with two +1/+1 counters on it if a // permanent you controlled left the battlefield this turn. Ability ability = new EntersBattlefieldAbility( - new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), false, RevoltCondition.getInstance(), + new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), false, RevoltCondition.instance, "Revolt — enters the battlefield with two +1/+1 counters on it if a permanent you controlled left the battlefield this turn", null); ability.addWatcher(new RevoltWatcher()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/g/GrimFlayer.java b/Mage.Sets/src/mage/cards/g/GrimFlayer.java index ff9748c264..c72ef0bed1 100644 --- a/Mage.Sets/src/mage/cards/g/GrimFlayer.java +++ b/Mage.Sets/src/mage/cards/g/GrimFlayer.java @@ -71,7 +71,7 @@ public class GrimFlayer extends CardImpl { // Delirium — Grim Flayer gets +2/+2 as long as there are four or more card types among cards in your graveyard. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), - DeliriumCondition.getInstance(), + DeliriumCondition.instance, "Delirium — {this} gets +2/+2 as long as there are four or more card types among cards in your graveyard"))); } diff --git a/Mage.Sets/src/mage/cards/g/GrizzledOutcasts.java b/Mage.Sets/src/mage/cards/g/GrizzledOutcasts.java index fc0abe00ee..940fe85d5f 100644 --- a/Mage.Sets/src/mage/cards/g/GrizzledOutcasts.java +++ b/Mage.Sets/src/mage/cards/g/GrizzledOutcasts.java @@ -61,7 +61,7 @@ public class GrizzledOutcasts extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Grizzled Outcasts. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public GrizzledOutcasts(final GrizzledOutcasts card) { diff --git a/Mage.Sets/src/mage/cards/g/GruesomeDiscovery.java b/Mage.Sets/src/mage/cards/g/GruesomeDiscovery.java index a9a42e073f..d791fe8115 100644 --- a/Mage.Sets/src/mage/cards/g/GruesomeDiscovery.java +++ b/Mage.Sets/src/mage/cards/g/GruesomeDiscovery.java @@ -61,7 +61,7 @@ public class GruesomeDiscovery extends CardImpl { this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new GruesomeDiscoveryEffect(), new DiscardTargetEffect(2), - MorbidCondition.getInstance(), + MorbidCondition.instance, "Target player discards two cards. Morbid - If a creature died this turn, instead that player reveals his or her hand, you choose two cards from it, then that player discards those cards")); this.getSpellAbility().addTarget(new TargetPlayer()); } diff --git a/Mage.Sets/src/mage/cards/g/GuardianBeast.java b/Mage.Sets/src/mage/cards/g/GuardianBeast.java index f88cd0d8a5..4f30aae14c 100644 --- a/Mage.Sets/src/mage/cards/g/GuardianBeast.java +++ b/Mage.Sets/src/mage/cards/g/GuardianBeast.java @@ -79,7 +79,7 @@ public class GuardianBeast extends CardImpl { this.toughness = new MageInt(4); // As long as Guardian Beast is untapped, noncreature artifacts you control can't be enchanted, they're indestructible, and other players can't gain control of them. This effect doesn't remove Auras already attached to those artifacts. - Effect effect = new ConditionalContinuousEffect(new GainAbilityControlledEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield, filter), new InvertCondition(new SourceTappedCondition()), "noncreature artifacts you control can't be enchanted, they're indestructible, and other players can't gain control of them"); + Effect effect = new ConditionalContinuousEffect(new GainAbilityControlledEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield, filter), new InvertCondition(SourceTappedCondition.instance), "noncreature artifacts you control can't be enchanted, they're indestructible, and other players can't gain control of them"); GuardianBeastConditionalEffect effect2 = new GuardianBeastConditionalEffect(this.getId()); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect2)); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); diff --git a/Mage.Sets/src/mage/cards/g/GuulDrazSpecter.java b/Mage.Sets/src/mage/cards/g/GuulDrazSpecter.java index 45693e9dbd..45f08a5fcd 100644 --- a/Mage.Sets/src/mage/cards/g/GuulDrazSpecter.java +++ b/Mage.Sets/src/mage/cards/g/GuulDrazSpecter.java @@ -29,6 +29,7 @@ package mage.cards.g; import java.util.Set; import java.util.UUID; + import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Zone; @@ -46,7 +47,6 @@ import mage.cards.CardSetInfo; import mage.game.Game; /** - * * @author North */ public class GuulDrazSpecter extends CardImpl { @@ -54,7 +54,7 @@ public class GuulDrazSpecter extends CardImpl { private static final String ruleText = "{this} gets +3/+3 as long as an opponent has no cards in hand"; public GuulDrazSpecter(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); this.subtype.add("Specter"); this.color.setBlack(true); @@ -65,7 +65,7 @@ public class GuulDrazSpecter extends CardImpl { // Guul Draz Specter gets +3/+3 as long as an opponent has no cards in hand. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( new BoostSourceEffect(3, 3, Duration.WhileOnBattlefield), - new GuulDrazSpecterCondition(), + GuulDrazSpecterCondition.instance, ruleText))); // Whenever Guul Draz Specter deals combat damage to a player, that player discards a card. this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new DiscardTargetEffect(1), false, true)); @@ -81,7 +81,9 @@ public class GuulDrazSpecter extends CardImpl { } } -class GuulDrazSpecterCondition implements Condition { +enum GuulDrazSpecterCondition implements Condition { + + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage.Sets/src/mage/cards/g/GwendlynDiCorci.java b/Mage.Sets/src/mage/cards/g/GwendlynDiCorci.java index 4f1188c777..06869ed052 100644 --- a/Mage.Sets/src/mage/cards/g/GwendlynDiCorci.java +++ b/Mage.Sets/src/mage/cards/g/GwendlynDiCorci.java @@ -55,7 +55,7 @@ public class GwendlynDiCorci extends CardImpl { this.toughness = new MageInt(5); // {tap}: Target player discards a card at random. Activate this ability only during your turn. - Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new DiscardTargetEffect(1, true), new TapSourceCost(), MyTurnCondition.getInstance()); + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new DiscardTargetEffect(1, true), new TapSourceCost(), MyTurnCondition.instance); ability.addTarget(new TargetPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/h/HanweirWatchkeep.java b/Mage.Sets/src/mage/cards/h/HanweirWatchkeep.java index 3b2679c04a..fa222b22ce 100644 --- a/Mage.Sets/src/mage/cards/h/HanweirWatchkeep.java +++ b/Mage.Sets/src/mage/cards/h/HanweirWatchkeep.java @@ -64,7 +64,7 @@ public class HanweirWatchkeep extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Hanweir Watchkeep. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public HanweirWatchkeep(final HanweirWatchkeep card) { diff --git a/Mage.Sets/src/mage/cards/h/HauntingHymn.java b/Mage.Sets/src/mage/cards/h/HauntingHymn.java index 1766aeb6a2..20c25425b1 100644 --- a/Mage.Sets/src/mage/cards/h/HauntingHymn.java +++ b/Mage.Sets/src/mage/cards/h/HauntingHymn.java @@ -50,7 +50,7 @@ public class HauntingHymn extends CardImpl { this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DiscardTargetEffect(4), new DiscardTargetEffect(2), - MyMainPhaseCondition.getInstance(), + MyMainPhaseCondition.instance, "Target player discards two cards. If you cast this spell during your main phase, that player discards four cards instead")); this.getSpellAbility().addTarget(new TargetPlayer()); diff --git a/Mage.Sets/src/mage/cards/h/HeartstabberMosquito.java b/Mage.Sets/src/mage/cards/h/HeartstabberMosquito.java index 043c364434..85d89cbbd7 100644 --- a/Mage.Sets/src/mage/cards/h/HeartstabberMosquito.java +++ b/Mage.Sets/src/mage/cards/h/HeartstabberMosquito.java @@ -63,7 +63,7 @@ public class HeartstabberMosquito extends CardImpl { // When Heartstabber Mosquito enters the battlefield, if it was kicked, destroy target creature. EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false); ability.addTarget(new TargetCreaturePermanent()); - this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), "When {this} enters the battlefield, if it was kicked, destroy target creature.")); + this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, destroy target creature.")); } public HeartstabberMosquito(final HeartstabberMosquito card) { diff --git a/Mage.Sets/src/mage/cards/h/HeirOfTheWilds.java b/Mage.Sets/src/mage/cards/h/HeirOfTheWilds.java index a0b00a9c33..66c1b778a8 100644 --- a/Mage.Sets/src/mage/cards/h/HeirOfTheWilds.java +++ b/Mage.Sets/src/mage/cards/h/HeirOfTheWilds.java @@ -59,7 +59,7 @@ public class HeirOfTheWilds extends CardImpl { // Ferocious - Whenever Heir of the Wilds attacks, if you control a creature with power 4 or greater, Heir of the Wilds gets +1/+1 until end of turn. Ability ability = new ConditionalTriggeredAbility( new AttacksTriggeredAbility(new BoostSourceEffect(1,1,Duration.EndOfTurn), false), - FerociousCondition.getInstance(), + FerociousCondition.instance, "Ferocious - Whenever {this} attacks, if you control a creature with power 4 or greater, {this} gets +1/+1 until end of turn." ); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/h/HermitOfTheNatterknolls.java b/Mage.Sets/src/mage/cards/h/HermitOfTheNatterknolls.java index d2cdc0dbf7..bb45944d45 100644 --- a/Mage.Sets/src/mage/cards/h/HermitOfTheNatterknolls.java +++ b/Mage.Sets/src/mage/cards/h/HermitOfTheNatterknolls.java @@ -64,14 +64,14 @@ public class HermitOfTheNatterknolls extends CardImpl { // Whenever an opponent casts a spell during your turn, draw a card. this.addAbility(new ConditionalTriggeredAbility( new SpellCastOpponentTriggeredAbility(new DrawCardSourceControllerEffect(1), new FilterSpell("a spell"), true), - new MyTurnCondition(), + MyTurnCondition.instance, "Whenever an opponent casts a spell during your turn, draw a card." )); // At the beginning of each upkeep, if no spells were cast last turn, transform Hermit of the Natterknolls. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public HermitOfTheNatterknolls(final HermitOfTheNatterknolls card) { diff --git a/Mage.Sets/src/mage/cards/h/HiddenHerbalists.java b/Mage.Sets/src/mage/cards/h/HiddenHerbalists.java index b3aadebfae..c6f29e0b07 100644 --- a/Mage.Sets/src/mage/cards/h/HiddenHerbalists.java +++ b/Mage.Sets/src/mage/cards/h/HiddenHerbalists.java @@ -56,7 +56,7 @@ public class HiddenHerbalists extends CardImpl { // Revolt &mdash When Hidden Herbalists enters the battlefield, if a permanent you controlled left the battlefield this turn, add {G}{G} to your mana pool; this.addAbility( new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility( - new BasicManaEffect(Mana.GreenMana(2)), false), RevoltCondition.getInstance(), + new BasicManaEffect(Mana.GreenMana(2)), false), RevoltCondition.instance, "Revolt — When {this} enters the battlefield, if a permanent you controlled left" + " the battlefield this turn, add {G}{G} to your mana pool."), new RevoltWatcher() diff --git a/Mage.Sets/src/mage/cards/h/HiddenStockpile.java b/Mage.Sets/src/mage/cards/h/HiddenStockpile.java index c32e5240c3..61c7ea73da 100644 --- a/Mage.Sets/src/mage/cards/h/HiddenStockpile.java +++ b/Mage.Sets/src/mage/cards/h/HiddenStockpile.java @@ -57,7 +57,7 @@ public class HiddenStockpile extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{W}{B}"); // Revolt — At the beginning of your end step, if a permanent you controlled left the battlefield this turn, create a 1/1 colorless Servo artifact creature token. - Ability ability = new ConditionalTriggeredAbility(new BeginningOfYourEndStepTriggeredAbility(new CreateTokenEffect(new ServoToken()), false), RevoltCondition.getInstance(), + Ability ability = new ConditionalTriggeredAbility(new BeginningOfYourEndStepTriggeredAbility(new CreateTokenEffect(new ServoToken()), false), RevoltCondition.instance, "Revolt — At the beginning of your end step, if a permanent you controlled left the battlefield this turn, create a 1/1 colorless Servo artifact creature token"); ability.setAbilityWord(AbilityWord.REVOLT); ability.addWatcher(new RevoltWatcher()); diff --git a/Mage.Sets/src/mage/cards/h/HinterlandHermit.java b/Mage.Sets/src/mage/cards/h/HinterlandHermit.java index 01b0e6f8a4..e790f6302f 100644 --- a/Mage.Sets/src/mage/cards/h/HinterlandHermit.java +++ b/Mage.Sets/src/mage/cards/h/HinterlandHermit.java @@ -61,7 +61,7 @@ public class HinterlandHermit extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Hinterland Hermit. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public HinterlandHermit(final HinterlandHermit card) { diff --git a/Mage.Sets/src/mage/cards/h/HinterlandLogger.java b/Mage.Sets/src/mage/cards/h/HinterlandLogger.java index 272b9172ed..dc56ddfdf7 100644 --- a/Mage.Sets/src/mage/cards/h/HinterlandLogger.java +++ b/Mage.Sets/src/mage/cards/h/HinterlandLogger.java @@ -60,7 +60,7 @@ public class HinterlandLogger extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Hinterland Logger. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public HinterlandLogger(final HinterlandLogger card) { diff --git a/Mage.Sets/src/mage/cards/h/HinterlandScourge.java b/Mage.Sets/src/mage/cards/h/HinterlandScourge.java index 973f7e098d..bcbc63f107 100644 --- a/Mage.Sets/src/mage/cards/h/HinterlandScourge.java +++ b/Mage.Sets/src/mage/cards/h/HinterlandScourge.java @@ -67,7 +67,7 @@ public class HinterlandScourge extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Hinterland Scourge. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public HinterlandScourge(final HinterlandScourge card) { diff --git a/Mage.Sets/src/mage/cards/h/HollowTrees.java b/Mage.Sets/src/mage/cards/h/HollowTrees.java index 2efd45c6b6..fcece2c3c2 100644 --- a/Mage.Sets/src/mage/cards/h/HollowTrees.java +++ b/Mage.Sets/src/mage/cards/h/HollowTrees.java @@ -65,7 +65,7 @@ public class HollowTrees extends CardImpl { this.addAbility(new SkipUntapOptionalAbility()); // At the beginning of your upkeep, if Hollow Trees is tapped, put a storage counter on it. OneShotEffect addStorageCounter = new AddCountersSourceEffect(CounterType.STORAGE.createInstance()); - Effect effect = new ConditionalOneShotEffect(addStorageCounter, SourceTappedCondition.getInstance(), "if {this} is tapped, put a storage counter on it"); + Effect effect = new ConditionalOneShotEffect(addStorageCounter, SourceTappedCondition.instance, "if {this} is tapped, put a storage counter on it"); this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.YOU, false)); // {tap}, Remove any number of storage counters from Hollow Trees: Add {G} to your mana pool for each storage counter removed this way. Ability ability = new DynamicManaAbility( diff --git a/Mage.Sets/src/mage/cards/h/HollowhengeScavenger.java b/Mage.Sets/src/mage/cards/h/HollowhengeScavenger.java index 00ef26d9ed..3d22996805 100644 --- a/Mage.Sets/src/mage/cards/h/HollowhengeScavenger.java +++ b/Mage.Sets/src/mage/cards/h/HollowhengeScavenger.java @@ -56,7 +56,7 @@ public class HollowhengeScavenger extends CardImpl { // Morbid - When Hollowhenge Scavenger enters the battlefield, if a creature died this turn, you gain 5 life. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new GainLifeEffect(5)); - this.addAbility(new ConditionalTriggeredAbility(ability, MorbidCondition.getInstance(), staticText)); + this.addAbility(new ConditionalTriggeredAbility(ability, MorbidCondition.instance, staticText)); } public HollowhengeScavenger(final HollowhengeScavenger card) { diff --git a/Mage.Sets/src/mage/cards/h/HonoredHierarch.java b/Mage.Sets/src/mage/cards/h/HonoredHierarch.java index e4dbd843b2..ada60bb291 100644 --- a/Mage.Sets/src/mage/cards/h/HonoredHierarch.java +++ b/Mage.Sets/src/mage/cards/h/HonoredHierarch.java @@ -63,12 +63,12 @@ public class HonoredHierarch extends CardImpl { // As long as Honored Hierarch is renowned, it has vigilance and "{T}: Add one mana of any color to your mana pool." Effect effect = new ConditionalContinuousEffect( new GainAbilitySourceEffect(VigilanceAbility.getInstance(), Duration.WhileOnBattlefield), - RenownedSourceCondition.getInstance(), + RenownedSourceCondition.instance, "As long as {this} is renown, it has vigilance"); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); effect = new ConditionalContinuousEffect( new GainAbilitySourceEffect(new AnyColorManaAbility(), Duration.WhileOnBattlefield), - RenownedSourceCondition.getInstance(), + RenownedSourceCondition.instance, "and \"{T}: Add one mana of any color to your mana pool.\""); ability.addEffect(effect); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/h/HoofprintsOfTheStag.java b/Mage.Sets/src/mage/cards/h/HoofprintsOfTheStag.java index 12a94603b2..e4027aace8 100644 --- a/Mage.Sets/src/mage/cards/h/HoofprintsOfTheStag.java +++ b/Mage.Sets/src/mage/cards/h/HoofprintsOfTheStag.java @@ -58,7 +58,7 @@ public class HoofprintsOfTheStag extends CardImpl { // Whenever you draw a card, you may put a hoofprint counter on Hoofprints of the Stag. this.addAbility(new DrawCardControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.HOOFPRINT.createInstance(1)), true)); // {2}{w}, Remove four hoofprint counters from Hoofprints of the Stag: Create a 4/4 white Elemental creature token with flying. Activate this ability only during your turn. - Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new WhiteElementalToken(), 1), new ManaCostsImpl("{2}{W}"), MyTurnCondition.getInstance()); + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new WhiteElementalToken(), 1), new ManaCostsImpl("{2}{W}"), MyTurnCondition.instance); ability.addCost(new RemoveCountersSourceCost(CounterType.HOOFPRINT.createInstance(4))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/h/HoundOfTheFarbogs.java b/Mage.Sets/src/mage/cards/h/HoundOfTheFarbogs.java index 35abb80c62..c1ecf30c9b 100644 --- a/Mage.Sets/src/mage/cards/h/HoundOfTheFarbogs.java +++ b/Mage.Sets/src/mage/cards/h/HoundOfTheFarbogs.java @@ -59,7 +59,7 @@ public class HoundOfTheFarbogs extends CardImpl { // Delirium — Hound of the Farborgs has menace as long as there are four or more card types among cards in your graveyard. Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, - new ConditionalContinuousEffect(new GainAbilitySourceEffect(new MenaceAbility(), Duration.WhileOnBattlefield), new DeliriumCondition(), RULE)); + new ConditionalContinuousEffect(new GainAbilitySourceEffect(new MenaceAbility(), Duration.WhileOnBattlefield), DeliriumCondition.instance, RULE)); ability.setAbilityWord(AbilityWord.DELIRIUM); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/h/HowlOfTheHorde.java b/Mage.Sets/src/mage/cards/h/HowlOfTheHorde.java index 3f54681711..5dba37f4c3 100644 --- a/Mage.Sets/src/mage/cards/h/HowlOfTheHorde.java +++ b/Mage.Sets/src/mage/cards/h/HowlOfTheHorde.java @@ -60,7 +60,7 @@ public class HowlOfTheHorde extends CardImpl { this.getSpellAbility().addEffect(effect); // Raid - If you attacked with a creature this turn, when you cast your next instant or sorcery spell this turn, copy that spell an additional time. You may choose new targets for the copy. - this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new CreateDelayedTriggeredAbilityEffect(new HowlOfTheHordeDelayedTriggeredAbility()), RaidCondition.getInstance(), "

Raid - If you attacked with a creature this turn, when you cast your next instant or sorcery spell this turn, copy that spell an additional time. You may choose new targets for the copy.")); + this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new CreateDelayedTriggeredAbilityEffect(new HowlOfTheHordeDelayedTriggeredAbility()), RaidCondition.instance, "

Raid - If you attacked with a creature this turn, when you cast your next instant or sorcery spell this turn, copy that spell an additional time. You may choose new targets for the copy.")); this.getSpellAbility().addWatcher(new PlayerAttackedWatcher()); } diff --git a/Mage.Sets/src/mage/cards/h/HowlpackAlpha.java b/Mage.Sets/src/mage/cards/h/HowlpackAlpha.java index f62ebd571e..453ede1fdd 100644 --- a/Mage.Sets/src/mage/cards/h/HowlpackAlpha.java +++ b/Mage.Sets/src/mage/cards/h/HowlpackAlpha.java @@ -86,7 +86,7 @@ public class HowlpackAlpha extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Howlpack Alpha. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public HowlpackAlpha(final HowlpackAlpha card) { diff --git a/Mage.Sets/src/mage/cards/h/HowlpackOfEstwald.java b/Mage.Sets/src/mage/cards/h/HowlpackOfEstwald.java index 8a4dc3ddd0..bef4280b92 100644 --- a/Mage.Sets/src/mage/cards/h/HowlpackOfEstwald.java +++ b/Mage.Sets/src/mage/cards/h/HowlpackOfEstwald.java @@ -60,7 +60,7 @@ public class HowlpackOfEstwald extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Howlpack of Estwald. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public HowlpackOfEstwald(final HowlpackOfEstwald card) { diff --git a/Mage.Sets/src/mage/cards/h/HumbleDefector.java b/Mage.Sets/src/mage/cards/h/HumbleDefector.java index 9bf9ddd629..3f716ac0b2 100644 --- a/Mage.Sets/src/mage/cards/h/HumbleDefector.java +++ b/Mage.Sets/src/mage/cards/h/HumbleDefector.java @@ -63,7 +63,7 @@ public class HumbleDefector extends CardImpl { this.toughness = new MageInt(1); // {T}: Draw two cards. Target opponent gains control of Humble Defector. Activate this ability only during your turn. - Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new HumbleDefectorEffect(), new TapSourceCost(), MyTurnCondition.getInstance()); + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new HumbleDefectorEffect(), new TapSourceCost(), MyTurnCondition.instance); ability.addTarget(new TargetOpponent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/h/HundredHandedOne.java b/Mage.Sets/src/mage/cards/h/HundredHandedOne.java index 38db0393be..8b41af1bbc 100644 --- a/Mage.Sets/src/mage/cards/h/HundredHandedOne.java +++ b/Mage.Sets/src/mage/cards/h/HundredHandedOne.java @@ -66,11 +66,11 @@ public class HundredHandedOne extends CardImpl { // As long as Hundred-Handed One is monstrous, it has reach and can block an additional ninety-nine creatures each combat. ConditionalContinuousEffect effect1 = new ConditionalContinuousEffect( new GainAbilitySourceEffect(ReachAbility.getInstance(), Duration.WhileOnBattlefield), - MonstrousCondition.getInstance(), + MonstrousCondition.instance, "As long as Hundred-Handed One is monstrous, it has reach"); ConditionalContinuousEffect effect2 = new ConditionalContinuousEffect( new CanBlockAdditionalCreatureEffect(99), - MonstrousCondition.getInstance(), + MonstrousCondition.instance, "and can block an additional ninety-nine creatures each combat"); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect1); ability.addEffect(effect2); diff --git a/Mage.Sets/src/mage/cards/h/HungerOfTheHowlpack.java b/Mage.Sets/src/mage/cards/h/HungerOfTheHowlpack.java index 9efd65cb6e..94e3019095 100644 --- a/Mage.Sets/src/mage/cards/h/HungerOfTheHowlpack.java +++ b/Mage.Sets/src/mage/cards/h/HungerOfTheHowlpack.java @@ -53,7 +53,7 @@ public class HungerOfTheHowlpack extends CardImpl { new ConditionalOneShotEffect( new AddCountersTargetEffect(CounterType.P1P1.createInstance(3)), new AddCountersTargetEffect(CounterType.P1P1.createInstance()), - MorbidCondition.getInstance(), + MorbidCondition.instance, "Put a +1/+1 counter on target creature. Morbid - Put three +1/+1 counters on that creature instead if a creature died this turn")); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/cards/h/HuntingWilds.java b/Mage.Sets/src/mage/cards/h/HuntingWilds.java index 96d8aa22a1..5454307b3b 100644 --- a/Mage.Sets/src/mage/cards/h/HuntingWilds.java +++ b/Mage.Sets/src/mage/cards/h/HuntingWilds.java @@ -73,7 +73,7 @@ public class HuntingWilds extends CardImpl { // If Hunting Wilds was kicked, untap all Forests put onto the battlefield this way. // They become 3/3 green creatures with haste that are still lands. - this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new HuntingWildsEffect(), KickedCondition.getInstance())); + this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new HuntingWildsEffect(), KickedCondition.instance)); } public HuntingWilds(final HuntingWilds card) { diff --git a/Mage.Sets/src/mage/cards/h/HuntmasterOfTheFells.java b/Mage.Sets/src/mage/cards/h/HuntmasterOfTheFells.java index f9a81f1234..b3476597cf 100644 --- a/Mage.Sets/src/mage/cards/h/HuntmasterOfTheFells.java +++ b/Mage.Sets/src/mage/cards/h/HuntmasterOfTheFells.java @@ -70,7 +70,7 @@ public class HuntmasterOfTheFells extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Huntmaster of the Fells. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public HuntmasterOfTheFells(final HuntmasterOfTheFells card) { diff --git a/Mage.Sets/src/mage/cards/h/HypnoticCloud.java b/Mage.Sets/src/mage/cards/h/HypnoticCloud.java index 4df5794f3a..23dabed145 100644 --- a/Mage.Sets/src/mage/cards/h/HypnoticCloud.java +++ b/Mage.Sets/src/mage/cards/h/HypnoticCloud.java @@ -52,7 +52,7 @@ public class HypnoticCloud extends CardImpl { // Target player discards a card. If Hypnotic Cloud was kicked, that player discards three cards instead. this.getSpellAbility().addTarget(new TargetPlayer()); - this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new DiscardTargetEffect(3), new DiscardTargetEffect(1), KickedCondition.getInstance(), + this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new DiscardTargetEffect(3), new DiscardTargetEffect(1), KickedCondition.instance, "Target player discards a card. If {this} was kicked, that player discards three cards instead")); } diff --git a/Mage.Sets/src/mage/cards/i/IcatianStore.java b/Mage.Sets/src/mage/cards/i/IcatianStore.java index 3c97821042..821e4edabb 100644 --- a/Mage.Sets/src/mage/cards/i/IcatianStore.java +++ b/Mage.Sets/src/mage/cards/i/IcatianStore.java @@ -65,7 +65,7 @@ public class IcatianStore extends CardImpl { this.addAbility(new SkipUntapOptionalAbility()); // At the beginning of your upkeep, if Icatian Store is tapped, put a storage counter on it. OneShotEffect addStorageCounter = new AddCountersSourceEffect(CounterType.STORAGE.createInstance()); - Effect effect = new ConditionalOneShotEffect(addStorageCounter, SourceTappedCondition.getInstance(), "if {this} is tapped, put a storage counter on it"); + Effect effect = new ConditionalOneShotEffect(addStorageCounter, SourceTappedCondition.instance, "if {this} is tapped, put a storage counter on it"); this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.YOU, false)); // {tap}, Remove any number of storage counters from Icatian Store: Add {W} to your mana pool for each storage counter removed this way. Ability ability = new DynamicManaAbility( diff --git a/Mage.Sets/src/mage/cards/i/IcyBlast.java b/Mage.Sets/src/mage/cards/i/IcyBlast.java index c56279915f..00bf7a9d4f 100644 --- a/Mage.Sets/src/mage/cards/i/IcyBlast.java +++ b/Mage.Sets/src/mage/cards/i/IcyBlast.java @@ -60,7 +60,7 @@ public class IcyBlast extends CardImpl { // Ferocious - If you control a creature with power 4 or greater, those creatures don't untap during their controllers' next untap steps. Effect effect = new ConditionalContinuousRuleModifyingEffect( new DontUntapInControllersNextUntapStepTargetEffect(), - new LockedInCondition(FerociousCondition.getInstance())); + new LockedInCondition(FerociousCondition.instance)); effect.setText("
Ferocious — If you control a creature with power 4 or greater, those creatures don't untap during their controllers' next untap steps"); this.getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/cards/i/IllusionistsGambit.java b/Mage.Sets/src/mage/cards/i/IllusionistsGambit.java index be4f10b277..bf08eab326 100644 --- a/Mage.Sets/src/mage/cards/i/IllusionistsGambit.java +++ b/Mage.Sets/src/mage/cards/i/IllusionistsGambit.java @@ -59,7 +59,7 @@ public class IllusionistsGambit extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{U}{U}"); // Cast Illusionist's Gambit only during the declare blockers step on an opponent's turn. - this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(PhaseStep.DECLARE_BLOCKERS, OnOpponentsTurnCondition.getInstance())); + this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(PhaseStep.DECLARE_BLOCKERS, OnOpponentsTurnCondition.instance)); // Remove all attacking creatures from combat and untap them. After this phase, there is an additional combat phase. Each of those creatures attacks that combat if able. They can't attack you or a planeswalker you control that combat. this.getSpellAbility().addEffect(new IllusionistsGambitRemoveFromCombatEffect()); diff --git a/Mage.Sets/src/mage/cards/i/ImpactResonance.java b/Mage.Sets/src/mage/cards/i/ImpactResonance.java index dda23398e3..2ee8511465 100644 --- a/Mage.Sets/src/mage/cards/i/ImpactResonance.java +++ b/Mage.Sets/src/mage/cards/i/ImpactResonance.java @@ -54,7 +54,7 @@ public class ImpactResonance extends CardImpl { // Impact Resonance deals X damage divided as you choose among any number of target creatures, where X is the greatest amount of damage dealt by a source to a permanent or player this turn. - DynamicValue xValue = new GreatestAmountOfDamageDealtValue(); + DynamicValue xValue = GreatestAmountOfDamageDealtValue.instance; Effect effect = new DamageMultiEffect(xValue); effect.setText("{this} deals X damage divided as you choose among any number of target creatures, where X is the greatest amount of damage dealt by a source to a permanent or player this turn"); this.getSpellAbility().addEffect(effect); @@ -73,17 +73,14 @@ public class ImpactResonance extends CardImpl { } -class GreatestAmountOfDamageDealtValue implements DynamicValue, MageSingleton { +enum GreatestAmountOfDamageDealtValue implements DynamicValue, MageSingleton { - private static final GreatestAmountOfDamageDealtValue fINSTANCE = new GreatestAmountOfDamageDealtValue(); + instance; private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } - public static GreatestAmountOfDamageDealtValue getInstance() { - return fINSTANCE; - } @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { @@ -100,7 +97,7 @@ class GreatestAmountOfDamageDealtValue implements DynamicValue, MageSingleton { @Override public DynamicValue copy() { - return new GreatestAmountOfDamageDealtValue(); + return this; } @Override diff --git a/Mage.Sets/src/mage/cards/i/IndomitableArchangel.java b/Mage.Sets/src/mage/cards/i/IndomitableArchangel.java index e1a15d82a3..0826fcdf0a 100644 --- a/Mage.Sets/src/mage/cards/i/IndomitableArchangel.java +++ b/Mage.Sets/src/mage/cards/i/IndomitableArchangel.java @@ -67,7 +67,7 @@ public class IndomitableArchangel extends CardImpl { this.toughness = new MageInt(4); this.addAbility(FlyingAbility.getInstance()); ContinuousEffect gainAbilityEffect = new GainAbilityControlledEffect(ShroudAbility.getInstance(), Duration.WhileOnBattlefield, filter); - ConditionalContinuousEffect effect = new ConditionalContinuousEffect(gainAbilityEffect, MetalcraftCondition.getInstance(), rule); + ConditionalContinuousEffect effect = new ConditionalContinuousEffect(gainAbilityEffect, MetalcraftCondition.instance, rule); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); } diff --git a/Mage.Sets/src/mage/cards/i/InexorableBlob.java b/Mage.Sets/src/mage/cards/i/InexorableBlob.java index b17f1f67da..54db08b2cb 100644 --- a/Mage.Sets/src/mage/cards/i/InexorableBlob.java +++ b/Mage.Sets/src/mage/cards/i/InexorableBlob.java @@ -53,7 +53,7 @@ public class InexorableBlob extends CardImpl { // Delirium — Whenever Inexorable Blob attacks and there are at least four card types among cards in your graveyard, // create a 3/3 green Ooze creature token tapped and attacking. this.addAbility(new ConditionalTriggeredAbility(new AttacksTriggeredAbility(new CreateTokenEffect(new OozeToken(3, 3), 1, true, true), false), - DeliriumCondition.getInstance(), + DeliriumCondition.instance, "Delirium — Whenever {this} attacks and there are at least four card types among cards in your graveyard, " + "create a 3/3 green Ooze creature token tapped and attacking.")); } diff --git a/Mage.Sets/src/mage/cards/i/InfernalTutor.java b/Mage.Sets/src/mage/cards/i/InfernalTutor.java index 070aae33cb..30ea02ca2b 100644 --- a/Mage.Sets/src/mage/cards/i/InfernalTutor.java +++ b/Mage.Sets/src/mage/cards/i/InfernalTutor.java @@ -64,7 +64,7 @@ public class InfernalTutor extends CardImpl { // Hellbent - If you have no cards in hand, instead search your library for a card, put it into your hand, then shuffle your library. Effect effect = new ConditionalOneShotEffect( new SearchLibraryPutInHandEffect(new TargetCardInLibrary(new FilterCard()), false, true), - HellbentCondition.getInstance(), + HellbentCondition.instance, "

Hellbent - If you have no cards in hand, instead search your library for a card, put it into your hand, then shuffle your library"); this.getSpellAbility().addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/i/InfernoTrap.java b/Mage.Sets/src/mage/cards/i/InfernoTrap.java index 60f6cf0031..35af6a6bf0 100644 --- a/Mage.Sets/src/mage/cards/i/InfernoTrap.java +++ b/Mage.Sets/src/mage/cards/i/InfernoTrap.java @@ -78,10 +78,10 @@ public class InfernoTrap extends CardImpl { class InfernoTrapCondition implements Condition { - private static final InfernoTrapCondition fInstance = new InfernoTrapCondition(); + private static final InfernoTrapCondition instance = new InfernoTrapCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/i/InquisitorsOx.java b/Mage.Sets/src/mage/cards/i/InquisitorsOx.java index 800da6463c..e3f2f4bb21 100644 --- a/Mage.Sets/src/mage/cards/i/InquisitorsOx.java +++ b/Mage.Sets/src/mage/cards/i/InquisitorsOx.java @@ -56,9 +56,9 @@ public class InquisitorsOx extends CardImpl { this.color.setWhite(true); // Delirium — Inquisitor's Ox gets +1/+0 and has vigilance as long as there are four or more card types among cards in your graveyard. - ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new BoostSourceEffect(1, 0, Duration.WhileOnBattlefield), DeliriumCondition.getInstance(), "Delirium — {this} gets +1/+0"); + ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new BoostSourceEffect(1, 0, Duration.WhileOnBattlefield), DeliriumCondition.instance, "Delirium — {this} gets +1/+0"); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); - ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(VigilanceAbility.getInstance()), DeliriumCondition.getInstance(), "and has vigilance as long as there are four or more card types among cards in your graveyard.")); + ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(VigilanceAbility.getInstance()), DeliriumCondition.instance, "and has vigilance as long as there are four or more card types among cards in your graveyard.")); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/i/InstigatorGang.java b/Mage.Sets/src/mage/cards/i/InstigatorGang.java index c995002d8e..b1fcf7fcd7 100644 --- a/Mage.Sets/src/mage/cards/i/InstigatorGang.java +++ b/Mage.Sets/src/mage/cards/i/InstigatorGang.java @@ -71,7 +71,7 @@ public class InstigatorGang extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Instigator Gang. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public InstigatorGang(final InstigatorGang card) { diff --git a/Mage.Sets/src/mage/cards/i/InstillEnergy.java b/Mage.Sets/src/mage/cards/i/InstillEnergy.java index a00bb20eee..d89c08b54b 100644 --- a/Mage.Sets/src/mage/cards/i/InstillEnergy.java +++ b/Mage.Sets/src/mage/cards/i/InstillEnergy.java @@ -72,7 +72,7 @@ public class InstillEnergy extends CardImpl { Ability haste = new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(asThough, AttachmentType.AURA, Duration.WhileOnBattlefield, "Enchanted creature can attack as though it had haste.")); this.addAbility(haste); // {0}: Untap enchanted creature. Activate this ability only during your turn and only once each turn. - this.addAbility(new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new UntapEnchantedEffect(), new GenericManaCost(0), 1, MyTurnCondition.getInstance())); + this.addAbility(new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new UntapEnchantedEffect(), new GenericManaCost(0), 1, MyTurnCondition.instance)); } public InstillEnergy(final InstillEnergy card) { diff --git a/Mage.Sets/src/mage/cards/i/IntoTheRoil.java b/Mage.Sets/src/mage/cards/i/IntoTheRoil.java index c33056b0e6..6daee376e8 100644 --- a/Mage.Sets/src/mage/cards/i/IntoTheRoil.java +++ b/Mage.Sets/src/mage/cards/i/IntoTheRoil.java @@ -56,7 +56,7 @@ public class IntoTheRoil extends CardImpl { this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DrawCardSourceControllerEffect(1), - KickedCondition.getInstance(), + KickedCondition.instance, "If {this} was kicked, draw a card")); this.getSpellAbility().addTarget(new TargetNonlandPermanent()); } diff --git a/Mage.Sets/src/mage/cards/i/InvasiveSurgery.java b/Mage.Sets/src/mage/cards/i/InvasiveSurgery.java index 6d1542733d..74e9531112 100644 --- a/Mage.Sets/src/mage/cards/i/InvasiveSurgery.java +++ b/Mage.Sets/src/mage/cards/i/InvasiveSurgery.java @@ -113,7 +113,7 @@ class InvasiveSurgeryEffect extends SearchTargetGraveyardHandLibraryForCardNameA } // Check the Delirium condition - if (!DeliriumCondition.getInstance().apply(game, source)) { + if (!DeliriumCondition.instance.apply(game, source)) { return true; } return this.applySearchAndExile(game, source, cardName, spellController); diff --git a/Mage.Sets/src/mage/cards/i/InventorsFair.java b/Mage.Sets/src/mage/cards/i/InventorsFair.java index 14223b78e8..7d0fd29665 100644 --- a/Mage.Sets/src/mage/cards/i/InventorsFair.java +++ b/Mage.Sets/src/mage/cards/i/InventorsFair.java @@ -75,7 +75,7 @@ public class InventorsFair extends CardImpl { // {4}, {T}, Sacrifice Inventors' Fair: Search your library for an artifact card, reveal it, put it into your hand, then shuffle your library. // Activate this ability only if you control threeor more artifacts. Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInHandEffect(new TargetCardInLibrary(1, filter), true), - new GenericManaCost(4), MetalcraftCondition.getInstance()); + new GenericManaCost(4), MetalcraftCondition.instance); ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/i/IronFistOfTheEmpire.java b/Mage.Sets/src/mage/cards/i/IronFistOfTheEmpire.java index 98bcf39afb..991b088e0d 100644 --- a/Mage.Sets/src/mage/cards/i/IronFistOfTheEmpire.java +++ b/Mage.Sets/src/mage/cards/i/IronFistOfTheEmpire.java @@ -57,7 +57,7 @@ public class IronFistOfTheEmpire extends CardImpl { triggeredAbility.addEffect(new CreateTokenEffect(new RoyalGuardToken())); Ability ability = new ConditionalTriggeredAbility( triggeredAbility, - HateCondition.getInstance(), + HateCondition.instance, "Hate — At the beggining of each end step, if opponent lost life from a source other than combat damage this turn, you gain 1 life and create a 2/2 red Soldier creature token with first strike named Royal Guard."); this.addAbility(ability, new LifeLossOtherFromCombatWatcher()); } diff --git a/Mage.Sets/src/mage/cards/i/Ironfang.java b/Mage.Sets/src/mage/cards/i/Ironfang.java index 5ca2e8afe6..cd74c1b8dd 100644 --- a/Mage.Sets/src/mage/cards/i/Ironfang.java +++ b/Mage.Sets/src/mage/cards/i/Ironfang.java @@ -63,7 +63,7 @@ public class Ironfang extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Ironfang. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public Ironfang(final Ironfang card) { diff --git a/Mage.Sets/src/mage/cards/i/IshkanahGrafwidow.java b/Mage.Sets/src/mage/cards/i/IshkanahGrafwidow.java index 244d68f93f..648acec363 100644 --- a/Mage.Sets/src/mage/cards/i/IshkanahGrafwidow.java +++ b/Mage.Sets/src/mage/cards/i/IshkanahGrafwidow.java @@ -74,7 +74,7 @@ public class IshkanahGrafwidow extends CardImpl { // create three 1/2 green Spider creature tokens with reach. Ability ability = new ConditionalTriggeredAbility( new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new SpiderToken(), 3), false), - new DeliriumCondition(), + DeliriumCondition.instance, "Delirium — When {this} enters the battlefield, if there are four or more card types among cards in your graveyard, " + "create three 1/2 green Spider creature tokens with reach."); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/j/JandorsRing.java b/Mage.Sets/src/mage/cards/j/JandorsRing.java index 0ca38945de..e6a272225e 100644 --- a/Mage.Sets/src/mage/cards/j/JandorsRing.java +++ b/Mage.Sets/src/mage/cards/j/JandorsRing.java @@ -147,10 +147,10 @@ class JandorsRingWatcher extends Watcher { class WatchedCardInHandCondition implements Condition { - private static final WatchedCardInHandCondition fInstance = new WatchedCardInHandCondition(); + private static final WatchedCardInHandCondition instance = new WatchedCardInHandCondition(); public static WatchedCardInHandCondition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/j/JeeringInstigator.java b/Mage.Sets/src/mage/cards/j/JeeringInstigator.java index 3f95591d29..94b56fbabd 100644 --- a/Mage.Sets/src/mage/cards/j/JeeringInstigator.java +++ b/Mage.Sets/src/mage/cards/j/JeeringInstigator.java @@ -73,7 +73,7 @@ public class JeeringInstigator extends CardImpl { // When Jeering Instigator is turned face up, if it's your turn, gain control of another target creature until end of turn. Untap it. That creature gains haste until end of turn. Ability ability = new ConditionalTriggeredAbility( new TurnedFaceUpSourceTriggeredAbility(new GainControlTargetEffect(Duration.EndOfTurn),false, false), - MyTurnCondition.getInstance(), + MyTurnCondition.instance, "When {this} is turned face up, if it's your turn, gain control of another target creature until end of turn. Untap that creature. It gains haste until end of turn."); ability.setWorksFaceDown(true); Effect effect = new UntapTargetEffect(); diff --git a/Mage.Sets/src/mage/cards/j/Jilt.java b/Mage.Sets/src/mage/cards/j/Jilt.java index 60f475ca31..799208d43d 100644 --- a/Mage.Sets/src/mage/cards/j/Jilt.java +++ b/Mage.Sets/src/mage/cards/j/Jilt.java @@ -62,7 +62,7 @@ public class Jilt extends CardImpl { this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); Effect effect = new ConditionalOneShotEffect( new DamageTargetEffect(2), - KickedCondition.getInstance(), + KickedCondition.instance, "If {this} was kicked, it deals 2 damage to another target creature"); effect.setTargetPointer(new SecondTargetPointer()); this.getSpellAbility().addEffect(effect); @@ -73,7 +73,7 @@ public class Jilt extends CardImpl { @Override public void adjustTargets(Ability ability, Game game) { - if (ability instanceof SpellAbility && KickedCondition.getInstance().apply(game, ability)) { + if (ability instanceof SpellAbility && KickedCondition.instance.apply(game, ability)) { FilterCreaturePermanent filter = new FilterCreaturePermanent("Another creature: Damaged"); filter.add(new AnotherTargetPredicate(2)); Target target = new TargetCreaturePermanent(filter); diff --git a/Mage.Sets/src/mage/cards/j/JorKadeenThePrevailer.java b/Mage.Sets/src/mage/cards/j/JorKadeenThePrevailer.java index 97115d182e..bdf8083a41 100644 --- a/Mage.Sets/src/mage/cards/j/JorKadeenThePrevailer.java +++ b/Mage.Sets/src/mage/cards/j/JorKadeenThePrevailer.java @@ -63,7 +63,7 @@ public class JorKadeenThePrevailer extends CardImpl { // Metalcraft - Creatures you control get +3/+0 as long as you control three or more artifacts. ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new BoostControlledEffect(3, 0, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false), - MetalcraftCondition.getInstance(), effectText); + MetalcraftCondition.instance, effectText); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); } diff --git a/Mage.Sets/src/mage/cards/j/JuniperOrderAdvocate.java b/Mage.Sets/src/mage/cards/j/JuniperOrderAdvocate.java index 6ba6d843de..213cba387e 100644 --- a/Mage.Sets/src/mage/cards/j/JuniperOrderAdvocate.java +++ b/Mage.Sets/src/mage/cards/j/JuniperOrderAdvocate.java @@ -68,7 +68,7 @@ public class JuniperOrderAdvocate extends CardImpl { // As long as Juniper Order Advocate is untapped, green creatures you control get +1/+1. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, false), - new InvertCondition(new SourceTappedCondition()), + new InvertCondition(SourceTappedCondition.instance), "As long as {this} is untapped, green creatures you control get +1/+1."))); } diff --git a/Mage.Sets/src/mage/cards/k/KangeeAerieKeeper.java b/Mage.Sets/src/mage/cards/k/KangeeAerieKeeper.java index f257303cb8..344d6975a0 100644 --- a/Mage.Sets/src/mage/cards/k/KangeeAerieKeeper.java +++ b/Mage.Sets/src/mage/cards/k/KangeeAerieKeeper.java @@ -84,7 +84,7 @@ public class KangeeAerieKeeper extends CardImpl { // When Kangee, Aerie Keeper enters the battlefield, if it was kicked, put X feather counters on it. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new AddCountersSourceEffect(CounterType.FEATHER.createInstance(), new KangeeAerieKeeperGetKickerXValue(), true)); - this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), "When {this} enters the battlefield, if it was kicked, put X feather counters on it.")); + this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, put X feather counters on it.")); // Other Bird creatures get +1/+1 for each feather counter on Kangee, Aerie Keeper. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(new CountersSourceCount(CounterType.FEATHER), new CountersSourceCount(CounterType.FEATHER), Duration.WhileOnBattlefield, filter, true, "Other Bird creatures get +1/+1 for each feather counter on {this}."))); diff --git a/Mage.Sets/src/mage/cards/k/KavuAggressor.java b/Mage.Sets/src/mage/cards/k/KavuAggressor.java index 1a1ea275db..73544bb651 100644 --- a/Mage.Sets/src/mage/cards/k/KavuAggressor.java +++ b/Mage.Sets/src/mage/cards/k/KavuAggressor.java @@ -58,7 +58,7 @@ public class KavuAggressor extends CardImpl { this.addAbility(new CantBlockAbility()); // If Kavu Aggressor was kicked, it enters the battlefield with a +1/+1 counter on it. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), - KickedCondition.getInstance(), "If {this} was kicked, it enters the battlefield with a +1/+1 counter on it.", "")); + KickedCondition.instance, "If {this} was kicked, it enters the battlefield with a +1/+1 counter on it.", "")); } public KavuAggressor(final KavuAggressor card) { diff --git a/Mage.Sets/src/mage/cards/k/KavuPrimarch.java b/Mage.Sets/src/mage/cards/k/KavuPrimarch.java index 5721d5ddf5..83710a9191 100644 --- a/Mage.Sets/src/mage/cards/k/KavuPrimarch.java +++ b/Mage.Sets/src/mage/cards/k/KavuPrimarch.java @@ -60,7 +60,7 @@ public class KavuPrimarch extends CardImpl { // If Kavu Primarch was kicked, it enters the battlefield with four +1/+1 counters on it. - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(4)),KickedCondition.getInstance(), + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(4)),KickedCondition.instance, "If Kavu Primarch was kicked, it enters the battlefield with four +1/+1 counters on it.", "")); } diff --git a/Mage.Sets/src/mage/cards/k/KavuTitan.java b/Mage.Sets/src/mage/cards/k/KavuTitan.java index 741fa88fdc..77cc7e0701 100644 --- a/Mage.Sets/src/mage/cards/k/KavuTitan.java +++ b/Mage.Sets/src/mage/cards/k/KavuTitan.java @@ -59,7 +59,7 @@ public class KavuTitan extends CardImpl { this.addAbility(new KickerAbility("{2}{G}")); // If Kavu Titan was kicked, it enters the battlefield with three +1/+1 counters on it and with trample. Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)), - KickedCondition.getInstance(), + KickedCondition.instance, "If Kavu Titan was kicked, it enters the battlefield with three +1/+1 counters on it and with trample.", ""); ability.addEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/k/KeldonMegaliths.java b/Mage.Sets/src/mage/cards/k/KeldonMegaliths.java index ce6ccc8f3b..8dc487e1f1 100644 --- a/Mage.Sets/src/mage/cards/k/KeldonMegaliths.java +++ b/Mage.Sets/src/mage/cards/k/KeldonMegaliths.java @@ -55,7 +55,7 @@ public class KeldonMegaliths extends CardImpl { // {tap}: Add {R} to your mana pool. this.addAbility(new RedManaAbility()); // Hellbent - {1}{R}, {tap}: Keldon Megaliths deals 1 damage to target creature or player. Activate this ability only if you have no cards in hand. - Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl<>("{1}{R}"), HellbentCondition.getInstance(), + Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl<>("{1}{R}"), HellbentCondition.instance, "Hellbent — {1}{R}, {T}: {this} deals 1 damage to target creature or player. Activate this ability only if you have no cards in hand."); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/k/KentaroTheSmilingCat.java b/Mage.Sets/src/mage/cards/k/KentaroTheSmilingCat.java index 2c2db3191d..27b9d5e4d6 100644 --- a/Mage.Sets/src/mage/cards/k/KentaroTheSmilingCat.java +++ b/Mage.Sets/src/mage/cards/k/KentaroTheSmilingCat.java @@ -94,7 +94,7 @@ class KentaroTheSmilingCatCastingEffect extends ContinuousEffectImpl { } static final AlternativeCostSourceAbility alternativeCastingCostAbility = new AlternativeCostSourceAbility( - SourceIsSpellCondition.getInstance(), null, filterSamurai, true, new ColorlessConvertedManaCost()); + SourceIsSpellCondition.instance, null, filterSamurai, true, new ColorlessConvertedManaCost()); public KentaroTheSmilingCatCastingEffect() { super(Duration.WhileOnBattlefield, Outcome.Benefit); diff --git a/Mage.Sets/src/mage/cards/k/KessigDireSwine.java b/Mage.Sets/src/mage/cards/k/KessigDireSwine.java index f47f1aa98e..c742afb2b1 100644 --- a/Mage.Sets/src/mage/cards/k/KessigDireSwine.java +++ b/Mage.Sets/src/mage/cards/k/KessigDireSwine.java @@ -56,7 +56,7 @@ public class KessigDireSwine extends CardImpl { // Delirium — Kessig Dire Swine has trample as long as there are four or more card types among cards in your graveyard. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield), - new DeliriumCondition(), "Delirium — {this} has trample as long as there are four or more card types among cards in your graveyard"))); + DeliriumCondition.instance, "Delirium — {this} has trample as long as there are four or more card types among cards in your graveyard"))); } public KessigDireSwine(final KessigDireSwine card) { diff --git a/Mage.Sets/src/mage/cards/k/KessigForgemaster.java b/Mage.Sets/src/mage/cards/k/KessigForgemaster.java index 57e4d743c5..861ed8fd8b 100644 --- a/Mage.Sets/src/mage/cards/k/KessigForgemaster.java +++ b/Mage.Sets/src/mage/cards/k/KessigForgemaster.java @@ -68,7 +68,7 @@ public class KessigForgemaster extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Kessig Forgemaster. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } diff --git a/Mage.Sets/src/mage/cards/k/KindlyStranger.java b/Mage.Sets/src/mage/cards/k/KindlyStranger.java index 432ba787f8..ae87563be1 100644 --- a/Mage.Sets/src/mage/cards/k/KindlyStranger.java +++ b/Mage.Sets/src/mage/cards/k/KindlyStranger.java @@ -58,7 +58,7 @@ public class KindlyStranger extends CardImpl { // Delirium — {2}{B}: Transform Kindly Stranger. Activate this ability only if there are four or more card types among cards in your graveyard. this.addAbility(new TransformAbility()); this.addAbility(new ConditionalActivatedAbility(Zone.BATTLEFIELD, - new TransformSourceEffect(true), new ManaCostsImpl<>("{2}{B}"), DeliriumCondition.getInstance())); + new TransformSourceEffect(true), new ManaCostsImpl<>("{2}{B}"), DeliriumCondition.instance)); } public KindlyStranger(final KindlyStranger card) { diff --git a/Mage.Sets/src/mage/cards/k/KorAeronaut.java b/Mage.Sets/src/mage/cards/k/KorAeronaut.java index 8625c340b5..1890676d75 100644 --- a/Mage.Sets/src/mage/cards/k/KorAeronaut.java +++ b/Mage.Sets/src/mage/cards/k/KorAeronaut.java @@ -62,7 +62,7 @@ public class KorAeronaut extends CardImpl { EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), false); ability.addTarget(new TargetCreaturePermanent()); - this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), "When {this} enters the battlefield, if it was kicked, target creature gains flying until end of turn.")); + this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, target creature gains flying until end of turn.")); } public KorAeronaut(final KorAeronaut card) { diff --git a/Mage.Sets/src/mage/cards/k/KorSanctifiers.java b/Mage.Sets/src/mage/cards/k/KorSanctifiers.java index 8ca7a6bf41..8d86ebfa54 100644 --- a/Mage.Sets/src/mage/cards/k/KorSanctifiers.java +++ b/Mage.Sets/src/mage/cards/k/KorSanctifiers.java @@ -60,7 +60,7 @@ public class KorSanctifiers extends CardImpl { // When Kor Sanctifiers enters the battlefield, if it was kicked, destroy target artifact or enchantment. EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false); ability.addTarget(new TargetPermanent(new FilterArtifactOrEnchantmentPermanent())); - this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), "When {this} enters the battlefield, if it was kicked, destroy target artifact or enchantment.")); + this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, destroy target artifact or enchantment.")); } public KorSanctifiers (final KorSanctifiers card) { diff --git a/Mage.Sets/src/mage/cards/k/KrallenhordeHowler.java b/Mage.Sets/src/mage/cards/k/KrallenhordeHowler.java index ecb2507a99..e144f17d23 100644 --- a/Mage.Sets/src/mage/cards/k/KrallenhordeHowler.java +++ b/Mage.Sets/src/mage/cards/k/KrallenhordeHowler.java @@ -74,7 +74,7 @@ public class KrallenhordeHowler extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Krallenhorde Howler. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public KrallenhordeHowler(final KrallenhordeHowler card) { diff --git a/Mage.Sets/src/mage/cards/k/KrallenhordeKiller.java b/Mage.Sets/src/mage/cards/k/KrallenhordeKiller.java index 718706fcee..728103b0d3 100644 --- a/Mage.Sets/src/mage/cards/k/KrallenhordeKiller.java +++ b/Mage.Sets/src/mage/cards/k/KrallenhordeKiller.java @@ -65,7 +65,7 @@ public class KrallenhordeKiller extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Krallenhorde Killer. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public KrallenhordeKiller(final KrallenhordeKiller card) { diff --git a/Mage.Sets/src/mage/cards/k/KrallenhordeWantons.java b/Mage.Sets/src/mage/cards/k/KrallenhordeWantons.java index a74c7496ef..7192b17514 100644 --- a/Mage.Sets/src/mage/cards/k/KrallenhordeWantons.java +++ b/Mage.Sets/src/mage/cards/k/KrallenhordeWantons.java @@ -61,7 +61,7 @@ public class KrallenhordeWantons extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Krallenhorde Wantons. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public KrallenhordeWantons(final KrallenhordeWantons card) { diff --git a/Mage.Sets/src/mage/cards/k/KruinOutlaw.java b/Mage.Sets/src/mage/cards/k/KruinOutlaw.java index c15cd910af..df622b5638 100644 --- a/Mage.Sets/src/mage/cards/k/KruinOutlaw.java +++ b/Mage.Sets/src/mage/cards/k/KruinOutlaw.java @@ -64,7 +64,7 @@ public class KruinOutlaw extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Kruin Outlaw. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public KruinOutlaw(final KruinOutlaw card) { diff --git a/Mage.Sets/src/mage/cards/k/KuldothaPhoenix.java b/Mage.Sets/src/mage/cards/k/KuldothaPhoenix.java index c1cec4ece6..2300c3d884 100644 --- a/Mage.Sets/src/mage/cards/k/KuldothaPhoenix.java +++ b/Mage.Sets/src/mage/cards/k/KuldothaPhoenix.java @@ -68,7 +68,7 @@ public class KuldothaPhoenix extends CardImpl { new ReturnSourceFromGraveyardToBattlefieldEffect(), new ManaCostsImpl("{4}"), new CompoundCondition("during your upkeep and only if you control three or more artifacts", - new IsStepCondition(PhaseStep.UPKEEP), new MetalcraftCondition()) + new IsStepCondition(PhaseStep.UPKEEP), MetalcraftCondition.instance) ); ability.setAbilityWord(AbilityWord.METALCRAFT); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/k/KuonOgreAscendant.java b/Mage.Sets/src/mage/cards/k/KuonOgreAscendant.java index 69406a8a8b..2baa771744 100644 --- a/Mage.Sets/src/mage/cards/k/KuonOgreAscendant.java +++ b/Mage.Sets/src/mage/cards/k/KuonOgreAscendant.java @@ -68,7 +68,7 @@ public class KuonOgreAscendant extends CardImpl { Zone.BATTLEFIELD, new FlipSourceEffect(new KuonsEssenceToken()), TargetController.ANY, - new KuonOgreAscendantCondition(), false), + KuonOgreAscendantCondition.instance, false), new CreaturesDiedWatcher()); } @@ -100,13 +100,10 @@ class KuonsEssenceToken extends Token { } } -class KuonOgreAscendantCondition implements Condition { +enum KuonOgreAscendantCondition implements Condition { - private static final KuonOgreAscendantCondition fInstance = new KuonOgreAscendantCondition(); + instance; - public static KuonOgreAscendantCondition getInstance() { - return fInstance; - } @Override public boolean apply(Game game, Ability source) { diff --git a/Mage.Sets/src/mage/cards/k/KytheonsTactics.java b/Mage.Sets/src/mage/cards/k/KytheonsTactics.java index 916d98e5b4..4630fd26c0 100644 --- a/Mage.Sets/src/mage/cards/k/KytheonsTactics.java +++ b/Mage.Sets/src/mage/cards/k/KytheonsTactics.java @@ -53,7 +53,7 @@ public class KytheonsTactics extends CardImpl { // Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, those creatures also gain vigilance until end of turn. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new AddContinuousEffectToGame(new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn)), - SpellMasteryCondition.getInstance(), + SpellMasteryCondition.instance, "
Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, those creatures also gain vigilance until end of turn")); } diff --git a/Mage.Sets/src/mage/cards/l/LambholtButcher.java b/Mage.Sets/src/mage/cards/l/LambholtButcher.java index 3c5e44bfe6..b99a48a9ff 100644 --- a/Mage.Sets/src/mage/cards/l/LambholtButcher.java +++ b/Mage.Sets/src/mage/cards/l/LambholtButcher.java @@ -59,7 +59,7 @@ public class LambholtButcher extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Lambholt Butcher. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public LambholtButcher(final LambholtButcher card) { diff --git a/Mage.Sets/src/mage/cards/l/LambholtElder.java b/Mage.Sets/src/mage/cards/l/LambholtElder.java index cf5c8ba794..75450b4938 100644 --- a/Mage.Sets/src/mage/cards/l/LambholtElder.java +++ b/Mage.Sets/src/mage/cards/l/LambholtElder.java @@ -62,7 +62,7 @@ public class LambholtElder extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Lambholt Elder. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public LambholtElder(final LambholtElder card) { diff --git a/Mage.Sets/src/mage/cards/l/LambholtPacifist.java b/Mage.Sets/src/mage/cards/l/LambholtPacifist.java index 5fd6be8493..5abf4cba10 100644 --- a/Mage.Sets/src/mage/cards/l/LambholtPacifist.java +++ b/Mage.Sets/src/mage/cards/l/LambholtPacifist.java @@ -73,7 +73,7 @@ public class LambholtPacifist extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Lambholt Pacifist. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public LambholtPacifist(final LambholtPacifist card) { diff --git a/Mage.Sets/src/mage/cards/l/LatchkeyFaerie.java b/Mage.Sets/src/mage/cards/l/LatchkeyFaerie.java index ef5cfad3c6..f63d4274f5 100644 --- a/Mage.Sets/src/mage/cards/l/LatchkeyFaerie.java +++ b/Mage.Sets/src/mage/cards/l/LatchkeyFaerie.java @@ -61,7 +61,7 @@ public class LatchkeyFaerie extends CardImpl { // When Latchkey Faerie enters the battlefield, if its prowl cost was paid, draw a card. EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1), false); - this.addAbility(new ConditionalTriggeredAbility(ability, ProwlCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(ability, ProwlCondition.instance, "When {this} enters the battlefield, if its prowl cost was paid, draw a card.")); } diff --git a/Mage.Sets/src/mage/cards/l/LavaballTrap.java b/Mage.Sets/src/mage/cards/l/LavaballTrap.java index cc60fbc8c5..3cd38d796c 100644 --- a/Mage.Sets/src/mage/cards/l/LavaballTrap.java +++ b/Mage.Sets/src/mage/cards/l/LavaballTrap.java @@ -77,10 +77,10 @@ public class LavaballTrap extends CardImpl { class LavaballTrapCondition implements Condition { - private static final LavaballTrapCondition fInstance = new LavaballTrapCondition(); + private static final LavaballTrapCondition instance = new LavaballTrapCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/l/LethargyTrap.java b/Mage.Sets/src/mage/cards/l/LethargyTrap.java index 266afe2aca..a7ac563535 100644 --- a/Mage.Sets/src/mage/cards/l/LethargyTrap.java +++ b/Mage.Sets/src/mage/cards/l/LethargyTrap.java @@ -77,10 +77,10 @@ public class LethargyTrap extends CardImpl { class LethargyTrapCondition implements Condition { - private static final LethargyTrapCondition fInstance = new LethargyTrapCondition(); + private static final LethargyTrapCondition instance = new LethargyTrapCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/l/LifecraftCavalry.java b/Mage.Sets/src/mage/cards/l/LifecraftCavalry.java index b3962f78ec..d14fb90f45 100644 --- a/Mage.Sets/src/mage/cards/l/LifecraftCavalry.java +++ b/Mage.Sets/src/mage/cards/l/LifecraftCavalry.java @@ -61,7 +61,7 @@ public class LifecraftCavalry extends CardImpl { new EntersBattlefieldAbility( new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), false, - RevoltCondition.getInstance(), + RevoltCondition.instance, "Revolt — {this} enters the battlefield with two +1/+1 counter on it if a permanent you controlled left the battlefield this turn", null), new RevoltWatcher() ); diff --git a/Mage.Sets/src/mage/cards/l/LighthouseChronologist.java b/Mage.Sets/src/mage/cards/l/LighthouseChronologist.java index 998881ffd5..9a98b9d3be 100644 --- a/Mage.Sets/src/mage/cards/l/LighthouseChronologist.java +++ b/Mage.Sets/src/mage/cards/l/LighthouseChronologist.java @@ -69,7 +69,7 @@ public class LighthouseChronologist extends LevelerCard { // At the beginning of each end step, if it's not your turn, take an extra turn after this one. Abilities abilities2 = new AbilitiesImpl<>(); abilities2.add(new BeginningOfEndStepTriggeredAbility( - Zone.BATTLEFIELD, new AddExtraTurnControllerEffect(false), TargetController.ANY, NotMyTurnCondition.getInstance(), false)); + Zone.BATTLEFIELD, new AddExtraTurnControllerEffect(false), TargetController.ANY, NotMyTurnCondition.instance, false)); this.addAbilities(LevelerCardBuilder.construct( new LevelerCardBuilder.LevelAbility(4, 6, abilities1, 2, 4), diff --git a/Mage.Sets/src/mage/cards/l/LlanowarElite.java b/Mage.Sets/src/mage/cards/l/LlanowarElite.java index 1067b49086..6673c38661 100644 --- a/Mage.Sets/src/mage/cards/l/LlanowarElite.java +++ b/Mage.Sets/src/mage/cards/l/LlanowarElite.java @@ -61,7 +61,7 @@ public class LlanowarElite extends CardImpl { // If Llanowar Elite was kicked, it enters the battlefield with five +1/+1 counters on it. Ability ability = new EntersBattlefieldAbility( - new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance(5)), KickedCondition.getInstance(), ""), + new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance(5)), KickedCondition.instance, ""), "If {this} was kicked, it enters the battlefield with five +1/+1 counters on it."); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/l/LoneWolfOfTheNatterknolls.java b/Mage.Sets/src/mage/cards/l/LoneWolfOfTheNatterknolls.java index 62e964528c..9342faff79 100644 --- a/Mage.Sets/src/mage/cards/l/LoneWolfOfTheNatterknolls.java +++ b/Mage.Sets/src/mage/cards/l/LoneWolfOfTheNatterknolls.java @@ -63,13 +63,13 @@ public class LoneWolfOfTheNatterknolls extends CardImpl { // Whenever an opponent cast a spell during your turn, draw two cards. this.addAbility(new ConditionalTriggeredAbility( new SpellCastOpponentTriggeredAbility(new DrawCardSourceControllerEffect(2), new FilterSpell("a spell"), true), - new MyTurnCondition(), + MyTurnCondition.instance, "Whenever an opponent casts a spell during your turn, draw two card." )); // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Lone Wolf of the Natterknolls. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public LoneWolfOfTheNatterknolls(final LoneWolfOfTheNatterknolls card) { diff --git a/Mage.Sets/src/mage/cards/l/LumengridDrake.java b/Mage.Sets/src/mage/cards/l/LumengridDrake.java index 90fc4557d2..97b92457e0 100644 --- a/Mage.Sets/src/mage/cards/l/LumengridDrake.java +++ b/Mage.Sets/src/mage/cards/l/LumengridDrake.java @@ -60,7 +60,7 @@ public class LumengridDrake extends CardImpl { // Metalcraft — When Lumengrid Drake enters the battlefield, if you control three or more artifacts, return target creature to its owner's hand. TriggeredAbility conditional = new ConditionalTriggeredAbility( - new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect()), MetalcraftCondition.getInstance(), ruleText); + new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect()), MetalcraftCondition.instance, ruleText); conditional.addTarget(new TargetCreaturePermanent()); this.addAbility(conditional); } diff --git a/Mage.Sets/src/mage/cards/l/LuminarchAscension.java b/Mage.Sets/src/mage/cards/l/LuminarchAscension.java index 1d46c54762..2b9ea42f4e 100644 --- a/Mage.Sets/src/mage/cards/l/LuminarchAscension.java +++ b/Mage.Sets/src/mage/cards/l/LuminarchAscension.java @@ -141,10 +141,10 @@ class SourceHasCountersCost extends CostImpl { class YouLostNoLifeThisTurnCondition implements Condition { - private static final YouLostNoLifeThisTurnCondition fInstance = new YouLostNoLifeThisTurnCondition(); + private static final YouLostNoLifeThisTurnCondition instance = new YouLostNoLifeThisTurnCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/l/LurkingArynx.java b/Mage.Sets/src/mage/cards/l/LurkingArynx.java index 29432ac181..6a125a2ab1 100644 --- a/Mage.Sets/src/mage/cards/l/LurkingArynx.java +++ b/Mage.Sets/src/mage/cards/l/LurkingArynx.java @@ -60,7 +60,7 @@ public class LurkingArynx extends CardImpl { Zone.BATTLEFIELD, new MustBeBlockedByTargetSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{2}{G}"), - FormidableCondition.getInstance()); + FormidableCondition.instance); ability.setAbilityWord(AbilityWord.FORMIDABLE); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/m/MagmaBurst.java b/Mage.Sets/src/mage/cards/m/MagmaBurst.java index c464045885..83512218bd 100644 --- a/Mage.Sets/src/mage/cards/m/MagmaBurst.java +++ b/Mage.Sets/src/mage/cards/m/MagmaBurst.java @@ -66,7 +66,7 @@ public class MagmaBurst extends CardImpl { @Override public void adjustTargets(Ability ability, Game game) { if(ability.getOriginalId().equals(originalId)) { - ability.addTarget(new TargetCreatureOrPlayer(KickedCondition.getInstance().apply(game, ability) ? 2 : 1)); + ability.addTarget(new TargetCreatureOrPlayer(KickedCondition.instance.apply(game, ability) ? 2 : 1)); } } diff --git a/Mage.Sets/src/mage/cards/m/MaliciousAffliction.java b/Mage.Sets/src/mage/cards/m/MaliciousAffliction.java index b6c25fb0c7..1eaa3f1421 100644 --- a/Mage.Sets/src/mage/cards/m/MaliciousAffliction.java +++ b/Mage.Sets/src/mage/cards/m/MaliciousAffliction.java @@ -67,7 +67,7 @@ public class MaliciousAffliction extends CardImpl { // Morbid - When you cast Malicious Affliction, if a creature died this turn, you may copy Malicious Affliction and may choose a new target for the copy. Ability ability = new ConditionalTriggeredAbility( new CastSourceTriggeredAbility(new CopySourceSpellEffect(), true), - new LockedInCondition(MorbidCondition.getInstance()), + new LockedInCondition(MorbidCondition.instance), "Morbid - When you cast {this}, if a creature died this turn, you may copy {this} and may choose a new target for the copy"); ability.setRuleAtTheTop(true); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/m/ManaVault.java b/Mage.Sets/src/mage/cards/m/ManaVault.java index 0189a13d70..0dd401531a 100644 --- a/Mage.Sets/src/mage/cards/m/ManaVault.java +++ b/Mage.Sets/src/mage/cards/m/ManaVault.java @@ -67,7 +67,7 @@ public class ManaVault extends CardImpl { // At the beginning of your draw step, if Mana Vault is tapped, it deals 1 damage to you. this.addAbility(new ConditionalTriggeredAbility( new BeginningOfDrawTriggeredAbility(Zone.BATTLEFIELD, new DamageControllerEffect(1), TargetController.YOU, false), - SourceTappedCondition.getInstance(), + SourceTappedCondition.instance, "At the beginning of your draw step, if {this} is tapped, it deals 1 damage to you.")); // {tap}: Add {C}{C}{C} to your mana pool. this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.ColorlessMana(3), new TapSourceCost())); diff --git a/Mage.Sets/src/mage/cards/m/ManicScribe.java b/Mage.Sets/src/mage/cards/m/ManicScribe.java index c778087617..93df92a24e 100644 --- a/Mage.Sets/src/mage/cards/m/ManicScribe.java +++ b/Mage.Sets/src/mage/cards/m/ManicScribe.java @@ -61,7 +61,7 @@ public class ManicScribe extends CardImpl { // that player puts the top three cards of his or her library into his or her graveyard. this.addAbility(new ConditionalTriggeredAbility( new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new PutTopCardOfLibraryIntoGraveTargetEffect(3), TargetController.OPPONENT, false, true), - DeliriumCondition.getInstance(), + DeliriumCondition.instance, "Delirium — At the beginning of each opponent's upkeep, if there are four or more card types among cards in your graveyard, " + "that player puts the top three cards of his or her library into his or her graveyard.")); } diff --git a/Mage.Sets/src/mage/cards/m/MarduHeartPiercer.java b/Mage.Sets/src/mage/cards/m/MarduHeartPiercer.java index d8344776cf..65f3ff4701 100644 --- a/Mage.Sets/src/mage/cards/m/MarduHeartPiercer.java +++ b/Mage.Sets/src/mage/cards/m/MarduHeartPiercer.java @@ -55,7 +55,7 @@ public class MarduHeartPiercer extends CardImpl { this.toughness = new MageInt(3); // Raid - When Mardu Heart-Piercer enters the battlefield, if you attacked with a creature this turn, Mardu Heart-Piercer deals 2 damage to target creature or player. - Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(2)), RaidCondition.getInstance(), + Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(2)), RaidCondition.instance, "Raid - When {this} enters the battlefield, if you attacked with a creature this turn, {this} deals 2 damage to target creature or player."); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability, new PlayerAttackedWatcher()); diff --git a/Mage.Sets/src/mage/cards/m/MarduHordechief.java b/Mage.Sets/src/mage/cards/m/MarduHordechief.java index 064abc85e2..77c0120fa2 100644 --- a/Mage.Sets/src/mage/cards/m/MarduHordechief.java +++ b/Mage.Sets/src/mage/cards/m/MarduHordechief.java @@ -54,7 +54,7 @@ public class MarduHordechief extends CardImpl { this.toughness = new MageInt(3); // Raid - When Mardu Hordechief enters the battlefield, if you attacked with a creature this turn, create a 1/1 white Warrior creature token - this.addAbility(new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new WarriorToken())), RaidCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new WarriorToken())), RaidCondition.instance, "Raid - When {this} enters the battlefield, if you attacked with a creature this turn, create a 1/1 white Warrior creature token."), new PlayerAttackedWatcher()); } diff --git a/Mage.Sets/src/mage/cards/m/MarduSkullhunter.java b/Mage.Sets/src/mage/cards/m/MarduSkullhunter.java index 183d5d3db9..e8275a4417 100644 --- a/Mage.Sets/src/mage/cards/m/MarduSkullhunter.java +++ b/Mage.Sets/src/mage/cards/m/MarduSkullhunter.java @@ -59,7 +59,7 @@ public class MarduSkullhunter extends CardImpl { this.addAbility(new EntersBattlefieldTappedAbility()); // Raid - When Mardu Skullhunter enters the battlefield, if you attacked with a creature this turn, target opponent discards a card. - Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new DiscardTargetEffect(1)), RaidCondition.getInstance(), + Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new DiscardTargetEffect(1)), RaidCondition.instance, "Raid - When {this} enters the battlefield, if you attacked with a creature this turn, target opponent discards a card."); ability.addTarget(new TargetOpponent()); this.addAbility(ability, new PlayerAttackedWatcher()); diff --git a/Mage.Sets/src/mage/cards/m/MarduWarshrieker.java b/Mage.Sets/src/mage/cards/m/MarduWarshrieker.java index 1d3188e3f4..7076d36e26 100644 --- a/Mage.Sets/src/mage/cards/m/MarduWarshrieker.java +++ b/Mage.Sets/src/mage/cards/m/MarduWarshrieker.java @@ -54,7 +54,7 @@ public class MarduWarshrieker extends CardImpl { this.toughness = new MageInt(3); // Raid - When Mardu Warshrieker enters the battlefield, if you attacked with a creature this turn, add {R}{W}{B} to your mana pool. - this.addAbility(new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new AddManaToManaPoolSourceControllerEffect(new Mana(1, 0, 0, 1, 1, 0, 0, 0))), RaidCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new AddManaToManaPoolSourceControllerEffect(new Mana(1, 0, 0, 1, 1, 0, 0, 0))), RaidCondition.instance, "Raid - When {this} enters the battlefield, if you attacked with a creature this turn, add {R}{W}{B} to your mana pool."), new PlayerAttackedWatcher()); } diff --git a/Mage.Sets/src/mage/cards/m/MarshCasualties.java b/Mage.Sets/src/mage/cards/m/MarshCasualties.java index 3b671f035a..461b76d34c 100644 --- a/Mage.Sets/src/mage/cards/m/MarshCasualties.java +++ b/Mage.Sets/src/mage/cards/m/MarshCasualties.java @@ -64,7 +64,7 @@ public class MarshCasualties extends CardImpl { this.getSpellAbility().addEffect(new ConditionalContinuousEffect( new MarshCasualtiesEffect(-2, -2), new MarshCasualtiesEffect(-1, -1), - new LockedInCondition(KickedCondition.getInstance()), + new LockedInCondition(KickedCondition.instance), ruleText)); this.getSpellAbility().addTarget(new TargetPlayer()); } diff --git a/Mage.Sets/src/mage/cards/m/MarshalsAnthem.java b/Mage.Sets/src/mage/cards/m/MarshalsAnthem.java index 3b68280ca0..efbc674962 100644 --- a/Mage.Sets/src/mage/cards/m/MarshalsAnthem.java +++ b/Mage.Sets/src/mage/cards/m/MarshalsAnthem.java @@ -79,7 +79,7 @@ public class MarshalsAnthem extends CardImpl { // When Marshal's Anthem enters the battlefield, return up to X target creature cards from your graveyard to the battlefield, where X is the number of times Marshal's Anthem was kicked. Ability ability = new ConditionalTriggeredAbility( new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToBattlefieldTargetEffect(), false), - KickedCondition.getInstance(), + KickedCondition.instance, "When {this} enters the battlefield, return up to X target creature cards from your graveyard to the battlefield, where X is the number of times {this} was kicked."); originalId = ability.getOriginalId(); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/m/MartyrsOfKorlis.java b/Mage.Sets/src/mage/cards/m/MartyrsOfKorlis.java index c5ce8f9815..051b24c495 100644 --- a/Mage.Sets/src/mage/cards/m/MartyrsOfKorlis.java +++ b/Mage.Sets/src/mage/cards/m/MartyrsOfKorlis.java @@ -58,7 +58,7 @@ public class MartyrsOfKorlis extends CardImpl { // As long as Martyrs of Korlis is untapped, all damage that would be dealt to you by artifacts is dealt to Martyrs of Korlis instead. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( new RedirectArtifactDamageFromPlayerToSourceEffect(Duration.WhileOnBattlefield), - new InvertCondition(new SourceTappedCondition()), + new InvertCondition(SourceTappedCondition.instance), "{this} redirects artifact damage from controller as long as it's untapped"))); } diff --git a/Mage.Sets/src/mage/cards/m/MayorOfAvabruck.java b/Mage.Sets/src/mage/cards/m/MayorOfAvabruck.java index 1cb6a3559f..f76cbf5069 100644 --- a/Mage.Sets/src/mage/cards/m/MayorOfAvabruck.java +++ b/Mage.Sets/src/mage/cards/m/MayorOfAvabruck.java @@ -82,7 +82,7 @@ public class MayorOfAvabruck extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Mayor of Avabruck. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public MayorOfAvabruck(final MayorOfAvabruck card) { diff --git a/Mage.Sets/src/mage/cards/m/MedomaiTheAgeless.java b/Mage.Sets/src/mage/cards/m/MedomaiTheAgeless.java index 6547b20cc1..9621727938 100644 --- a/Mage.Sets/src/mage/cards/m/MedomaiTheAgeless.java +++ b/Mage.Sets/src/mage/cards/m/MedomaiTheAgeless.java @@ -81,15 +81,15 @@ public class MedomaiTheAgeless extends CardImpl { class ExtraTurnCondition implements Condition { - private static ExtraTurnCondition fInstance = null; + private static ExtraTurnCondition instance = null; private ExtraTurnCondition() {} public static Condition getInstance() { - if (fInstance == null) { - fInstance = new ExtraTurnCondition(); + if (instance == null) { + instance = new ExtraTurnCondition(); } - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/m/MercilessPredator.java b/Mage.Sets/src/mage/cards/m/MercilessPredator.java index 62ac9c7bcd..c595e92eab 100644 --- a/Mage.Sets/src/mage/cards/m/MercilessPredator.java +++ b/Mage.Sets/src/mage/cards/m/MercilessPredator.java @@ -60,7 +60,7 @@ public class MercilessPredator extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Merciless Predator. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public MercilessPredator(final MercilessPredator card) { diff --git a/Mage.Sets/src/mage/cards/m/MightBeyondReason.java b/Mage.Sets/src/mage/cards/m/MightBeyondReason.java index 9540316d19..b3ea858897 100644 --- a/Mage.Sets/src/mage/cards/m/MightBeyondReason.java +++ b/Mage.Sets/src/mage/cards/m/MightBeyondReason.java @@ -51,7 +51,7 @@ public class MightBeyondReason extends CardImpl { getSpellAbility().addEffect(new ConditionalOneShotEffect( new AddCountersTargetEffect(CounterType.P1P1.createInstance(3)), new AddCountersTargetEffect(CounterType.P1P1.createInstance(2)), - DeliriumCondition.getInstance(), + DeliriumCondition.instance, "Put two +1/+1 counter on target creature.
" + "Delirium — Put three +1/+1 counter on that creature instead if there are four or more card types among cards in your graveyard" )); diff --git a/Mage.Sets/src/mage/cards/m/MightMakesRight.java b/Mage.Sets/src/mage/cards/m/MightMakesRight.java index 7a2665b0cb..110820e519 100644 --- a/Mage.Sets/src/mage/cards/m/MightMakesRight.java +++ b/Mage.Sets/src/mage/cards/m/MightMakesRight.java @@ -90,12 +90,12 @@ public class MightMakesRight extends CardImpl { class ControlsEachCreatureWithGreatestPowerCondition implements Condition { - private static final ControlsEachCreatureWithGreatestPowerCondition fInstance = new ControlsEachCreatureWithGreatestPowerCondition(); + private static final ControlsEachCreatureWithGreatestPowerCondition instance = new ControlsEachCreatureWithGreatestPowerCondition(); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/m/MightOfOldKrosa.java b/Mage.Sets/src/mage/cards/m/MightOfOldKrosa.java index 3b62c7b243..09e52a04b4 100644 --- a/Mage.Sets/src/mage/cards/m/MightOfOldKrosa.java +++ b/Mage.Sets/src/mage/cards/m/MightOfOldKrosa.java @@ -51,7 +51,7 @@ public class MightOfOldKrosa extends CardImpl { this.getSpellAbility().addEffect(new ConditionalContinuousEffect( new BoostTargetEffect(4,4, Duration.EndOfTurn), new BoostTargetEffect(2, 2, Duration.EndOfTurn), - new LockedInCondition(MyMainPhaseCondition.getInstance()), + new LockedInCondition(MyMainPhaseCondition.instance), "Target creature gets +2/+2 until end of turn. If you cast this spell during your main phase, that creature gets +4/+4 until end of turn instead")); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/cards/m/MightOfTheNephilim.java b/Mage.Sets/src/mage/cards/m/MightOfTheNephilim.java index 6abaaa804d..c99a9b5d0c 100644 --- a/Mage.Sets/src/mage/cards/m/MightOfTheNephilim.java +++ b/Mage.Sets/src/mage/cards/m/MightOfTheNephilim.java @@ -69,10 +69,10 @@ public class MightOfTheNephilim extends CardImpl { class MightOfTheNephilimValue implements DynamicValue { - private static final MightOfTheNephilimValue fINSTANCE = new MightOfTheNephilimValue(); + private static final MightOfTheNephilimValue instance = new MightOfTheNephilimValue(); public static MightOfTheNephilimValue getInstance() { - return fINSTANCE; + return instance; } private MightOfTheNephilimValue() {} @@ -88,7 +88,7 @@ class MightOfTheNephilimValue implements DynamicValue { @Override public MightOfTheNephilimValue copy() { - return fINSTANCE; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/m/MindbreakTrap.java b/Mage.Sets/src/mage/cards/m/MindbreakTrap.java index 6314be8c37..102a99dcd0 100644 --- a/Mage.Sets/src/mage/cards/m/MindbreakTrap.java +++ b/Mage.Sets/src/mage/cards/m/MindbreakTrap.java @@ -73,10 +73,10 @@ public class MindbreakTrap extends CardImpl { class MindbreakTrapCondition implements Condition { - private static final MindbreakTrapCondition fInstance = new MindbreakTrapCondition(); + private static final MindbreakTrapCondition instance = new MindbreakTrapCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/m/MindwrackDemon.java b/Mage.Sets/src/mage/cards/m/MindwrackDemon.java index e383c3e7a4..3f65694c85 100644 --- a/Mage.Sets/src/mage/cards/m/MindwrackDemon.java +++ b/Mage.Sets/src/mage/cards/m/MindwrackDemon.java @@ -68,7 +68,7 @@ public class MindwrackDemon extends CardImpl { // At the beginning of your upkeep, if you don't have 4 or more card types in your graveyard, you lose 4 life. Ability ability = new ConditionalTriggeredAbility( new BeginningOfUpkeepTriggeredAbility(new LoseLifeSourceControllerEffect(4), TargetController.YOU, false), - new InvertCondition(new DeliriumCondition()), + new InvertCondition(DeliriumCondition.instance), "Delirium — At the beginning of your upkeep, you lose 4 life unless there are four or more card types among cards in your graveyard."); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/m/MirranMettle.java b/Mage.Sets/src/mage/cards/m/MirranMettle.java index 325474d72e..87b49f7df4 100644 --- a/Mage.Sets/src/mage/cards/m/MirranMettle.java +++ b/Mage.Sets/src/mage/cards/m/MirranMettle.java @@ -54,7 +54,7 @@ public class MirranMettle extends CardImpl { this.getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn)); this.getSpellAbility().addEffect(new ConditionalContinuousEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn), - new LockedInCondition(MetalcraftCondition.getInstance()), effectText)); + new LockedInCondition(MetalcraftCondition.instance), effectText)); } public MirranMettle(final MirranMettle card) { diff --git a/Mage.Sets/src/mage/cards/m/MoldShambler.java b/Mage.Sets/src/mage/cards/m/MoldShambler.java index 1f65c9a2a2..9b1c6d0b29 100644 --- a/Mage.Sets/src/mage/cards/m/MoldShambler.java +++ b/Mage.Sets/src/mage/cards/m/MoldShambler.java @@ -70,7 +70,7 @@ public class MoldShambler extends CardImpl { EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false); Target target = new TargetPermanent(filter); ability.addTarget(target); - this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), "When {this} enters the battlefield, if it was kicked, destroy target noncreature permanent.")); + this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, destroy target noncreature permanent.")); } public MoldShambler(final MoldShambler card) { diff --git a/Mage.Sets/src/mage/cards/m/MoldgrafScavenger.java b/Mage.Sets/src/mage/cards/m/MoldgrafScavenger.java index c02c73a174..a1ea286f48 100644 --- a/Mage.Sets/src/mage/cards/m/MoldgrafScavenger.java +++ b/Mage.Sets/src/mage/cards/m/MoldgrafScavenger.java @@ -54,7 +54,7 @@ public class MoldgrafScavenger extends CardImpl { // Delirium — Moldgraf Scavenger gets +3/+0 as long as there are four or more card types among cards in your graveyard. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( new BoostSourceEffect(3, 0, Duration.WhileOnBattlefield), - DeliriumCondition.getInstance(), + DeliriumCondition.instance, "Delirium — {this} gets +3/+0 as long as there are four or more card types among cards in your graveyard"))); } diff --git a/Mage.Sets/src/mage/cards/m/MoltenDisaster.java b/Mage.Sets/src/mage/cards/m/MoltenDisaster.java index 11136859a8..b8da4da2a7 100644 --- a/Mage.Sets/src/mage/cards/m/MoltenDisaster.java +++ b/Mage.Sets/src/mage/cards/m/MoltenDisaster.java @@ -104,14 +104,14 @@ class MoltenDisasterSplitSecondEffect extends ContinuousRuleModifyingEffectImpl @Override public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType() == GameEvent.EventType.CAST_SPELL) { - if (KickedCondition.getInstance().apply(game, source)) { + if (KickedCondition.instance.apply(game, source)) { return true; } } if (event.getType() == GameEvent.EventType.ACTIVATE_ABILITY) { Ability ability = game.getAbility(event.getTargetId(), event.getSourceId()); if (ability != null && !(ability instanceof ActivatedManaAbilityImpl)) { - if (KickedCondition.getInstance().apply(game, source)) { + if (KickedCondition.instance.apply(game, source)) { return true; } } diff --git a/Mage.Sets/src/mage/cards/m/MoltenPsyche.java b/Mage.Sets/src/mage/cards/m/MoltenPsyche.java index 9b8d8d99f1..a841e6dd88 100644 --- a/Mage.Sets/src/mage/cards/m/MoltenPsyche.java +++ b/Mage.Sets/src/mage/cards/m/MoltenPsyche.java @@ -106,13 +106,13 @@ class MoltenPsycheEffect extends OneShotEffect { Player player = game.getPlayer(playerId); if (player != null) { player.drawCards(cardsToDraw.get(playerId), game); - if (MetalcraftCondition.getInstance().apply(game, source) && !playerId.equals(source.getControllerId())) { + if (MetalcraftCondition.instance.apply(game, source) && !playerId.equals(source.getControllerId())) { MoltenPsycheWatcher watcher = (MoltenPsycheWatcher) game.getState().getWatchers().get("CardsDrawn"); player.damage(watcher.getDraws(playerId), source.getSourceId(), game, false, true); } } } - if (MetalcraftCondition.getInstance().apply(game, source)) { + if (MetalcraftCondition.instance.apply(game, source)) { MoltenPsycheWatcher watcher = (MoltenPsycheWatcher) game.getState().getWatchers().get("CardsDrawn"); for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { if (game.isOpponent(controller, playerId)) { diff --git a/Mage.Sets/src/mage/cards/m/MondronenShaman.java b/Mage.Sets/src/mage/cards/m/MondronenShaman.java index 58658ac3c8..0b1ddde028 100644 --- a/Mage.Sets/src/mage/cards/m/MondronenShaman.java +++ b/Mage.Sets/src/mage/cards/m/MondronenShaman.java @@ -63,7 +63,7 @@ public class MondronenShaman extends CardImpl { this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); this.addAbility(new ConditionalTriggeredAbility(ability, - NoSpellsWereCastLastTurnCondition.getInstance(), + NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } diff --git a/Mage.Sets/src/mage/cards/m/MoonriseIntruder.java b/Mage.Sets/src/mage/cards/m/MoonriseIntruder.java index df1072afb4..d2205df20e 100644 --- a/Mage.Sets/src/mage/cards/m/MoonriseIntruder.java +++ b/Mage.Sets/src/mage/cards/m/MoonriseIntruder.java @@ -63,7 +63,7 @@ public class MoonriseIntruder extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Moonrise Intruder. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public MoonriseIntruder(final MoonriseIntruder card) { diff --git a/Mage.Sets/src/mage/cards/m/MoonscarredWerewolf.java b/Mage.Sets/src/mage/cards/m/MoonscarredWerewolf.java index a5ca7f270a..538d96e3d6 100644 --- a/Mage.Sets/src/mage/cards/m/MoonscarredWerewolf.java +++ b/Mage.Sets/src/mage/cards/m/MoonscarredWerewolf.java @@ -69,7 +69,7 @@ public class MoonscarredWerewolf extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Moonscarred Werewolf. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); this.addAbility(new ConditionalTriggeredAbility(ability, - TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), + TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } diff --git a/Mage.Sets/src/mage/cards/m/MoorlandDrifter.java b/Mage.Sets/src/mage/cards/m/MoorlandDrifter.java index bbd40c5aff..c51714c71e 100644 --- a/Mage.Sets/src/mage/cards/m/MoorlandDrifter.java +++ b/Mage.Sets/src/mage/cards/m/MoorlandDrifter.java @@ -52,7 +52,7 @@ public class MoorlandDrifter extends CardImpl { this.toughness = new MageInt(2); // Delirium — Moorland Drifter has flying as long as there are four or more card types among cards in your graveyard. - ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance()), DeliriumCondition.getInstance(), "Delirium — Moorland Drifter has flying as long as there are four or more card types among cards in your graveyard."); + ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance()), DeliriumCondition.instance, "Delirium — Moorland Drifter has flying as long as there are four or more card types among cards in your graveyard."); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); } diff --git a/Mage.Sets/src/mage/cards/m/MorkrutBanshee.java b/Mage.Sets/src/mage/cards/m/MorkrutBanshee.java index 4ce685aff0..3cf21d3968 100644 --- a/Mage.Sets/src/mage/cards/m/MorkrutBanshee.java +++ b/Mage.Sets/src/mage/cards/m/MorkrutBanshee.java @@ -58,7 +58,7 @@ public class MorkrutBanshee extends CardImpl { // Morbid - When Morkut Banshee enters the battlefield, if a creature died this turn, target creature gets -4/-4 until end of turn. TriggeredAbility triggeredAbility = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(-4, -4, Duration.EndOfTurn)); - TriggeredAbility ability = new ConditionalTriggeredAbility(triggeredAbility, MorbidCondition.getInstance(), staticText); + TriggeredAbility ability = new ConditionalTriggeredAbility(triggeredAbility, MorbidCondition.instance, staticText); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/m/MorselTheft.java b/Mage.Sets/src/mage/cards/m/MorselTheft.java index da36077cd6..e60cb31a1a 100644 --- a/Mage.Sets/src/mage/cards/m/MorselTheft.java +++ b/Mage.Sets/src/mage/cards/m/MorselTheft.java @@ -59,7 +59,7 @@ public class MorselTheft extends CardImpl { effect.setText("and you gain 3 life"); getSpellAbility().addEffect(effect); getSpellAbility().addTarget(new TargetPlayer()); - getSpellAbility().addEffect(new ConditionalOneShotEffect(new DrawCardSourceControllerEffect(1), ProwlCondition.getInstance())); + getSpellAbility().addEffect(new ConditionalOneShotEffect(new DrawCardSourceControllerEffect(1), ProwlCondition.instance)); } diff --git a/Mage.Sets/src/mage/cards/m/MosswortBridge.java b/Mage.Sets/src/mage/cards/m/MosswortBridge.java index 26de3a1e53..38b4e3f809 100644 --- a/Mage.Sets/src/mage/cards/m/MosswortBridge.java +++ b/Mage.Sets/src/mage/cards/m/MosswortBridge.java @@ -76,13 +76,13 @@ public class MosswortBridge extends CardImpl { } } -class MosswortBridgeTotalPowerCondition implements Condition { +enum MosswortBridgeTotalPowerCondition implements Condition { - private static MosswortBridgeTotalPowerCondition fInstance = new MosswortBridgeTotalPowerCondition(); + instance; private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/m/Mournwillow.java b/Mage.Sets/src/mage/cards/m/Mournwillow.java index 874951e60b..30c66c5e6f 100644 --- a/Mage.Sets/src/mage/cards/m/Mournwillow.java +++ b/Mage.Sets/src/mage/cards/m/Mournwillow.java @@ -62,7 +62,7 @@ public class Mournwillow extends CardImpl { // creatures with power 2 or less can't block this turn. Ability ability = new ConditionalTriggeredAbility( new EntersBattlefieldTriggeredAbility(new MournwillowEffect(), false), - new DeliriumCondition(), + DeliriumCondition.instance, "Delirium — When {this} enters the battlefield, if there are four or more card types among cards in your graveyard, " + "creatures with power 2 or less can't block this turn."); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/m/MoxOpal.java b/Mage.Sets/src/mage/cards/m/MoxOpal.java index 82170702f7..467bd4e43f 100644 --- a/Mage.Sets/src/mage/cards/m/MoxOpal.java +++ b/Mage.Sets/src/mage/cards/m/MoxOpal.java @@ -53,7 +53,7 @@ public class MoxOpal extends CardImpl { Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(), new TapSourceCost(), - MetalcraftCondition.getInstance()); + MetalcraftCondition.instance); ability.setAbilityWord(AbilityWord.METALCRAFT); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/n/NarnamRenegade.java b/Mage.Sets/src/mage/cards/n/NarnamRenegade.java index abd46a837f..5602bc47ab 100644 --- a/Mage.Sets/src/mage/cards/n/NarnamRenegade.java +++ b/Mage.Sets/src/mage/cards/n/NarnamRenegade.java @@ -60,7 +60,7 @@ public class NarnamRenegade extends CardImpl { this.addAbility( new EntersBattlefieldAbility( new AddCountersSourceEffect(CounterType.P1P1.createInstance()), - false, RevoltCondition.getInstance(), + false, RevoltCondition.instance, "Revolt — {this} enters the battlefield with a +1/+1 counter on it if a permanent you controlled left the battlefield this turn", null), new RevoltWatcher() ); diff --git a/Mage.Sets/src/mage/cards/n/NeckBreaker.java b/Mage.Sets/src/mage/cards/n/NeckBreaker.java index 34ab5759c5..66f5afbc9d 100644 --- a/Mage.Sets/src/mage/cards/n/NeckBreaker.java +++ b/Mage.Sets/src/mage/cards/n/NeckBreaker.java @@ -75,7 +75,7 @@ public class NeckBreaker extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Neck Breaker. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public NeckBreaker(final NeckBreaker card) { diff --git a/Mage.Sets/src/mage/cards/n/Necrologia.java b/Mage.Sets/src/mage/cards/n/Necrologia.java index e5eaeac2ec..3043fdbbe2 100644 --- a/Mage.Sets/src/mage/cards/n/Necrologia.java +++ b/Mage.Sets/src/mage/cards/n/Necrologia.java @@ -48,7 +48,7 @@ public class Necrologia extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{B}{B}"); // Cast Necrologia only during your end step. - this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(null, PhaseStep.END_TURN, MyTurnCondition.getInstance(), + this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(null, PhaseStep.END_TURN, MyTurnCondition.instance, "Cast {this} only during your end step")); // As an additional cost to cast to Necrologia, pay X life. diff --git a/Mage.Sets/src/mage/cards/n/NecromanticSummons.java b/Mage.Sets/src/mage/cards/n/NecromanticSummons.java index 3748852940..025dd70559 100644 --- a/Mage.Sets/src/mage/cards/n/NecromanticSummons.java +++ b/Mage.Sets/src/mage/cards/n/NecromanticSummons.java @@ -59,7 +59,7 @@ public class NecromanticSummons extends CardImpl { // Spell mastery - If there are two or more instant and/or sorcery cards in your graveyard, that creature enters the battlefield with two additional +1/+1 counters on it. Effect effect = new ConditionalOneShotEffect(new NecromanticSummoningEffect(), - SpellMasteryCondition.getInstance(), "
Spell mastery - If there are two or more instant and/or sorcery cards in your graveyard, that creature enters the battlefield with two additional +1/+1 counters on it"); + SpellMasteryCondition.instance, "
Spell mastery - If there are two or more instant and/or sorcery cards in your graveyard, that creature enters the battlefield with two additional +1/+1 counters on it"); this.getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/cards/n/NeedlebiteTrap.java b/Mage.Sets/src/mage/cards/n/NeedlebiteTrap.java index fa69a3bd4f..8ae6408b45 100644 --- a/Mage.Sets/src/mage/cards/n/NeedlebiteTrap.java +++ b/Mage.Sets/src/mage/cards/n/NeedlebiteTrap.java @@ -72,10 +72,10 @@ public class NeedlebiteTrap extends CardImpl { class NeedlebiteTrapCondition implements Condition { - private static final NeedlebiteTrapCondition fInstance = new NeedlebiteTrapCondition(); + private static final NeedlebiteTrapCondition instance = new NeedlebiteTrapCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/n/NessianDemolok.java b/Mage.Sets/src/mage/cards/n/NessianDemolok.java index 91766e7f51..70b1769331 100644 --- a/Mage.Sets/src/mage/cards/n/NessianDemolok.java +++ b/Mage.Sets/src/mage/cards/n/NessianDemolok.java @@ -67,7 +67,7 @@ public class NessianDemolok extends CardImpl { // When Nessian Demolok enters the battlefield, if tribute wasn't paid, destroy target noncreature permanent. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false); ability.addTarget(new TargetPermanent(filter)); - this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.instance, "When {this} enters the battlefield, if its tribute wasn't paid, destroy target noncreature permanent.")); } diff --git a/Mage.Sets/src/mage/cards/n/NessianWildsRavager.java b/Mage.Sets/src/mage/cards/n/NessianWildsRavager.java index b7a283a59c..32a6179e88 100644 --- a/Mage.Sets/src/mage/cards/n/NessianWildsRavager.java +++ b/Mage.Sets/src/mage/cards/n/NessianWildsRavager.java @@ -65,7 +65,7 @@ public class NessianWildsRavager extends CardImpl { // When Nessian Wilds Ravager enters the battlefield, if tribute wasn't paid, you may have Nessian Wilds Ravager fight another target creature. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new FightTargetSourceEffect(), true); ability.addTarget(new TargetCreaturePermanent(filter)); - this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.instance, "When {this} enters the battlefield, if its tribute wasn't paid, you may have {this} fight another target creature.")); } diff --git a/Mage.Sets/src/mage/cards/n/NettlingImp.java b/Mage.Sets/src/mage/cards/n/NettlingImp.java index f9ab39809e..b4f7a07a8e 100644 --- a/Mage.Sets/src/mage/cards/n/NettlingImp.java +++ b/Mage.Sets/src/mage/cards/n/NettlingImp.java @@ -79,7 +79,7 @@ public class NettlingImp extends CardImpl { // {tap}: Choose target non-Wall creature the active player has controlled continuously since the beginning of the turn. That creature attacks this turn if able. If it doesn't, destroy it at the beginning of the next end step. Activate this ability only during an opponent's turn, before attackers are declared. Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new AttacksIfAbleTargetEffect(Duration.EndOfTurn), new TapSourceCost(), new NettlingImpTurnCondition(), "{T}: Choose target non-Wall creature the active player has controlled continuously since the beginning of the turn. That creature attacks this turn if able. If it doesn't, destroy it at the beginning of the next end step. Activate this ability only during an opponent's turn, before attackers are declared."); - ability.addEffect(new ConditionalOneShotEffect(new DestroyTargetAtBeginningOfNextEndStepEffect(), new InvertCondition(new TargetAttackedThisTurnCondition()))); + ability.addEffect(new ConditionalOneShotEffect(new DestroyTargetAtBeginningOfNextEndStepEffect(), new InvertCondition(TargetAttackedThisTurnCondition.instance))); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability, new AttackedThisTurnWatcher()); diff --git a/Mage.Sets/src/mage/cards/n/NightMarketAeronaut.java b/Mage.Sets/src/mage/cards/n/NightMarketAeronaut.java index 4763df3d24..4f0952b289 100644 --- a/Mage.Sets/src/mage/cards/n/NightMarketAeronaut.java +++ b/Mage.Sets/src/mage/cards/n/NightMarketAeronaut.java @@ -61,7 +61,7 @@ public class NightMarketAeronaut extends CardImpl { // Revolt — Night Market Aeronaut enters the battlefield with a +1/+1 counter on it if // a permanent you controlled left the battlefield this turn. Ability ability = new EntersBattlefieldAbility( - new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false, RevoltCondition.getInstance(), + new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false, RevoltCondition.instance, "Revolt — {this} enters the battlefield with a +1/+1 counter on it if a permanent you controlled left the battlefield this turn", null); ability.addWatcher(new RevoltWatcher()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/n/NightfallPredator.java b/Mage.Sets/src/mage/cards/n/NightfallPredator.java index 05ed78f600..1402a75fee 100644 --- a/Mage.Sets/src/mage/cards/n/NightfallPredator.java +++ b/Mage.Sets/src/mage/cards/n/NightfallPredator.java @@ -75,7 +75,7 @@ public class NightfallPredator extends CardImpl { this.addAbility(activatedAbility); // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Nightfall Predator. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public NightfallPredator(final NightfallPredator card) { diff --git a/Mage.Sets/src/mage/cards/n/NimAbomination.java b/Mage.Sets/src/mage/cards/n/NimAbomination.java index c3554545c8..adacfdb3e6 100644 --- a/Mage.Sets/src/mage/cards/n/NimAbomination.java +++ b/Mage.Sets/src/mage/cards/n/NimAbomination.java @@ -56,7 +56,7 @@ public class NimAbomination extends CardImpl { // At the beginning of your end step, if Nim Abomination is untapped, you lose 3 life. this.addAbility(new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new LoseLifeSourceControllerEffect(3), - TargetController.YOU, new SourceUntappedCondition(), false)); + TargetController.YOU, SourceUntappedCondition.instance, false)); } public NimAbomination(final NimAbomination card) { @@ -69,13 +69,9 @@ public class NimAbomination extends CardImpl { } } -class SourceUntappedCondition implements Condition { +enum SourceUntappedCondition implements Condition { - private static final SourceUntappedCondition fInstance = new SourceUntappedCondition(); - - public static SourceUntappedCondition getInstance() { - return fInstance; - } + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage.Sets/src/mage/cards/n/NissasPilgrimage.java b/Mage.Sets/src/mage/cards/n/NissasPilgrimage.java index 79e37cb4fc..2946502672 100644 --- a/Mage.Sets/src/mage/cards/n/NissasPilgrimage.java +++ b/Mage.Sets/src/mage/cards/n/NissasPilgrimage.java @@ -100,7 +100,7 @@ class NissasPilgrimageEffect extends OneShotEffect { MageObject sourceObject = source.getSourceObject(game); if (controller != null && sourceObject != null) { int number = 2; - if (SpellMasteryCondition.getInstance().apply(game, source)) { + if (SpellMasteryCondition.instance.apply(game, source)) { number++; } TargetCardInLibrary target = new TargetCardInLibrary(0, number, filter); diff --git a/Mage.Sets/src/mage/cards/n/NotOfThisWorld.java b/Mage.Sets/src/mage/cards/n/NotOfThisWorld.java index d559e88d75..69d7fe6d38 100644 --- a/Mage.Sets/src/mage/cards/n/NotOfThisWorld.java +++ b/Mage.Sets/src/mage/cards/n/NotOfThisWorld.java @@ -173,10 +173,10 @@ class NotOfThisWorldCondition implements Condition { filter.add(new ControllerPredicate(TargetController.YOU)); } - private static final NotOfThisWorldCondition fInstance = new NotOfThisWorldCondition(); + private static final NotOfThisWorldCondition instance = new NotOfThisWorldCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/n/NotoriousThrong.java b/Mage.Sets/src/mage/cards/n/NotoriousThrong.java index deef7475f2..e8cda95734 100644 --- a/Mage.Sets/src/mage/cards/n/NotoriousThrong.java +++ b/Mage.Sets/src/mage/cards/n/NotoriousThrong.java @@ -61,7 +61,7 @@ public class NotoriousThrong extends CardImpl { this.getSpellAbility().addEffect(new NotoriousThrongEffect()); this.getSpellAbility().addWatcher(new AmountOfDamageAPlayerReceivedThisTurnWatcher()); // If Notorious Throng's prowl cost was paid, take an extra turn after this one. - Effect effect = new ConditionalOneShotEffect(new AddExtraTurnControllerEffect(), ProwlCondition.getInstance()); + Effect effect = new ConditionalOneShotEffect(new AddExtraTurnControllerEffect(), ProwlCondition.instance); effect.setText("If {this}'s prowl cost was paid, take an extra turn after this one."); this.getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/cards/o/OakStreetInnkeeper.java b/Mage.Sets/src/mage/cards/o/OakStreetInnkeeper.java index e4278c6965..5766d2a666 100644 --- a/Mage.Sets/src/mage/cards/o/OakStreetInnkeeper.java +++ b/Mage.Sets/src/mage/cards/o/OakStreetInnkeeper.java @@ -65,7 +65,7 @@ public class OakStreetInnkeeper extends CardImpl { // As long as it's not your turn, tapped creatures you control have hexproof. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( new GainAbilityControlledEffect(HexproofAbility.getInstance(), Duration.WhileOnBattlefield, filter), - NotMyTurnCondition.getInstance(), + NotMyTurnCondition.instance, "As long as it's not your turn, tapped creatures you control have hexproof"))); } diff --git a/Mage.Sets/src/mage/cards/o/OathOfChandra.java b/Mage.Sets/src/mage/cards/o/OathOfChandra.java index c7e867f7a9..1d9a1105de 100644 --- a/Mage.Sets/src/mage/cards/o/OathOfChandra.java +++ b/Mage.Sets/src/mage/cards/o/OathOfChandra.java @@ -76,7 +76,7 @@ public class OathOfChandra extends CardImpl { // At the beginning of each end step, if a planeswalker entered the battlefield under your control this turn, Oath of Chandra deals 2 damage to each opponent. this.addAbility(new ConditionalTriggeredAbility(new BeginningOfEndStepTriggeredAbility( new DamagePlayersEffect(Outcome.Damage, new StaticValue(2), TargetController.OPPONENT), - TargetController.ANY, false), OathOfChandraCondition.getInstance(), + TargetController.ANY, false), OathOfChandraCondition.instance, "At the beginning of each end step, if a planeswalker entered the battlefield under your control this turn, {this} deals 2 damage to each opponent."), new OathOfChandraWatcher()); } @@ -90,13 +90,9 @@ public class OathOfChandra extends CardImpl { } } -class OathOfChandraCondition implements Condition { +enum OathOfChandraCondition implements Condition { - private static final OathOfChandraCondition fInstance = new OathOfChandraCondition(); - - public static Condition getInstance() { - return fInstance; - } + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage.Sets/src/mage/cards/o/OathOfLiliana.java b/Mage.Sets/src/mage/cards/o/OathOfLiliana.java index d966d0d567..b3c4969f1b 100644 --- a/Mage.Sets/src/mage/cards/o/OathOfLiliana.java +++ b/Mage.Sets/src/mage/cards/o/OathOfLiliana.java @@ -83,10 +83,10 @@ public class OathOfLiliana extends CardImpl { class OathOfLilianaCondition implements Condition { - private static final OathOfLilianaCondition fInstance = new OathOfLilianaCondition(); + private static final OathOfLilianaCondition instance = new OathOfLilianaCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/o/ObsessiveSkinner.java b/Mage.Sets/src/mage/cards/o/ObsessiveSkinner.java index fd23f91e15..a3dd1d2a8d 100644 --- a/Mage.Sets/src/mage/cards/o/ObsessiveSkinner.java +++ b/Mage.Sets/src/mage/cards/o/ObsessiveSkinner.java @@ -64,7 +64,7 @@ public class ObsessiveSkinner extends CardImpl { // put a +1/+1 counter on target creature. ability = new ConditionalTriggeredAbility( new BeginningOfUpkeepTriggeredAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance()), TargetController.OPPONENT, false), - DeliriumCondition.getInstance(), + DeliriumCondition.instance, "Delirium — At the beginning of each opponent's upkeep, if there are four or more card types among cards in your graveyard, " + "put a +1/+1 counter on target creature."); ability.addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/cards/o/OldManOfTheSea.java b/Mage.Sets/src/mage/cards/o/OldManOfTheSea.java index bf7c766aba..dbb42971c5 100644 --- a/Mage.Sets/src/mage/cards/o/OldManOfTheSea.java +++ b/Mage.Sets/src/mage/cards/o/OldManOfTheSea.java @@ -73,7 +73,7 @@ public class OldManOfTheSea extends CardImpl { FilterCreaturePermanent controllableCreatures = new FilterCreaturePermanent("creature with power less than or equal to Old Man of the Sea's power"); controllableCreatures.add(new PowerLowerEqualSourcePredicate(this.getId())); ConditionalContinuousEffect effect = new ConditionalContinuousEffect( - new OldManOfTheSeaGainControlTargetEffect(Duration.Custom, true), new CompoundCondition(SourceTappedCondition.getInstance(), new SourcePowerGreaterEqualTargetCondition()), + new OldManOfTheSeaGainControlTargetEffect(Duration.Custom, true), new CompoundCondition(SourceTappedCondition.instance, new SourcePowerGreaterEqualTargetCondition()), "Gain control of target creature with power less than or equal to {this}'s power for as long as {this} remains tapped and that creature's power remains less than or equal to {this}'s power"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent(controllableCreatures)); diff --git a/Mage.Sets/src/mage/cards/o/OneOfThePack.java b/Mage.Sets/src/mage/cards/o/OneOfThePack.java index 997d571395..86592c2947 100644 --- a/Mage.Sets/src/mage/cards/o/OneOfThePack.java +++ b/Mage.Sets/src/mage/cards/o/OneOfThePack.java @@ -58,7 +58,7 @@ public class OneOfThePack extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform One of the Pack. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public OneOfThePack(final OneOfThePack card) { diff --git a/Mage.Sets/src/mage/cards/o/OracleEnVec.java b/Mage.Sets/src/mage/cards/o/OracleEnVec.java index 010692f7e6..2e0a3f2bf9 100644 --- a/Mage.Sets/src/mage/cards/o/OracleEnVec.java +++ b/Mage.Sets/src/mage/cards/o/OracleEnVec.java @@ -73,7 +73,7 @@ public class OracleEnVec extends CardImpl { this.toughness = new MageInt(1); // {tap}: Target opponent chooses any number of creatures he or she controls. During that player's next turn, the chosen creatures attack if able, and other creatures can't attack. At the beginning of that turn's end step, destroy each of the chosen creatures that didn't attack. Activate this ability only during your turn. - Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new OracleEnVecEffect(), new TapSourceCost(), MyTurnCondition.getInstance()); + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new OracleEnVecEffect(), new TapSourceCost(), MyTurnCondition.instance); ability.addTarget(new TargetOpponent()); this.addAbility(ability, new AttackedThisTurnWatcher()); } diff --git a/Mage.Sets/src/mage/cards/o/OracleOfBones.java b/Mage.Sets/src/mage/cards/o/OracleOfBones.java index 14ac672080..561b857d05 100644 --- a/Mage.Sets/src/mage/cards/o/OracleOfBones.java +++ b/Mage.Sets/src/mage/cards/o/OracleOfBones.java @@ -69,7 +69,7 @@ public class OracleOfBones extends CardImpl { this.addAbility(new TributeAbility(2)); // When Oracle of Bones enters the battlefield, if tribute wasn't paid, you may cast an instant or sorcery card from your hand without paying its mana cost. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new OracleOfBonesCastEffect(), false); - this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.instance, "When {this} enters the battlefield, if its tribute wasn't paid, you may cast an instant or sorcery card from your hand without paying its mana cost.")); } diff --git a/Mage.Sets/src/mage/cards/o/OranRiefRecluse.java b/Mage.Sets/src/mage/cards/o/OranRiefRecluse.java index 18af4b1584..5bfe3d94e6 100644 --- a/Mage.Sets/src/mage/cards/o/OranRiefRecluse.java +++ b/Mage.Sets/src/mage/cards/o/OranRiefRecluse.java @@ -71,7 +71,7 @@ public class OranRiefRecluse extends CardImpl { // When Oran-Rief Recluse enters the battlefield, if it was kicked, destroy target creature with flying. EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false); ability.addTarget(new TargetCreaturePermanent(filter)); - this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), "When {this} enters the battlefield, if it was kicked, destroy target creature with flying.")); + this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, destroy target creature with flying.")); } public OranRiefRecluse(final OranRiefRecluse card) { diff --git a/Mage.Sets/src/mage/cards/o/OrimsChant.java b/Mage.Sets/src/mage/cards/o/OrimsChant.java index 0991b1416d..fa13e3ef13 100644 --- a/Mage.Sets/src/mage/cards/o/OrimsChant.java +++ b/Mage.Sets/src/mage/cards/o/OrimsChant.java @@ -122,7 +122,7 @@ class OrimsChantEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller != null && KickedCondition.getInstance().apply(game, source)) { + if (controller != null && KickedCondition.instance.apply(game, source)) { game.addEffect(new CantAttackAnyPlayerAllEffect(Duration.EndOfTurn, new FilterCreaturePermanent("creatures")), source); return true; } diff --git a/Mage.Sets/src/mage/cards/o/OrimsThunder.java b/Mage.Sets/src/mage/cards/o/OrimsThunder.java index a38c7d4135..d45eff89bd 100644 --- a/Mage.Sets/src/mage/cards/o/OrimsThunder.java +++ b/Mage.Sets/src/mage/cards/o/OrimsThunder.java @@ -63,14 +63,14 @@ public class OrimsThunder extends CardImpl { this.getSpellAbility().addTarget(new TargetPermanent(new FilterArtifactOrEnchantmentPermanent())); this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new OrimsThunderEffect2(), - KickedCondition.getInstance(), + KickedCondition.instance, "If Orim's Thunder was kicked, it deals damage equal to that permanent's converted mana cost to target creature")); } @Override public void adjustTargets(Ability ability, Game game) { if (ability instanceof SpellAbility) { - if (KickedCondition.getInstance().apply(game, ability)) { + if (KickedCondition.instance.apply(game, ability)) { ability.addTarget(new TargetCreaturePermanent()); } } @@ -104,7 +104,7 @@ class OrimsThunderEffect2 extends OneShotEffect { if (firstTarget != null) { damage = firstTarget.getConvertedManaCost(); } - boolean kicked = KickedCondition.getInstance().apply(game, source); + boolean kicked = KickedCondition.instance.apply(game, source); if (kicked && secondTarget != null) { secondTarget.damage(damage, source.getSourceId(), game, false, true); return true; diff --git a/Mage.Sets/src/mage/cards/o/OrimsTouch.java b/Mage.Sets/src/mage/cards/o/OrimsTouch.java index 966fbdbb3c..82e2162469 100644 --- a/Mage.Sets/src/mage/cards/o/OrimsTouch.java +++ b/Mage.Sets/src/mage/cards/o/OrimsTouch.java @@ -55,7 +55,7 @@ public class OrimsTouch extends CardImpl { // Prevent the next 2 damage that would be dealt to target creature or player this turn. If Orim's Touch was kicked, prevent the next 4 damage that would be dealt to that creature or player this turn instead. Effect effect = new ConditionalReplacementEffect( new PreventDamageToTargetEffect(Duration.EndOfTurn, 4), - new LockedInCondition(KickedCondition.getInstance()), + new LockedInCondition(KickedCondition.instance), new PreventDamageToTargetEffect(Duration.EndOfTurn, 2)); effect.setText("Prevent the next 2 damage that would be dealt to target creature or player this turn. If Orim's Touch was kicked, prevent the next 4 damage that would be dealt to that creature or player this turn instead"); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); diff --git a/Mage.Sets/src/mage/cards/o/Ornitharch.java b/Mage.Sets/src/mage/cards/o/Ornitharch.java index a33c1a72a9..7f05379fa0 100644 --- a/Mage.Sets/src/mage/cards/o/Ornitharch.java +++ b/Mage.Sets/src/mage/cards/o/Ornitharch.java @@ -60,7 +60,7 @@ public class Ornitharch extends CardImpl { this.addAbility(new TributeAbility(2)); // When Ornitharch enters the battlefield, if tribute wasn't paid, create two 1/1 white Bird creature tokens with flying. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new BirdToken(), 2), false); - this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.instance, "When {this} enters the battlefield, if its tribute wasn't paid, create two 1/1 white Bird creature tokens with flying.")); } diff --git a/Mage.Sets/src/mage/cards/o/OsaiVultures.java b/Mage.Sets/src/mage/cards/o/OsaiVultures.java index 94474e2b94..6a78b76e49 100644 --- a/Mage.Sets/src/mage/cards/o/OsaiVultures.java +++ b/Mage.Sets/src/mage/cards/o/OsaiVultures.java @@ -61,7 +61,7 @@ public class OsaiVultures extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // At the beginning of each end step, if a creature died this turn, put a carrion counter on Osai Vultures. this.addAbility(new ConditionalTriggeredAbility(new BeginningOfEndStepTriggeredAbility( - new AddCountersSourceEffect(CounterType.CARRION.createInstance()), TargetController.ANY, false), MorbidCondition.getInstance(), + new AddCountersSourceEffect(CounterType.CARRION.createInstance()), TargetController.ANY, false), MorbidCondition.instance, "At the beginning of each end step, if a creature died this turn, put a carrion counter on {this}.")); // Remove two carrion counters from Osai Vultures: Osai Vultures gets +1/+1 until end of turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), diff --git a/Mage.Sets/src/mage/cards/o/Overload.java b/Mage.Sets/src/mage/cards/o/Overload.java index f873f6eb51..d7e90d3957 100644 --- a/Mage.Sets/src/mage/cards/o/Overload.java +++ b/Mage.Sets/src/mage/cards/o/Overload.java @@ -69,7 +69,7 @@ public class Overload extends CardImpl { @Override public void adjustTargets(Ability ability, Game game) { if(ability instanceof SpellAbility) { - if(!KickedCondition.getInstance().apply(game, ability)) { + if(!KickedCondition.instance.apply(game, ability)) { ability.getTargets().clear(); ability.getTargets().add(new TargetArtifactPermanent(filter2)); } diff --git a/Mage.Sets/src/mage/cards/p/ParanoidParishBlade.java b/Mage.Sets/src/mage/cards/p/ParanoidParishBlade.java index 57343b54eb..d0622545ab 100644 --- a/Mage.Sets/src/mage/cards/p/ParanoidParishBlade.java +++ b/Mage.Sets/src/mage/cards/p/ParanoidParishBlade.java @@ -57,11 +57,11 @@ public class ParanoidParishBlade extends CardImpl { // Delirium — Paranoid Parish-Blade gets +1/+0 and has first strike as long as there are four or more card types among cards in your graveyard. ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new BoostSourceEffect(1, 0, Duration.WhileOnBattlefield), - DeliriumCondition.getInstance(), "Delirium — {this} gets +1/+0 "); + DeliriumCondition.instance, "Delirium — {this} gets +1/+0 "); effect.setText("Delirium — {this} gets +1/+0"); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); effect = new ConditionalContinuousEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.WhileOnBattlefield), - DeliriumCondition.getInstance(), "and has first strike as long as there are four or more card types among cards in your graveyard."); + DeliriumCondition.instance, "and has first strike as long as there are four or more card types among cards in your graveyard."); ability.addEffect(effect); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/p/PathOfBravery.java b/Mage.Sets/src/mage/cards/p/PathOfBravery.java index e4505cb914..27a26c7144 100644 --- a/Mage.Sets/src/mage/cards/p/PathOfBravery.java +++ b/Mage.Sets/src/mage/cards/p/PathOfBravery.java @@ -83,10 +83,10 @@ public class PathOfBravery extends CardImpl { class LifeCondition implements Condition { - private static LifeCondition fInstance = new LifeCondition(); + private static LifeCondition instance = new LifeCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/p/PearlspearCourier.java b/Mage.Sets/src/mage/cards/p/PearlspearCourier.java index f69a6a830a..a9b2e3a467 100644 --- a/Mage.Sets/src/mage/cards/p/PearlspearCourier.java +++ b/Mage.Sets/src/mage/cards/p/PearlspearCourier.java @@ -71,10 +71,10 @@ public class PearlspearCourier extends CardImpl { this.addAbility(new SkipUntapOptionalAbility()); // {2}{W}, {tap}: Target Soldier creature gets +2/+2 and has vigilance for as long as Pearlspear Courier remains tapped. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( - new BoostTargetEffect(2, 2, Duration.Custom), SourceTappedCondition.getInstance(), + new BoostTargetEffect(2, 2, Duration.Custom), SourceTappedCondition.instance, "target Soldier creature gets +2/+2"), new ManaCostsImpl("{2}{W}")); ability.addEffect(new ConditionalContinuousEffect(new GainAbilityTargetEffect(VigilanceAbility.getInstance(), - Duration.Custom), SourceTappedCondition.getInstance(),"and has vigilance for as long as {this} remains tapped")); + Duration.Custom), SourceTappedCondition.instance,"and has vigilance for as long as {this} remains tapped")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/p/PermafrostTrap.java b/Mage.Sets/src/mage/cards/p/PermafrostTrap.java index 6c5d5cf99f..8965db050e 100644 --- a/Mage.Sets/src/mage/cards/p/PermafrostTrap.java +++ b/Mage.Sets/src/mage/cards/p/PermafrostTrap.java @@ -74,10 +74,10 @@ public class PermafrostTrap extends CardImpl { class PermafrostTrapCondition implements Condition { - private static final PermafrostTrapCondition fInstance = new PermafrostTrapCondition(); + private static final PermafrostTrapCondition instance = new PermafrostTrapCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/p/PharagaxGiant.java b/Mage.Sets/src/mage/cards/p/PharagaxGiant.java index 59f04fd618..8ea864b4b0 100644 --- a/Mage.Sets/src/mage/cards/p/PharagaxGiant.java +++ b/Mage.Sets/src/mage/cards/p/PharagaxGiant.java @@ -57,7 +57,7 @@ public class PharagaxGiant extends CardImpl { this.addAbility(new TributeAbility(2)); // When Pharagax Giant enters the battlefield, if tribute wasn't paid, Pharagax Giant deals 5 damage to each opponent. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DamagePlayersEffect(5, TargetController.OPPONENT), false); - this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.instance, "When {this} enters the battlefield, if its tribute wasn't paid, {this} deals 5 damage to each opponent.")); } diff --git a/Mage.Sets/src/mage/cards/p/PhyrexianScuta.java b/Mage.Sets/src/mage/cards/p/PhyrexianScuta.java index df72976ca5..2c6f37fd98 100644 --- a/Mage.Sets/src/mage/cards/p/PhyrexianScuta.java +++ b/Mage.Sets/src/mage/cards/p/PhyrexianScuta.java @@ -55,7 +55,7 @@ public class PhyrexianScuta extends CardImpl { // Kicker-Pay 3 life. this.addAbility(new KickerAbility(new PayLifeCost(3))); // If Phyrexian Scuta was kicked, it enters the battlefield with two +1/+1 counters on it. - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), KickedCondition.getInstance(), "If Phyrexian Scuta was kicked, it enters the battlefield with two +1/+1 counters on it.", "")); + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), KickedCondition.instance, "If Phyrexian Scuta was kicked, it enters the battlefield with two +1/+1 counters on it.", "")); } public PhyrexianScuta(final PhyrexianScuta card) { diff --git a/Mage.Sets/src/mage/cards/p/PickTheBrain.java b/Mage.Sets/src/mage/cards/p/PickTheBrain.java index 52a14384a5..b0932a20e8 100644 --- a/Mage.Sets/src/mage/cards/p/PickTheBrain.java +++ b/Mage.Sets/src/mage/cards/p/PickTheBrain.java @@ -106,7 +106,7 @@ class PickTheBrainEffect extends SearchTargetGraveyardHandLibraryForCardNameAndE controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.HAND, true); // Check the Delirium condition - if (!DeliriumCondition.getInstance().apply(game, source)) { + if (!DeliriumCondition.instance.apply(game, source)) { return true; } return this.applySearchAndExile(game, source, card.getName(), opponent.getId()); diff --git a/Mage.Sets/src/mage/cards/p/PincerSpider.java b/Mage.Sets/src/mage/cards/p/PincerSpider.java index 22802ed7b4..7629af1514 100644 --- a/Mage.Sets/src/mage/cards/p/PincerSpider.java +++ b/Mage.Sets/src/mage/cards/p/PincerSpider.java @@ -61,7 +61,7 @@ public class PincerSpider extends CardImpl { // If Pincer Spider was kicked, it enters the battlefield with a +1/+1 counter on it. Ability ability = new EntersBattlefieldAbility( - new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), KickedCondition.getInstance(), ""), + new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), KickedCondition.instance, ""), "If {this} was kicked, it enters the battlefield with a +1/+1 counter on it."); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/p/PitfallTrap.java b/Mage.Sets/src/mage/cards/p/PitfallTrap.java index 402f8dad56..f9073c40b3 100644 --- a/Mage.Sets/src/mage/cards/p/PitfallTrap.java +++ b/Mage.Sets/src/mage/cards/p/PitfallTrap.java @@ -79,10 +79,10 @@ public class PitfallTrap extends CardImpl { class PitfallTrapCondition implements Condition { - private static final PitfallTrapCondition fInstance = new PitfallTrapCondition(); + private static final PitfallTrapCondition instance = new PitfallTrapCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/p/PolisCrusher.java b/Mage.Sets/src/mage/cards/p/PolisCrusher.java index b0174536d0..2040c771c3 100644 --- a/Mage.Sets/src/mage/cards/p/PolisCrusher.java +++ b/Mage.Sets/src/mage/cards/p/PolisCrusher.java @@ -82,7 +82,7 @@ public class PolisCrusher extends CardImpl { // Whenever Polis Crusher deals combat damage to a player, if Polis Crusher is monstrous, destroy target enchantment that player controls. Ability ability = new ConditionalTriggeredAbility( new DealsCombatDamageToAPlayerTriggeredAbility(new DestroyTargetEffect(), false, true), - MonstrousCondition.getInstance(), + MonstrousCondition.instance, "Whenever {this} deals combat damage to a player, if {this} is monstrous, destroy target enchantment that player controls."); originalId = ability.getOriginalId(); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/p/PollenRemedy.java b/Mage.Sets/src/mage/cards/p/PollenRemedy.java index 2e13fd26f2..68f400226e 100644 --- a/Mage.Sets/src/mage/cards/p/PollenRemedy.java +++ b/Mage.Sets/src/mage/cards/p/PollenRemedy.java @@ -60,7 +60,7 @@ public class PollenRemedy extends CardImpl { this.addAbility(new KickerAbility(new SacrificeTargetCost(new TargetControlledPermanent(1, 1, new FilterControlledLandPermanent("a land"), true)))); // Prevent the next 3 damage that would be dealt this turn to any number of target creatures and/or players, divided as you choose. If Pollen Remedy was kicked, prevent the next 6 damage this way instead. Effect effect = new ConditionalReplacementEffect(new PreventDamageToTargetMultiAmountEffect(Duration.EndOfTurn, 6), - KickedCondition.getInstance(), new PreventDamageToTargetMultiAmountEffect(Duration.EndOfTurn, 3)); + KickedCondition.instance, new PreventDamageToTargetMultiAmountEffect(Duration.EndOfTurn, 3)); effect.setText("Prevent the next 3 damage that would be dealt this turn to any number of target creatures and/or players, divided as you choose. If {this} was kicked, prevent the next 6 damage this way instead."); this.getSpellAbility().addEffect(effect); originalId = this.getSpellAbility().getOriginalId(); @@ -69,7 +69,7 @@ public class PollenRemedy extends CardImpl { @Override public void adjustTargets(Ability ability, Game game) { if(ability.getOriginalId().equals(originalId)) { - ability.addTarget(new TargetCreatureOrPlayerAmount(KickedCondition.getInstance().apply(game, ability) ? 6 : 3)); + ability.addTarget(new TargetCreatureOrPlayerAmount(KickedCondition.instance.apply(game, ability) ? 6 : 3)); } } diff --git a/Mage.Sets/src/mage/cards/p/PouncingKavu.java b/Mage.Sets/src/mage/cards/p/PouncingKavu.java index 71514802db..44a9e21208 100644 --- a/Mage.Sets/src/mage/cards/p/PouncingKavu.java +++ b/Mage.Sets/src/mage/cards/p/PouncingKavu.java @@ -63,7 +63,7 @@ public class PouncingKavu extends CardImpl { this.addAbility(FirstStrikeAbility.getInstance()); // If Pouncing Kavu was kicked, it enters the battlefield with two +1/+1 counters on it and with haste. Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), - KickedCondition.getInstance(), "If {this} was kicked, it enters the battlefield with two +1/+1 counters on it and with haste.", ""); + KickedCondition.instance, "If {this} was kicked, it enters the battlefield with two +1/+1 counters on it and with haste.", ""); ability.addEffect(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/p/PouncingWurm.java b/Mage.Sets/src/mage/cards/p/PouncingWurm.java index 2d65adda10..8df7322580 100644 --- a/Mage.Sets/src/mage/cards/p/PouncingWurm.java +++ b/Mage.Sets/src/mage/cards/p/PouncingWurm.java @@ -61,7 +61,7 @@ public class PouncingWurm extends CardImpl { // If Pouncing Wurm was kicked, it enters the battlefield with three +1/+1 counters on it and with haste. Ability ability = new ConditionalTriggeredAbility( new EntersBattlefieldTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(3))), - KickedCondition.getInstance(),"If Pouncing Wurm was kicked, it enters the battlefield with three +1/+1 counters on it and with haste."); + KickedCondition.instance,"If Pouncing Wurm was kicked, it enters the battlefield with three +1/+1 counters on it and with haste."); ability.addEffect(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/p/Preacher.java b/Mage.Sets/src/mage/cards/p/Preacher.java index cf59a2aad1..653197552f 100644 --- a/Mage.Sets/src/mage/cards/p/Preacher.java +++ b/Mage.Sets/src/mage/cards/p/Preacher.java @@ -120,7 +120,7 @@ class PreacherEffect extends OneShotEffect { ConditionalContinuousEffect effect = new ConditionalContinuousEffect( new GainControlTargetEffect(Duration.Custom), - new CompoundCondition(SourceTappedCondition.getInstance(), new CompoundCondition (condition, conditionTarget)), + new CompoundCondition(SourceTappedCondition.instance, new CompoundCondition (condition, conditionTarget)), "Gain control of target creature of an opponent's choice that he or she controls for as long as {this} remains tapped"); game.addEffect(effect, source); } diff --git a/Mage.Sets/src/mage/cards/p/PredatorsHowl.java b/Mage.Sets/src/mage/cards/p/PredatorsHowl.java index 8ed951092c..9390c6c24d 100644 --- a/Mage.Sets/src/mage/cards/p/PredatorsHowl.java +++ b/Mage.Sets/src/mage/cards/p/PredatorsHowl.java @@ -51,7 +51,7 @@ public class PredatorsHowl extends CardImpl { Effect effect = new ConditionalOneShotEffect( new CreateTokenEffect(new WolfToken(), 3), new CreateTokenEffect(new WolfToken(), 1), - new MorbidCondition(), + MorbidCondition.instance, "Create a 2/2 green Wolf creature token.

Morbid - Create three 2/2 green Wolf creature tokens instead if a creature died this turn."); this.getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/cards/p/Prickleboar.java b/Mage.Sets/src/mage/cards/p/Prickleboar.java index 2d297e2163..10005f831b 100644 --- a/Mage.Sets/src/mage/cards/p/Prickleboar.java +++ b/Mage.Sets/src/mage/cards/p/Prickleboar.java @@ -58,12 +58,12 @@ public class Prickleboar extends CardImpl { /// As long as it's your turn, Prickleboar gets +2/+0 Effect boostEffect = new ConditionalContinuousEffect( new BoostSourceEffect(2, 0, Duration.WhileOnBattlefield), - MyTurnCondition.getInstance(), + MyTurnCondition.instance, "As long as it's your turn, {this} gets +2/+0"); // and has first strike. Effect gainAbilityEffect = new ConditionalContinuousEffect( new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.WhileOnBattlefield), - MyTurnCondition.getInstance(), + MyTurnCondition.instance, "and has first strike"); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, boostEffect); ability.addEffect(gainAbilityEffect); diff --git a/Mage.Sets/src/mage/cards/p/PrimalGrowth.java b/Mage.Sets/src/mage/cards/p/PrimalGrowth.java index dfd5356155..ecf2e7f2ab 100644 --- a/Mage.Sets/src/mage/cards/p/PrimalGrowth.java +++ b/Mage.Sets/src/mage/cards/p/PrimalGrowth.java @@ -56,7 +56,7 @@ public class PrimalGrowth extends CardImpl { this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 2, new FilterBasicLandCard()), false, true), new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 1, new FilterBasicLandCard()), false, true), - KickedCondition.getInstance(), + KickedCondition.instance, "Search your library for a basic land card, put that card onto the battlefield, then shuffle your library. If Primal Growth was kicked, instead search your library for up to two basic land cards, put them onto the battlefield, then shuffle your library")); } diff --git a/Mage.Sets/src/mage/cards/p/PrisonBarricade.java b/Mage.Sets/src/mage/cards/p/PrisonBarricade.java index 5066053ff2..f46ef58254 100644 --- a/Mage.Sets/src/mage/cards/p/PrisonBarricade.java +++ b/Mage.Sets/src/mage/cards/p/PrisonBarricade.java @@ -61,7 +61,7 @@ public class PrisonBarricade extends CardImpl { this.addAbility(new KickerAbility("{1}{W}")); // If Prison Barricade was kicked, it enters the battlefield with a +1/+1 counter on it and with "Prison Barricade can attack as though it didn't have defender." Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), - KickedCondition.getInstance(), "If {this} was kicked, it enters the battlefield with a +1/+1 counter on it and with \"{this} can attack as though it didn't have defender.\"", ""); + KickedCondition.instance, "If {this} was kicked, it enters the battlefield with a +1/+1 counter on it and with \"{this} can attack as though it didn't have defender.\"", ""); ability.addEffect(new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/p/PristineAngel.java b/Mage.Sets/src/mage/cards/p/PristineAngel.java index 5886d5164b..23e0f0f529 100644 --- a/Mage.Sets/src/mage/cards/p/PristineAngel.java +++ b/Mage.Sets/src/mage/cards/p/PristineAngel.java @@ -81,7 +81,7 @@ public class PristineAngel extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( new GainAbilitySourceEffect(new ProtectionAbility(filter), Duration.WhileOnBattlefield), - new InvertCondition(new SourceTappedCondition()), + new InvertCondition(SourceTappedCondition.instance), "As long as {this} is untapped, it has protection from artifacts and from all colors"))); // Whenever you cast a spell, you may untap Pristine Angel. this.addAbility(new SpellCastControllerTriggeredAbility(new UntapSourceEffect(), true)); diff --git a/Mage.Sets/src/mage/cards/p/Probe.java b/Mage.Sets/src/mage/cards/p/Probe.java index da653074fd..9430f0c0da 100644 --- a/Mage.Sets/src/mage/cards/p/Probe.java +++ b/Mage.Sets/src/mage/cards/p/Probe.java @@ -57,7 +57,7 @@ public class Probe extends CardImpl { // If Probe was kicked, target player discards two cards. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DiscardTargetEffect(2), - KickedCondition.getInstance(), + KickedCondition.instance, "If {this} was kicked, target player discards two cards")); } @@ -65,7 +65,7 @@ public class Probe extends CardImpl { public void adjustTargets(Ability ability, Game game) { if (ability instanceof SpellAbility) { ability.getTargets().clear(); - if (KickedCondition.getInstance().apply(game, ability)) { + if (KickedCondition.instance.apply(game, ability)) { ability.addTarget(new TargetPlayer()); } } diff --git a/Mage.Sets/src/mage/cards/p/Prohibit.java b/Mage.Sets/src/mage/cards/p/Prohibit.java index 096deebaed..7e53ef2425 100644 --- a/Mage.Sets/src/mage/cards/p/Prohibit.java +++ b/Mage.Sets/src/mage/cards/p/Prohibit.java @@ -71,7 +71,7 @@ public class Prohibit extends CardImpl { @Override public void adjustTargets(Ability ability, Game game) { if (ability instanceof SpellAbility) { - if (!KickedCondition.getInstance().apply(game, ability)) { + if (!KickedCondition.instance.apply(game, ability)) { ability.getTargets().clear(); ability.getTargets().add(new TargetSpell(filter2)); } diff --git a/Mage.Sets/src/mage/cards/p/PsychicRebuttal.java b/Mage.Sets/src/mage/cards/p/PsychicRebuttal.java index 4fdc20c5d2..6d5b7a9802 100644 --- a/Mage.Sets/src/mage/cards/p/PsychicRebuttal.java +++ b/Mage.Sets/src/mage/cards/p/PsychicRebuttal.java @@ -107,7 +107,7 @@ class PsychicRebuttalEffect extends OneShotEffect { if (spell != null) { game.getStack().counter(spell.getId(), source.getSourceId(), game); - if (SpellMasteryCondition.getInstance().apply(game, source) + if (SpellMasteryCondition.instance.apply(game, source) && controller.chooseUse(Outcome.PlayForFree, "Copy " + spell.getName() + " (you may choose new targets for the copy)?", source, game)) { StackObject newStackObject = spell.createCopyOnStack(game, source, source.getControllerId(), true); diff --git a/Mage.Sets/src/mage/cards/p/PuresteelPaladin.java b/Mage.Sets/src/mage/cards/p/PuresteelPaladin.java index ebfc089644..d5d2a062ae 100644 --- a/Mage.Sets/src/mage/cards/p/PuresteelPaladin.java +++ b/Mage.Sets/src/mage/cards/p/PuresteelPaladin.java @@ -71,7 +71,7 @@ public class PuresteelPaladin extends CardImpl { // Metalcraft - Equipment you control have equip {0} as long as you control three or more artifacts this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( new GainAbilityControlledEffect(new EquipAbility(Outcome.AddAbility, new GenericManaCost(0)), Duration.WhileOnBattlefield, filter), - MetalcraftCondition.getInstance(), + MetalcraftCondition.instance, "Metalcraft - Equipment you control have equip {0} as long as you control three or more artifacts"))); } diff --git a/Mage.Sets/src/mage/cards/q/QueenMarchesa.java b/Mage.Sets/src/mage/cards/q/QueenMarchesa.java index 476b755162..85dc944ae2 100644 --- a/Mage.Sets/src/mage/cards/q/QueenMarchesa.java +++ b/Mage.Sets/src/mage/cards/q/QueenMarchesa.java @@ -86,10 +86,10 @@ public class QueenMarchesa extends CardImpl { class OpponentIsMonarchCondition implements Condition { - private final static OpponentIsMonarchCondition fInstance = new OpponentIsMonarchCondition(); + private final static OpponentIsMonarchCondition instance = new OpponentIsMonarchCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/r/RagMan.java b/Mage.Sets/src/mage/cards/r/RagMan.java index 6cde3946ea..efbf7a83af 100644 --- a/Mage.Sets/src/mage/cards/r/RagMan.java +++ b/Mage.Sets/src/mage/cards/r/RagMan.java @@ -64,7 +64,7 @@ public class RagMan extends CardImpl { this.toughness = new MageInt(1); // {B}{B}{B}, {tap}: Target opponent reveals his or her hand and discards a creature card at random. Activate this ability only during your turn. - Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new RevealHandTargetEffect(), new ManaCostsImpl("{B}{B}{B}"), MyTurnCondition.getInstance()); + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new RevealHandTargetEffect(), new ManaCostsImpl("{B}{B}{B}"), MyTurnCondition.instance); ability.addCost(new TapSourceCost()); ability.addEffect(new RagManDiscardEffect()); ability.addTarget(new TargetOpponent()); diff --git a/Mage.Sets/src/mage/cards/r/Ragamuffyn.java b/Mage.Sets/src/mage/cards/r/Ragamuffyn.java index 25ae1bc42c..30523b770e 100644 --- a/Mage.Sets/src/mage/cards/r/Ragamuffyn.java +++ b/Mage.Sets/src/mage/cards/r/Ragamuffyn.java @@ -65,7 +65,7 @@ public class Ragamuffyn extends CardImpl { this.toughness = new MageInt(2); // Hellbent - {tap}, Sacrifice a creature or land: Draw a card. Activate this ability only if you have no cards in hand. - Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD,new DrawCardSourceControllerEffect(1),new TapSourceCost(), HellbentCondition.getInstance()); + Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD,new DrawCardSourceControllerEffect(1),new TapSourceCost(), HellbentCondition.instance); ability.setAbilityWord(AbilityWord.HELLBENT); ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/r/RakdosPitDragon.java b/Mage.Sets/src/mage/cards/r/RakdosPitDragon.java index 93d4dbaa9d..2b5a602eb3 100644 --- a/Mage.Sets/src/mage/cards/r/RakdosPitDragon.java +++ b/Mage.Sets/src/mage/cards/r/RakdosPitDragon.java @@ -68,7 +68,7 @@ public class RakdosPitDragon extends CardImpl { // Hellbent — Rakdos Pit Dragon has double strike as long as you have no cards in hand. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( new GainAbilitySourceEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield), - HellbentCondition.getInstance(), + HellbentCondition.instance, "Hellbent - Rakdos Pit Dragon has double strike as long as you have no cards in hand"))); } diff --git a/Mage.Sets/src/mage/cards/r/RampagingWerewolf.java b/Mage.Sets/src/mage/cards/r/RampagingWerewolf.java index 325e64c38b..528140a049 100644 --- a/Mage.Sets/src/mage/cards/r/RampagingWerewolf.java +++ b/Mage.Sets/src/mage/cards/r/RampagingWerewolf.java @@ -60,7 +60,7 @@ public class RampagingWerewolf extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Rampaging Werewolf. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } diff --git a/Mage.Sets/src/mage/cards/r/RasputinDreamweaver.java b/Mage.Sets/src/mage/cards/r/RasputinDreamweaver.java index 79bb93d47d..079d4b211d 100644 --- a/Mage.Sets/src/mage/cards/r/RasputinDreamweaver.java +++ b/Mage.Sets/src/mage/cards/r/RasputinDreamweaver.java @@ -107,10 +107,10 @@ public class RasputinDreamweaver extends CardImpl { class RasputinDreamweaverStartedUntappedCondition implements Condition { - private static final RasputinDreamweaverStartedUntappedCondition fInstance = new RasputinDreamweaverStartedUntappedCondition(); + private static final RasputinDreamweaverStartedUntappedCondition instance = new RasputinDreamweaverStartedUntappedCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/r/RavagerOfTheFells.java b/Mage.Sets/src/mage/cards/r/RavagerOfTheFells.java index 994f15c46b..6e777ce1a4 100644 --- a/Mage.Sets/src/mage/cards/r/RavagerOfTheFells.java +++ b/Mage.Sets/src/mage/cards/r/RavagerOfTheFells.java @@ -84,7 +84,7 @@ public class RavagerOfTheFells extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Ravager of the Fells. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public RavagerOfTheFells(final RavagerOfTheFells card) { diff --git a/Mage.Sets/src/mage/cards/r/RavagingBlaze.java b/Mage.Sets/src/mage/cards/r/RavagingBlaze.java index 2a4edb5f48..8425bec3a2 100644 --- a/Mage.Sets/src/mage/cards/r/RavagingBlaze.java +++ b/Mage.Sets/src/mage/cards/r/RavagingBlaze.java @@ -52,7 +52,7 @@ public class RavagingBlaze extends CardImpl { this.getSpellAbility().addTarget(new TargetCreaturePermanent()); // Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, Ravaging Blaze also deals X damage to that creature's controller. this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new DamageTargetControllerEffect(new ManacostVariableValue()), - SpellMasteryCondition.getInstance(), "
Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, Ravaging Blaze also deals X damage to that creature's controller.")); + SpellMasteryCondition.instance, "
Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, Ravaging Blaze also deals X damage to that creature's controller.")); } public RavagingBlaze(final RavagingBlaze card) { diff --git a/Mage.Sets/src/mage/cards/r/RavagingRiftwurm.java b/Mage.Sets/src/mage/cards/r/RavagingRiftwurm.java index 33fd7eb3a0..b6f99c7ed9 100644 --- a/Mage.Sets/src/mage/cards/r/RavagingRiftwurm.java +++ b/Mage.Sets/src/mage/cards/r/RavagingRiftwurm.java @@ -63,7 +63,7 @@ public class RavagingRiftwurm extends CardImpl { this.addAbility(new VanishingSacrificeAbility()); // If Ravaging Riftwurm was kicked, it enters the battlefield with three additional time counters on it. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3)), - KickedCondition.getInstance(), "If {this} was kicked, it enters the battlefield with three additional time counters on it.", "")); + KickedCondition.instance, "If {this} was kicked, it enters the battlefield with three additional time counters on it.", "")); } public RavagingRiftwurm(final RavagingRiftwurm card) { diff --git a/Mage.Sets/src/mage/cards/r/RavenousTrap.java b/Mage.Sets/src/mage/cards/r/RavenousTrap.java index 98881776f1..67e666d284 100644 --- a/Mage.Sets/src/mage/cards/r/RavenousTrap.java +++ b/Mage.Sets/src/mage/cards/r/RavenousTrap.java @@ -70,10 +70,10 @@ public class RavenousTrap extends CardImpl { class RavenousTrapCondition implements Condition { - private static final RavenousTrapCondition fInstance = new RavenousTrapCondition(); + private static final RavenousTrapCondition instance = new RavenousTrapCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/r/RazorfieldRhino.java b/Mage.Sets/src/mage/cards/r/RazorfieldRhino.java index e80808a4e4..03b234e282 100644 --- a/Mage.Sets/src/mage/cards/r/RazorfieldRhino.java +++ b/Mage.Sets/src/mage/cards/r/RazorfieldRhino.java @@ -54,7 +54,7 @@ public class RazorfieldRhino extends CardImpl { this.power = new MageInt(4); this.toughness = new MageInt(4); ContinuousEffect effect1 = new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(effect1, MetalcraftCondition.getInstance(), "Metalcraft - Razorfield Rhino gets +2/+2 as long as you control three or more artifacts"))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(effect1, MetalcraftCondition.instance, "Metalcraft - Razorfield Rhino gets +2/+2 as long as you control three or more artifacts"))); } public RazorfieldRhino (final RazorfieldRhino card) { diff --git a/Mage.Sets/src/mage/cards/r/ReaperOfFlightMoonsilver.java b/Mage.Sets/src/mage/cards/r/ReaperOfFlightMoonsilver.java index 5d49e8fc08..fe843085fc 100644 --- a/Mage.Sets/src/mage/cards/r/ReaperOfFlightMoonsilver.java +++ b/Mage.Sets/src/mage/cards/r/ReaperOfFlightMoonsilver.java @@ -61,7 +61,7 @@ public class ReaperOfFlightMoonsilver extends CardImpl { this.addAbility(new ConditionalActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 1, Duration.EndOfTurn), new SacrificeTargetCost(new TargetControlledCreaturePermanent()), - new DeliriumCondition(), + DeliriumCondition.instance, "Delirium — Sacrifice another creature: Reaper of Flight Moonsilver gets +2/+1 until end of turn. " + "Activate this ability only if there are four or more card types among cards in your graveyard")); } diff --git a/Mage.Sets/src/mage/cards/r/RecklessBushwhacker.java b/Mage.Sets/src/mage/cards/r/RecklessBushwhacker.java index c2f11fd90e..1aa05dc372 100644 --- a/Mage.Sets/src/mage/cards/r/RecklessBushwhacker.java +++ b/Mage.Sets/src/mage/cards/r/RecklessBushwhacker.java @@ -72,7 +72,7 @@ public class RecklessBushwhacker extends CardImpl { // When Reckless Bushwhacker enters the battlefield, if its surge cost was paid, other creatures you control get +1/+0 and gain haste until end of turn. EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new BoostControlledEffect(1, 0, Duration.EndOfTurn, true), false); ability.addEffect(new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.EndOfTurn, FILTER, true)); - this.addAbility(new ConditionalTriggeredAbility(ability, SurgedCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(ability, SurgedCondition.instance, "When {this} enters the battlefield, if its surge cost was paid, other creatures you control get +1/+0 and gain haste until end of turn.")); } diff --git a/Mage.Sets/src/mage/cards/r/RecklessWaif.java b/Mage.Sets/src/mage/cards/r/RecklessWaif.java index 6693565591..261c5ec371 100644 --- a/Mage.Sets/src/mage/cards/r/RecklessWaif.java +++ b/Mage.Sets/src/mage/cards/r/RecklessWaif.java @@ -62,7 +62,7 @@ public class RecklessWaif extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Reckless Waif. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public RecklessWaif(final RecklessWaif card) { diff --git a/Mage.Sets/src/mage/cards/r/RefractionTrap.java b/Mage.Sets/src/mage/cards/r/RefractionTrap.java index 34acfdc556..6f7d67fb19 100644 --- a/Mage.Sets/src/mage/cards/r/RefractionTrap.java +++ b/Mage.Sets/src/mage/cards/r/RefractionTrap.java @@ -81,10 +81,10 @@ public class RefractionTrap extends CardImpl { class RefractionTrapCondition implements Condition { - private static final RefractionTrapCondition fInstance = new RefractionTrapCondition(); + private static final RefractionTrapCondition instance = new RefractionTrapCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/r/RenegadeRallier.java b/Mage.Sets/src/mage/cards/r/RenegadeRallier.java index d36dda229a..8ef49ab495 100644 --- a/Mage.Sets/src/mage/cards/r/RenegadeRallier.java +++ b/Mage.Sets/src/mage/cards/r/RenegadeRallier.java @@ -67,7 +67,7 @@ public class RenegadeRallier extends CardImpl { // Revolt — When Renegade Rallier enters the battlefield, if a permanent you controlled left the battlefield this turn, // return target permanent card with converted mana cost 2 or less from your graveyard to your battlefield. Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility( - new ReturnFromGraveyardToBattlefieldTargetEffect(), false), RevoltCondition.getInstance(), + new ReturnFromGraveyardToBattlefieldTargetEffect(), false), RevoltCondition.instance, "Revolt — When {this} enters the battlefield, if a permanent you controlled left" + " the battlefield this turn, return target permanent card with converted mana cost 2 or less from your graveyard to your battlefield."); ability.setAbilityWord(AbilityWord.REVOLT); diff --git a/Mage.Sets/src/mage/cards/r/Reset.java b/Mage.Sets/src/mage/cards/r/Reset.java index 9cecf9edb0..232d6d0f5f 100644 --- a/Mage.Sets/src/mage/cards/r/Reset.java +++ b/Mage.Sets/src/mage/cards/r/Reset.java @@ -28,6 +28,7 @@ package mage.cards.r; import java.util.UUID; + import mage.abilities.common.CastOnlyDuringPhaseStepSourceAbility; import mage.abilities.condition.CompoundCondition; import mage.abilities.condition.common.AfterUpkeepStepCondtion; @@ -38,17 +39,16 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; /** - * * @author LevelX2 */ public class Reset extends CardImpl { public Reset(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}{U}"); // Cast Reset only during an opponent's turn after his or her upkeep step. this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(null, null, - new CompoundCondition(OnOpponentsTurnCondition.getInstance(), AfterUpkeepStepCondtion.getInstance()), + new CompoundCondition(OnOpponentsTurnCondition.instance, AfterUpkeepStepCondtion.instance), "Cast {this} only during an opponent's turn after his or her upkeep step")); // Untap all lands you control. diff --git a/Mage.Sets/src/mage/cards/r/ResoluteArchangel.java b/Mage.Sets/src/mage/cards/r/ResoluteArchangel.java index e8664d300a..78934a6738 100644 --- a/Mage.Sets/src/mage/cards/r/ResoluteArchangel.java +++ b/Mage.Sets/src/mage/cards/r/ResoluteArchangel.java @@ -101,10 +101,10 @@ class ResoluteArchangelEffect extends OneShotEffect { class ControllerLifeLowerThanStrtingLife implements Condition { - private static final ControllerLifeLowerThanStrtingLife fInstance = new ControllerLifeLowerThanStrtingLife(); + private static final ControllerLifeLowerThanStrtingLife instance = new ControllerLifeLowerThanStrtingLife(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/r/Revenge.java b/Mage.Sets/src/mage/cards/r/Revenge.java index f57ead444c..68a8fffaec 100644 --- a/Mage.Sets/src/mage/cards/r/Revenge.java +++ b/Mage.Sets/src/mage/cards/r/Revenge.java @@ -81,18 +81,12 @@ public class Revenge extends CardImpl { } } -class LostLifeCondition implements Condition { +enum LostLifeCondition implements Condition { - private static LostLifeCondition fInstance = null; + instance; public static Condition getInstance() { - if (fInstance == null) { - fInstance = new LostLifeCondition(); - } - return fInstance; - } - - private LostLifeCondition() { + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/r/RicochetTrap.java b/Mage.Sets/src/mage/cards/r/RicochetTrap.java index 46c4b90644..3d95024219 100644 --- a/Mage.Sets/src/mage/cards/r/RicochetTrap.java +++ b/Mage.Sets/src/mage/cards/r/RicochetTrap.java @@ -82,10 +82,10 @@ public class RicochetTrap extends CardImpl { class RicochetTrapCondition implements Condition { - private static final RicochetTrapCondition fInstance = new RicochetTrapCondition(); + private static final RicochetTrapCondition instance = new RicochetTrapCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/r/RidingRonto.java b/Mage.Sets/src/mage/cards/r/RidingRonto.java index 6742636ec4..1668f0bdd9 100644 --- a/Mage.Sets/src/mage/cards/r/RidingRonto.java +++ b/Mage.Sets/src/mage/cards/r/RidingRonto.java @@ -59,7 +59,7 @@ public class RidingRonto extends CardImpl { // As long as Riding Ronto is monstrous, it has vigilance this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.WhileOnBattlefield), - MonstrousCondition.getInstance(), + MonstrousCondition.instance, "As long as Riding Ronto is monstrous, it has vigilance") )); diff --git a/Mage.Sets/src/mage/cards/r/RiteOfReplication.java b/Mage.Sets/src/mage/cards/r/RiteOfReplication.java index 9d16ed8fdb..0801769a28 100644 --- a/Mage.Sets/src/mage/cards/r/RiteOfReplication.java +++ b/Mage.Sets/src/mage/cards/r/RiteOfReplication.java @@ -52,7 +52,7 @@ public class RiteOfReplication extends CardImpl { // Create a token that's a copy of target creature. If Rite of Replication was kicked, create five of those tokens instead. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new PutTokenOntoBattlefieldCopyTargetEffect(null, null, false, 5), - new PutTokenOntoBattlefieldCopyTargetEffect(), KickedCondition.getInstance(), + new PutTokenOntoBattlefieldCopyTargetEffect(), KickedCondition.instance, "Create a token that's a copy of target creature. If {this} was kicked, create five of those tokens instead")); } diff --git a/Mage.Sets/src/mage/cards/r/RoarOfChallenge.java b/Mage.Sets/src/mage/cards/r/RoarOfChallenge.java index 31957cc2a1..18baa77816 100644 --- a/Mage.Sets/src/mage/cards/r/RoarOfChallenge.java +++ b/Mage.Sets/src/mage/cards/r/RoarOfChallenge.java @@ -55,7 +55,7 @@ public class RoarOfChallenge extends CardImpl { // Ferocious - That creature gains indestructible until end of turn if you control a creature with power 4 or greater. this.getSpellAbility().addEffect(new ConditionalContinuousEffect( new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn), - new LockedInCondition(FerociousCondition.getInstance()), + new LockedInCondition(FerociousCondition.instance), "
Ferocious — That creature gains indestructible until end of turn if you control a creature with power 4 or greater.")); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/cards/r/RocketLauncher.java b/Mage.Sets/src/mage/cards/r/RocketLauncher.java index 050d69bbe0..a2965cf2db 100644 --- a/Mage.Sets/src/mage/cards/r/RocketLauncher.java +++ b/Mage.Sets/src/mage/cards/r/RocketLauncher.java @@ -59,7 +59,7 @@ public class RocketLauncher extends CardImpl { Watcher watcher = new RocketLauncherWatcher(this.getId()); // {2}: Rocket Launcher deals 1 damage to target creature or player. Destroy Rocket Launcher at the beginning of the next end step. Activate this ability only if you've controlled Rocket Launcher continuously since the beginning of your most recent turn. Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, - new DamageTargetEffect(1), new GenericManaCost(2), new ControlledTurnCondition()); + new DamageTargetEffect(1), new GenericManaCost(2), ControlledTurnCondition.instance); ability.addTarget(new TargetCreatureOrPlayer()); ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new DestroySourceEffect(true)))); @@ -116,13 +116,10 @@ class RocketLauncherWatcher extends Watcher { } } -class ControlledTurnCondition implements Condition { +enum ControlledTurnCondition implements Condition { - private static final ControlledTurnCondition fInstance = new ControlledTurnCondition(); + instance; - public static ControlledTurnCondition getInstance() { - return fInstance; - } @Override public boolean apply(Game game, Ability source) { diff --git a/Mage.Sets/src/mage/cards/r/RootwaterMatriarch.java b/Mage.Sets/src/mage/cards/r/RootwaterMatriarch.java index 51eb48e692..324561346e 100644 --- a/Mage.Sets/src/mage/cards/r/RootwaterMatriarch.java +++ b/Mage.Sets/src/mage/cards/r/RootwaterMatriarch.java @@ -56,7 +56,7 @@ public class RootwaterMatriarch extends CardImpl { this.toughness = new MageInt(3); // {T}: Gain control of target creature for as long as that creature is enchanted - ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new GainControlTargetEffect(Duration.Custom), EnchantedTargetCondition.getInstance(), + ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new GainControlTargetEffect(Duration.Custom), EnchantedTargetCondition.instance, "Gain control of target creature for as long as that creature is enchanted"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/cards/r/RuneflareTrap.java b/Mage.Sets/src/mage/cards/r/RuneflareTrap.java index 5df1695288..4f847aade0 100644 --- a/Mage.Sets/src/mage/cards/r/RuneflareTrap.java +++ b/Mage.Sets/src/mage/cards/r/RuneflareTrap.java @@ -102,10 +102,10 @@ class TargetPlayerCardsInHandCount implements DynamicValue { class RuneflareTrapCondition implements Condition { - private static final RuneflareTrapCondition fInstance = new RuneflareTrapCondition(); + private static final RuneflareTrapCondition instance = new RuneflareTrapCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/r/RushingRiver.java b/Mage.Sets/src/mage/cards/r/RushingRiver.java index 2fe97fb671..fa33ff406f 100644 --- a/Mage.Sets/src/mage/cards/r/RushingRiver.java +++ b/Mage.Sets/src/mage/cards/r/RushingRiver.java @@ -62,7 +62,7 @@ public class RushingRiver extends CardImpl { this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); Effect effect = new ConditionalOneShotEffect( new ReturnToHandTargetEffect(), - KickedCondition.getInstance(), + KickedCondition.instance, "If {this} was kicked, return another target nonland permanent to its owner's hand"); effect.setTargetPointer(new SecondTargetPointer()); this.getSpellAbility().addEffect(effect); @@ -72,7 +72,7 @@ public class RushingRiver extends CardImpl { @Override public void adjustTargets(Ability ability, Game game) { - if (ability instanceof SpellAbility && KickedCondition.getInstance().apply(game, ability)) { + if (ability instanceof SpellAbility && KickedCondition.instance.apply(game, ability)) { ability.getTargets().clear(); ability.addTarget(new TargetNonlandPermanent(2)); } diff --git a/Mage.Sets/src/mage/cards/r/RustedRelic.java b/Mage.Sets/src/mage/cards/r/RustedRelic.java index 3f6a008ad8..0af06612f7 100644 --- a/Mage.Sets/src/mage/cards/r/RustedRelic.java +++ b/Mage.Sets/src/mage/cards/r/RustedRelic.java @@ -53,7 +53,7 @@ public class RustedRelic extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( new BecomesCreatureSourceEffect(new RustedRelicToken(), "artifact", Duration.WhileOnBattlefield), - MetalcraftCondition.getInstance(), + MetalcraftCondition.instance, "Metalcraft - {this} is a 5/5 Golem artifact creature as long as you control three or more artifacts"))); } diff --git a/Mage.Sets/src/mage/cards/s/SabertoothOutrider.java b/Mage.Sets/src/mage/cards/s/SabertoothOutrider.java index 5072585331..36da07281e 100644 --- a/Mage.Sets/src/mage/cards/s/SabertoothOutrider.java +++ b/Mage.Sets/src/mage/cards/s/SabertoothOutrider.java @@ -59,7 +59,7 @@ public class SabertoothOutrider extends CardImpl { // Formidable - Whenever Sabertooth Outrider attacks, if creatures you control have total power 8 or greater, Sabertooth Outrider gains first strike until end of turn. this.addAbility(new ConditionalTriggeredAbility( new AttacksTriggeredAbility(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), false), - FormidableCondition.getInstance(), + FormidableCondition.instance, "Formidable — Whenever {this} attacks, if creatures you control have total power 8 or greater, {this} gains first strike until end of turn." )); diff --git a/Mage.Sets/src/mage/cards/s/SadisticSacrament.java b/Mage.Sets/src/mage/cards/s/SadisticSacrament.java index 70214dc534..9f29c5661e 100644 --- a/Mage.Sets/src/mage/cards/s/SadisticSacrament.java +++ b/Mage.Sets/src/mage/cards/s/SadisticSacrament.java @@ -66,7 +66,7 @@ public class SadisticSacrament extends CardImpl { this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new SadisticSacramentEffect(15), new SadisticSacramentEffect(3), - KickedCondition.getInstance(), + KickedCondition.instance, ruleText)); this.getSpellAbility().addTarget(new TargetPlayer()); } diff --git a/Mage.Sets/src/mage/cards/s/SageOfAncientLore.java b/Mage.Sets/src/mage/cards/s/SageOfAncientLore.java index 5d5602284d..a2e591a726 100644 --- a/Mage.Sets/src/mage/cards/s/SageOfAncientLore.java +++ b/Mage.Sets/src/mage/cards/s/SageOfAncientLore.java @@ -80,7 +80,7 @@ public class SageOfAncientLore extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Sage of Ancient Lore. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public SageOfAncientLore(final SageOfAncientLore card) { diff --git a/Mage.Sets/src/mage/cards/s/SandSilos.java b/Mage.Sets/src/mage/cards/s/SandSilos.java index f5f45867cc..b2d90bb5e4 100644 --- a/Mage.Sets/src/mage/cards/s/SandSilos.java +++ b/Mage.Sets/src/mage/cards/s/SandSilos.java @@ -65,7 +65,7 @@ public class SandSilos extends CardImpl { this.addAbility(new SkipUntapOptionalAbility()); // At the beginning of your upkeep, if Sand Silos is tapped, put a storage counter on it. OneShotEffect addStorageCounter = new AddCountersSourceEffect(CounterType.STORAGE.createInstance()); - Effect effect = new ConditionalOneShotEffect(addStorageCounter, SourceTappedCondition.getInstance(), "if {this} is tapped, put a storage counter on it"); + Effect effect = new ConditionalOneShotEffect(addStorageCounter, SourceTappedCondition.instance, "if {this} is tapped, put a storage counter on it"); this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.YOU, false)); // {tap}, Remove any number of storage counters from Sand Silos: Add {U} to your mana pool for each storage counter removed this way. Ability ability = new DynamicManaAbility( diff --git a/Mage.Sets/src/mage/cards/s/SavageBeating.java b/Mage.Sets/src/mage/cards/s/SavageBeating.java index a28cf08924..a8a4e601db 100644 --- a/Mage.Sets/src/mage/cards/s/SavageBeating.java +++ b/Mage.Sets/src/mage/cards/s/SavageBeating.java @@ -55,7 +55,7 @@ public class SavageBeating extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{R}{R}"); // Cast Savage Beating only during your turn and only during combat. - this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(TurnPhase.COMBAT, null, MyTurnCondition.getInstance(), + this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(TurnPhase.COMBAT, null, MyTurnCondition.instance, "Cast {this} only during your turn and only during combat")); // Choose one - Creatures you control gain double strike until end of turn; diff --git a/Mage.Sets/src/mage/cards/s/SavageOffensive.java b/Mage.Sets/src/mage/cards/s/SavageOffensive.java index 9753d5b114..c8b5c276b4 100644 --- a/Mage.Sets/src/mage/cards/s/SavageOffensive.java +++ b/Mage.Sets/src/mage/cards/s/SavageOffensive.java @@ -68,7 +68,7 @@ public class SavageOffensive extends CardImpl { // If Savage Offensive was kicked, they get +1/+1 until end of turn. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new AddContinuousEffectToGame(new BoostControlledEffect(1, 1, Duration.EndOfTurn)), - new LockedInCondition(KickedCondition.getInstance()), + new LockedInCondition(KickedCondition.instance), "If {this} was kicked, they get +1/+1 until end of turn.")); } diff --git a/Mage.Sets/src/mage/cards/s/SavagePunch.java b/Mage.Sets/src/mage/cards/s/SavagePunch.java index 4adf367358..f9cf2a7fb2 100644 --- a/Mage.Sets/src/mage/cards/s/SavagePunch.java +++ b/Mage.Sets/src/mage/cards/s/SavagePunch.java @@ -64,7 +64,7 @@ public class SavagePunch extends CardImpl { // Ferocious - The creature you control gets +2/+2 until end of turn before it fights if you control a creature with power 4 or greater. Effect effect = new ConditionalContinuousEffect( new BoostTargetEffect(2,2,Duration.EndOfTurn), - new LockedInCondition(FerociousCondition.getInstance()), + new LockedInCondition(FerociousCondition.instance), "Ferocious — The creature you control gets +2/+2 until end of turn before it fights if you control a creature with power 4 or greater"); effect.setApplyEffectsAfter(); this.getSpellAbility().addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/s/ScabClanBerserker.java b/Mage.Sets/src/mage/cards/s/ScabClanBerserker.java index 82c885b5b1..8a115add5d 100644 --- a/Mage.Sets/src/mage/cards/s/ScabClanBerserker.java +++ b/Mage.Sets/src/mage/cards/s/ScabClanBerserker.java @@ -67,7 +67,7 @@ public class ScabClanBerserker extends CardImpl { // Whenever an opponent casts a noncreature spell, if Scab-Clan Berserker is renowned, Scab-Clan Berserker deals 2 damage to that player. this.addAbility(new ConditionalTriggeredAbility( new ScabClanBerserkerTriggeredAbility(), - RenownedSourceCondition.getInstance(), + RenownedSourceCondition.instance, "Whenever an opponent casts a noncreature spell, if Scab-Clan Berserker is renowned, Scab-Clan Berserker deals 2 damage to that player")); } diff --git a/Mage.Sets/src/mage/cards/s/ScaleguardSentinels.java b/Mage.Sets/src/mage/cards/s/ScaleguardSentinels.java index a9c84759ad..1625f1b0f6 100644 --- a/Mage.Sets/src/mage/cards/s/ScaleguardSentinels.java +++ b/Mage.Sets/src/mage/cards/s/ScaleguardSentinels.java @@ -102,10 +102,10 @@ public class ScaleguardSentinels extends CardImpl { class ScaleguardSentinelsCondition implements Condition { - private static final ScaleguardSentinelsCondition fInstance = new ScaleguardSentinelsCondition(); + private static final ScaleguardSentinelsCondition instance = new ScaleguardSentinelsCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/s/ScepterOfFugue.java b/Mage.Sets/src/mage/cards/s/ScepterOfFugue.java index 90e95c7053..c1f3271bc1 100644 --- a/Mage.Sets/src/mage/cards/s/ScepterOfFugue.java +++ b/Mage.Sets/src/mage/cards/s/ScepterOfFugue.java @@ -52,7 +52,7 @@ public class ScepterOfFugue extends CardImpl { // {1}{B}, {tap}: Target player discards a card. Activate this ability only during your turn. - Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new DiscardTargetEffect(1), new ManaCostsImpl("{1}{B}"), MyTurnCondition.getInstance()); + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new DiscardTargetEffect(1), new ManaCostsImpl("{1}{B}"), MyTurnCondition.instance); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetPlayer()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/s/ScorchingLava.java b/Mage.Sets/src/mage/cards/s/ScorchingLava.java index 5d78592dd2..03dc90be8b 100644 --- a/Mage.Sets/src/mage/cards/s/ScorchingLava.java +++ b/Mage.Sets/src/mage/cards/s/ScorchingLava.java @@ -58,9 +58,9 @@ public class ScorchingLava extends CardImpl { // Scorching Lava deals 2 damage to target creature or player. If Scorching Lava was kicked, that creature can't be regenerated this turn and if it would die this turn, exile it instead. this.getSpellAbility().addEffect(new DamageTargetEffect(2)); this.getSpellAbility().addEffect(new ConditionalContinuousRuleModifyingEffect( - new CantRegenerateTargetEffect(Duration.EndOfTurn, "That creature"), new LockedInCondition(KickedCondition.getInstance()))); + new CantRegenerateTargetEffect(Duration.EndOfTurn, "That creature"), new LockedInCondition(KickedCondition.instance))); Effect effect = new ConditionalReplacementEffect(new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn), - new LockedInCondition(KickedCondition.getInstance())); + new LockedInCondition(KickedCondition.instance)); effect.setText("and if it would die this turn, exile it instead"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); diff --git a/Mage.Sets/src/mage/cards/s/ScornedVillager.java b/Mage.Sets/src/mage/cards/s/ScornedVillager.java index f55904e113..ec788a0037 100644 --- a/Mage.Sets/src/mage/cards/s/ScornedVillager.java +++ b/Mage.Sets/src/mage/cards/s/ScornedVillager.java @@ -65,7 +65,7 @@ public class ScornedVillager extends CardImpl { this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); this.addAbility(new ConditionalTriggeredAbility(ability, - NoSpellsWereCastLastTurnCondition.getInstance(), + NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } diff --git a/Mage.Sets/src/mage/cards/s/ScourTheLaboratory.java b/Mage.Sets/src/mage/cards/s/ScourTheLaboratory.java index d40946a359..a7147d236d 100644 --- a/Mage.Sets/src/mage/cards/s/ScourTheLaboratory.java +++ b/Mage.Sets/src/mage/cards/s/ScourTheLaboratory.java @@ -49,7 +49,7 @@ public class ScourTheLaboratory extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{4}{U}{U}"); // Delirium — Scour the Laboratory costs {2} less to cast if there are four or more card types among cards in your graveyard. - Ability ability = new SimpleStaticAbility(Zone.STACK, new SpellCostReductionSourceEffect(2, DeliriumCondition.getInstance())); + Ability ability = new SimpleStaticAbility(Zone.STACK, new SpellCostReductionSourceEffect(2, DeliriumCondition.instance)); ability.setRuleAtTheTop(true); ability.setAbilityWord(AbilityWord.DELIRIUM); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/s/ScourgeWolf.java b/Mage.Sets/src/mage/cards/s/ScourgeWolf.java index 7f96f225d6..5001d820ff 100644 --- a/Mage.Sets/src/mage/cards/s/ScourgeWolf.java +++ b/Mage.Sets/src/mage/cards/s/ScourgeWolf.java @@ -59,7 +59,7 @@ public class ScourgeWolf extends CardImpl { // Delirium — Scourge Wolf has double strike as long as there are four or more card types among cards in your graveyard. ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new GainAbilitySourceEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield), - DeliriumCondition.getInstance(), "Delirium — {this} has double strike as long as there are four or more card types among cards in your graveyard."); + DeliriumCondition.instance, "Delirium — {this} has double strike as long as there are four or more card types among cards in your graveyard."); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); } diff --git a/Mage.Sets/src/mage/cards/s/ScreechingSilcaw.java b/Mage.Sets/src/mage/cards/s/ScreechingSilcaw.java index 50d3c9c453..67c531267b 100644 --- a/Mage.Sets/src/mage/cards/s/ScreechingSilcaw.java +++ b/Mage.Sets/src/mage/cards/s/ScreechingSilcaw.java @@ -59,7 +59,7 @@ public class ScreechingSilcaw extends CardImpl { TriggeredAbility conditional = new ConditionalTriggeredAbility( new DealsCombatDamageToAPlayerTriggeredAbility(new PutLibraryIntoGraveTargetEffect(4), false, true), - MetalcraftCondition.getInstance(), text); + MetalcraftCondition.instance, text); this.addAbility(conditional); } diff --git a/Mage.Sets/src/mage/cards/s/SeaGateWreckage.java b/Mage.Sets/src/mage/cards/s/SeaGateWreckage.java index 43ea374600..2e9326bbe1 100644 --- a/Mage.Sets/src/mage/cards/s/SeaGateWreckage.java +++ b/Mage.Sets/src/mage/cards/s/SeaGateWreckage.java @@ -54,7 +54,7 @@ public class SeaGateWreckage extends CardImpl { // {2}{C}, {T}: Draw a card. Activate this ability only if you have no cards in hand. Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), - new ManaCostsImpl("{2}{C}"), HellbentCondition.getInstance()); + new ManaCostsImpl("{2}{C}"), HellbentCondition.instance); ability.addCost(new TapSourceCost()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/Seasinger.java b/Mage.Sets/src/mage/cards/s/Seasinger.java index 9b018b0f38..b305bb031f 100644 --- a/Mage.Sets/src/mage/cards/s/Seasinger.java +++ b/Mage.Sets/src/mage/cards/s/Seasinger.java @@ -91,7 +91,7 @@ public class Seasinger extends CardImpl { // {tap}: Gain control of target creature whose controller controls an Island for as long as you control Seasinger and Seasinger remains tapped. ConditionalContinuousEffect effect = new ConditionalContinuousEffect( new GainControlTargetEffect(Duration.Custom), - new PermanentsOnTheBattlefieldCondition(seasinger, CountType.EQUAL_TO, 1, SourceTappedCondition.getInstance()), rule); + new PermanentsOnTheBattlefieldCondition(seasinger, CountType.EQUAL_TO, 1, SourceTappedCondition.instance), rule); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); creatureWhoseControllerControlsIsland.add(new ControllerControlsIslandPredicate()); ability.addTarget(new TargetCreaturePermanent(creatureWhoseControllerControlsIsland)); diff --git a/Mage.Sets/src/mage/cards/s/SeeTheUnwritten.java b/Mage.Sets/src/mage/cards/s/SeeTheUnwritten.java index a04ce0c619..dfbb8f4f3c 100644 --- a/Mage.Sets/src/mage/cards/s/SeeTheUnwritten.java +++ b/Mage.Sets/src/mage/cards/s/SeeTheUnwritten.java @@ -61,7 +61,7 @@ public class SeeTheUnwritten extends CardImpl { this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new SeeTheUnwrittenEffect(1), new SeeTheUnwrittenEffect(2), - new InvertCondition(FerociousCondition.getInstance()), + new InvertCondition(FerociousCondition.instance), "Reveal the top eight cards of your library. You may put a creature card from among them onto the battlefield. Put the rest into your graveyard." + "
Ferocious — If you control a creature with power 4 or greater, you may put two creature cards onto the battlefield instead of one")); } diff --git a/Mage.Sets/src/mage/cards/s/SendToSleep.java b/Mage.Sets/src/mage/cards/s/SendToSleep.java index 6c9913020d..1e62db1b41 100644 --- a/Mage.Sets/src/mage/cards/s/SendToSleep.java +++ b/Mage.Sets/src/mage/cards/s/SendToSleep.java @@ -55,7 +55,7 @@ public class SendToSleep extends CardImpl { // Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, those creatures don't untap during their controllers' next untap steps. Effect effect = new ConditionalOneShotEffect( new AddContinuousEffectToGame(new DontUntapInControllersNextUntapStepTargetEffect(", those creatures")), - SpellMasteryCondition.getInstance()); + SpellMasteryCondition.instance); effect.setText("
Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, those creatures don't untap during their controllers' next untap steps"); this.getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/cards/s/ShamanOfForgottenWays.java b/Mage.Sets/src/mage/cards/s/ShamanOfForgottenWays.java index 2bcc656f3e..a0a1839202 100644 --- a/Mage.Sets/src/mage/cards/s/ShamanOfForgottenWays.java +++ b/Mage.Sets/src/mage/cards/s/ShamanOfForgottenWays.java @@ -74,7 +74,7 @@ public class ShamanOfForgottenWays extends CardImpl { Zone.BATTLEFIELD, new ShamanOfForgottenWaysEffect(), new ManaCostsImpl("{9}{G}{G}"), - FormidableCondition.getInstance()); + FormidableCondition.instance); ability.addCost(new TapSourceCost()); ability.setAbilityWord(AbilityWord.FORMIDABLE); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/s/ShivanEmissary.java b/Mage.Sets/src/mage/cards/s/ShivanEmissary.java index ee087160a8..2620421734 100644 --- a/Mage.Sets/src/mage/cards/s/ShivanEmissary.java +++ b/Mage.Sets/src/mage/cards/s/ShivanEmissary.java @@ -69,7 +69,7 @@ public class ShivanEmissary extends CardImpl { // When Shivan Emissary enters the battlefield, if it was kicked, destroy target nonblack creature. It can't be regenerated. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(true)); ability.addTarget(new TargetCreaturePermanent(filter)); - this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, destroy target nonblack creature. It can't be regenerated.")); } diff --git a/Mage.Sets/src/mage/cards/s/ShrikeHarpy.java b/Mage.Sets/src/mage/cards/s/ShrikeHarpy.java index 86d467d105..2dbfa96115 100644 --- a/Mage.Sets/src/mage/cards/s/ShrikeHarpy.java +++ b/Mage.Sets/src/mage/cards/s/ShrikeHarpy.java @@ -62,7 +62,7 @@ public class ShrikeHarpy extends CardImpl { // When Shrike Harpy enters the battlefield, if tribute wasn't paid, target opponent sacrifices a creature. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new SacrificeEffect(new FilterCreaturePermanent("a creature"), 1, "target opponent"), false); ability.addTarget(new TargetOpponent()); - this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.instance, "When {this} enters the battlefield, if its tribute wasn't paid, target opponent sacrifices a creature.")); } diff --git a/Mage.Sets/src/mage/cards/s/SilkweaverElite.java b/Mage.Sets/src/mage/cards/s/SilkweaverElite.java index f3696e1f72..707dc47b2c 100644 --- a/Mage.Sets/src/mage/cards/s/SilkweaverElite.java +++ b/Mage.Sets/src/mage/cards/s/SilkweaverElite.java @@ -59,7 +59,7 @@ public class SilkweaverElite extends CardImpl { // Revolt — When Silkweaver Elite enters the battlefield, if a permanent you controlled left the battlefield this turn, draw a card. Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility( - new DrawCardSourceControllerEffect(1), false), RevoltCondition.getInstance(), + new DrawCardSourceControllerEffect(1), false), RevoltCondition.instance, "Revolt — When {this} enters the battlefield, if a permanent you controlled left" + " the battlefield this turn, draw a card."); ability.setAbilityWord(AbilityWord.REVOLT); diff --git a/Mage.Sets/src/mage/cards/s/SilverpeltWerewolf.java b/Mage.Sets/src/mage/cards/s/SilverpeltWerewolf.java index 6775995037..87b5f3c0e5 100644 --- a/Mage.Sets/src/mage/cards/s/SilverpeltWerewolf.java +++ b/Mage.Sets/src/mage/cards/s/SilverpeltWerewolf.java @@ -65,7 +65,7 @@ public class SilverpeltWerewolf extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Silverpelt Werewolf. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public SilverpeltWerewolf(final SilverpeltWerewolf card) { diff --git a/Mage.Sets/src/mage/cards/s/SinuousVermin.java b/Mage.Sets/src/mage/cards/s/SinuousVermin.java index 5be0b70db7..552b877782 100644 --- a/Mage.Sets/src/mage/cards/s/SinuousVermin.java +++ b/Mage.Sets/src/mage/cards/s/SinuousVermin.java @@ -62,7 +62,7 @@ public class SinuousVermin extends CardImpl { Ability ability = new SimpleStaticAbility( Zone.BATTLEFIELD, new ConditionalContinuousEffect(new GainAbilitySourceEffect(new MenaceAbility(), Duration.WhileOnBattlefield), - MonstrousCondition.getInstance(), + MonstrousCondition.instance, "As long as {this} is monstrous, it has menace")); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/SirenOfTheFangedCoast.java b/Mage.Sets/src/mage/cards/s/SirenOfTheFangedCoast.java index 4fa88524f0..ec1651565c 100644 --- a/Mage.Sets/src/mage/cards/s/SirenOfTheFangedCoast.java +++ b/Mage.Sets/src/mage/cards/s/SirenOfTheFangedCoast.java @@ -62,7 +62,7 @@ public class SirenOfTheFangedCoast extends CardImpl { // When Siren of the Fanged Coast enters the battlefield, if tribute wasn't paid, gain control of target creature. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new GainControlTargetEffect(Duration.EndOfGame, true), false); ability.addTarget(new TargetCreaturePermanent()); - this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.instance, "When {this} enters the battlefield, if its tribute wasn't paid, gain control of target creature.")); } diff --git a/Mage.Sets/src/mage/cards/s/SirensCall.java b/Mage.Sets/src/mage/cards/s/SirensCall.java index 3d0c72a4ac..878eaf0680 100644 --- a/Mage.Sets/src/mage/cards/s/SirensCall.java +++ b/Mage.Sets/src/mage/cards/s/SirensCall.java @@ -58,7 +58,7 @@ public class SirensCall extends CardImpl { // Cast Siren's Call only during an opponent's turn, before attackers are declared. this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(null, null, - new CompoundCondition(OnOpponentsTurnCondition.getInstance(), BeforeAttackersAreDeclaredCondition.getInstance()), + new CompoundCondition(OnOpponentsTurnCondition.instance, BeforeAttackersAreDeclaredCondition.instance), "Cast {this} only during an opponent's turn, before attackers are declared")); // Creatures the active player controls attack this turn if able. diff --git a/Mage.Sets/src/mage/cards/s/SithAssassin.java b/Mage.Sets/src/mage/cards/s/SithAssassin.java index 7417c62114..80da34d278 100644 --- a/Mage.Sets/src/mage/cards/s/SithAssassin.java +++ b/Mage.Sets/src/mage/cards/s/SithAssassin.java @@ -66,7 +66,7 @@ public class SithAssassin extends CardImpl { // Hate — When Sith Assassin enters the battlefield, if opponent lost life from source other than combat damage this turn, you may destroy target nonblack creature. Ability ability = new ConditionalTriggeredAbility( new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), true), - HateCondition.getInstance(), + HateCondition.instance, "Hate - When {this} enters the battlefield, if an opponent lost life from a source other than combat damage this turn, you may destroy target nonblack creature."); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability, new LifeLossOtherFromCombatWatcher()); diff --git a/Mage.Sets/src/mage/cards/s/SithInquisitor.java b/Mage.Sets/src/mage/cards/s/SithInquisitor.java index 4466770616..5d86033f29 100644 --- a/Mage.Sets/src/mage/cards/s/SithInquisitor.java +++ b/Mage.Sets/src/mage/cards/s/SithInquisitor.java @@ -56,7 +56,7 @@ public class SithInquisitor extends CardImpl { // Hate — When Sith Assassin enters the battlefield, if opponent lost life from source other than combat damage this turn, target player discard a card at random. Ability ability = new ConditionalTriggeredAbility( new EntersBattlefieldTriggeredAbility(new DiscardTargetEffect(1, true)), - HateCondition.getInstance(), + HateCondition.instance, "Hate — When {this} enters the battlefield, if an opponent lost life from a source other then combat damage this turn, target player discard a card at random."); ability.addTarget(new TargetPlayer()); this.addAbility(ability, new LifeLossOtherFromCombatWatcher()); diff --git a/Mage.Sets/src/mage/cards/s/SithMagic.java b/Mage.Sets/src/mage/cards/s/SithMagic.java index 22fcadfde6..57637f4db4 100644 --- a/Mage.Sets/src/mage/cards/s/SithMagic.java +++ b/Mage.Sets/src/mage/cards/s/SithMagic.java @@ -74,7 +74,7 @@ public class SithMagic extends CardImpl { triggeredAbility.addEffect(new SithMagicReplacementEffect()); Ability ability = new ConditionalTriggeredAbility( triggeredAbility, - HateCondition.getInstance(), + HateCondition.instance, "Hate — At the beggining of each combat, if opponent lost life from a source other than combat damage this turn, you may return target card from a graveyard to the battlefield under your control. It gains lifelink and haste. Exile it at the beginning of the next end step or if it would leave the battlefield."); ability.addTarget(new TargetCardInGraveyard(new FilterCreatureCard())); this.addAbility(ability, new LifeLossOtherFromCombatWatcher()); diff --git a/Mage.Sets/src/mage/cards/s/SithManipulator.java b/Mage.Sets/src/mage/cards/s/SithManipulator.java index a27e3a3816..96dbdd38b4 100644 --- a/Mage.Sets/src/mage/cards/s/SithManipulator.java +++ b/Mage.Sets/src/mage/cards/s/SithManipulator.java @@ -58,7 +58,7 @@ public class SithManipulator extends CardImpl { // When Sith Manipulator enters the battlefield, return target creature to its owner's hand. Ability ability = new ConditionalTriggeredAbility( new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect()), - new InvertCondition(HateCondition.getInstance()), + new InvertCondition(HateCondition.instance), "When Sith Manipulator enters the battlefield, return target creature to its owner's hand"); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability, new LifeLossOtherFromCombatWatcher()); @@ -66,7 +66,7 @@ public class SithManipulator extends CardImpl { // Hate — If opponent lost life from source other than combat damage this turn, put that card on top of its owner's library instead. ability = new ConditionalTriggeredAbility( new EntersBattlefieldTriggeredAbility(new ReturnToLibraryPermanentEffect(true)), - HateCondition.getInstance(), + HateCondition.instance, "Hate — If opponent lost life from source other than combat damage this turn, put that card on top of its owner's library instead"); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability, new LifeLossOtherFromCombatWatcher()); diff --git a/Mage.Sets/src/mage/cards/s/SithMarauder.java b/Mage.Sets/src/mage/cards/s/SithMarauder.java index 73817f9334..b3c8924b68 100644 --- a/Mage.Sets/src/mage/cards/s/SithMarauder.java +++ b/Mage.Sets/src/mage/cards/s/SithMarauder.java @@ -56,7 +56,7 @@ public class SithMarauder extends CardImpl { // Hate — When Sith Marauder enters the battlefield, if an opponent lost life from a source other than combat damage this turn, Sith Marauder deals 3 damage to target creature or player. Ability ability = new ConditionalTriggeredAbility( new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(3)), - HateCondition.getInstance(), + HateCondition.instance, "Hate — When {this} enters the battlefield, if an opponent lost life from a source other than combat damage this turn, {this} deals 3 damage to target creature or player"); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability, new LifeLossOtherFromCombatWatcher()); diff --git a/Mage.Sets/src/mage/cards/s/SithMindseer.java b/Mage.Sets/src/mage/cards/s/SithMindseer.java index dca9401594..1d32f616e3 100644 --- a/Mage.Sets/src/mage/cards/s/SithMindseer.java +++ b/Mage.Sets/src/mage/cards/s/SithMindseer.java @@ -57,7 +57,7 @@ public class SithMindseer extends CardImpl { // Hate — When Sith Mindseer enters the battlefield, if an opponent loses life from a source other than combat damage, gain control of target creature for as long as Sith Mindseer remains on the battlefield. Ability ability = new ConditionalTriggeredAbility( new EntersBattlefieldTriggeredAbility(new GainControlTargetEffect(Duration.WhileOnBattlefield)), - HateCondition.getInstance(), + HateCondition.instance, "Hate — When Sith Mindseer enters the battlefield, if an opponent loses life from a source other than combat damage, gain control of target creature for as long as Sith Mindseer remains on the battlefield."); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability, new LifeLossOtherFromCombatWatcher()); diff --git a/Mage.Sets/src/mage/cards/s/SithSorcerer.java b/Mage.Sets/src/mage/cards/s/SithSorcerer.java index f5042c1eb7..9cc5c62e63 100644 --- a/Mage.Sets/src/mage/cards/s/SithSorcerer.java +++ b/Mage.Sets/src/mage/cards/s/SithSorcerer.java @@ -59,7 +59,7 @@ public class SithSorcerer extends CardImpl { // Hate — When Sith Assassin enters the battlefield, if opponent lost life from source other than combat damage this turn, draw a card. Ability ability = new ConditionalTriggeredAbility( new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1)), - HateCondition.getInstance(), + HateCondition.instance, "Hate — When {this} enters the battlefield, if an opponent lost life from a source other than combat damage this turn, draw a card."); this.addAbility(ability, new LifeLossOtherFromCombatWatcher()); diff --git a/Mage.Sets/src/mage/cards/s/SithThoughtseeker.java b/Mage.Sets/src/mage/cards/s/SithThoughtseeker.java index a29c7ff206..d8a90f9bb6 100644 --- a/Mage.Sets/src/mage/cards/s/SithThoughtseeker.java +++ b/Mage.Sets/src/mage/cards/s/SithThoughtseeker.java @@ -58,7 +58,7 @@ public class SithThoughtseeker extends CardImpl { Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl<>("{2}{U}"), - HateCondition.getInstance()); + HateCondition.instance); ability.setAbilityWord(AbilityWord.HATE); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/SkirsdagHighPriest.java b/Mage.Sets/src/mage/cards/s/SkirsdagHighPriest.java index fc9abce36c..5a14203331 100644 --- a/Mage.Sets/src/mage/cards/s/SkirsdagHighPriest.java +++ b/Mage.Sets/src/mage/cards/s/SkirsdagHighPriest.java @@ -68,7 +68,7 @@ public class SkirsdagHighPriest extends CardImpl { // Morbid - {tap}, Tap two untapped creatures you control: Create a 5/5 black Demon creature token with flying. Activate this ability only if a creature died this turn. Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new DemonToken()), - new TapSourceCost(), MorbidCondition.getInstance()); + new TapSourceCost(), MorbidCondition.instance); ability.addCost(new TapTargetCost(new TargetControlledCreaturePermanent(2, 2, filter, false))); ability.setAbilityWord(AbilityWord.MORBID); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/s/SkitteringCrustacean.java b/Mage.Sets/src/mage/cards/s/SkitteringCrustacean.java index 650a08ef5c..61844a9b87 100644 --- a/Mage.Sets/src/mage/cards/s/SkitteringCrustacean.java +++ b/Mage.Sets/src/mage/cards/s/SkitteringCrustacean.java @@ -61,7 +61,7 @@ public class SkitteringCrustacean extends CardImpl { Ability ability = new SimpleStaticAbility( Zone.BATTLEFIELD, new ConditionalContinuousEffect(new GainAbilitySourceEffect(HexproofAbility.getInstance(), Duration.WhileOnBattlefield), - MonstrousCondition.getInstance(), + MonstrousCondition.instance, "As long as {this} is monstrous, it has hexproof")); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/Skizzik.java b/Mage.Sets/src/mage/cards/s/Skizzik.java index 55bc2f5e9c..71f35cde2f 100644 --- a/Mage.Sets/src/mage/cards/s/Skizzik.java +++ b/Mage.Sets/src/mage/cards/s/Skizzik.java @@ -60,7 +60,7 @@ public class Skizzik extends CardImpl { // Haste this.addAbility(HasteAbility.getInstance()); // At the beginning of the end step, sacrifice Skizzik unless it was kicked. - this.addAbility(new BeginningOfEndStepTriggeredAbility(new SacrificeSourceUnlessConditionEffect(KickedCondition.getInstance()), TargetController.ANY, false)); + this.addAbility(new BeginningOfEndStepTriggeredAbility(new SacrificeSourceUnlessConditionEffect(KickedCondition.instance), TargetController.ANY, false)); } public Skizzik(final Skizzik card) { diff --git a/Mage.Sets/src/mage/cards/s/SlingbowTrap.java b/Mage.Sets/src/mage/cards/s/SlingbowTrap.java index 3772079ba9..fa8c9d5fa5 100644 --- a/Mage.Sets/src/mage/cards/s/SlingbowTrap.java +++ b/Mage.Sets/src/mage/cards/s/SlingbowTrap.java @@ -79,10 +79,10 @@ public class SlingbowTrap extends CardImpl { class SlingbowTrapCondition implements Condition { - private static final SlingbowTrapCondition fInstance = new SlingbowTrapCondition(); + private static final SlingbowTrapCondition instance = new SlingbowTrapCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/s/SlitheringShade.java b/Mage.Sets/src/mage/cards/s/SlitheringShade.java index 59e89e13a8..d7d9f83a1b 100644 --- a/Mage.Sets/src/mage/cards/s/SlitheringShade.java +++ b/Mage.Sets/src/mage/cards/s/SlitheringShade.java @@ -66,7 +66,7 @@ public class SlitheringShade extends CardImpl { // Hellbent — Slithering Shade can attack as though it didn't have defender as long as you have no cards in hand. Effect effect = new ConditionalAsThoughEffect( new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield), - HellbentCondition.getInstance()); + HellbentCondition.instance); effect.setText("Hellbent - {this} can attack as though it didn't have defender as long as you have no cards in hand"); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); diff --git a/Mage.Sets/src/mage/cards/s/SnakeOfTheGoldenGrove.java b/Mage.Sets/src/mage/cards/s/SnakeOfTheGoldenGrove.java index e833e63ac4..3d525e03f9 100644 --- a/Mage.Sets/src/mage/cards/s/SnakeOfTheGoldenGrove.java +++ b/Mage.Sets/src/mage/cards/s/SnakeOfTheGoldenGrove.java @@ -56,7 +56,7 @@ public class SnakeOfTheGoldenGrove extends CardImpl { this.addAbility(new TributeAbility(3)); // When Snake of the Golden Grove enters the battlefield, if tribute wasn't paid, you gain 4 life. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new GainLifeEffect(4), false); - this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.instance, "When {this} enters the battlefield, if its tribute wasn't paid, you gain 4 life.")); } diff --git a/Mage.Sets/src/mage/cards/s/SnapsailGlider.java b/Mage.Sets/src/mage/cards/s/SnapsailGlider.java index ee0cd2eb49..a886cb0d35 100644 --- a/Mage.Sets/src/mage/cards/s/SnapsailGlider.java +++ b/Mage.Sets/src/mage/cards/s/SnapsailGlider.java @@ -57,7 +57,7 @@ public class SnapsailGlider extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); ContinuousEffect effect = new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(effect, MetalcraftCondition.getInstance(), rule))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(effect, MetalcraftCondition.instance, rule))); } public SnapsailGlider (final SnapsailGlider card) { diff --git a/Mage.Sets/src/mage/cards/s/SokenzanRenegade.java b/Mage.Sets/src/mage/cards/s/SokenzanRenegade.java index d0c4ba0c70..3c48a75f29 100644 --- a/Mage.Sets/src/mage/cards/s/SokenzanRenegade.java +++ b/Mage.Sets/src/mage/cards/s/SokenzanRenegade.java @@ -131,12 +131,12 @@ class SokenzanRenegadeEffect extends OneShotEffect { } } -class OnePlayerHasTheMostCards implements Condition { +enum OnePlayerHasTheMostCards implements Condition { - private static final OnePlayerHasTheMostCards fInstance = new OnePlayerHasTheMostCards(); + instance; public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/s/SolemnRecruit.java b/Mage.Sets/src/mage/cards/s/SolemnRecruit.java index dc94ed7449..6e0bcc4c18 100644 --- a/Mage.Sets/src/mage/cards/s/SolemnRecruit.java +++ b/Mage.Sets/src/mage/cards/s/SolemnRecruit.java @@ -63,7 +63,7 @@ public class SolemnRecruit extends CardImpl { new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false ), - RevoltCondition.getInstance(), + RevoltCondition.instance, "Revolt — At the beginning of your end step, if a permanent you controlled left the battlefield this turn, put a +1/+1 counter on {this}." ), new RevoltWatcher()); } diff --git a/Mage.Sets/src/mage/cards/s/SolitaryHunter.java b/Mage.Sets/src/mage/cards/s/SolitaryHunter.java index edac753359..a93aa22bb6 100644 --- a/Mage.Sets/src/mage/cards/s/SolitaryHunter.java +++ b/Mage.Sets/src/mage/cards/s/SolitaryHunter.java @@ -62,7 +62,7 @@ public class SolitaryHunter extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Solitary Hunter. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public SolitaryHunter(final SolitaryHunter card) { diff --git a/Mage.Sets/src/mage/cards/s/SomberwaldSpider.java b/Mage.Sets/src/mage/cards/s/SomberwaldSpider.java index 869b799896..65bdbd16b1 100644 --- a/Mage.Sets/src/mage/cards/s/SomberwaldSpider.java +++ b/Mage.Sets/src/mage/cards/s/SomberwaldSpider.java @@ -55,7 +55,7 @@ public class SomberwaldSpider extends CardImpl { this.addAbility(ReachAbility.getInstance()); // Morbid - Somberwald Spider enters the battlefield with two +1/+1 counters on it if a creature died this turn. this.addAbility(new EntersBattlefieldAbility( - new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), MorbidCondition.getInstance(), ""), + new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), MorbidCondition.instance, ""), "with two +1/+1 counters on it if a creature died this turn")); } diff --git a/Mage.Sets/src/mage/cards/s/SoulSwallower.java b/Mage.Sets/src/mage/cards/s/SoulSwallower.java index 4dcae29267..088d106be5 100644 --- a/Mage.Sets/src/mage/cards/s/SoulSwallower.java +++ b/Mage.Sets/src/mage/cards/s/SoulSwallower.java @@ -59,7 +59,7 @@ public class SoulSwallower extends CardImpl { // Delirium — At the beginning of your upkeep, if there are four or more card types among cards in your graveyard, put three +1/+1 counters on Soul Swallower. this.addAbility(new ConditionalTriggeredAbility( new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)), TargetController.YOU, false), - DeliriumCondition.getInstance(), + DeliriumCondition.instance, "Delirium — At the beginning of your upkeep, if there are four or more card types among cards in your graveyard, " + "put three +1/+1 counters on Soul Swallower.")); } diff --git a/Mage.Sets/src/mage/cards/s/SphinxOfLostTruths.java b/Mage.Sets/src/mage/cards/s/SphinxOfLostTruths.java index 6d7681e513..dfd774abf2 100644 --- a/Mage.Sets/src/mage/cards/s/SphinxOfLostTruths.java +++ b/Mage.Sets/src/mage/cards/s/SphinxOfLostTruths.java @@ -63,7 +63,7 @@ public class SphinxOfLostTruths extends CardImpl { // When Sphinx of Lost Truths enters the battlefield, draw three cards. Then if it wasn't kicked, discard three cards. Ability ability = new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(3)); - ability.addEffect(new ConditionalOneShotEffect(new DiscardControllerEffect(3), new InvertCondition(KickedCondition.getInstance()), + ability.addEffect(new ConditionalOneShotEffect(new DiscardControllerEffect(3), new InvertCondition(KickedCondition.instance), "Then if it wasn't kicked, discard three cards")); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/SpiralingDuelist.java b/Mage.Sets/src/mage/cards/s/SpiralingDuelist.java index da586f33f0..dc1531c6ce 100644 --- a/Mage.Sets/src/mage/cards/s/SpiralingDuelist.java +++ b/Mage.Sets/src/mage/cards/s/SpiralingDuelist.java @@ -58,7 +58,7 @@ public class SpiralingDuelist extends CardImpl { this.toughness = new MageInt(1); ContinuousEffect effect = new GainAbilitySourceEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(effect, MetalcraftCondition.getInstance(), effectText))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(effect, MetalcraftCondition.instance, effectText))); } public SpiralingDuelist(final SpiralingDuelist card) { diff --git a/Mage.Sets/src/mage/cards/s/SpireSerpent.java b/Mage.Sets/src/mage/cards/s/SpireSerpent.java index 3f0be5a405..6038e1c40a 100644 --- a/Mage.Sets/src/mage/cards/s/SpireSerpent.java +++ b/Mage.Sets/src/mage/cards/s/SpireSerpent.java @@ -61,10 +61,10 @@ public class SpireSerpent extends CardImpl { this.toughness = new MageInt(5); this.addAbility(DefenderAbility.getInstance()); - ConditionalContinuousEffect effect1 = new ConditionalContinuousEffect(new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), MetalcraftCondition.getInstance(), abilityText1); + ConditionalContinuousEffect effect1 = new ConditionalContinuousEffect(new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), MetalcraftCondition.instance, abilityText1); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect1); Effect effect = new ConditionalAsThoughEffect(new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield), - MetalcraftCondition.getInstance()); + MetalcraftCondition.instance); effect.setText("and can attack as though it didn't have defender"); ability.addEffect(effect); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/s/SpiritOfResistance.java b/Mage.Sets/src/mage/cards/s/SpiritOfResistance.java index 0cde764d31..eb69e1f59a 100644 --- a/Mage.Sets/src/mage/cards/s/SpiritOfResistance.java +++ b/Mage.Sets/src/mage/cards/s/SpiritOfResistance.java @@ -75,10 +75,10 @@ public class SpiritOfResistance extends CardImpl { class SpiritOfResistanceCondition implements Condition { - private static final SpiritOfResistanceCondition fInstance = new SpiritOfResistanceCondition(); + private static final SpiritOfResistanceCondition instance = new SpiritOfResistanceCondition(); public static SpiritOfResistanceCondition getInstance() { - return fInstance; + return instance; } private SpiritOfResistanceCondition() {} diff --git a/Mage.Sets/src/mage/cards/s/SpiritShield.java b/Mage.Sets/src/mage/cards/s/SpiritShield.java index cc2ae0fe20..e9dfe031f7 100644 --- a/Mage.Sets/src/mage/cards/s/SpiritShield.java +++ b/Mage.Sets/src/mage/cards/s/SpiritShield.java @@ -56,7 +56,7 @@ public class SpiritShield extends CardImpl { this.addAbility(new SkipUntapOptionalAbility()); // {2}, {tap}: Target creature gets +0/+2 for as long as Spirit Shield remains tapped. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( - new BoostTargetEffect(0, 2, Duration.Custom), SourceTappedCondition.getInstance(), + new BoostTargetEffect(0, 2, Duration.Custom), SourceTappedCondition.instance, "target creature gets +0/+2 for as long as {this} remains tapped"), new ManaCostsImpl("{2}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/cards/s/StallionOfAshmouth.java b/Mage.Sets/src/mage/cards/s/StallionOfAshmouth.java index 42aca48a1d..9cf4be1075 100644 --- a/Mage.Sets/src/mage/cards/s/StallionOfAshmouth.java +++ b/Mage.Sets/src/mage/cards/s/StallionOfAshmouth.java @@ -54,7 +54,7 @@ public class StallionOfAshmouth extends CardImpl { // Delirium — {1}{B}: Stallion of Ashmouth gets +1/+1 until end of turn. Activate this ability only if there are // four or more card types among cards in your graveyard. - this.addAbility(new ConditionalActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{1}{B}"), new DeliriumCondition())); + this.addAbility(new ConditionalActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{1}{B}"), DeliriumCondition.instance)); } public StallionOfAshmouth(final StallionOfAshmouth card) { diff --git a/Mage.Sets/src/mage/cards/s/StampedingElkHerd.java b/Mage.Sets/src/mage/cards/s/StampedingElkHerd.java index c495e6d20d..a57c6a2acc 100644 --- a/Mage.Sets/src/mage/cards/s/StampedingElkHerd.java +++ b/Mage.Sets/src/mage/cards/s/StampedingElkHerd.java @@ -55,7 +55,7 @@ public class StampedingElkHerd extends CardImpl { // Formidable - Whenever Stampeding Elk Herd attacks, if creatures you control have total power 8 or greater, creatures you control gain trample until end of turn. this.addAbility(new ConditionalTriggeredAbility( new AttacksTriggeredAbility(new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, new FilterControlledCreaturePermanent()), false), - FormidableCondition.getInstance(), + FormidableCondition.instance, "Formidable — Whenever {this} attacks, if creatures you control have total power 8 or greater, creatures you control gain trample until end of turn." )); } diff --git a/Mage.Sets/src/mage/cards/s/StoicRebuttal.java b/Mage.Sets/src/mage/cards/s/StoicRebuttal.java index 269c3f6da3..4ced7b64d4 100644 --- a/Mage.Sets/src/mage/cards/s/StoicRebuttal.java +++ b/Mage.Sets/src/mage/cards/s/StoicRebuttal.java @@ -51,7 +51,7 @@ public class StoicRebuttal extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{U}{U}"); // Metalcraft - Stoic Rebuttal costs {1} less to cast if you control three or more artifacts. - Ability ability = new SimpleStaticAbility(Zone.STACK, new SpellCostReductionSourceEffect(1, MetalcraftCondition.getInstance())); + Ability ability = new SimpleStaticAbility(Zone.STACK, new SpellCostReductionSourceEffect(1, MetalcraftCondition.instance)); ability.setRuleAtTheTop(true); ability.setAbilityWord(AbilityWord.METALCRAFT); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/s/StrangeAugmentation.java b/Mage.Sets/src/mage/cards/s/StrangeAugmentation.java index 53c28ac918..aee389fef7 100644 --- a/Mage.Sets/src/mage/cards/s/StrangeAugmentation.java +++ b/Mage.Sets/src/mage/cards/s/StrangeAugmentation.java @@ -64,7 +64,7 @@ public class StrangeAugmentation extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1))); // Delirium &mdash Enchanted creature gets an additional +2/+2 as long as there are four or more card types among cards in your graveyard. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new BoostEnchantedEffect(2, 2), DeliriumCondition.getInstance(), + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new BoostEnchantedEffect(2, 2), DeliriumCondition.instance, "Delirium — Enchanted creature gets an additional +2/+2 as long as there are four or more card types among cards in your graveyard."))); } diff --git a/Mage.Sets/src/mage/cards/s/StrengthOfNight.java b/Mage.Sets/src/mage/cards/s/StrengthOfNight.java index 66fb99f61e..ddc29bee2a 100644 --- a/Mage.Sets/src/mage/cards/s/StrengthOfNight.java +++ b/Mage.Sets/src/mage/cards/s/StrengthOfNight.java @@ -62,7 +62,7 @@ public class StrengthOfNight extends CardImpl { // Creatures you control get +1/+1 until end of turn. If Strength of Night was kicked, Zombie creatures you control get an additional +2/+2 until end of turn. this.getSpellAbility().addEffect(new BoostControlledEffect(1, 1, Duration.EndOfTurn)); ContinuousEffect effect = new BoostControlledEffect(2, 2, Duration.EndOfTurn, filter); - this.getSpellAbility().addEffect(new ConditionalContinuousEffect(effect, new LockedInCondition(KickedCondition.getInstance()), + this.getSpellAbility().addEffect(new ConditionalContinuousEffect(effect, new LockedInCondition(KickedCondition.instance), "If {this} was kicked, Zombie creatures you control get an additional +2/+2 until end of turn.")); } diff --git a/Mage.Sets/src/mage/cards/s/StubbornDenial.java b/Mage.Sets/src/mage/cards/s/StubbornDenial.java index 3022647095..eb85512442 100644 --- a/Mage.Sets/src/mage/cards/s/StubbornDenial.java +++ b/Mage.Sets/src/mage/cards/s/StubbornDenial.java @@ -59,12 +59,12 @@ public class StubbornDenial extends CardImpl { // Counter target noncreature spell unless its controller pays {1}. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new CounterUnlessPaysEffect(new GenericManaCost(1)), - new InvertCondition(FerociousCondition.getInstance()), + new InvertCondition(FerociousCondition.instance), "Counter target noncreature spell unless its controller pays {1}.")); // Ferocious - If you control a creature with power 4 or greater, counter that spell instead. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new CounterTargetEffect(), - FerociousCondition.getInstance(), + FerociousCondition.instance, "
Ferocious &mdash If you control a creature with power 4 or greater, counter that spell instead")); this.getSpellAbility().addTarget(new TargetSpell(filter)); } diff --git a/Mage.Sets/src/mage/cards/s/SulfurousBlast.java b/Mage.Sets/src/mage/cards/s/SulfurousBlast.java index d20cd17e75..15bd134ba0 100644 --- a/Mage.Sets/src/mage/cards/s/SulfurousBlast.java +++ b/Mage.Sets/src/mage/cards/s/SulfurousBlast.java @@ -48,7 +48,7 @@ public class SulfurousBlast extends CardImpl { this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DamageEverythingEffect(3), new DamageEverythingEffect(2), - MyMainPhaseCondition.getInstance(), + MyMainPhaseCondition.instance, "Sulfurous Blast deals 2 damage to each creature and each player. If you cast this spell during your main phase, Sulfurous Blast deals 3 damage to each creature and each player instead")); } diff --git a/Mage.Sets/src/mage/cards/s/SummoningTrap.java b/Mage.Sets/src/mage/cards/s/SummoningTrap.java index 85c17fc3ef..cf7e3ba828 100644 --- a/Mage.Sets/src/mage/cards/s/SummoningTrap.java +++ b/Mage.Sets/src/mage/cards/s/SummoningTrap.java @@ -83,10 +83,10 @@ public class SummoningTrap extends CardImpl { class SummoningTrapCondition implements Condition { - private static final SummoningTrapCondition fInstance = new SummoningTrapCondition(); + private static final SummoningTrapCondition instance = new SummoningTrapCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/s/SundialOfTheInfinite.java b/Mage.Sets/src/mage/cards/s/SundialOfTheInfinite.java index 5c76b49c0d..f2906d30ff 100644 --- a/Mage.Sets/src/mage/cards/s/SundialOfTheInfinite.java +++ b/Mage.Sets/src/mage/cards/s/SundialOfTheInfinite.java @@ -51,7 +51,7 @@ public class SundialOfTheInfinite extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); // {1}, {tap}: End the turn. Activate this ability only during your turn. - Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new EndTurnEffect(), new GenericManaCost(1), MyTurnCondition.getInstance()); + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new EndTurnEffect(), new GenericManaCost(1), MyTurnCondition.instance); ability.addCost(new TapSourceCost()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/SurrakTheHuntCaller.java b/Mage.Sets/src/mage/cards/s/SurrakTheHuntCaller.java index da8cde5990..177509decd 100644 --- a/Mage.Sets/src/mage/cards/s/SurrakTheHuntCaller.java +++ b/Mage.Sets/src/mage/cards/s/SurrakTheHuntCaller.java @@ -59,7 +59,7 @@ public class SurrakTheHuntCaller extends CardImpl { // Formidable - At the beginning of combat on your turn, if creatures you control have total power 8 or greater, target creature you control gains haste until end of turn. Ability ability = new ConditionalTriggeredAbility( new BeginningOfCombatTriggeredAbility(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn), TargetController.YOU, false), - FormidableCondition.getInstance(), + FormidableCondition.instance, "Formidable — At the beginning of combat on your turn, if creatures you control have total power 8 or greater, target creature you control gains haste until end of turn."); ability.addTarget(new TargetControlledCreaturePermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/s/SwarmbornGiant.java b/Mage.Sets/src/mage/cards/s/SwarmbornGiant.java index 60d463c19e..867b0bfd2c 100644 --- a/Mage.Sets/src/mage/cards/s/SwarmbornGiant.java +++ b/Mage.Sets/src/mage/cards/s/SwarmbornGiant.java @@ -71,7 +71,7 @@ public class SwarmbornGiant extends CardImpl { Ability ability = new SimpleStaticAbility( Zone.BATTLEFIELD, new ConditionalContinuousEffect(new GainAbilitySourceEffect(ReachAbility.getInstance(), Duration.WhileOnBattlefield), - MonstrousCondition.getInstance(), + MonstrousCondition.instance, "As long as {this} is monstrous, it has reach")); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/SwiftReckoning.java b/Mage.Sets/src/mage/cards/s/SwiftReckoning.java index c993e23067..89a669677d 100644 --- a/Mage.Sets/src/mage/cards/s/SwiftReckoning.java +++ b/Mage.Sets/src/mage/cards/s/SwiftReckoning.java @@ -62,7 +62,7 @@ public class SwiftReckoning extends CardImpl { AsThoughEffect effect = new CastAsThoughItHadFlashSourceEffect(Duration.EndOfGame); effect.setText("Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, you may cast {this} as though it had flash"); this.addAbility(new SimpleStaticAbility(Zone.ALL, new ConditionalAsThoughEffect(effect, - SpellMasteryCondition.getInstance()))); + SpellMasteryCondition.instance))); // Destroy target tapped creature. this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); diff --git a/Mage.Sets/src/mage/cards/s/SwordOfTheParuns.java b/Mage.Sets/src/mage/cards/s/SwordOfTheParuns.java index b838cf5e34..c2f0180690 100644 --- a/Mage.Sets/src/mage/cards/s/SwordOfTheParuns.java +++ b/Mage.Sets/src/mage/cards/s/SwordOfTheParuns.java @@ -73,14 +73,14 @@ public class SwordOfTheParuns extends CardImpl { // As long as equipped creature is tapped, tapped creatures you control get +2/+0. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( new BoostControlledEffect(2,0, Duration.WhileOnBattlefield, filterTapped), - new CompoundCondition(EquipmentAttachedCondition.getInstance(), new AttachedToTappedCondition()), + new CompoundCondition(EquipmentAttachedCondition.instance, AttachedToTappedCondition.instance), "As long as equipped creature is tapped, tapped creatures you control get +2/+0" ))); // As long as equipped creature is untapped, untapped creatures you control get +0/+2. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( new BoostControlledEffect(0,2, Duration.WhileOnBattlefield, filterUntapped), - new CompoundCondition(EquipmentAttachedCondition.getInstance(), new InvertCondition(new AttachedToTappedCondition())), + new CompoundCondition(EquipmentAttachedCondition.instance, new InvertCondition(AttachedToTappedCondition.instance)), "As long as equipped creature is untapped, untapped creatures you control get +0/+2" ))); diff --git a/Mage.Sets/src/mage/cards/t/TalentOfTheTelepath.java b/Mage.Sets/src/mage/cards/t/TalentOfTheTelepath.java index 67d4da6078..2d8d8d8ebc 100644 --- a/Mage.Sets/src/mage/cards/t/TalentOfTheTelepath.java +++ b/Mage.Sets/src/mage/cards/t/TalentOfTheTelepath.java @@ -113,7 +113,7 @@ class TalentOfTheTelepathEffect extends OneShotEffect { // cast an instant or sorcery for free if (!cardsToCast.isEmpty()) { int numberOfSpells = 1; - if (SpellMasteryCondition.getInstance().apply(game, source)) { + if (SpellMasteryCondition.instance.apply(game, source)) { numberOfSpells++; } Player controller = game.getPlayer(source.getControllerId()); diff --git a/Mage.Sets/src/mage/cards/t/TapestryOfTheAges.java b/Mage.Sets/src/mage/cards/t/TapestryOfTheAges.java index e63b3269e9..0b0f158693 100644 --- a/Mage.Sets/src/mage/cards/t/TapestryOfTheAges.java +++ b/Mage.Sets/src/mage/cards/t/TapestryOfTheAges.java @@ -77,11 +77,11 @@ public class TapestryOfTheAges extends CardImpl { } } -class PlayerCastNonCreatureSpellCondition implements Condition { - private final static PlayerCastNonCreatureSpellCondition fInstance = new PlayerCastNonCreatureSpellCondition(); +enum PlayerCastNonCreatureSpellCondition implements Condition { + instance; public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/t/TasteForMayhem.java b/Mage.Sets/src/mage/cards/t/TasteForMayhem.java index 3afafe2611..116843e691 100644 --- a/Mage.Sets/src/mage/cards/t/TasteForMayhem.java +++ b/Mage.Sets/src/mage/cards/t/TasteForMayhem.java @@ -64,7 +64,7 @@ public class TasteForMayhem extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 0))); // Hellbent - Enchanted creature gets an additional +2/+0 as long as you have no cards in hand. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new BoostEnchantedEffect(2, 0), HellbentCondition.getInstance(), "Hellbent — Enchanted creature gets an additional +2/+0 as long as you have no cards in hand"))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new BoostEnchantedEffect(2, 0), HellbentCondition.instance, "Hellbent — Enchanted creature gets an additional +2/+0 as long as you have no cards in hand"))); } public TasteForMayhem(final TasteForMayhem card) { diff --git a/Mage.Sets/src/mage/cards/t/TawnossWeaponry.java b/Mage.Sets/src/mage/cards/t/TawnossWeaponry.java index 899190a1a6..3c2bd0d3d7 100644 --- a/Mage.Sets/src/mage/cards/t/TawnossWeaponry.java +++ b/Mage.Sets/src/mage/cards/t/TawnossWeaponry.java @@ -56,7 +56,7 @@ public class TawnossWeaponry extends CardImpl { this.addAbility(new SkipUntapOptionalAbility()); // {2}, {tap}: Target creature gets +1/+1 for as long as Tawnos's Weaponry remains tapped. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( - new BoostTargetEffect(1, 1, Duration.Custom), SourceTappedCondition.getInstance(), + new BoostTargetEffect(1, 1, Duration.Custom), SourceTappedCondition.instance, "target creature gets +1/+1 for as long as {this} remains tapped"), new ManaCostsImpl("{2}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/cards/t/TempestOwl.java b/Mage.Sets/src/mage/cards/t/TempestOwl.java index d58dfe2ebd..1e0fb716fc 100644 --- a/Mage.Sets/src/mage/cards/t/TempestOwl.java +++ b/Mage.Sets/src/mage/cards/t/TempestOwl.java @@ -63,7 +63,7 @@ public class TempestOwl extends CardImpl { // When Tempest Owl enters the battlefield, if it was kicked, tap up to three target permanents. EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new TapTargetEffect(), false); ability.addTarget(new TargetPermanent(0, 3, new FilterPermanent(), false)); - this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), "When {this} enters the battlefield, if it was kicked, tap up to three target permanents.")); + this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, tap up to three target permanents.")); } public TempestOwl(final TempestOwl card) { diff --git a/Mage.Sets/src/mage/cards/t/TemurBattleRage.java b/Mage.Sets/src/mage/cards/t/TemurBattleRage.java index 23777af4c9..893df14b03 100644 --- a/Mage.Sets/src/mage/cards/t/TemurBattleRage.java +++ b/Mage.Sets/src/mage/cards/t/TemurBattleRage.java @@ -58,7 +58,7 @@ public class TemurBattleRage extends CardImpl { // Ferocious That creature also gains trample until end of turn if you control a creature with power 4 or greater. this.getSpellAbility().addEffect(new ConditionalContinuousEffect( new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn), - new LockedInCondition(FerociousCondition.getInstance()), + new LockedInCondition(FerociousCondition.instance), rule)); } diff --git a/Mage.Sets/src/mage/cards/t/TerrorOfKruinPass.java b/Mage.Sets/src/mage/cards/t/TerrorOfKruinPass.java index 16ac9c68ee..1e8a93ebbe 100644 --- a/Mage.Sets/src/mage/cards/t/TerrorOfKruinPass.java +++ b/Mage.Sets/src/mage/cards/t/TerrorOfKruinPass.java @@ -84,7 +84,7 @@ public class TerrorOfKruinPass extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Terror of Kruin Pass. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public TerrorOfKruinPass(final TerrorOfKruinPass card) { diff --git a/Mage.Sets/src/mage/cards/t/TheChainVeil.java b/Mage.Sets/src/mage/cards/t/TheChainVeil.java index a2f760fd11..cd2e2a08d1 100644 --- a/Mage.Sets/src/mage/cards/t/TheChainVeil.java +++ b/Mage.Sets/src/mage/cards/t/TheChainVeil.java @@ -67,7 +67,7 @@ public class TheChainVeil extends CardImpl { // At the beginning of your end step, if you didn't activate a loyalty ability of a planeswalker this turn, you lose 2 life. this.addAbility(new BeginningOfEndStepTriggeredAbility( - Zone.BATTLEFIELD, new LoseLifeSourceControllerEffect(2), TargetController.YOU, TheChainVeilCondition.getInstance(), false), new ActivatedLoyaltyAbilityWatcher()); + Zone.BATTLEFIELD, new LoseLifeSourceControllerEffect(2), TargetController.YOU, TheChainVeilCondition.instance, false), new ActivatedLoyaltyAbilityWatcher()); // {4}, {T}: For each planeswalker you control, you may activate one of its loyalty abilities once this turn as though none of its loyalty abilities had been activated this turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, @@ -164,13 +164,11 @@ class TheChainVeilIncreaseLoyaltyUseEffect extends ContinuousEffectImpl { } } -class TheChainVeilCondition implements Condition { +enum TheChainVeilCondition implements Condition { + + instance; - private static final TheChainVeilCondition fInstance = new TheChainVeilCondition(); - public static Condition getInstance() { - return fInstance; - } @Override public boolean apply(Game game, Ability source) { diff --git a/Mage.Sets/src/mage/cards/t/ThicketElemental.java b/Mage.Sets/src/mage/cards/t/ThicketElemental.java index fb4c5333b9..077e5fad0a 100644 --- a/Mage.Sets/src/mage/cards/t/ThicketElemental.java +++ b/Mage.Sets/src/mage/cards/t/ThicketElemental.java @@ -58,7 +58,7 @@ public class ThicketElemental extends CardImpl { // When Thicket Elemental enters the battlefield, if it was kicked, you may reveal cards from the top of your library until you reveal a creature card. If you do, put that card onto the battlefield and shuffle all other cards revealed this way into your library. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new RevealCardsFromLibraryUntilEffect(new FilterCreatureCard(), Zone.BATTLEFIELD, Zone.LIBRARY, true)); - this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, you may reveal cards from the top of your library until you reveal a creature card. If you do, put that card onto the battlefield and shuffle all other cards revealed this way into your library.")); } diff --git a/Mage.Sets/src/mage/cards/t/ThirstingAxe.java b/Mage.Sets/src/mage/cards/t/ThirstingAxe.java index d9a8879d9a..ce1f58447c 100644 --- a/Mage.Sets/src/mage/cards/t/ThirstingAxe.java +++ b/Mage.Sets/src/mage/cards/t/ThirstingAxe.java @@ -71,7 +71,7 @@ public class ThirstingAxe extends CardImpl { // At the beginning of your end step, if equipped creature didn't deal combat damage to a creature this turn, sacrifice it. TriggeredAbility ability = new BeginningOfYourEndStepTriggeredAbility(new SacrificeEquippedEffect(), false); Condition condition = new CompoundCondition( - AttachedCondition.getInstance(), + AttachedCondition.instance, new InvertCondition(new EquippedDealtCombatDamageToCreatureCondition())); String triggeredAbilityText = "At the beginning of your end step, if equipped creature " + "didn't deal combat damage to a creature this turn, sacrifice it."; diff --git a/Mage.Sets/src/mage/cards/t/ThrabenDoomsayer.java b/Mage.Sets/src/mage/cards/t/ThrabenDoomsayer.java index 7275e3f6bd..1ec37dcd2d 100644 --- a/Mage.Sets/src/mage/cards/t/ThrabenDoomsayer.java +++ b/Mage.Sets/src/mage/cards/t/ThrabenDoomsayer.java @@ -61,7 +61,7 @@ public class ThrabenDoomsayer extends CardImpl { this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new HumanToken()), new TapSourceCost())); // Fateful hour - As long as you have 5 or less life, other creatures you control get +2/+2. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new BoostControlledEffect(2, 2, Duration.WhileOnBattlefield, true), - FatefulHourCondition.getInstance(), "As long as you have 5 or less life, other creatures you control get +2/+2"))); + FatefulHourCondition.instance, "As long as you have 5 or less life, other creatures you control get +2/+2"))); } public ThrabenDoomsayer(final ThrabenDoomsayer card) { diff --git a/Mage.Sets/src/mage/cards/t/ThrabenFoulbloods.java b/Mage.Sets/src/mage/cards/t/ThrabenFoulbloods.java index 7effa1663f..71853d213d 100644 --- a/Mage.Sets/src/mage/cards/t/ThrabenFoulbloods.java +++ b/Mage.Sets/src/mage/cards/t/ThrabenFoulbloods.java @@ -56,9 +56,9 @@ public class ThrabenFoulbloods extends CardImpl { this.toughness = new MageInt(2); // Delirium — Thraben Foulbloods gets +1/+1 and has menace as long as there are four or more card types among cards in your graveyard. (A creature with menace can't be blocked except by two or more creatures.) - ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new BoostSourceEffect(1, 1, Duration.WhileOnBattlefield), DeliriumCondition.getInstance(), "Delirium — {this} gets +1/+1"); + ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new BoostSourceEffect(1, 1, Duration.WhileOnBattlefield), DeliriumCondition.instance, "Delirium — {this} gets +1/+1"); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); - ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(new MenaceAbility()), DeliriumCondition.getInstance(), + ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(new MenaceAbility()), DeliriumCondition.instance, "and has menace as long as there are four or more card types among cards in your graveyard. (A creature with menace can't be blocked except by two or more creatures.)")); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/t/ThunderBrute.java b/Mage.Sets/src/mage/cards/t/ThunderBrute.java index 21cbd7560d..4df282e2fd 100644 --- a/Mage.Sets/src/mage/cards/t/ThunderBrute.java +++ b/Mage.Sets/src/mage/cards/t/ThunderBrute.java @@ -61,7 +61,7 @@ public class ThunderBrute extends CardImpl { this.addAbility(new TributeAbility(3)); // When Thunder Brute enters the battlefield, if tribute wasn't paid, it gains haste until end of turn. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.EndOfTurn), false); - this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.instance, "When {this} enters the battlefield, if its tribute wasn't paid, it gains haste until end of turn.")); } diff --git a/Mage.Sets/src/mage/cards/t/TideshaperMystic.java b/Mage.Sets/src/mage/cards/t/TideshaperMystic.java index 39bc46460b..d8d2c39e39 100644 --- a/Mage.Sets/src/mage/cards/t/TideshaperMystic.java +++ b/Mage.Sets/src/mage/cards/t/TideshaperMystic.java @@ -56,7 +56,7 @@ public class TideshaperMystic extends CardImpl { // {tap}: Target land becomes the basic land type of your choice until end of turn. Activate this ability only during your turn. Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, - new BecomesBasicLandTargetEffect(Duration.EndOfTurn), new TapSourceCost(), MyTurnCondition.getInstance()); + new BecomesBasicLandTargetEffect(Duration.EndOfTurn), new TapSourceCost(), MyTurnCondition.instance); ability.addTarget(new TargetLandPermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/t/TimberShredder.java b/Mage.Sets/src/mage/cards/t/TimberShredder.java index df1949043a..c2aeba4688 100644 --- a/Mage.Sets/src/mage/cards/t/TimberShredder.java +++ b/Mage.Sets/src/mage/cards/t/TimberShredder.java @@ -63,7 +63,7 @@ public class TimberShredder extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Timber Shredder. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public TimberShredder(final TimberShredder card) { diff --git a/Mage.Sets/src/mage/cards/t/TimelyHordemate.java b/Mage.Sets/src/mage/cards/t/TimelyHordemate.java index 323de5c314..a502e47e4b 100644 --- a/Mage.Sets/src/mage/cards/t/TimelyHordemate.java +++ b/Mage.Sets/src/mage/cards/t/TimelyHordemate.java @@ -64,7 +64,7 @@ public class TimelyHordemate extends CardImpl { this.toughness = new MageInt(2); // Raid - When Timely Hordemate enters the battlefield, if you attacked this turn, return target creature card with converted mana cost 2 or less from your graveyard to the battlefield. - Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToBattlefieldTargetEffect()), RaidCondition.getInstance(), + Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToBattlefieldTargetEffect()), RaidCondition.instance, "Raid - When {this} enters the battlefield, if you attacked with a creature this turn, return target creature card with converted mana cost 2 or less from your graveyard to the battlefield."); ability.addTarget(new TargetCardInYourGraveyard(filter)); this.addAbility(ability, new PlayerAttackedWatcher()); diff --git a/Mage.Sets/src/mage/cards/t/ToTheSlaughter.java b/Mage.Sets/src/mage/cards/t/ToTheSlaughter.java index f842f12747..209cd8cffa 100644 --- a/Mage.Sets/src/mage/cards/t/ToTheSlaughter.java +++ b/Mage.Sets/src/mage/cards/t/ToTheSlaughter.java @@ -52,17 +52,17 @@ public class ToTheSlaughter extends CardImpl { // Target player sacrifices a creature or planeswalker. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new SacrificeEffect(new FilterCreatureOrPlaneswalkerPermanent(), 1, "Target player"), - new InvertCondition(DeliriumCondition.getInstance()), + new InvertCondition(DeliriumCondition.instance), "Target player sacrifices a creature or planeswalker.")); // Delirium — If there are four or more card types among cards in your graveyard, instead that player sacrifices a creature and a planeswalker. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target player"), - DeliriumCondition.getInstance(), + DeliriumCondition.instance, "
Delirium — If there are four or more card types among cards in your graveyard, instead that player sacrifices a creature")); this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new SacrificeEffect(new FilterPlaneswalkerPermanent(), 1, "Target player"), - DeliriumCondition.getInstance(), "and a planeswalker.")); + DeliriumCondition.instance, "and a planeswalker.")); this.getSpellAbility().addTarget(new TargetPlayer()); } diff --git a/Mage.Sets/src/mage/cards/t/TolarianEmissary.java b/Mage.Sets/src/mage/cards/t/TolarianEmissary.java index 30aa4e485f..dc4fe6c4b6 100644 --- a/Mage.Sets/src/mage/cards/t/TolarianEmissary.java +++ b/Mage.Sets/src/mage/cards/t/TolarianEmissary.java @@ -62,7 +62,7 @@ public class TolarianEmissary extends CardImpl { // When Tolarian Emissary enters the battlefield, if it was kicked, destroy target enchantment. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect()); ability.addTarget(new TargetEnchantmentPermanent()); - this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, destroy target enchantment.")); } diff --git a/Mage.Sets/src/mage/cards/t/ToothCollector.java b/Mage.Sets/src/mage/cards/t/ToothCollector.java index 6bf5529229..252305be15 100644 --- a/Mage.Sets/src/mage/cards/t/ToothCollector.java +++ b/Mage.Sets/src/mage/cards/t/ToothCollector.java @@ -78,7 +78,7 @@ public class ToothCollector extends CardImpl { // target creature that player controls gets -1/-1 until end of turn. ability = new ConditionalTriggeredAbility( new ToothCollectorAbility(), - new DeliriumCondition(), + DeliriumCondition.instance, "Delirium — At the beginning of each opponent's upkeep, if there are four or more card types among cards in your graveyard, " + "target creature that player controls gets -1/-1 until end of turn."); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/t/Topplegeist.java b/Mage.Sets/src/mage/cards/t/Topplegeist.java index 84b0983bab..94df6fe470 100644 --- a/Mage.Sets/src/mage/cards/t/Topplegeist.java +++ b/Mage.Sets/src/mage/cards/t/Topplegeist.java @@ -80,7 +80,7 @@ public class Topplegeist extends CardImpl { // tap target creature that player controls. ability = new ConditionalTriggeredAbility( new TopplegeistAbility(), - new DeliriumCondition(), + DeliriumCondition.instance, "Delirium — At the beginning of each opponent's upkeep, if there are four or more card types among cards in your graveyard, " + "tap target creature that player controls."); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/t/TorchSlinger.java b/Mage.Sets/src/mage/cards/t/TorchSlinger.java index d13806ba20..fc75300509 100644 --- a/Mage.Sets/src/mage/cards/t/TorchSlinger.java +++ b/Mage.Sets/src/mage/cards/t/TorchSlinger.java @@ -60,7 +60,7 @@ public class TorchSlinger extends CardImpl { // When Torch Slinger enters the battlefield, if it was kicked, it deals 2 damage to target creature. EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(2), false); ability.addTarget(new TargetCreaturePermanent()); - this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), "When {this} enters the battlefield, if it was kicked, it deals 2 damage to target creature.")); + this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, it deals 2 damage to target creature.")); } public TorchSlinger(final TorchSlinger card) { diff --git a/Mage.Sets/src/mage/cards/t/TormentedPariah.java b/Mage.Sets/src/mage/cards/t/TormentedPariah.java index 54288dc32e..3803a5bccd 100644 --- a/Mage.Sets/src/mage/cards/t/TormentedPariah.java +++ b/Mage.Sets/src/mage/cards/t/TormentedPariah.java @@ -62,7 +62,7 @@ public class TormentedPariah extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Tormented Pariah. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public TormentedPariah(final TormentedPariah card) { diff --git a/Mage.Sets/src/mage/cards/t/TovolarsMagehunter.java b/Mage.Sets/src/mage/cards/t/TovolarsMagehunter.java index ca785346c6..abe6a09238 100644 --- a/Mage.Sets/src/mage/cards/t/TovolarsMagehunter.java +++ b/Mage.Sets/src/mage/cards/t/TovolarsMagehunter.java @@ -70,7 +70,7 @@ public class TovolarsMagehunter extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Tovolar's Magehunter. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); this.addAbility(new ConditionalTriggeredAbility(ability, - TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), + TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } diff --git a/Mage.Sets/src/mage/cards/t/TragicSlip.java b/Mage.Sets/src/mage/cards/t/TragicSlip.java index a4a9d7cbc8..d6e822e384 100644 --- a/Mage.Sets/src/mage/cards/t/TragicSlip.java +++ b/Mage.Sets/src/mage/cards/t/TragicSlip.java @@ -53,7 +53,7 @@ public class TragicSlip extends CardImpl { this.getSpellAbility().addEffect(new ConditionalContinuousEffect( new BoostTargetEffect(-13, -13, Duration.EndOfTurn), new BoostTargetEffect(-1, -1, Duration.EndOfTurn), - new LockedInCondition(MorbidCondition.getInstance()), + new LockedInCondition(MorbidCondition.instance), "Target creature gets -1/-1 until end of turn. Morbid - That creature gets -13/-13 until end of turn instead if a creature died this turn")); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/cards/t/TraverseTheUlvenwald.java b/Mage.Sets/src/mage/cards/t/TraverseTheUlvenwald.java index 3eeae9eed6..24e682e8a6 100644 --- a/Mage.Sets/src/mage/cards/t/TraverseTheUlvenwald.java +++ b/Mage.Sets/src/mage/cards/t/TraverseTheUlvenwald.java @@ -59,14 +59,14 @@ public class TraverseTheUlvenwald extends CardImpl { // Search your library for a basic land card, reveal it, put it into your hand, then shuffle your library. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new SearchLibraryPutInHandEffect(new TargetCardInLibrary(1, 1, new FilterBasicLandCard()), true), - new InvertCondition(DeliriumCondition.getInstance()), + new InvertCondition(DeliriumCondition.instance), "Search your library for a basic land card, reveal it, put it into your hand, then shuffle your library.")); // Delirium — If there are four or more card types among cards in your graveyard, instead search your library // for a creature or land card, reveal it, put it into your hand, then shuffle your library. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new SearchLibraryPutInHandEffect(new TargetCardInLibrary(1, 1, filter), true), - DeliriumCondition.getInstance(), + DeliriumCondition.instance, "
Delirium — If there are four or more card types among cards in your graveyard, instead search your library for a creature or land card, " + "reveal it, put it into your hand, then shuffle your library.")); } diff --git a/Mage.Sets/src/mage/cards/t/TriumphOfCruelty.java b/Mage.Sets/src/mage/cards/t/TriumphOfCruelty.java index cb05aba85a..0c44047d3f 100644 --- a/Mage.Sets/src/mage/cards/t/TriumphOfCruelty.java +++ b/Mage.Sets/src/mage/cards/t/TriumphOfCruelty.java @@ -57,7 +57,7 @@ public class TriumphOfCruelty extends CardImpl { TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new DiscardTargetEffect(1), TargetController.YOU, false); Target target = new TargetOpponent(); ability.addTarget(target); - this.addAbility(new ConditionalTriggeredAbility(ability, ControlsCreatureGreatestPowerCondition.getInstance(), ruleText)); + this.addAbility(new ConditionalTriggeredAbility(ability, ControlsCreatureGreatestPowerCondition.instance, ruleText)); } public TriumphOfCruelty(final TriumphOfCruelty card) { diff --git a/Mage.Sets/src/mage/cards/t/TriumphOfFerocity.java b/Mage.Sets/src/mage/cards/t/TriumphOfFerocity.java index 5a9ef85ec7..d82b572292 100644 --- a/Mage.Sets/src/mage/cards/t/TriumphOfFerocity.java +++ b/Mage.Sets/src/mage/cards/t/TriumphOfFerocity.java @@ -52,7 +52,7 @@ public class TriumphOfFerocity extends CardImpl { // At the beginning of your upkeep, draw a card if you control the creature with the greatest power or tied for the greatest power. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new DrawCardSourceControllerEffect(1), TargetController.YOU, false); - this.addAbility(new ConditionalTriggeredAbility(ability, ControlsCreatureGreatestPowerCondition.getInstance(), ruleText)); + this.addAbility(new ConditionalTriggeredAbility(ability, ControlsCreatureGreatestPowerCondition.instance, ruleText)); } public TriumphOfFerocity(final TriumphOfFerocity card) { diff --git a/Mage.Sets/src/mage/cards/t/Twinstrike.java b/Mage.Sets/src/mage/cards/t/Twinstrike.java index efbe96a4c9..b23223682a 100644 --- a/Mage.Sets/src/mage/cards/t/Twinstrike.java +++ b/Mage.Sets/src/mage/cards/t/Twinstrike.java @@ -50,12 +50,12 @@ public class Twinstrike extends CardImpl { // Twinstrike deals 2 damage to each of two target creatures. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DamageTargetEffect(2), - new InvertCondition(HellbentCondition.getInstance()), + new InvertCondition(HellbentCondition.instance), "{this} deals 2 damage to each of two target creatures")); // Hellbent - Cackling Flames deals 5 damage to that creature or player instead if you have no cards in hand. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DestroyTargetEffect(), - HellbentCondition.getInstance(), + HellbentCondition.instance, "

Hellbent - Destroy those creatures instead if you have no cards in hand")); this.getSpellAbility().addTarget(new TargetCreaturePermanent(2,2)); diff --git a/Mage.Sets/src/mage/cards/t/TyrantOfValakut.java b/Mage.Sets/src/mage/cards/t/TyrantOfValakut.java index 8b777425ba..49028b6ced 100644 --- a/Mage.Sets/src/mage/cards/t/TyrantOfValakut.java +++ b/Mage.Sets/src/mage/cards/t/TyrantOfValakut.java @@ -61,7 +61,7 @@ public class TyrantOfValakut extends CardImpl { // When Tyrant of Valakut enters the battlefield, if its surge cost was paid, it deals 3 damage to target creature or player. EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(3), false); ability.addTarget(new TargetCreatureOrPlayer()); - this.addAbility(new ConditionalTriggeredAbility(ability, SurgedCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(ability, SurgedCondition.instance, "When {this} enters the battlefield, if its surge cost was paid, it deals 3 damage to target creature or player.")); } diff --git a/Mage.Sets/src/mage/cards/u/UlrichOfTheKrallenhorde.java b/Mage.Sets/src/mage/cards/u/UlrichOfTheKrallenhorde.java index 189764d2c7..96c693c632 100644 --- a/Mage.Sets/src/mage/cards/u/UlrichOfTheKrallenhorde.java +++ b/Mage.Sets/src/mage/cards/u/UlrichOfTheKrallenhorde.java @@ -72,7 +72,7 @@ public class UlrichOfTheKrallenhorde extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Ulrich of the Krallenhorde. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public UlrichOfTheKrallenhorde(final UlrichOfTheKrallenhorde card) { diff --git a/Mage.Sets/src/mage/cards/u/UlrichUncontestedAlpha.java b/Mage.Sets/src/mage/cards/u/UlrichUncontestedAlpha.java index 0c2d0d5ac2..5603c1604f 100644 --- a/Mage.Sets/src/mage/cards/u/UlrichUncontestedAlpha.java +++ b/Mage.Sets/src/mage/cards/u/UlrichUncontestedAlpha.java @@ -76,7 +76,7 @@ public class UlrichUncontestedAlpha extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Ulrich, Uncontested Alpha. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public UlrichUncontestedAlpha(final UlrichUncontestedAlpha card) { diff --git a/Mage.Sets/src/mage/cards/u/UlvenwaldBear.java b/Mage.Sets/src/mage/cards/u/UlvenwaldBear.java index f3cf8d7192..3ab39bcf6a 100644 --- a/Mage.Sets/src/mage/cards/u/UlvenwaldBear.java +++ b/Mage.Sets/src/mage/cards/u/UlvenwaldBear.java @@ -57,7 +57,7 @@ public class UlvenwaldBear extends CardImpl { // Morbid - When Ulvenwald Bear enters the battlefield, if a creature died this turn, put two +1/+1 counters on target creature. Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance(2), Outcome.BoostCreature)), - MorbidCondition.getInstance(), "When {this} enters the battlefield, if a creature died this turn, put two +1/+1 counters on target creature."); + MorbidCondition.instance, "When {this} enters the battlefield, if a creature died this turn, put two +1/+1 counters on target creature."); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/u/UlvenwaldMystics.java b/Mage.Sets/src/mage/cards/u/UlvenwaldMystics.java index 5c46673f42..980a9efa8f 100644 --- a/Mage.Sets/src/mage/cards/u/UlvenwaldMystics.java +++ b/Mage.Sets/src/mage/cards/u/UlvenwaldMystics.java @@ -61,7 +61,7 @@ public class UlvenwaldMystics extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Ulvenwald Mystics. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public UlvenwaldMystics(final UlvenwaldMystics card) { diff --git a/Mage.Sets/src/mage/cards/u/UlvenwaldPrimordials.java b/Mage.Sets/src/mage/cards/u/UlvenwaldPrimordials.java index 3fb2cb4576..3009472eb5 100644 --- a/Mage.Sets/src/mage/cards/u/UlvenwaldPrimordials.java +++ b/Mage.Sets/src/mage/cards/u/UlvenwaldPrimordials.java @@ -67,7 +67,7 @@ public class UlvenwaldPrimordials extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Ulvenwald Primordials. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public UlvenwaldPrimordials(final UlvenwaldPrimordials card) { diff --git a/Mage.Sets/src/mage/cards/u/UnholyHunger.java b/Mage.Sets/src/mage/cards/u/UnholyHunger.java index fb19173e4d..ec319dfd59 100644 --- a/Mage.Sets/src/mage/cards/u/UnholyHunger.java +++ b/Mage.Sets/src/mage/cards/u/UnholyHunger.java @@ -53,7 +53,7 @@ public class UnholyHunger extends CardImpl { // Spell mastery - If there are two or more instant and/or sorcery cards in your graveyard, you gain 2 life. Effect effect = new ConditionalOneShotEffect(new GainLifeEffect(2), - SpellMasteryCondition.getInstance(), "Spell mastery - If there are two or more instant and/or sorcery cards in your graveyard, you gain 2 life"); + SpellMasteryCondition.instance, "Spell mastery - If there are two or more instant and/or sorcery cards in your graveyard, you gain 2 life"); this.getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/cards/u/UnstableFooting.java b/Mage.Sets/src/mage/cards/u/UnstableFooting.java index 2d65d9bfa7..00a5c49047 100644 --- a/Mage.Sets/src/mage/cards/u/UnstableFooting.java +++ b/Mage.Sets/src/mage/cards/u/UnstableFooting.java @@ -62,7 +62,7 @@ public class UnstableFooting extends CardImpl { this.getSpellAbility().addEffect(new UnstableFootingEffect()); this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DamageTargetEffect(5), - KickedCondition.getInstance(), + KickedCondition.instance, "If {this} was kicked, it deals 5 damage to target player")); } @@ -71,7 +71,7 @@ public class UnstableFooting extends CardImpl { public void adjustTargets(Ability ability, Game game) { if (ability instanceof SpellAbility) { ability.getTargets().clear(); - if (KickedCondition.getInstance().apply(game, ability)) { + if (KickedCondition.instance.apply(game, ability)) { ability.addTarget(new TargetPlayer()); } } diff --git a/Mage.Sets/src/mage/cards/u/UrborgEmissary.java b/Mage.Sets/src/mage/cards/u/UrborgEmissary.java index ef6030992d..0324c4f4c5 100644 --- a/Mage.Sets/src/mage/cards/u/UrborgEmissary.java +++ b/Mage.Sets/src/mage/cards/u/UrborgEmissary.java @@ -59,7 +59,7 @@ public class UrborgEmissary extends CardImpl { // When Urborg Emissary enters the battlefield, if it was kicked, return target permanent to its owner's hand. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect()); ability.addTarget(new TargetPermanent()); - this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, return target permanent to its owner's hand.")); } diff --git a/Mage.Sets/src/mage/cards/u/UrborgSkeleton.java b/Mage.Sets/src/mage/cards/u/UrborgSkeleton.java index faeec75ebc..9ee69bba29 100644 --- a/Mage.Sets/src/mage/cards/u/UrborgSkeleton.java +++ b/Mage.Sets/src/mage/cards/u/UrborgSkeleton.java @@ -67,7 +67,7 @@ public class UrborgSkeleton extends CardImpl { // If Urborg Skeleton was kicked, it enters the battlefield with a +1/+1 counter on it. Ability ability = new EntersBattlefieldAbility( new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), - KickedCondition.getInstance(), staticText,""); + KickedCondition.instance, staticText,""); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/u/UrzasRage.java b/Mage.Sets/src/mage/cards/u/UrzasRage.java index f09a4fdb5b..fadef48a42 100644 --- a/Mage.Sets/src/mage/cards/u/UrzasRage.java +++ b/Mage.Sets/src/mage/cards/u/UrzasRage.java @@ -63,7 +63,7 @@ public class UrzasRage extends CardImpl { // Urza's Rage deals 3 damage to target creature or player. If Urza's Rage was kicked, instead it deals 10 damage to that creature or player and the damage can't be prevented. this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new DamageTargetEffect(10, false), - new DamageTargetEffect(3), KickedCondition.getInstance(), + new DamageTargetEffect(3), KickedCondition.instance, "{this} deals 3 damage to target creature or player. If {this} was kicked, instead it deals 10 damage to that creature or player and the damage can't be prevented.")); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); } diff --git a/Mage.Sets/src/mage/cards/v/VampiresBite.java b/Mage.Sets/src/mage/cards/v/VampiresBite.java index 963bfb5951..bbf1e413d2 100644 --- a/Mage.Sets/src/mage/cards/v/VampiresBite.java +++ b/Mage.Sets/src/mage/cards/v/VampiresBite.java @@ -59,7 +59,7 @@ public class VampiresBite extends CardImpl { this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new BoostTargetEffect(3, 0, Duration.EndOfTurn)); ContinuousEffect effect = new GainAbilityTargetEffect(LifelinkAbility.getInstance(), Duration.EndOfTurn); - this.getSpellAbility().addEffect(new ConditionalContinuousEffect(effect, new LockedInCondition(KickedCondition.getInstance()), "If {this} was kicked, that creature gains lifelink until end of turn")); + this.getSpellAbility().addEffect(new ConditionalContinuousEffect(effect, new LockedInCondition(KickedCondition.instance), "If {this} was kicked, that creature gains lifelink until end of turn")); } public VampiresBite(final VampiresBite card) { diff --git a/Mage.Sets/src/mage/cards/v/VedalkenCertarch.java b/Mage.Sets/src/mage/cards/v/VedalkenCertarch.java index 0c8b384e52..287c7c30d2 100644 --- a/Mage.Sets/src/mage/cards/v/VedalkenCertarch.java +++ b/Mage.Sets/src/mage/cards/v/VedalkenCertarch.java @@ -69,7 +69,7 @@ public class VedalkenCertarch extends CardImpl { this.toughness = new MageInt(1); // Metalcraft - {T}: Tap target artifact, creature, or land. Activate this ability only if you control three or more artifacts. - Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new TapSourceCost(), MetalcraftCondition.getInstance()); + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new TapSourceCost(), MetalcraftCondition.instance); ability.setAbilityWord(AbilityWord.METALCRAFT); ability.addTarget(new TargetPermanent(filter)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/v/VedalkenShackles.java b/Mage.Sets/src/mage/cards/v/VedalkenShackles.java index 00e5d25867..d8eaabff95 100644 --- a/Mage.Sets/src/mage/cards/v/VedalkenShackles.java +++ b/Mage.Sets/src/mage/cards/v/VedalkenShackles.java @@ -70,7 +70,7 @@ public class VedalkenShackles extends CardImpl { // {2}, {tap}: Gain control of target creature with power less than or equal to the number of Islands you control for as long as Vedalken Shackles remains tapped. ConditionalContinuousEffect effect = new ConditionalContinuousEffect( - new GainControlTargetEffect(Duration.Custom), SourceTappedCondition.getInstance(), + new GainControlTargetEffect(Duration.Custom), SourceTappedCondition.instance, "Gain control of target creature with power less than or equal to the number of Islands you control for as long as {this} remains tapped"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(2)); ability.addCost(new TapSourceCost()); diff --git a/Mage.Sets/src/mage/cards/v/VengefulFirebrand.java b/Mage.Sets/src/mage/cards/v/VengefulFirebrand.java index f02377613a..49fe2f0d29 100644 --- a/Mage.Sets/src/mage/cards/v/VengefulFirebrand.java +++ b/Mage.Sets/src/mage/cards/v/VengefulFirebrand.java @@ -81,9 +81,9 @@ public class VengefulFirebrand extends CardImpl { } } -class VengefulFirebrandCondition implements Condition { +enum VengefulFirebrandCondition implements Condition { - private static VengefulFirebrandCondition fInstance = new VengefulFirebrandCondition(); + instance; private static final FilterCard filter = new FilterCard("Warrior"); static { @@ -91,7 +91,7 @@ class VengefulFirebrandCondition implements Condition { } public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/v/VengefulRebel.java b/Mage.Sets/src/mage/cards/v/VengefulRebel.java index e92da1cd1f..bca954fa82 100644 --- a/Mage.Sets/src/mage/cards/v/VengefulRebel.java +++ b/Mage.Sets/src/mage/cards/v/VengefulRebel.java @@ -60,7 +60,7 @@ public class VengefulRebel extends CardImpl { // target creature an opponent controls gets -3/-3 until end of turn. Ability ability = new ConditionalTriggeredAbility( new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(-3, -3, Duration.EndOfTurn), false), - RevoltCondition.getInstance(), + RevoltCondition.instance, "When {this} enters the battlefield, if a permanent you controlled left the battlefield this turn, " + "target creature an opponent controls gets -3/-3 until end of turn" ); diff --git a/Mage.Sets/src/mage/cards/v/VerdelothTheAncient.java b/Mage.Sets/src/mage/cards/v/VerdelothTheAncient.java index a2424fdb7d..da0071c2d5 100644 --- a/Mage.Sets/src/mage/cards/v/VerdelothTheAncient.java +++ b/Mage.Sets/src/mage/cards/v/VerdelothTheAncient.java @@ -82,7 +82,7 @@ public class VerdelothTheAncient extends CardImpl { // When Verdeloth the Ancient enters the battlefield, if it was kicked, create X 1/1 green Saproling creature tokens. EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new SaprolingToken(), new GetKickerXValue()), false); - this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, create X 1/1 green Saproling creature tokens.")); } diff --git a/Mage.Sets/src/mage/cards/v/VerduranEmissary.java b/Mage.Sets/src/mage/cards/v/VerduranEmissary.java index 71e2156e52..097daf2cc5 100644 --- a/Mage.Sets/src/mage/cards/v/VerduranEmissary.java +++ b/Mage.Sets/src/mage/cards/v/VerduranEmissary.java @@ -59,7 +59,7 @@ public class VerduranEmissary extends CardImpl { // When {this} enters the battlefield, if it was kicked, destroy target artifact. It can't be regenerated. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(true)); ability.addTarget(new TargetArtifactPermanent()); - this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, destroy target artifact. It can't be regenerated.")); } diff --git a/Mage.Sets/src/mage/cards/v/VeteranBodyguard.java b/Mage.Sets/src/mage/cards/v/VeteranBodyguard.java index 9da8ee64ec..0762401d3a 100644 --- a/Mage.Sets/src/mage/cards/v/VeteranBodyguard.java +++ b/Mage.Sets/src/mage/cards/v/VeteranBodyguard.java @@ -63,7 +63,7 @@ public class VeteranBodyguard extends CardImpl { this.toughness = new MageInt(5); // As long as Veteran Bodyguard is untapped, all damage that would be dealt to you by unblocked creatures is dealt to Veteran Bodyguard instead. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new VeteranBodyguardEffect(), new InvertCondition(new SourceTappedCondition()), "As long as {this} is untapped, all damage that would be dealt to you by unblocked creatures is dealt to {this} instead."))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new VeteranBodyguardEffect(), new InvertCondition(SourceTappedCondition.instance), "As long as {this} is untapped, all damage that would be dealt to you by unblocked creatures is dealt to {this} instead."))); } public VeteranBodyguard(final VeteranBodyguard card) { diff --git a/Mage.Sets/src/mage/cards/v/VildinPackAlpha.java b/Mage.Sets/src/mage/cards/v/VildinPackAlpha.java index 8db94d0073..e974d1b7ce 100644 --- a/Mage.Sets/src/mage/cards/v/VildinPackAlpha.java +++ b/Mage.Sets/src/mage/cards/v/VildinPackAlpha.java @@ -71,7 +71,7 @@ public class VildinPackAlpha extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Vildin-Pack Alpha. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } diff --git a/Mage.Sets/src/mage/cards/v/VillageIronsmith.java b/Mage.Sets/src/mage/cards/v/VillageIronsmith.java index 7624057f81..1970c4ee0d 100644 --- a/Mage.Sets/src/mage/cards/v/VillageIronsmith.java +++ b/Mage.Sets/src/mage/cards/v/VillageIronsmith.java @@ -64,7 +64,7 @@ public class VillageIronsmith extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Village Ironsmith. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public VillageIronsmith(final VillageIronsmith card) { diff --git a/Mage.Sets/src/mage/cards/v/VillageMessenger.java b/Mage.Sets/src/mage/cards/v/VillageMessenger.java index b2ab9975d9..c8cff53869 100644 --- a/Mage.Sets/src/mage/cards/v/VillageMessenger.java +++ b/Mage.Sets/src/mage/cards/v/VillageMessenger.java @@ -64,7 +64,7 @@ public class VillageMessenger extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Village Messenger. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public VillageMessenger(final VillageMessenger card) { diff --git a/Mage.Sets/src/mage/cards/v/VillageSurvivors.java b/Mage.Sets/src/mage/cards/v/VillageSurvivors.java index d5bdf7db98..90ccf5aa91 100644 --- a/Mage.Sets/src/mage/cards/v/VillageSurvivors.java +++ b/Mage.Sets/src/mage/cards/v/VillageSurvivors.java @@ -59,7 +59,7 @@ public class VillageSurvivors extends CardImpl { // Fateful hour - As long as you have 5 or less life, other creatures you control have vigilance. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent(), true), - FatefulHourCondition.getInstance(), + FatefulHourCondition.instance, "Fateful hour - As long as you have 5 or less life, other creatures you control have vigilance"))); } diff --git a/Mage.Sets/src/mage/cards/v/VillagersOfEstwald.java b/Mage.Sets/src/mage/cards/v/VillagersOfEstwald.java index 75694ec85b..6dcb2a1020 100644 --- a/Mage.Sets/src/mage/cards/v/VillagersOfEstwald.java +++ b/Mage.Sets/src/mage/cards/v/VillagersOfEstwald.java @@ -61,7 +61,7 @@ public class VillagersOfEstwald extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Villagers of Estwald. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public VillagersOfEstwald(final VillagersOfEstwald card) { diff --git a/Mage.Sets/src/mage/cards/v/VinesOfVastwood.java b/Mage.Sets/src/mage/cards/v/VinesOfVastwood.java index e2fcf4b938..54a0e68f50 100644 --- a/Mage.Sets/src/mage/cards/v/VinesOfVastwood.java +++ b/Mage.Sets/src/mage/cards/v/VinesOfVastwood.java @@ -64,7 +64,7 @@ public class VinesOfVastwood extends CardImpl { // If Vines of Vastwood was kicked, that creature gets +4/+4 until end of turn. this.getSpellAbility().addEffect(new ConditionalContinuousEffect(new BoostTargetEffect(4, 4, Duration.EndOfTurn), - new LockedInCondition(KickedCondition.getInstance()), staticText)); + new LockedInCondition(KickedCondition.instance), staticText)); } public VinesOfVastwood(final VinesOfVastwood card) { diff --git a/Mage.Sets/src/mage/cards/v/ViridianBetrayers.java b/Mage.Sets/src/mage/cards/v/ViridianBetrayers.java index 970d433e84..ae4f229646 100644 --- a/Mage.Sets/src/mage/cards/v/ViridianBetrayers.java +++ b/Mage.Sets/src/mage/cards/v/ViridianBetrayers.java @@ -79,10 +79,10 @@ public class ViridianBetrayers extends CardImpl { class PoisonedCondition implements Condition { - private static PoisonedCondition fInstance = new PoisonedCondition(); + private static PoisonedCondition instance = new PoisonedCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/v/VodalianSerpent.java b/Mage.Sets/src/mage/cards/v/VodalianSerpent.java index 542a59657c..289f6ec3ab 100644 --- a/Mage.Sets/src/mage/cards/v/VodalianSerpent.java +++ b/Mage.Sets/src/mage/cards/v/VodalianSerpent.java @@ -61,7 +61,7 @@ public class VodalianSerpent extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackUnlessDefenderControllsPermanent(new FilterLandPermanent("Island", "an Island")))); // If Vodalian Serpent was kicked, it enters the battlefield with four +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(4)), - KickedCondition.getInstance(), "If {this} was kicked, it enters the battlefield with four +1/+1 counters on it.", "")); + KickedCondition.instance, "If {this} was kicked, it enters the battlefield with four +1/+1 counters on it.", "")); } public VodalianSerpent(final VodalianSerpent card) { diff --git a/Mage.Sets/src/mage/cards/v/VoraciousWurm.java b/Mage.Sets/src/mage/cards/v/VoraciousWurm.java index 9dcb687381..15aa0bf777 100644 --- a/Mage.Sets/src/mage/cards/v/VoraciousWurm.java +++ b/Mage.Sets/src/mage/cards/v/VoraciousWurm.java @@ -28,6 +28,7 @@ package mage.cards.v; import java.util.UUID; + import mage.MageInt; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.dynamicvalue.common.ControllerGotLifeCount; @@ -39,13 +40,12 @@ import mage.counters.CounterType; import mage.watchers.common.PlayerGainedLifeWatcher; /** - * * @author LevelX2 */ public class VoraciousWurm extends CardImpl { public VoraciousWurm(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}"); this.subtype.add("Wurm"); this.power = new MageInt(2); @@ -53,7 +53,7 @@ public class VoraciousWurm extends CardImpl { // Voracious Wurm enters the battlefield with X +1/+1 counters on it, where X is the amount of life you've gained this turn. this.addAbility(new EntersBattlefieldAbility( - new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), ControllerGotLifeCount.getInstance(), true)), + new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), ControllerGotLifeCount.getInstance(), true)), new PlayerGainedLifeWatcher()); } diff --git a/Mage.Sets/src/mage/cards/v/VoyagerDrake.java b/Mage.Sets/src/mage/cards/v/VoyagerDrake.java index ccd288ce0b..ffd28c9926 100644 --- a/Mage.Sets/src/mage/cards/v/VoyagerDrake.java +++ b/Mage.Sets/src/mage/cards/v/VoyagerDrake.java @@ -68,7 +68,7 @@ public class VoyagerDrake extends CardImpl { // When Voyager Drake enters the battlefield, up to X target creatures gain flying until end of turn, where X is the number of times Voyager Drake was kicked. Ability ability = new ConditionalTriggeredAbility( new EntersBattlefieldTriggeredAbility(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), false), - KickedCondition.getInstance(), + KickedCondition.instance, "When {this} enters the battlefield, up to X target creatures gain flying until end of turn, where X is the number of times {this} was kicked."); originalId = ability.getOriginalId(); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/w/WakeTheDead.java b/Mage.Sets/src/mage/cards/w/WakeTheDead.java index 9644abc6ca..725b1ea4ba 100644 --- a/Mage.Sets/src/mage/cards/w/WakeTheDead.java +++ b/Mage.Sets/src/mage/cards/w/WakeTheDead.java @@ -63,7 +63,7 @@ public class WakeTheDead extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{B}{B}"); // Cast Wake the Dead only during combat on an opponent's turn. - this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(TurnPhase.COMBAT, OnOpponentsTurnCondition.getInstance())); + this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(TurnPhase.COMBAT, OnOpponentsTurnCondition.instance)); // Return X target creature cards from your graveyard to the battlefield. Sacrifice those creatures at the beginning of the next end step. this.getSpellAbility().addEffect(new WakeTheDeadReturnFromGraveyardToBattlefieldTargetEffect()); diff --git a/Mage.Sets/src/mage/cards/w/Wakedancer.java b/Mage.Sets/src/mage/cards/w/Wakedancer.java index 8401053407..51fe5ab6cb 100644 --- a/Mage.Sets/src/mage/cards/w/Wakedancer.java +++ b/Mage.Sets/src/mage/cards/w/Wakedancer.java @@ -58,7 +58,7 @@ public class Wakedancer extends CardImpl { // Morbid - When Wakedancer enters the battlefield, if a creature died this turn, create a 2/2 black Zombie creature token. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new ZombieToken())); - this.addAbility(new ConditionalTriggeredAbility(ability, MorbidCondition.getInstance(), staticText)); + this.addAbility(new ConditionalTriggeredAbility(ability, MorbidCondition.instance, staticText)); } public Wakedancer(final Wakedancer card) { diff --git a/Mage.Sets/src/mage/cards/w/WalkerOfSecretWays.java b/Mage.Sets/src/mage/cards/w/WalkerOfSecretWays.java index 576bac4dfb..401d77bf00 100644 --- a/Mage.Sets/src/mage/cards/w/WalkerOfSecretWays.java +++ b/Mage.Sets/src/mage/cards/w/WalkerOfSecretWays.java @@ -75,7 +75,7 @@ public class WalkerOfSecretWays extends CardImpl { this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new WalkerOfSecretWaysEffect(), true, true)); // {1}{U}: Return target Ninja you control to its owner's hand. Activate this ability only during your turn. - Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new ManaCostsImpl("{1}{U}"), MyTurnCondition.getInstance()); + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new ManaCostsImpl("{1}{U}"), MyTurnCondition.instance); ability.addTarget(new TargetControlledCreaturePermanent(1,1, filterCreature, false)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/w/WarNameAspirant.java b/Mage.Sets/src/mage/cards/w/WarNameAspirant.java index a9a284d02c..4caee17f46 100644 --- a/Mage.Sets/src/mage/cards/w/WarNameAspirant.java +++ b/Mage.Sets/src/mage/cards/w/WarNameAspirant.java @@ -66,7 +66,7 @@ public class WarNameAspirant extends CardImpl { // Raid - War-Name Aspirant enters the battlefield with a +1/+1 counter on it if you attacked with a creature this turn. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1), false), - RaidCondition.getInstance(), + RaidCondition.instance, "Raid - {this} enters the battlefield with a +1/+1 counter on it if you attacked with a creature this turn", "{this} enters the battlefield with a +1/+1 counter"), new PlayerAttackedWatcher()); diff --git a/Mage.Sets/src/mage/cards/w/Warbringer.java b/Mage.Sets/src/mage/cards/w/Warbringer.java index 3e691b1a5b..fa445a9e88 100644 --- a/Mage.Sets/src/mage/cards/w/Warbringer.java +++ b/Mage.Sets/src/mage/cards/w/Warbringer.java @@ -99,7 +99,7 @@ class WarbringerSpellsCostReductionEffect extends CostModificationEffectImpl { if (abilityToModify.getControllerId().equals(source.getControllerId())) { Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId()); if (spell != null) { - return DashedCondition.getInstance().apply(game, abilityToModify); + return DashedCondition.instance.apply(game, abilityToModify); } } } diff --git a/Mage.Sets/src/mage/cards/w/WardenOfTheBeyond.java b/Mage.Sets/src/mage/cards/w/WardenOfTheBeyond.java index 8283341e10..08bc4ebfc3 100644 --- a/Mage.Sets/src/mage/cards/w/WardenOfTheBeyond.java +++ b/Mage.Sets/src/mage/cards/w/WardenOfTheBeyond.java @@ -78,10 +78,10 @@ public class WardenOfTheBeyond extends CardImpl { class OpponentOwnsCardInExileCondition implements Condition { - private static final OpponentOwnsCardInExileCondition fInstance = new OpponentOwnsCardInExileCondition(); + private static final OpponentOwnsCardInExileCondition instance = new OpponentOwnsCardInExileCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/w/WardenOfTheWall.java b/Mage.Sets/src/mage/cards/w/WardenOfTheWall.java index 3a3ec56414..5100a521af 100644 --- a/Mage.Sets/src/mage/cards/w/WardenOfTheWall.java +++ b/Mage.Sets/src/mage/cards/w/WardenOfTheWall.java @@ -60,7 +60,7 @@ public class WardenOfTheWall extends CardImpl { this.addAbility(new ColorlessManaAbility()); // As long as it's not your turn, Warden of the Wall is a 2/3 Gargoyle artifact creature with flying. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new BecomesCreatureSourceEffect(new GargoyleToken(), "", Duration.WhileOnBattlefield), NotMyTurnCondition.getInstance(), "As long as it's not your turn, Warden of the Wall is a 2/3 Gargoyle artifact creature with flying"))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new BecomesCreatureSourceEffect(new GargoyleToken(), "", Duration.WhileOnBattlefield), NotMyTurnCondition.instance, "As long as it's not your turn, Warden of the Wall is a 2/3 Gargoyle artifact creature with flying"))); } public WardenOfTheWall(final WardenOfTheWall card) { diff --git a/Mage.Sets/src/mage/cards/w/Watchdog.java b/Mage.Sets/src/mage/cards/w/Watchdog.java index 99d0d050f3..f8cc835cdf 100644 --- a/Mage.Sets/src/mage/cards/w/Watchdog.java +++ b/Mage.Sets/src/mage/cards/w/Watchdog.java @@ -61,7 +61,7 @@ public class Watchdog extends CardImpl { this.getAbilities().add(new SimpleStaticAbility(Zone.BATTLEFIELD, new BlocksIfAbleSourceEffect(Duration.WhileOnBattlefield))); // As long as Watchdog is untapped, all creatures attacking you get -1/-0. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( - new BoostAllEffect(-1, 0, Duration.WhileOnBattlefield, new WatchdogFilter(), false), new InvertCondition(new SourceTappedCondition()),"As long as {this} is untapped, all creatures attacking you get -1/-0"))); + new BoostAllEffect(-1, 0, Duration.WhileOnBattlefield, new WatchdogFilter(), false), new InvertCondition(SourceTappedCondition.instance),"As long as {this} is untapped, all creatures attacking you get -1/-0"))); } public Watchdog(final Watchdog card) { diff --git a/Mage.Sets/src/mage/cards/w/WaterspoutElemental.java b/Mage.Sets/src/mage/cards/w/WaterspoutElemental.java index 8c48ef74bd..44351bb43d 100644 --- a/Mage.Sets/src/mage/cards/w/WaterspoutElemental.java +++ b/Mage.Sets/src/mage/cards/w/WaterspoutElemental.java @@ -67,7 +67,7 @@ public class WaterspoutElemental extends CardImpl { // When Waterspout Elemental enters the battlefield, if it was kicked, return all other creatures to their owners' hands and you skip your next turn. EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandFromBattlefieldAllEffect(filter)); ability.addEffect(new SkipNextTurnSourceEffect()); - this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, return all other creatures to their owners' hands and you skip your next turn")); } diff --git a/Mage.Sets/src/mage/cards/w/WerewolfOfAncientHunger.java b/Mage.Sets/src/mage/cards/w/WerewolfOfAncientHunger.java index fa657f5270..4ea23641fa 100644 --- a/Mage.Sets/src/mage/cards/w/WerewolfOfAncientHunger.java +++ b/Mage.Sets/src/mage/cards/w/WerewolfOfAncientHunger.java @@ -78,7 +78,7 @@ public class WerewolfOfAncientHunger extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Werewolf of Ancient Hunger. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public WerewolfOfAncientHunger(final WerewolfOfAncientHunger card) { diff --git a/Mage.Sets/src/mage/cards/w/WerewolfRansacker.java b/Mage.Sets/src/mage/cards/w/WerewolfRansacker.java index c15582d68d..9315d1ef7e 100644 --- a/Mage.Sets/src/mage/cards/w/WerewolfRansacker.java +++ b/Mage.Sets/src/mage/cards/w/WerewolfRansacker.java @@ -74,7 +74,7 @@ public class WerewolfRansacker extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Werewolf Ransacker. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } public WerewolfRansacker(final WerewolfRansacker card) { diff --git a/Mage.Sets/src/mage/cards/w/WhiplashTrap.java b/Mage.Sets/src/mage/cards/w/WhiplashTrap.java index c638ba694d..dddf56a5cf 100644 --- a/Mage.Sets/src/mage/cards/w/WhiplashTrap.java +++ b/Mage.Sets/src/mage/cards/w/WhiplashTrap.java @@ -73,10 +73,10 @@ public class WhiplashTrap extends CardImpl { class WhiplashTrapCondition implements Condition { - private static final WhiplashTrapCondition fInstance = new WhiplashTrapCondition(); + private static final WhiplashTrapCondition instance = new WhiplashTrapCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/w/WhispererOfTheWilds.java b/Mage.Sets/src/mage/cards/w/WhispererOfTheWilds.java index f1e970a1c3..54256ac85e 100644 --- a/Mage.Sets/src/mage/cards/w/WhispererOfTheWilds.java +++ b/Mage.Sets/src/mage/cards/w/WhispererOfTheWilds.java @@ -59,7 +59,7 @@ public class WhispererOfTheWilds extends CardImpl { this.addAbility(new GreenManaAbility()); // Ferocious - {T}: Add {G}{G} to your mana pool. Activate this ability only if you control a creature with power 4 or greater. - Ability ability = new ActivateIfConditionManaAbility(Zone.BATTLEFIELD, new BasicManaEffect(Mana.GreenMana(2)), new TapSourceCost(), FerociousCondition.getInstance()); + Ability ability = new ActivateIfConditionManaAbility(Zone.BATTLEFIELD, new BasicManaEffect(Mana.GreenMana(2)), new TapSourceCost(), FerociousCondition.instance); ability.setAbilityWord(AbilityWord.FEROCIOUS); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/w/WhispersOfEmrakul.java b/Mage.Sets/src/mage/cards/w/WhispersOfEmrakul.java index a584605eaf..24a163608f 100644 --- a/Mage.Sets/src/mage/cards/w/WhispersOfEmrakul.java +++ b/Mage.Sets/src/mage/cards/w/WhispersOfEmrakul.java @@ -49,13 +49,13 @@ public class WhispersOfEmrakul extends CardImpl { // Target opponent discards a card at random. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DiscardTargetEffect(1, true), - new InvertCondition(DeliriumCondition.getInstance()), + new InvertCondition(DeliriumCondition.instance), "Target opponent discards a card at random.")); // Delirium — If there are four or more card types among cards in your graveyard, that player discards two cards at random instead. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DiscardTargetEffect(2, true), - DeliriumCondition.getInstance(), + DeliriumCondition.instance, "
Delirium — If there are four or more card types among cards in your graveyard, that player discards two cards at random instead")); this.getSpellAbility().addTarget(new TargetOpponent()); } diff --git a/Mage.Sets/src/mage/cards/w/WildSlash.java b/Mage.Sets/src/mage/cards/w/WildSlash.java index a59490dc87..2952de4b01 100644 --- a/Mage.Sets/src/mage/cards/w/WildSlash.java +++ b/Mage.Sets/src/mage/cards/w/WildSlash.java @@ -54,7 +54,7 @@ public class WildSlash extends CardImpl { ContinuousRuleModifyingEffect effect = new DamageCantBePreventedEffect(Duration.EndOfTurn, "damage can't be prevented this turn", false, false); effect.setText("Ferocious — If you control a creature with power 4 or greater, damage can't be prevented this turn.
"); this.getSpellAbility().addEffect(new ConditionalContinuousRuleModifyingEffect(effect, - new LockedInCondition(FerociousCondition.getInstance()))); + new LockedInCondition(FerociousCondition.instance))); // Wild Slash deals 2 damage to target creature or player. this.getSpellAbility().addEffect(new DamageTargetEffect(2)); diff --git a/Mage.Sets/src/mage/cards/w/WildbloodPack.java b/Mage.Sets/src/mage/cards/w/WildbloodPack.java index 5ce2402be2..8e2ab4da8b 100644 --- a/Mage.Sets/src/mage/cards/w/WildbloodPack.java +++ b/Mage.Sets/src/mage/cards/w/WildbloodPack.java @@ -68,7 +68,7 @@ public class WildbloodPack extends CardImpl { // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Wildblood Pack. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, TwoOrMoreSpellsWereCastLastTurnCondition.instance, TransformAbility.TWO_OR_MORE_SPELLS_TRANSFORM_RULE)); } diff --git a/Mage.Sets/src/mage/cards/w/WildwoodGeist.java b/Mage.Sets/src/mage/cards/w/WildwoodGeist.java index e0aafd0f26..7c313f62fc 100644 --- a/Mage.Sets/src/mage/cards/w/WildwoodGeist.java +++ b/Mage.Sets/src/mage/cards/w/WildwoodGeist.java @@ -55,7 +55,7 @@ public class WildwoodGeist extends CardImpl { // Wildwood Geist gets +2/+2 as long as it's your turn. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), - MyTurnCondition.getInstance(), + MyTurnCondition.instance, "{this} gets +2/+2 as long as it's your turn"))); } diff --git a/Mage.Sets/src/mage/cards/w/WillowSatyr.java b/Mage.Sets/src/mage/cards/w/WillowSatyr.java index 22c0c84927..1ed358b37e 100644 --- a/Mage.Sets/src/mage/cards/w/WillowSatyr.java +++ b/Mage.Sets/src/mage/cards/w/WillowSatyr.java @@ -69,7 +69,7 @@ public class WillowSatyr extends CardImpl { this.addAbility(new SkipUntapOptionalAbility()); // {tap}: Gain control of target legendary creature for as long as you control Willow Satyr and Willow Satyr remains tapped. ConditionalContinuousEffect effect = new ConditionalContinuousEffect( - new GainControlTargetEffect(Duration.Custom), new CompoundCondition(SourceTappedCondition.getInstance(), new SourceOnBattlefieldControlUnchangedCondition()), + new GainControlTargetEffect(Duration.Custom), new CompoundCondition(SourceTappedCondition.instance, new SourceOnBattlefieldControlUnchangedCondition()), "Gain control of target legendary creature for as long as you control {this} and {this} remains tapped"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent(filter)); diff --git a/Mage.Sets/src/mage/cards/w/WindbriskHeights.java b/Mage.Sets/src/mage/cards/w/WindbriskHeights.java index 1b33cc2551..5b687b2ef3 100644 --- a/Mage.Sets/src/mage/cards/w/WindbriskHeights.java +++ b/Mage.Sets/src/mage/cards/w/WindbriskHeights.java @@ -76,10 +76,10 @@ public class WindbriskHeights extends CardImpl { class WindbriskHeightsAttackersCondition implements Condition { - private static final WindbriskHeightsAttackersCondition fInstance = new WindbriskHeightsAttackersCondition(); + private static final WindbriskHeightsAttackersCondition instance = new WindbriskHeightsAttackersCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/w/WindsOfQalSisma.java b/Mage.Sets/src/mage/cards/w/WindsOfQalSisma.java index c565b2d6f5..86f9af0e57 100644 --- a/Mage.Sets/src/mage/cards/w/WindsOfQalSisma.java +++ b/Mage.Sets/src/mage/cards/w/WindsOfQalSisma.java @@ -60,7 +60,7 @@ public class WindsOfQalSisma extends CardImpl { // Ferocious - If you control a creature with power 4 or greater, instead prevent all combat damage that would be dealt this turn by creatures your opponents control. Effect effect = new ConditionalReplacementEffect( new PreventAllDamageByAllPermanentsEffect(filter, Duration.EndOfTurn, true), - new LockedInCondition(FerociousCondition.getInstance()), + new LockedInCondition(FerociousCondition.instance), new PreventAllDamageByAllPermanentsEffect(Duration.EndOfTurn, true)); effect.setText("Prevent all combat damage that would be dealt this turn.
" + "Ferocious — If you control a creature with power 4 or greater, instead prevent all combat damage that would be dealt this turn by creatures your opponents control"); diff --git a/Mage.Sets/src/mage/cards/w/WindwrightMage.java b/Mage.Sets/src/mage/cards/w/WindwrightMage.java index d4479c1cf3..cff63cf30f 100644 --- a/Mage.Sets/src/mage/cards/w/WindwrightMage.java +++ b/Mage.Sets/src/mage/cards/w/WindwrightMage.java @@ -81,7 +81,7 @@ public class WindwrightMage extends CardImpl { class WindwrightMageCondition implements Condition { - private static WindwrightMageCondition fInstance = new WindwrightMageCondition(); + private static WindwrightMageCondition instance = new WindwrightMageCondition(); private static final FilterCard filter = new FilterCard("artifact"); static { @@ -89,7 +89,7 @@ class WindwrightMageCondition implements Condition { } public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage.Sets/src/mage/cards/w/WingmateRoc.java b/Mage.Sets/src/mage/cards/w/WingmateRoc.java index cec09f556f..dffbd3bfa2 100644 --- a/Mage.Sets/src/mage/cards/w/WingmateRoc.java +++ b/Mage.Sets/src/mage/cards/w/WingmateRoc.java @@ -61,7 +61,7 @@ public class WingmateRoc extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Raid - When Wingmate Roc enters the battlefield, if you attacked with a creature this turn, create a 3/4 white Bird creature token with flying. - this.addAbility(new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new WingmateRocToken())), RaidCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new WingmateRocToken())), RaidCondition.instance, "Raid - When {this} enters the battlefield, if you attacked with a creature this turn, create a 3/4 white Bird creature token with flying."), new PlayerAttackedWatcher()); diff --git a/Mage.Sets/src/mage/cards/w/WolfbittenCaptive.java b/Mage.Sets/src/mage/cards/w/WolfbittenCaptive.java index f7cbd9adef..1b7f3c3aa1 100644 --- a/Mage.Sets/src/mage/cards/w/WolfbittenCaptive.java +++ b/Mage.Sets/src/mage/cards/w/WolfbittenCaptive.java @@ -67,7 +67,7 @@ public class WolfbittenCaptive extends CardImpl { // At the beginning of each upkeep, if no spells were cast last turn, transform Wolfbitten Captive. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); - this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.getInstance(), TransformAbility.NO_SPELLS_TRANSFORM_RULE)); + this.addAbility(new ConditionalTriggeredAbility(ability, NoSpellsWereCastLastTurnCondition.instance, TransformAbility.NO_SPELLS_TRANSFORM_RULE)); } public WolfbittenCaptive(final WolfbittenCaptive card) { diff --git a/Mage.Sets/src/mage/cards/w/WoodlandSleuth.java b/Mage.Sets/src/mage/cards/w/WoodlandSleuth.java index c2f58a76be..fc0a0bee03 100644 --- a/Mage.Sets/src/mage/cards/w/WoodlandSleuth.java +++ b/Mage.Sets/src/mage/cards/w/WoodlandSleuth.java @@ -65,7 +65,7 @@ public class WoodlandSleuth extends CardImpl { // Morbid - When Woodland Sleuth enters the battlefield, if a creature died this turn, return a creature card at random from your graveyard to your hand. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new WoodlandSleuthEffect()); - this.addAbility(new ConditionalTriggeredAbility(ability, MorbidCondition.getInstance(), staticText)); + this.addAbility(new ConditionalTriggeredAbility(ability, MorbidCondition.instance, staticText)); } public WoodlandSleuth(final WoodlandSleuth card) { diff --git a/Mage.Sets/src/mage/cards/z/ZelyonSword.java b/Mage.Sets/src/mage/cards/z/ZelyonSword.java index 11043a4ddf..8f58941ea9 100644 --- a/Mage.Sets/src/mage/cards/z/ZelyonSword.java +++ b/Mage.Sets/src/mage/cards/z/ZelyonSword.java @@ -56,7 +56,7 @@ public class ZelyonSword extends CardImpl { this.addAbility(new SkipUntapOptionalAbility()); // {3}, {tap}: Target creature gets +2/+0 for as long as Zelyon Sword remains tapped. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( - new BoostTargetEffect(2, 0, Duration.Custom), SourceTappedCondition.getInstance(), + new BoostTargetEffect(2, 0, Duration.Custom), SourceTappedCondition.instance, "target creature gets +2/+0 for as long as {this} remains tapped"), new ManaCostsImpl("{3}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/cards/z/ZuranEnchanter.java b/Mage.Sets/src/mage/cards/z/ZuranEnchanter.java index 8e29b75b48..40c3d7813c 100644 --- a/Mage.Sets/src/mage/cards/z/ZuranEnchanter.java +++ b/Mage.Sets/src/mage/cards/z/ZuranEnchanter.java @@ -55,7 +55,7 @@ public class ZuranEnchanter extends CardImpl { this.toughness = new MageInt(1); // {2}{B}, {tap}: Target player discards a card. Activate this ability only during your turn. - Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new DiscardTargetEffect(1), new ManaCostsImpl("{2}{B}"), MyTurnCondition.getInstance()); + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new DiscardTargetEffect(1), new ManaCostsImpl("{2}{B}"), MyTurnCondition.instance); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetPlayer()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/z/ZurgoHelmsmasher.java b/Mage.Sets/src/mage/cards/z/ZurgoHelmsmasher.java index e1e1aebff2..467e99f330 100644 --- a/Mage.Sets/src/mage/cards/z/ZurgoHelmsmasher.java +++ b/Mage.Sets/src/mage/cards/z/ZurgoHelmsmasher.java @@ -67,7 +67,7 @@ public class ZurgoHelmsmasher extends CardImpl { // Zurgo Helmsmasher has indestructible as long as it's your turn. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield), - MyTurnCondition.getInstance(), + MyTurnCondition.instance, "{this} has indestructible as long as it's your turn"))); // Whenever a creature dealt damage by Zurgo Helmsmasher this turn dies, put a +1/+1 counter on Zurgo Helmsmasher. diff --git a/Mage.Sets/src/mage/sets/AetherRevolt.java b/Mage.Sets/src/mage/sets/AetherRevolt.java index d811d902cb..21d57b6747 100644 --- a/Mage.Sets/src/mage/sets/AetherRevolt.java +++ b/Mage.Sets/src/mage/sets/AetherRevolt.java @@ -42,10 +42,10 @@ import mage.constants.SetType; */ public class AetherRevolt extends ExpansionSet { - private static final AetherRevolt fINSTANCE = new AetherRevolt(); + private static final AetherRevolt instance = new AetherRevolt(); public static AetherRevolt getInstance() { - return fINSTANCE; + return instance; } protected final List savedSpecialLand = new ArrayList<>(); diff --git a/Mage.Sets/src/mage/sets/AjaniVsNicolBolas.java b/Mage.Sets/src/mage/sets/AjaniVsNicolBolas.java index 8e1b36ac4c..d6be2178e8 100644 --- a/Mage.Sets/src/mage/sets/AjaniVsNicolBolas.java +++ b/Mage.Sets/src/mage/sets/AjaniVsNicolBolas.java @@ -38,10 +38,10 @@ import mage.cards.CardGraphicInfo; * @author LevelX2 */ public class AjaniVsNicolBolas extends ExpansionSet { - private static final AjaniVsNicolBolas fINSTANCE = new AjaniVsNicolBolas(); + private static final AjaniVsNicolBolas instance = new AjaniVsNicolBolas(); public static AjaniVsNicolBolas getInstance() { - return fINSTANCE; + return instance; } private AjaniVsNicolBolas() { diff --git a/Mage.Sets/src/mage/sets/AlaraReborn.java b/Mage.Sets/src/mage/sets/AlaraReborn.java index 5ac7e1bc0c..e60d182a11 100644 --- a/Mage.Sets/src/mage/sets/AlaraReborn.java +++ b/Mage.Sets/src/mage/sets/AlaraReborn.java @@ -37,10 +37,10 @@ import mage.constants.SetType; */ public class AlaraReborn extends ExpansionSet { - private static final AlaraReborn fINSTANCE = new AlaraReborn(); + private static final AlaraReborn instance = new AlaraReborn(); public static AlaraReborn getInstance() { - return fINSTANCE; + return instance; } private AlaraReborn() { diff --git a/Mage.Sets/src/mage/sets/Alliances.java b/Mage.Sets/src/mage/sets/Alliances.java index ddd07b8b64..732d3a6e9e 100644 --- a/Mage.Sets/src/mage/sets/Alliances.java +++ b/Mage.Sets/src/mage/sets/Alliances.java @@ -24,10 +24,10 @@ import mage.constants.Rarity; import mage.cards.CardGraphicInfo; public class Alliances extends ExpansionSet { - private static final Alliances fINSTANCE = new Alliances(); + private static final Alliances instance = new Alliances(); public static Alliances getInstance() { - return fINSTANCE; + return instance; } private Alliances() { diff --git a/Mage.Sets/src/mage/sets/Amonkhet.java b/Mage.Sets/src/mage/sets/Amonkhet.java index 902bdd5d84..ccc9987dc1 100644 --- a/Mage.Sets/src/mage/sets/Amonkhet.java +++ b/Mage.Sets/src/mage/sets/Amonkhet.java @@ -36,10 +36,10 @@ import mage.constants.SetType; */ public class Amonkhet extends ExpansionSet { - private static final Amonkhet fINSTANCE = new Amonkhet(); + private static final Amonkhet instance = new Amonkhet(); public static Amonkhet getInstance() { - return fINSTANCE; + return instance; } private Amonkhet() { diff --git a/Mage.Sets/src/mage/sets/AnthologyDivineVsDemonic.java b/Mage.Sets/src/mage/sets/AnthologyDivineVsDemonic.java index 0271f023e1..a899e87fbf 100644 --- a/Mage.Sets/src/mage/sets/AnthologyDivineVsDemonic.java +++ b/Mage.Sets/src/mage/sets/AnthologyDivineVsDemonic.java @@ -38,10 +38,10 @@ import mage.constants.SetType; */ public class AnthologyDivineVsDemonic extends ExpansionSet { - private static final AnthologyDivineVsDemonic fINSTANCE = new AnthologyDivineVsDemonic(); + private static final AnthologyDivineVsDemonic instance = new AnthologyDivineVsDemonic(); public static AnthologyDivineVsDemonic getInstance() { - return fINSTANCE; + return instance; } private AnthologyDivineVsDemonic() { diff --git a/Mage.Sets/src/mage/sets/AnthologyElvesVsGoblins.java b/Mage.Sets/src/mage/sets/AnthologyElvesVsGoblins.java index 658947e58d..6726edffd6 100644 --- a/Mage.Sets/src/mage/sets/AnthologyElvesVsGoblins.java +++ b/Mage.Sets/src/mage/sets/AnthologyElvesVsGoblins.java @@ -38,10 +38,10 @@ import mage.constants.SetType; */ public class AnthologyElvesVsGoblins extends ExpansionSet { - private static final AnthologyElvesVsGoblins fINSTANCE = new AnthologyElvesVsGoblins(); + private static final AnthologyElvesVsGoblins instance = new AnthologyElvesVsGoblins(); public static AnthologyElvesVsGoblins getInstance() { - return fINSTANCE; + return instance; } private AnthologyElvesVsGoblins() { diff --git a/Mage.Sets/src/mage/sets/AnthologyGarrukVsLiliana.java b/Mage.Sets/src/mage/sets/AnthologyGarrukVsLiliana.java index 12db89ee5e..223bc2e739 100644 --- a/Mage.Sets/src/mage/sets/AnthologyGarrukVsLiliana.java +++ b/Mage.Sets/src/mage/sets/AnthologyGarrukVsLiliana.java @@ -38,10 +38,10 @@ import mage.constants.SetType; */ public class AnthologyGarrukVsLiliana extends ExpansionSet { - private static final AnthologyGarrukVsLiliana fINSTANCE = new AnthologyGarrukVsLiliana(); + private static final AnthologyGarrukVsLiliana instance = new AnthologyGarrukVsLiliana(); public static AnthologyGarrukVsLiliana getInstance() { - return fINSTANCE; + return instance; } private AnthologyGarrukVsLiliana() { diff --git a/Mage.Sets/src/mage/sets/AnthologyJaceVsChandra.java b/Mage.Sets/src/mage/sets/AnthologyJaceVsChandra.java index 111ca0739c..4898ceb3a9 100644 --- a/Mage.Sets/src/mage/sets/AnthologyJaceVsChandra.java +++ b/Mage.Sets/src/mage/sets/AnthologyJaceVsChandra.java @@ -38,10 +38,10 @@ import mage.constants.SetType; */ public class AnthologyJaceVsChandra extends ExpansionSet { - private static final AnthologyJaceVsChandra fINSTANCE = new AnthologyJaceVsChandra(); + private static final AnthologyJaceVsChandra instance = new AnthologyJaceVsChandra(); public static AnthologyJaceVsChandra getInstance() { - return fINSTANCE; + return instance; } private AnthologyJaceVsChandra() { diff --git a/Mage.Sets/src/mage/sets/Antiquities.java b/Mage.Sets/src/mage/sets/Antiquities.java index c939d1c709..c3f94b8ce8 100644 --- a/Mage.Sets/src/mage/sets/Antiquities.java +++ b/Mage.Sets/src/mage/sets/Antiquities.java @@ -38,10 +38,10 @@ import mage.cards.CardGraphicInfo; */ public class Antiquities extends ExpansionSet { - private static final Antiquities fINSTANCE = new Antiquities(); + private static final Antiquities instance = new Antiquities(); public static Antiquities getInstance() { - return fINSTANCE; + return instance; } private Antiquities() { diff --git a/Mage.Sets/src/mage/sets/Apocalypse.java b/Mage.Sets/src/mage/sets/Apocalypse.java index 2ce5226b2c..fcc294d49a 100644 --- a/Mage.Sets/src/mage/sets/Apocalypse.java +++ b/Mage.Sets/src/mage/sets/Apocalypse.java @@ -5,10 +5,10 @@ import mage.constants.SetType; import mage.constants.Rarity; public class Apocalypse extends ExpansionSet { - private static final Apocalypse fINSTANCE = new Apocalypse(); + private static final Apocalypse instance = new Apocalypse(); public static Apocalypse getInstance() { - return fINSTANCE; + return instance; } private Apocalypse() { @@ -34,7 +34,7 @@ public class Apocalypse extends ExpansionSet { cards.add(new SetCardInfo("Brass Herald", 133, Rarity.UNCOMMON, mage.cards.b.BrassHerald.class)); cards.add(new SetCardInfo("Caves of Koilos", 140, Rarity.RARE, mage.cards.c.CavesOfKoilos.class)); cards.add(new SetCardInfo("Ceta Disciple", 19, Rarity.COMMON, mage.cards.c.CetaDisciple.class)); - cards.add(new SetCardInfo("Ceta Sanctuary", 20, Rarity.UNCOMMON, mage.cards.c.CetaSanctuary.class)); + cards.add(new SetCardInfo("Ceta Sanctuary", 20, Rarity.UNCOMMON, mage.cards.c.CetaSanctuary.class)); cards.add(new SetCardInfo("Cetavolver", 21, Rarity.RARE, mage.cards.c.Cetavolver.class)); cards.add(new SetCardInfo("Coalition Flag", 2, Rarity.UNCOMMON, mage.cards.c.CoalitionFlag.class)); cards.add(new SetCardInfo("Coalition Honor Guard", 3, Rarity.COMMON, mage.cards.c.CoalitionHonorGuard.class)); @@ -110,7 +110,7 @@ public class Apocalypse extends ExpansionSet { cards.add(new SetCardInfo("Phyrexian Gargantua", 48, Rarity.UNCOMMON, mage.cards.p.PhyrexianGargantua.class)); cards.add(new SetCardInfo("Phyrexian Rager", 49, Rarity.COMMON, mage.cards.p.PhyrexianRager.class)); cards.add(new SetCardInfo("Planar Despair", 50, Rarity.RARE, mage.cards.p.PlanarDespair.class)); - cards.add(new SetCardInfo("Powerstone Minefield", 115, Rarity.RARE, mage.cards.p.PowerstoneMinefield.class)); + cards.add(new SetCardInfo("Powerstone Minefield", 115, Rarity.RARE, mage.cards.p.PowerstoneMinefield.class)); cards.add(new SetCardInfo("Prophetic Bolt", 116, Rarity.RARE, mage.cards.p.PropheticBolt.class)); cards.add(new SetCardInfo("Putrid Warrior", 117, Rarity.COMMON, mage.cards.p.PutridWarrior.class)); cards.add(new SetCardInfo("Quagmire Druid", 51, Rarity.COMMON, mage.cards.q.QuagmireDruid.class)); diff --git a/Mage.Sets/src/mage/sets/ArabianNights.java b/Mage.Sets/src/mage/sets/ArabianNights.java index a0165eb36c..a1bb8fc702 100644 --- a/Mage.Sets/src/mage/sets/ArabianNights.java +++ b/Mage.Sets/src/mage/sets/ArabianNights.java @@ -45,10 +45,10 @@ import mage.cards.CardGraphicInfo; */ public class ArabianNights extends ExpansionSet { - private static final ArabianNights fINSTANCE = new ArabianNights(); + private static final ArabianNights instance = new ArabianNights(); public static ArabianNights getInstance() { - return fINSTANCE; + return instance; } private ArabianNights() { diff --git a/Mage.Sets/src/mage/sets/Archenemy.java b/Mage.Sets/src/mage/sets/Archenemy.java index d60c543203..5c2ad23170 100644 --- a/Mage.Sets/src/mage/sets/Archenemy.java +++ b/Mage.Sets/src/mage/sets/Archenemy.java @@ -39,10 +39,10 @@ import mage.cards.CardGraphicInfo; public class Archenemy extends ExpansionSet { - private static final Archenemy fINSTANCE = new Archenemy(); + private static final Archenemy instance = new Archenemy(); public static Archenemy getInstance() { - return fINSTANCE; + return instance; } private Archenemy() { diff --git a/Mage.Sets/src/mage/sets/ArchenemyNicolBolas.java b/Mage.Sets/src/mage/sets/ArchenemyNicolBolas.java index 314a4899a4..99d47b17de 100644 --- a/Mage.Sets/src/mage/sets/ArchenemyNicolBolas.java +++ b/Mage.Sets/src/mage/sets/ArchenemyNicolBolas.java @@ -37,10 +37,10 @@ import mage.constants.SetType; public class ArchenemyNicolBolas extends ExpansionSet { - private static final ArchenemyNicolBolas fINSTANCE = new ArchenemyNicolBolas(); + private static final ArchenemyNicolBolas instance = new ArchenemyNicolBolas(); public static ArchenemyNicolBolas getInstance() { - return fINSTANCE; + return instance; } private ArchenemyNicolBolas() { diff --git a/Mage.Sets/src/mage/sets/ArenaLeague.java b/Mage.Sets/src/mage/sets/ArenaLeague.java index 08adde01e1..2318bca3d8 100644 --- a/Mage.Sets/src/mage/sets/ArenaLeague.java +++ b/Mage.Sets/src/mage/sets/ArenaLeague.java @@ -39,10 +39,10 @@ import mage.cards.CardGraphicInfo; public class ArenaLeague extends ExpansionSet { - private static final ArenaLeague fINSTANCE = new ArenaLeague(); + private static final ArenaLeague instance = new ArenaLeague(); public static ArenaLeague getInstance() { - return fINSTANCE; + return instance; } private ArenaLeague() { diff --git a/Mage.Sets/src/mage/sets/AsiaPacificLandProgram.java b/Mage.Sets/src/mage/sets/AsiaPacificLandProgram.java index 7de9f11d10..f8b8ce308f 100644 --- a/Mage.Sets/src/mage/sets/AsiaPacificLandProgram.java +++ b/Mage.Sets/src/mage/sets/AsiaPacificLandProgram.java @@ -39,10 +39,10 @@ import mage.cards.CardGraphicInfo; public class AsiaPacificLandProgram extends ExpansionSet { - private static final AsiaPacificLandProgram fINSTANCE = new AsiaPacificLandProgram(); + private static final AsiaPacificLandProgram instance = new AsiaPacificLandProgram(); public static AsiaPacificLandProgram getInstance() { - return fINSTANCE; + return instance; } private AsiaPacificLandProgram() { diff --git a/Mage.Sets/src/mage/sets/AvacynRestored.java b/Mage.Sets/src/mage/sets/AvacynRestored.java index c746321d73..6f3862c984 100644 --- a/Mage.Sets/src/mage/sets/AvacynRestored.java +++ b/Mage.Sets/src/mage/sets/AvacynRestored.java @@ -38,10 +38,10 @@ import mage.cards.CardGraphicInfo; */ public class AvacynRestored extends ExpansionSet { - private static final AvacynRestored fINSTANCE = new AvacynRestored(); + private static final AvacynRestored instance = new AvacynRestored(); public static AvacynRestored getInstance() { - return fINSTANCE; + return instance; } private AvacynRestored() { diff --git a/Mage.Sets/src/mage/sets/BattleForZendikar.java b/Mage.Sets/src/mage/sets/BattleForZendikar.java index 372e401770..aa532e35ee 100644 --- a/Mage.Sets/src/mage/sets/BattleForZendikar.java +++ b/Mage.Sets/src/mage/sets/BattleForZendikar.java @@ -44,10 +44,10 @@ import mage.cards.FrameStyle; */ public class BattleForZendikar extends ExpansionSet { - private static final BattleForZendikar fINSTANCE = new BattleForZendikar(); + private static final BattleForZendikar instance = new BattleForZendikar(); public static BattleForZendikar getInstance() { - return fINSTANCE; + return instance; } protected final List savedSpecialLand = new ArrayList<>(); diff --git a/Mage.Sets/src/mage/sets/BetrayersOfKamigawa.java b/Mage.Sets/src/mage/sets/BetrayersOfKamigawa.java index bdd03c8740..adbc90bbb6 100644 --- a/Mage.Sets/src/mage/sets/BetrayersOfKamigawa.java +++ b/Mage.Sets/src/mage/sets/BetrayersOfKamigawa.java @@ -37,10 +37,10 @@ import mage.constants.Rarity; */ public class BetrayersOfKamigawa extends ExpansionSet { - private static final BetrayersOfKamigawa fINSTANCE = new BetrayersOfKamigawa(); + private static final BetrayersOfKamigawa instance = new BetrayersOfKamigawa(); public static BetrayersOfKamigawa getInstance() { - return fINSTANCE; + return instance; } private BetrayersOfKamigawa() { diff --git a/Mage.Sets/src/mage/sets/BlessedVsCursed.java b/Mage.Sets/src/mage/sets/BlessedVsCursed.java index 9300933862..888b9b7bb9 100644 --- a/Mage.Sets/src/mage/sets/BlessedVsCursed.java +++ b/Mage.Sets/src/mage/sets/BlessedVsCursed.java @@ -37,10 +37,10 @@ import mage.cards.CardGraphicInfo; * @author fireshoes */ public class BlessedVsCursed extends ExpansionSet { - private static final BlessedVsCursed fINSTANCE = new BlessedVsCursed(); + private static final BlessedVsCursed instance = new BlessedVsCursed(); public static BlessedVsCursed getInstance() { - return fINSTANCE; + return instance; } private BlessedVsCursed() { diff --git a/Mage.Sets/src/mage/sets/BornOfTheGods.java b/Mage.Sets/src/mage/sets/BornOfTheGods.java index aca88a1b39..6456a7d907 100644 --- a/Mage.Sets/src/mage/sets/BornOfTheGods.java +++ b/Mage.Sets/src/mage/sets/BornOfTheGods.java @@ -38,10 +38,10 @@ import mage.constants.Rarity; */ public class BornOfTheGods extends ExpansionSet { - private static final BornOfTheGods fINSTANCE = new BornOfTheGods(); + private static final BornOfTheGods instance = new BornOfTheGods(); public static BornOfTheGods getInstance() { - return fINSTANCE; + return instance; } private BornOfTheGods() { diff --git a/Mage.Sets/src/mage/sets/ChampionsOfKamigawa.java b/Mage.Sets/src/mage/sets/ChampionsOfKamigawa.java index ed47c7c0e3..afc0cc8aa5 100644 --- a/Mage.Sets/src/mage/sets/ChampionsOfKamigawa.java +++ b/Mage.Sets/src/mage/sets/ChampionsOfKamigawa.java @@ -7,10 +7,10 @@ import mage.constants.Rarity; import mage.cards.CardGraphicInfo; public class ChampionsOfKamigawa extends ExpansionSet { - private static final ChampionsOfKamigawa fINSTANCE = new ChampionsOfKamigawa(); + private static final ChampionsOfKamigawa instance = new ChampionsOfKamigawa(); public static ChampionsOfKamigawa getInstance() { - return fINSTANCE; + return instance; } private ChampionsOfKamigawa() { diff --git a/Mage.Sets/src/mage/sets/Champs.java b/Mage.Sets/src/mage/sets/Champs.java index 8156e4cee2..4c6b34821a 100644 --- a/Mage.Sets/src/mage/sets/Champs.java +++ b/Mage.Sets/src/mage/sets/Champs.java @@ -38,10 +38,10 @@ import mage.constants.Rarity; public class Champs extends ExpansionSet { - private static final Champs fINSTANCE = new Champs(); + private static final Champs instance = new Champs(); public static Champs getInstance() { - return fINSTANCE; + return instance; } private Champs() { diff --git a/Mage.Sets/src/mage/sets/Chronicles.java b/Mage.Sets/src/mage/sets/Chronicles.java index 7855de8387..31822147e4 100644 --- a/Mage.Sets/src/mage/sets/Chronicles.java +++ b/Mage.Sets/src/mage/sets/Chronicles.java @@ -38,10 +38,10 @@ import mage.cards.CardGraphicInfo; */ public class Chronicles extends ExpansionSet { - private static final Chronicles fINSTANCE = new Chronicles(); + private static final Chronicles instance = new Chronicles(); public static Chronicles getInstance() { - return fINSTANCE; + return instance; } private Chronicles() { @@ -143,7 +143,7 @@ public class Chronicles extends ExpansionSet { cards.add(new SetCardInfo("Urza's Tower", 105, Rarity.UNCOMMON, mage.cards.u.UrzasTower.class, new CardGraphicInfo(null, true))); cards.add(new SetCardInfo("Vaevictis Asmadi", 124, Rarity.RARE, mage.cards.v.VaevictisAsmadi.class)); cards.add(new SetCardInfo("Wall of Heat", 55, Rarity.COMMON, mage.cards.w.WallOfHeat.class)); - cards.add(new SetCardInfo("Wall of Opposition", 56, Rarity.UNCOMMON, mage.cards.w.WallOfOpposition.class)); + cards.add(new SetCardInfo("Wall of Opposition", 56, Rarity.UNCOMMON, mage.cards.w.WallOfOpposition.class)); cards.add(new SetCardInfo("Wall of Wonder", 28, Rarity.UNCOMMON, mage.cards.w.WallOfWonder.class)); cards.add(new SetCardInfo("Witch Hunter", 70, Rarity.UNCOMMON, mage.cards.w.WitchHunter.class)); cards.add(new SetCardInfo("Xira Arien", 125, Rarity.RARE, mage.cards.x.XiraArien.class)); diff --git a/Mage.Sets/src/mage/sets/ClashPack.java b/Mage.Sets/src/mage/sets/ClashPack.java index 606c1dd1d1..6e13659c53 100644 --- a/Mage.Sets/src/mage/sets/ClashPack.java +++ b/Mage.Sets/src/mage/sets/ClashPack.java @@ -37,10 +37,10 @@ import mage.constants.Rarity; * @author LevelX2 */ public class ClashPack extends ExpansionSet { - private static final ClashPack fINSTANCE = new ClashPack(); + private static final ClashPack instance = new ClashPack(); public static ClashPack getInstance() { - return fINSTANCE; + return instance; } private ClashPack() { diff --git a/Mage.Sets/src/mage/sets/ClassicSixthEdition.java b/Mage.Sets/src/mage/sets/ClassicSixthEdition.java index d9cb4734be..ec44f1d75c 100644 --- a/Mage.Sets/src/mage/sets/ClassicSixthEdition.java +++ b/Mage.Sets/src/mage/sets/ClassicSixthEdition.java @@ -43,10 +43,10 @@ import mage.cards.CardGraphicInfo; */ public class ClassicSixthEdition extends ExpansionSet { - private static final ClassicSixthEdition fINSTANCE = new ClassicSixthEdition(); + private static final ClassicSixthEdition instance = new ClassicSixthEdition(); public static ClassicSixthEdition getInstance() { - return fINSTANCE; + return instance; } private ClassicSixthEdition() { diff --git a/Mage.Sets/src/mage/sets/Coldsnap.java b/Mage.Sets/src/mage/sets/Coldsnap.java index 614198b1df..97217e0a49 100644 --- a/Mage.Sets/src/mage/sets/Coldsnap.java +++ b/Mage.Sets/src/mage/sets/Coldsnap.java @@ -37,10 +37,10 @@ import mage.constants.Rarity; */ public class Coldsnap extends ExpansionSet { - private static final Coldsnap fINSTANCE = new Coldsnap(); + private static final Coldsnap instance = new Coldsnap(); public static Coldsnap getInstance() { - return fINSTANCE; + return instance; } private Coldsnap() { diff --git a/Mage.Sets/src/mage/sets/Commander.java b/Mage.Sets/src/mage/sets/Commander.java index c4b7b10be6..98c6da9b7a 100644 --- a/Mage.Sets/src/mage/sets/Commander.java +++ b/Mage.Sets/src/mage/sets/Commander.java @@ -40,10 +40,10 @@ import mage.cards.CardGraphicInfo; public class Commander extends ExpansionSet { - private static final Commander fINSTANCE = new Commander(); + private static final Commander instance = new Commander(); public static Commander getInstance() { - return fINSTANCE; + return instance; } private Commander() { diff --git a/Mage.Sets/src/mage/sets/Commander2013.java b/Mage.Sets/src/mage/sets/Commander2013.java index c56145de85..151d8ac74b 100644 --- a/Mage.Sets/src/mage/sets/Commander2013.java +++ b/Mage.Sets/src/mage/sets/Commander2013.java @@ -41,10 +41,10 @@ import mage.cards.CardGraphicInfo; public class Commander2013 extends ExpansionSet { - private static final Commander2013 fINSTANCE = new Commander2013(); + private static final Commander2013 instance = new Commander2013(); public static Commander2013 getInstance() { - return fINSTANCE; + return instance; } private Commander2013() { diff --git a/Mage.Sets/src/mage/sets/Commander2014.java b/Mage.Sets/src/mage/sets/Commander2014.java index cb979dbbe7..b6e073691c 100644 --- a/Mage.Sets/src/mage/sets/Commander2014.java +++ b/Mage.Sets/src/mage/sets/Commander2014.java @@ -39,10 +39,10 @@ import mage.cards.CardGraphicInfo; public class Commander2014 extends ExpansionSet { - private static final Commander2014 fINSTANCE = new Commander2014(); + private static final Commander2014 instance = new Commander2014(); public static Commander2014 getInstance() { - return fINSTANCE; + return instance; } private Commander2014() { diff --git a/Mage.Sets/src/mage/sets/Commander2015.java b/Mage.Sets/src/mage/sets/Commander2015.java index 975c786220..c24ab32f39 100644 --- a/Mage.Sets/src/mage/sets/Commander2015.java +++ b/Mage.Sets/src/mage/sets/Commander2015.java @@ -39,10 +39,10 @@ import mage.cards.CardGraphicInfo; public class Commander2015 extends ExpansionSet { - private static final Commander2015 fINSTANCE = new Commander2015(); + private static final Commander2015 instance = new Commander2015(); public static Commander2015 getInstance() { - return fINSTANCE; + return instance; } private Commander2015() { diff --git a/Mage.Sets/src/mage/sets/Commander2016.java b/Mage.Sets/src/mage/sets/Commander2016.java index d9ab26fbd4..44f0077aa7 100644 --- a/Mage.Sets/src/mage/sets/Commander2016.java +++ b/Mage.Sets/src/mage/sets/Commander2016.java @@ -38,10 +38,10 @@ import mage.constants.SetType; */ public class Commander2016 extends ExpansionSet { - private static final Commander2016 fINSTANCE = new Commander2016(); + private static final Commander2016 instance = new Commander2016(); public static Commander2016 getInstance() { - return fINSTANCE; + return instance; } private Commander2016() { diff --git a/Mage.Sets/src/mage/sets/CommanderAnthology.java b/Mage.Sets/src/mage/sets/CommanderAnthology.java index 88a4627553..3c6a800c6e 100644 --- a/Mage.Sets/src/mage/sets/CommanderAnthology.java +++ b/Mage.Sets/src/mage/sets/CommanderAnthology.java @@ -35,10 +35,10 @@ import mage.constants.SetType; * @author fireshoes */ public class CommanderAnthology extends ExpansionSet { - private static final CommanderAnthology fINSTANCE = new CommanderAnthology(); + private static final CommanderAnthology instance = new CommanderAnthology(); public static CommanderAnthology getInstance() { - return fINSTANCE; + return instance; } private CommanderAnthology() { diff --git a/Mage.Sets/src/mage/sets/CommandersArsenal.java b/Mage.Sets/src/mage/sets/CommandersArsenal.java index 6001469a05..7f9ece8cea 100644 --- a/Mage.Sets/src/mage/sets/CommandersArsenal.java +++ b/Mage.Sets/src/mage/sets/CommandersArsenal.java @@ -38,10 +38,10 @@ import mage.constants.Rarity; public class CommandersArsenal extends ExpansionSet { - private static final CommandersArsenal fINSTANCE = new CommandersArsenal(); + private static final CommandersArsenal instance = new CommandersArsenal(); public static CommandersArsenal getInstance() { - return fINSTANCE; + return instance; } private CommandersArsenal() { diff --git a/Mage.Sets/src/mage/sets/Conflux.java b/Mage.Sets/src/mage/sets/Conflux.java index 260a72ccb9..b2ced40194 100644 --- a/Mage.Sets/src/mage/sets/Conflux.java +++ b/Mage.Sets/src/mage/sets/Conflux.java @@ -38,10 +38,10 @@ import mage.constants.Rarity; */ public class Conflux extends ExpansionSet { - private static final Conflux fINSTANCE = new Conflux(); + private static final Conflux instance = new Conflux(); public static Conflux getInstance() { - return fINSTANCE; + return instance; } private Conflux() { diff --git a/Mage.Sets/src/mage/sets/Conspiracy.java b/Mage.Sets/src/mage/sets/Conspiracy.java index 316e0f57c7..56fbffe3c6 100644 --- a/Mage.Sets/src/mage/sets/Conspiracy.java +++ b/Mage.Sets/src/mage/sets/Conspiracy.java @@ -39,10 +39,10 @@ import mage.constants.Rarity; public class Conspiracy extends ExpansionSet { - private static final Conspiracy fINSTANCE = new Conspiracy(); + private static final Conspiracy instance = new Conspiracy(); public static Conspiracy getInstance() { - return fINSTANCE; + return instance; } private Conspiracy() { @@ -194,7 +194,7 @@ public class Conspiracy extends ExpansionSet { cards.add(new SetCardInfo("Sky Spirit", 192, Rarity.UNCOMMON, mage.cards.s.SkySpirit.class)); cards.add(new SetCardInfo("Smallpox", 125, Rarity.UNCOMMON, mage.cards.s.Smallpox.class)); cards.add(new SetCardInfo("Soulcatcher", 82, Rarity.UNCOMMON, mage.cards.s.Soulcatcher.class)); - cards.add(new SetCardInfo("Spectral Searchlight", 205, Rarity.UNCOMMON, mage.cards.s.SpectralSearchlight.class)); + cards.add(new SetCardInfo("Spectral Searchlight", 205, Rarity.UNCOMMON, mage.cards.s.SpectralSearchlight.class)); cards.add(new SetCardInfo("Spiritmonger", 193, Rarity.RARE, mage.cards.s.Spiritmonger.class)); cards.add(new SetCardInfo("Split Decision", 25, Rarity.UNCOMMON, mage.cards.s.SplitDecision.class)); cards.add(new SetCardInfo("Spontaneous Combustion", 194, Rarity.UNCOMMON, mage.cards.s.SpontaneousCombustion.class)); diff --git a/Mage.Sets/src/mage/sets/ConspiracyTakeTheCrown.java b/Mage.Sets/src/mage/sets/ConspiracyTakeTheCrown.java index 234f7d95af..30fa1fdbf7 100644 --- a/Mage.Sets/src/mage/sets/ConspiracyTakeTheCrown.java +++ b/Mage.Sets/src/mage/sets/ConspiracyTakeTheCrown.java @@ -39,10 +39,10 @@ import mage.constants.Rarity; public class ConspiracyTakeTheCrown extends ExpansionSet { - private static final ConspiracyTakeTheCrown fINSTANCE = new ConspiracyTakeTheCrown(); + private static final ConspiracyTakeTheCrown instance = new ConspiracyTakeTheCrown(); public static ConspiracyTakeTheCrown getInstance() { - return fINSTANCE; + return instance; } private ConspiracyTakeTheCrown() { diff --git a/Mage.Sets/src/mage/sets/DarkAscension.java b/Mage.Sets/src/mage/sets/DarkAscension.java index 41df025c45..9ff75e9085 100644 --- a/Mage.Sets/src/mage/sets/DarkAscension.java +++ b/Mage.Sets/src/mage/sets/DarkAscension.java @@ -37,10 +37,10 @@ import mage.constants.Rarity; */ public class DarkAscension extends ExpansionSet { - private static final DarkAscension fINSTANCE = new DarkAscension(); + private static final DarkAscension instance = new DarkAscension(); public static DarkAscension getInstance() { - return fINSTANCE; + return instance; } private DarkAscension() { diff --git a/Mage.Sets/src/mage/sets/Darksteel.java b/Mage.Sets/src/mage/sets/Darksteel.java index 3c31af4289..4af459bc94 100644 --- a/Mage.Sets/src/mage/sets/Darksteel.java +++ b/Mage.Sets/src/mage/sets/Darksteel.java @@ -7,10 +7,10 @@ import mage.constants.Rarity; public class Darksteel extends ExpansionSet { - private static final Darksteel fINSTANCE = new Darksteel(); + private static final Darksteel instance = new Darksteel(); public static Darksteel getInstance() { - return fINSTANCE; + return instance; } public Darksteel() { diff --git a/Mage.Sets/src/mage/sets/Dissension.java b/Mage.Sets/src/mage/sets/Dissension.java index 89504b7043..19ce21b167 100644 --- a/Mage.Sets/src/mage/sets/Dissension.java +++ b/Mage.Sets/src/mage/sets/Dissension.java @@ -37,10 +37,10 @@ import mage.constants.Rarity; */ public class Dissension extends ExpansionSet { - private static final Dissension fINSTANCE = new Dissension(); + private static final Dissension instance = new Dissension(); public static Dissension getInstance() { - return fINSTANCE; + return instance; } private Dissension() { diff --git a/Mage.Sets/src/mage/sets/DivineVsDemonic.java b/Mage.Sets/src/mage/sets/DivineVsDemonic.java index 5f0bdc454b..c18dfb7d74 100644 --- a/Mage.Sets/src/mage/sets/DivineVsDemonic.java +++ b/Mage.Sets/src/mage/sets/DivineVsDemonic.java @@ -39,10 +39,10 @@ import mage.cards.CardGraphicInfo; */ public class DivineVsDemonic extends ExpansionSet { - private static final DivineVsDemonic fINSTANCE = new DivineVsDemonic(); + private static final DivineVsDemonic instance = new DivineVsDemonic(); public static DivineVsDemonic getInstance() { - return fINSTANCE; + return instance; } private DivineVsDemonic() { diff --git a/Mage.Sets/src/mage/sets/DragonsMaze.java b/Mage.Sets/src/mage/sets/DragonsMaze.java index a8152eec14..cf305e8471 100644 --- a/Mage.Sets/src/mage/sets/DragonsMaze.java +++ b/Mage.Sets/src/mage/sets/DragonsMaze.java @@ -46,10 +46,10 @@ import mage.constants.SetType; public class DragonsMaze extends ExpansionSet { - private static final DragonsMaze fINSTANCE = new DragonsMaze(); + private static final DragonsMaze instance = new DragonsMaze(); public static DragonsMaze getInstance() { - return fINSTANCE; + return instance; } List savedSpecialRares = new ArrayList<>(); diff --git a/Mage.Sets/src/mage/sets/DragonsOfTarkir.java b/Mage.Sets/src/mage/sets/DragonsOfTarkir.java index fc012985b1..beee02ce17 100644 --- a/Mage.Sets/src/mage/sets/DragonsOfTarkir.java +++ b/Mage.Sets/src/mage/sets/DragonsOfTarkir.java @@ -40,10 +40,10 @@ import mage.cards.CardGraphicInfo; public class DragonsOfTarkir extends ExpansionSet { - private static final DragonsOfTarkir fINSTANCE = new DragonsOfTarkir(); + private static final DragonsOfTarkir instance = new DragonsOfTarkir(); public static DragonsOfTarkir getInstance() { - return fINSTANCE; + return instance; } private DragonsOfTarkir() { diff --git a/Mage.Sets/src/mage/sets/DuelsOfThePlaneswalkers.java b/Mage.Sets/src/mage/sets/DuelsOfThePlaneswalkers.java index e05b6a82bb..e8d85320fe 100644 --- a/Mage.Sets/src/mage/sets/DuelsOfThePlaneswalkers.java +++ b/Mage.Sets/src/mage/sets/DuelsOfThePlaneswalkers.java @@ -38,10 +38,10 @@ import mage.constants.Rarity; */ public class DuelsOfThePlaneswalkers extends ExpansionSet { - private static final DuelsOfThePlaneswalkers fINSTANCE = new DuelsOfThePlaneswalkers(); + private static final DuelsOfThePlaneswalkers instance = new DuelsOfThePlaneswalkers(); public static DuelsOfThePlaneswalkers getInstance() { - return fINSTANCE; + return instance; } private DuelsOfThePlaneswalkers() { diff --git a/Mage.Sets/src/mage/sets/EighthEdition.java b/Mage.Sets/src/mage/sets/EighthEdition.java index 4b710f875e..13fe2c8c4e 100644 --- a/Mage.Sets/src/mage/sets/EighthEdition.java +++ b/Mage.Sets/src/mage/sets/EighthEdition.java @@ -9,10 +9,10 @@ import mage.constants.SetType; public class EighthEdition extends ExpansionSet { - private static final EighthEdition fINSTANCE = new EighthEdition(); + private static final EighthEdition instance = new EighthEdition(); public static EighthEdition getInstance() { - return fINSTANCE; + return instance; } private EighthEdition() { diff --git a/Mage.Sets/src/mage/sets/EldritchMoon.java b/Mage.Sets/src/mage/sets/EldritchMoon.java index 7c6fee0dcb..5e1c4eadfa 100644 --- a/Mage.Sets/src/mage/sets/EldritchMoon.java +++ b/Mage.Sets/src/mage/sets/EldritchMoon.java @@ -37,10 +37,10 @@ import mage.constants.SetType; */ public class EldritchMoon extends ExpansionSet { - private static final EldritchMoon fINSTANCE = new EldritchMoon(); + private static final EldritchMoon instance = new EldritchMoon(); public static EldritchMoon getInstance() { - return fINSTANCE; + return instance; } private EldritchMoon() { diff --git a/Mage.Sets/src/mage/sets/ElspethVsKiora.java b/Mage.Sets/src/mage/sets/ElspethVsKiora.java index eda7e3c646..e88da2c2f3 100644 --- a/Mage.Sets/src/mage/sets/ElspethVsKiora.java +++ b/Mage.Sets/src/mage/sets/ElspethVsKiora.java @@ -38,10 +38,10 @@ import mage.cards.CardGraphicInfo; * @author fireshoes */ public class ElspethVsKiora extends ExpansionSet { - private static final ElspethVsKiora fINSTANCE = new ElspethVsKiora(); + private static final ElspethVsKiora instance = new ElspethVsKiora(); public static ElspethVsKiora getInstance() { - return fINSTANCE; + return instance; } private ElspethVsKiora() { diff --git a/Mage.Sets/src/mage/sets/ElspethVsTezzeret.java b/Mage.Sets/src/mage/sets/ElspethVsTezzeret.java index c3bcf5bba2..1720d1d64a 100644 --- a/Mage.Sets/src/mage/sets/ElspethVsTezzeret.java +++ b/Mage.Sets/src/mage/sets/ElspethVsTezzeret.java @@ -7,10 +7,10 @@ import mage.constants.Rarity; import mage.cards.CardGraphicInfo; public class ElspethVsTezzeret extends ExpansionSet { - private static final ElspethVsTezzeret fINSTANCE = new ElspethVsTezzeret(); + private static final ElspethVsTezzeret instance = new ElspethVsTezzeret(); public static ElspethVsTezzeret getInstance() { - return fINSTANCE; + return instance; } private ElspethVsTezzeret() { diff --git a/Mage.Sets/src/mage/sets/ElvesVsGoblins.java b/Mage.Sets/src/mage/sets/ElvesVsGoblins.java index 07e315269a..b026d3d66d 100644 --- a/Mage.Sets/src/mage/sets/ElvesVsGoblins.java +++ b/Mage.Sets/src/mage/sets/ElvesVsGoblins.java @@ -17,10 +17,10 @@ import mage.cards.CardGraphicInfo; */ public class ElvesVsGoblins extends ExpansionSet { - private static final ElvesVsGoblins fINSTANCE = new ElvesVsGoblins(); + private static final ElvesVsGoblins instance = new ElvesVsGoblins(); public static ElvesVsGoblins getInstance() { - return fINSTANCE; + return instance; } private ElvesVsGoblins() { diff --git a/Mage.Sets/src/mage/sets/EternalMasters.java b/Mage.Sets/src/mage/sets/EternalMasters.java index 7254c3ebea..944b3d7de1 100644 --- a/Mage.Sets/src/mage/sets/EternalMasters.java +++ b/Mage.Sets/src/mage/sets/EternalMasters.java @@ -39,10 +39,10 @@ import mage.constants.Rarity; */ public class EternalMasters extends ExpansionSet { - private static final EternalMasters fINSTANCE = new EternalMasters(); + private static final EternalMasters instance = new EternalMasters(); public static EternalMasters getInstance() { - return fINSTANCE; + return instance; } private EternalMasters() { diff --git a/Mage.Sets/src/mage/sets/EuropeanLandProgram.java b/Mage.Sets/src/mage/sets/EuropeanLandProgram.java index 6c0c6fa95b..49d9517422 100644 --- a/Mage.Sets/src/mage/sets/EuropeanLandProgram.java +++ b/Mage.Sets/src/mage/sets/EuropeanLandProgram.java @@ -38,10 +38,10 @@ import mage.constants.SetType; */ public class EuropeanLandProgram extends ExpansionSet { - private static final EuropeanLandProgram fINSTANCE = new EuropeanLandProgram(); + private static final EuropeanLandProgram instance = new EuropeanLandProgram(); public static EuropeanLandProgram getInstance() { - return fINSTANCE; + return instance; } private EuropeanLandProgram() { diff --git a/Mage.Sets/src/mage/sets/Eventide.java b/Mage.Sets/src/mage/sets/Eventide.java index bbdca5340e..ec865bae5b 100644 --- a/Mage.Sets/src/mage/sets/Eventide.java +++ b/Mage.Sets/src/mage/sets/Eventide.java @@ -6,10 +6,10 @@ import mage.constants.SetType; import mage.constants.Rarity; public class Eventide extends ExpansionSet { - private static final Eventide fINSTANCE = new Eventide(); + private static final Eventide instance = new Eventide(); public static Eventide getInstance() { - return fINSTANCE; + return instance; } private Eventide() { diff --git a/Mage.Sets/src/mage/sets/Exodus.java b/Mage.Sets/src/mage/sets/Exodus.java index ac156cd866..b651b60bfc 100644 --- a/Mage.Sets/src/mage/sets/Exodus.java +++ b/Mage.Sets/src/mage/sets/Exodus.java @@ -37,10 +37,10 @@ import mage.constants.SetType; */ public class Exodus extends ExpansionSet { - private static final Exodus fINSTANCE = new Exodus(); + private static final Exodus instance = new Exodus(); public static Exodus getInstance() { - return fINSTANCE; + return instance; } private Exodus() { diff --git a/Mage.Sets/src/mage/sets/FTVAngels.java b/Mage.Sets/src/mage/sets/FTVAngels.java index abf0527ce6..238438a6d7 100644 --- a/Mage.Sets/src/mage/sets/FTVAngels.java +++ b/Mage.Sets/src/mage/sets/FTVAngels.java @@ -37,10 +37,10 @@ import mage.constants.SetType; */ public class FTVAngels extends ExpansionSet { - private static final FTVAngels fINSTANCE = new FTVAngels(); + private static final FTVAngels instance = new FTVAngels(); public static FTVAngels getInstance() { - return fINSTANCE; + return instance; } private FTVAngels() { diff --git a/Mage.Sets/src/mage/sets/FTVAnnihilation.java b/Mage.Sets/src/mage/sets/FTVAnnihilation.java index f699372b19..1c2d737163 100644 --- a/Mage.Sets/src/mage/sets/FTVAnnihilation.java +++ b/Mage.Sets/src/mage/sets/FTVAnnihilation.java @@ -37,10 +37,10 @@ import mage.constants.SetType; */ public class FTVAnnihilation extends ExpansionSet { - private static final FTVAnnihilation fINSTANCE = new FTVAnnihilation(); + private static final FTVAnnihilation instance = new FTVAnnihilation(); public static FTVAnnihilation getInstance() { - return fINSTANCE; + return instance; } private FTVAnnihilation() { diff --git a/Mage.Sets/src/mage/sets/FTVDragons.java b/Mage.Sets/src/mage/sets/FTVDragons.java index 87b7e27df9..e3eb1af59e 100644 --- a/Mage.Sets/src/mage/sets/FTVDragons.java +++ b/Mage.Sets/src/mage/sets/FTVDragons.java @@ -37,10 +37,10 @@ import mage.constants.SetType; */ public class FTVDragons extends ExpansionSet { - private static final FTVDragons fINSTANCE = new FTVDragons(); + private static final FTVDragons instance = new FTVDragons(); public static FTVDragons getInstance() { - return fINSTANCE; + return instance; } private FTVDragons() { diff --git a/Mage.Sets/src/mage/sets/FTVExiled.java b/Mage.Sets/src/mage/sets/FTVExiled.java index 054fed5333..6c5717ca94 100644 --- a/Mage.Sets/src/mage/sets/FTVExiled.java +++ b/Mage.Sets/src/mage/sets/FTVExiled.java @@ -37,10 +37,10 @@ import mage.constants.SetType; */ public class FTVExiled extends ExpansionSet { - private static final FTVExiled fINSTANCE = new FTVExiled(); + private static final FTVExiled instance = new FTVExiled(); public static FTVExiled getInstance() { - return fINSTANCE; + return instance; } private FTVExiled() { diff --git a/Mage.Sets/src/mage/sets/FTVLegends.java b/Mage.Sets/src/mage/sets/FTVLegends.java index 2e012fc9e1..d5b37fdd23 100644 --- a/Mage.Sets/src/mage/sets/FTVLegends.java +++ b/Mage.Sets/src/mage/sets/FTVLegends.java @@ -37,10 +37,10 @@ import mage.constants.SetType; */ public class FTVLegends extends ExpansionSet { - private static final FTVLegends fINSTANCE = new FTVLegends(); + private static final FTVLegends instance = new FTVLegends(); public static FTVLegends getInstance() { - return fINSTANCE; + return instance; } private FTVLegends() { diff --git a/Mage.Sets/src/mage/sets/FTVLore.java b/Mage.Sets/src/mage/sets/FTVLore.java index 39ba306b57..9eba986c73 100644 --- a/Mage.Sets/src/mage/sets/FTVLore.java +++ b/Mage.Sets/src/mage/sets/FTVLore.java @@ -37,10 +37,10 @@ import mage.constants.SetType; */ public class FTVLore extends ExpansionSet { - private static final FTVLore fINSTANCE = new FTVLore(); + private static final FTVLore instance = new FTVLore(); public static FTVLore getInstance() { - return fINSTANCE; + return instance; } private FTVLore() { diff --git a/Mage.Sets/src/mage/sets/FTVRealms.java b/Mage.Sets/src/mage/sets/FTVRealms.java index f310bd1759..568dfef96f 100644 --- a/Mage.Sets/src/mage/sets/FTVRealms.java +++ b/Mage.Sets/src/mage/sets/FTVRealms.java @@ -37,10 +37,10 @@ import mage.constants.SetType; */ public class FTVRealms extends ExpansionSet { - private static final FTVRealms fINSTANCE = new FTVRealms(); + private static final FTVRealms instance = new FTVRealms(); public static FTVRealms getInstance() { - return fINSTANCE; + return instance; } private FTVRealms() { diff --git a/Mage.Sets/src/mage/sets/FTVRelics.java b/Mage.Sets/src/mage/sets/FTVRelics.java index 2af0de0d97..0c31c9c432 100644 --- a/Mage.Sets/src/mage/sets/FTVRelics.java +++ b/Mage.Sets/src/mage/sets/FTVRelics.java @@ -37,10 +37,10 @@ import mage.constants.SetType; */ public class FTVRelics extends ExpansionSet { - private static final FTVRelics fINSTANCE = new FTVRelics(); + private static final FTVRelics instance = new FTVRelics(); public static FTVRelics getInstance() { - return fINSTANCE; + return instance; } private FTVRelics() { diff --git a/Mage.Sets/src/mage/sets/FTVTwenty.java b/Mage.Sets/src/mage/sets/FTVTwenty.java index 21034cf3fd..66c8358bf2 100644 --- a/Mage.Sets/src/mage/sets/FTVTwenty.java +++ b/Mage.Sets/src/mage/sets/FTVTwenty.java @@ -38,10 +38,10 @@ import mage.constants.SetType; */ public class FTVTwenty extends ExpansionSet { - private static final FTVTwenty fINSTANCE = new FTVTwenty(); + private static final FTVTwenty instance = new FTVTwenty(); public static FTVTwenty getInstance() { - return fINSTANCE; + return instance; } private FTVTwenty() { diff --git a/Mage.Sets/src/mage/sets/FallenEmpires.java b/Mage.Sets/src/mage/sets/FallenEmpires.java index 0f082432b9..987ac79ab1 100644 --- a/Mage.Sets/src/mage/sets/FallenEmpires.java +++ b/Mage.Sets/src/mage/sets/FallenEmpires.java @@ -68,10 +68,10 @@ import mage.cards.CardGraphicInfo; */ public class FallenEmpires extends ExpansionSet { - private static final FallenEmpires fINSTANCE = new FallenEmpires(); + private static final FallenEmpires instance = new FallenEmpires(); public static FallenEmpires getInstance() { - return fINSTANCE; + return instance; } private FallenEmpires() { diff --git a/Mage.Sets/src/mage/sets/FateReforged.java b/Mage.Sets/src/mage/sets/FateReforged.java index 2ef6c0b1d9..82a0078ded 100644 --- a/Mage.Sets/src/mage/sets/FateReforged.java +++ b/Mage.Sets/src/mage/sets/FateReforged.java @@ -44,13 +44,13 @@ import mage.cards.CardGraphicInfo; */ public class FateReforged extends ExpansionSet { - private static final FateReforged fINSTANCE = new FateReforged(); + private static final FateReforged instance = new FateReforged(); List savedSpecialRares = new ArrayList<>(); List savedSpecialCommon = new ArrayList<>(); public static FateReforged getInstance() { - return fINSTANCE; + return instance; } private FateReforged() { diff --git a/Mage.Sets/src/mage/sets/FifthDawn.java b/Mage.Sets/src/mage/sets/FifthDawn.java index ca85fd75d4..94ab579952 100644 --- a/Mage.Sets/src/mage/sets/FifthDawn.java +++ b/Mage.Sets/src/mage/sets/FifthDawn.java @@ -37,10 +37,10 @@ import mage.constants.Rarity; */ public class FifthDawn extends ExpansionSet { - private static final FifthDawn fINSTANCE = new FifthDawn(); + private static final FifthDawn instance = new FifthDawn(); public static FifthDawn getInstance() { - return fINSTANCE; + return instance; } private FifthDawn() { diff --git a/Mage.Sets/src/mage/sets/FifthEdition.java b/Mage.Sets/src/mage/sets/FifthEdition.java index ed9a1f0052..9cb9aa2bc2 100644 --- a/Mage.Sets/src/mage/sets/FifthEdition.java +++ b/Mage.Sets/src/mage/sets/FifthEdition.java @@ -19,10 +19,10 @@ import mage.cards.CardGraphicInfo; public class FifthEdition extends ExpansionSet { - private static final FifthEdition fINSTANCE = new FifthEdition(); + private static final FifthEdition instance = new FifthEdition(); public static FifthEdition getInstance() { - return fINSTANCE; + return instance; } private FifthEdition() { @@ -76,12 +76,12 @@ public class FifthEdition extends ExpansionSet { cards.add(new SetCardInfo("Bottle of Suleiman", 354, Rarity.RARE, mage.cards.b.BottleOfSuleiman.class)); cards.add(new SetCardInfo("Bottomless Vault", 411, Rarity.RARE, mage.cards.b.BottomlessVault.class)); cards.add(new SetCardInfo("Brainstorm", 76, Rarity.COMMON, mage.cards.b.Brainstorm.class)); - cards.add(new SetCardInfo("Brainwash", 289, Rarity.COMMON, mage.cards.b.Brainwash.class)); + cards.add(new SetCardInfo("Brainwash", 289, Rarity.COMMON, mage.cards.b.Brainwash.class)); cards.add(new SetCardInfo("Brassclaw Orcs", 213, Rarity.COMMON, BrassclawOrcs.class)); cards.add(new SetCardInfo("Breeding Pit", 10, Rarity.UNCOMMON, mage.cards.b.BreedingPit.class)); cards.add(new SetCardInfo("Brothers of Fire", 214, Rarity.COMMON, mage.cards.b.BrothersOfFire.class)); cards.add(new SetCardInfo("Brushland", 412, Rarity.RARE, mage.cards.b.Brushland.class)); - cards.add(new SetCardInfo("Carapace", 143, Rarity.COMMON, mage.cards.c.Carapace.class)); + cards.add(new SetCardInfo("Carapace", 143, Rarity.COMMON, mage.cards.c.Carapace.class)); cards.add(new SetCardInfo("Caribou Range", 290, Rarity.RARE, mage.cards.c.CaribouRange.class)); cards.add(new SetCardInfo("Carrion Ants", 12, Rarity.UNCOMMON, mage.cards.c.CarrionAnts.class)); cards.add(new SetCardInfo("Castle", 291, Rarity.UNCOMMON, mage.cards.c.Castle.class)); @@ -362,7 +362,7 @@ public class FifthEdition extends ExpansionSet { cards.add(new SetCardInfo("Skull Catapult", 399, Rarity.UNCOMMON, mage.cards.s.SkullCatapult.class)); cards.add(new SetCardInfo("Smoke", 268, Rarity.RARE, mage.cards.s.Smoke.class)); cards.add(new SetCardInfo("Sorceress Queen", 56, Rarity.RARE, mage.cards.s.SorceressQueen.class)); - cards.add(new SetCardInfo("Soul Barrier", 125, Rarity.COMMON, mage.cards.s.SoulBarrier.class)); + cards.add(new SetCardInfo("Soul Barrier", 125, Rarity.COMMON, mage.cards.s.SoulBarrier.class)); cards.add(new SetCardInfo("Soul Net", 400, Rarity.UNCOMMON, mage.cards.s.SoulNet.class)); cards.add(new SetCardInfo("Spell Blast", 126, Rarity.COMMON, mage.cards.s.SpellBlast.class)); cards.add(new SetCardInfo("Spirit Link", 340, Rarity.UNCOMMON, mage.cards.s.SpiritLink.class)); diff --git a/Mage.Sets/src/mage/sets/FourthEdition.java b/Mage.Sets/src/mage/sets/FourthEdition.java index 6efaa0aa39..a0b6388c94 100644 --- a/Mage.Sets/src/mage/sets/FourthEdition.java +++ b/Mage.Sets/src/mage/sets/FourthEdition.java @@ -40,10 +40,10 @@ import mage.cards.CardGraphicInfo; */ public class FourthEdition extends ExpansionSet { - private static final FourthEdition fINSTANCE = new FourthEdition(); + private static final FourthEdition instance = new FourthEdition(); public static FourthEdition getInstance() { - return fINSTANCE; + return instance; } private FourthEdition() { diff --git a/Mage.Sets/src/mage/sets/FridayNightMagic.java b/Mage.Sets/src/mage/sets/FridayNightMagic.java index 0ca3351008..f0cdeb8537 100644 --- a/Mage.Sets/src/mage/sets/FridayNightMagic.java +++ b/Mage.Sets/src/mage/sets/FridayNightMagic.java @@ -39,10 +39,10 @@ import mage.constants.SetType; */ public class FridayNightMagic extends ExpansionSet { - private static final FridayNightMagic fINSTANCE = new FridayNightMagic(); + private static final FridayNightMagic instance = new FridayNightMagic(); public static FridayNightMagic getInstance() { - return fINSTANCE; + return instance; } private FridayNightMagic() { diff --git a/Mage.Sets/src/mage/sets/FutureSight.java b/Mage.Sets/src/mage/sets/FutureSight.java index 6a06a53d50..996959adfe 100644 --- a/Mage.Sets/src/mage/sets/FutureSight.java +++ b/Mage.Sets/src/mage/sets/FutureSight.java @@ -37,10 +37,10 @@ import mage.constants.Rarity; */ public class FutureSight extends ExpansionSet { - private static final FutureSight fINSTANCE = new FutureSight(); + private static final FutureSight instance = new FutureSight(); public static FutureSight getInstance() { - return fINSTANCE; + return instance; } private FutureSight() { diff --git a/Mage.Sets/src/mage/sets/GameDay.java b/Mage.Sets/src/mage/sets/GameDay.java index e6a35ebcb3..3c73abfb6d 100644 --- a/Mage.Sets/src/mage/sets/GameDay.java +++ b/Mage.Sets/src/mage/sets/GameDay.java @@ -38,10 +38,10 @@ import mage.constants.Rarity; */ public class GameDay extends ExpansionSet { - private static final GameDay fINSTANCE = new GameDay(); + private static final GameDay instance = new GameDay(); public static GameDay getInstance() { - return fINSTANCE; + return instance; } private GameDay() { diff --git a/Mage.Sets/src/mage/sets/GarrukVsLiliana.java b/Mage.Sets/src/mage/sets/GarrukVsLiliana.java index 46b18b29ab..4d70715e31 100644 --- a/Mage.Sets/src/mage/sets/GarrukVsLiliana.java +++ b/Mage.Sets/src/mage/sets/GarrukVsLiliana.java @@ -17,10 +17,10 @@ import mage.cards.CardGraphicInfo; */ public class GarrukVsLiliana extends ExpansionSet { - private static final GarrukVsLiliana fINSTANCE = new GarrukVsLiliana(); + private static final GarrukVsLiliana instance = new GarrukVsLiliana(); public static GarrukVsLiliana getInstance() { - return fINSTANCE; + return instance; } private GarrukVsLiliana() { diff --git a/Mage.Sets/src/mage/sets/Gatecrash.java b/Mage.Sets/src/mage/sets/Gatecrash.java index ae3f3d0fd8..52696e47b5 100644 --- a/Mage.Sets/src/mage/sets/Gatecrash.java +++ b/Mage.Sets/src/mage/sets/Gatecrash.java @@ -37,10 +37,10 @@ import mage.constants.Rarity; */ public class Gatecrash extends ExpansionSet { - private static final Gatecrash fINSTANCE = new Gatecrash(); + private static final Gatecrash instance = new Gatecrash(); public static Gatecrash getInstance() { - return fINSTANCE; + return instance; } private Gatecrash() { diff --git a/Mage.Sets/src/mage/sets/GrandPrix.java b/Mage.Sets/src/mage/sets/GrandPrix.java index 8025c629b1..144ea8de41 100644 --- a/Mage.Sets/src/mage/sets/GrandPrix.java +++ b/Mage.Sets/src/mage/sets/GrandPrix.java @@ -38,10 +38,10 @@ import mage.constants.SetType; */ public class GrandPrix extends ExpansionSet { - private static final GrandPrix fINSTANCE = new GrandPrix(); + private static final GrandPrix instance = new GrandPrix(); public static GrandPrix getInstance() { - return fINSTANCE; + return instance; } private GrandPrix() { diff --git a/Mage.Sets/src/mage/sets/Guildpact.java b/Mage.Sets/src/mage/sets/Guildpact.java index 8f72f59934..a2c6b59b63 100644 --- a/Mage.Sets/src/mage/sets/Guildpact.java +++ b/Mage.Sets/src/mage/sets/Guildpact.java @@ -37,10 +37,10 @@ import mage.constants.Rarity; * Created by IntelliJ IDEA. User: Loki Date: 20.12.10 Time: 21:01 */ public class Guildpact extends ExpansionSet { - private static final Guildpact fINSTANCE = new Guildpact(); + private static final Guildpact instance = new Guildpact(); public static Guildpact getInstance() { - return fINSTANCE; + return instance; } private Guildpact() { @@ -153,7 +153,7 @@ public class Guildpact extends ExpansionSet { cards.add(new SetCardInfo("Revenant Patriarch", 59, Rarity.UNCOMMON, mage.cards.r.RevenantPatriarch.class)); cards.add(new SetCardInfo("Rumbling Slum", 126, Rarity.RARE, mage.cards.r.RumblingSlum.class)); cards.add(new SetCardInfo("Runeboggle", 33, Rarity.COMMON, mage.cards.r.Runeboggle.class)); - cards.add(new SetCardInfo("Sanguine Praetor", 60, Rarity.RARE, mage.cards.s.SanguinePraetor.class)); + cards.add(new SetCardInfo("Sanguine Praetor", 60, Rarity.RARE, mage.cards.s.SanguinePraetor.class)); cards.add(new SetCardInfo("Savage Twister", 127, Rarity.UNCOMMON, mage.cards.s.SavageTwister.class)); cards.add(new SetCardInfo("Scab-Clan Mauler", 128, Rarity.COMMON, mage.cards.s.ScabClanMauler.class)); cards.add(new SetCardInfo("Schismotivate", 129, Rarity.UNCOMMON, mage.cards.s.Schismotivate.class)); diff --git a/Mage.Sets/src/mage/sets/Guru.java b/Mage.Sets/src/mage/sets/Guru.java index e1a9ac092d..16c6b0979f 100644 --- a/Mage.Sets/src/mage/sets/Guru.java +++ b/Mage.Sets/src/mage/sets/Guru.java @@ -6,10 +6,10 @@ import mage.constants.SetType; import mage.constants.Rarity; public class Guru extends ExpansionSet { - private static final Guru fINSTANCE = new Guru(); + private static final Guru instance = new Guru(); public static Guru getInstance() { - return fINSTANCE; + return instance; } private Guru() { diff --git a/Mage.Sets/src/mage/sets/HeroesVsMonsters.java b/Mage.Sets/src/mage/sets/HeroesVsMonsters.java index 558f2fb234..9feee99f99 100644 --- a/Mage.Sets/src/mage/sets/HeroesVsMonsters.java +++ b/Mage.Sets/src/mage/sets/HeroesVsMonsters.java @@ -38,10 +38,10 @@ import mage.cards.CardGraphicInfo; */ public class HeroesVsMonsters extends ExpansionSet { - private static final HeroesVsMonsters fINSTANCE = new HeroesVsMonsters(); + private static final HeroesVsMonsters instance = new HeroesVsMonsters(); public static HeroesVsMonsters getInstance() { - return fINSTANCE; + return instance; } private HeroesVsMonsters() { diff --git a/Mage.Sets/src/mage/sets/Homelands.java b/Mage.Sets/src/mage/sets/Homelands.java index 1daaa1699a..3580843344 100644 --- a/Mage.Sets/src/mage/sets/Homelands.java +++ b/Mage.Sets/src/mage/sets/Homelands.java @@ -50,10 +50,10 @@ import mage.cards.CardGraphicInfo; */ public class Homelands extends ExpansionSet { - private static final Homelands fINSTANCE = new Homelands(); + private static final Homelands instance = new Homelands(); public static Homelands getInstance() { - return fINSTANCE; + return instance; } private Homelands() { diff --git a/Mage.Sets/src/mage/sets/HourOfDevastation.java b/Mage.Sets/src/mage/sets/HourOfDevastation.java index 1c80191496..8c0d383c22 100644 --- a/Mage.Sets/src/mage/sets/HourOfDevastation.java +++ b/Mage.Sets/src/mage/sets/HourOfDevastation.java @@ -36,10 +36,10 @@ import mage.constants.SetType; */ public class HourOfDevastation extends ExpansionSet { - private static final HourOfDevastation fINSTANCE = new HourOfDevastation(); + private static final HourOfDevastation instance = new HourOfDevastation(); public static HourOfDevastation getInstance() { - return fINSTANCE; + return instance; } private HourOfDevastation() { diff --git a/Mage.Sets/src/mage/sets/IceAge.java b/Mage.Sets/src/mage/sets/IceAge.java index 86fec7d389..71ee7713be 100644 --- a/Mage.Sets/src/mage/sets/IceAge.java +++ b/Mage.Sets/src/mage/sets/IceAge.java @@ -38,10 +38,10 @@ import mage.cards.CardGraphicInfo; */ public class IceAge extends ExpansionSet { - private static final IceAge fINSTANCE = new IceAge(); + private static final IceAge instance = new IceAge(); public static IceAge getInstance() { - return fINSTANCE; + return instance; } private IceAge() { @@ -246,7 +246,7 @@ public class IceAge extends ExpansionSet { cards.add(new SetCardInfo("Soldevi Machinist", 102, Rarity.UNCOMMON, mage.cards.s.SoldeviMachinist.class)); cards.add(new SetCardInfo("Soldevi Simulacrum", 314, Rarity.UNCOMMON, mage.cards.s.SoldeviSimulacrum.class)); cards.add(new SetCardInfo("Songs of the Damned", 48, Rarity.COMMON, mage.cards.s.SongsOfTheDamned.class)); - cards.add(new SetCardInfo("Soul Barrier", 103, Rarity.UNCOMMON, mage.cards.s.SoulBarrier.class)); + cards.add(new SetCardInfo("Soul Barrier", 103, Rarity.UNCOMMON, mage.cards.s.SoulBarrier.class)); cards.add(new SetCardInfo("Soul Kiss", 50, Rarity.COMMON, mage.cards.s.SoulKiss.class)); cards.add(new SetCardInfo("Spoils of Evil", 51, Rarity.RARE, mage.cards.s.SpoilsOfEvil.class)); cards.add(new SetCardInfo("Stampede", 153, Rarity.RARE, mage.cards.s.Stampede.class)); diff --git a/Mage.Sets/src/mage/sets/Innistrad.java b/Mage.Sets/src/mage/sets/Innistrad.java index f687790fe8..66ab52956d 100644 --- a/Mage.Sets/src/mage/sets/Innistrad.java +++ b/Mage.Sets/src/mage/sets/Innistrad.java @@ -39,10 +39,10 @@ import mage.cards.CardGraphicInfo; */ public class Innistrad extends ExpansionSet { - private static final Innistrad fINSTANCE = new Innistrad(); + private static final Innistrad instance = new Innistrad(); public static Innistrad getInstance() { - return fINSTANCE; + return instance; } private Innistrad() { diff --git a/Mage.Sets/src/mage/sets/Invasion.java b/Mage.Sets/src/mage/sets/Invasion.java index 7d6c1378bf..38a3fcb838 100644 --- a/Mage.Sets/src/mage/sets/Invasion.java +++ b/Mage.Sets/src/mage/sets/Invasion.java @@ -37,10 +37,10 @@ import mage.cards.CardGraphicInfo; * @author North */ public class Invasion extends ExpansionSet { - private static final Invasion fINSTANCE = new Invasion(); + private static final Invasion instance = new Invasion(); public static Invasion getInstance() { - return fINSTANCE; + return instance; } private Invasion() { diff --git a/Mage.Sets/src/mage/sets/IzzetVsGolgari.java b/Mage.Sets/src/mage/sets/IzzetVsGolgari.java index e2ee63e127..ced023966e 100644 --- a/Mage.Sets/src/mage/sets/IzzetVsGolgari.java +++ b/Mage.Sets/src/mage/sets/IzzetVsGolgari.java @@ -38,10 +38,10 @@ import mage.cards.CardGraphicInfo; */ public class IzzetVsGolgari extends ExpansionSet { - private static final IzzetVsGolgari fINSTANCE = new IzzetVsGolgari(); + private static final IzzetVsGolgari instance = new IzzetVsGolgari(); public static IzzetVsGolgari getInstance() { - return fINSTANCE; + return instance; } private IzzetVsGolgari() { diff --git a/Mage.Sets/src/mage/sets/JaceVsChandra.java b/Mage.Sets/src/mage/sets/JaceVsChandra.java index 23184a7a01..bc0f1f1377 100644 --- a/Mage.Sets/src/mage/sets/JaceVsChandra.java +++ b/Mage.Sets/src/mage/sets/JaceVsChandra.java @@ -17,10 +17,10 @@ import mage.cards.CardGraphicInfo; */ public class JaceVsChandra extends ExpansionSet { - private static final JaceVsChandra fINSTANCE = new JaceVsChandra(); + private static final JaceVsChandra instance = new JaceVsChandra(); public static JaceVsChandra getInstance() { - return fINSTANCE; + return instance; } private JaceVsChandra() { diff --git a/Mage.Sets/src/mage/sets/JaceVsVraska.java b/Mage.Sets/src/mage/sets/JaceVsVraska.java index 6e180bdd8e..5f0fa22e18 100644 --- a/Mage.Sets/src/mage/sets/JaceVsVraska.java +++ b/Mage.Sets/src/mage/sets/JaceVsVraska.java @@ -39,10 +39,10 @@ import mage.cards.CardGraphicInfo; */ public class JaceVsVraska extends ExpansionSet { - private static final JaceVsVraska fINSTANCE = new JaceVsVraska(); + private static final JaceVsVraska instance = new JaceVsVraska(); public static JaceVsVraska getInstance() { - return fINSTANCE; + return instance; } private JaceVsVraska() { diff --git a/Mage.Sets/src/mage/sets/JourneyIntoNyx.java b/Mage.Sets/src/mage/sets/JourneyIntoNyx.java index 45dff5d82d..aa7a33202f 100644 --- a/Mage.Sets/src/mage/sets/JourneyIntoNyx.java +++ b/Mage.Sets/src/mage/sets/JourneyIntoNyx.java @@ -38,10 +38,10 @@ import mage.constants.Rarity; */ public class JourneyIntoNyx extends ExpansionSet { - private static final JourneyIntoNyx fINSTANCE = new JourneyIntoNyx(); + private static final JourneyIntoNyx instance = new JourneyIntoNyx(); public static JourneyIntoNyx getInstance() { - return fINSTANCE; + return instance; } private JourneyIntoNyx() { diff --git a/Mage.Sets/src/mage/sets/JudgePromo.java b/Mage.Sets/src/mage/sets/JudgePromo.java index a6c06f4b07..9225c6fa42 100644 --- a/Mage.Sets/src/mage/sets/JudgePromo.java +++ b/Mage.Sets/src/mage/sets/JudgePromo.java @@ -38,10 +38,10 @@ import mage.constants.SetType; */ public class JudgePromo extends ExpansionSet { - private static final JudgePromo fINSTANCE = new JudgePromo(); + private static final JudgePromo instance = new JudgePromo(); public static JudgePromo getInstance() { - return fINSTANCE; + return instance; } private JudgePromo() { diff --git a/Mage.Sets/src/mage/sets/Judgment.java b/Mage.Sets/src/mage/sets/Judgment.java index ac2f77e38e..0d2fa87a1a 100644 --- a/Mage.Sets/src/mage/sets/Judgment.java +++ b/Mage.Sets/src/mage/sets/Judgment.java @@ -37,10 +37,10 @@ import mage.constants.SetType; */ public class Judgment extends ExpansionSet { - private static final Judgment fINSTANCE = new Judgment(); + private static final Judgment instance = new Judgment(); public static Judgment getInstance() { - return fINSTANCE; + return instance; } private Judgment() { diff --git a/Mage.Sets/src/mage/sets/Kaladesh.java b/Mage.Sets/src/mage/sets/Kaladesh.java index 75f24e41be..2a146aeb3b 100644 --- a/Mage.Sets/src/mage/sets/Kaladesh.java +++ b/Mage.Sets/src/mage/sets/Kaladesh.java @@ -43,10 +43,10 @@ import mage.cards.CardGraphicInfo; */ public class Kaladesh extends ExpansionSet { - private static final Kaladesh fINSTANCE = new Kaladesh(); + private static final Kaladesh instance = new Kaladesh(); public static Kaladesh getInstance() { - return fINSTANCE; + return instance; } protected final List savedSpecialLand = new ArrayList<>(); diff --git a/Mage.Sets/src/mage/sets/KhansOfTarkir.java b/Mage.Sets/src/mage/sets/KhansOfTarkir.java index 2c79f379ec..8fd693de69 100644 --- a/Mage.Sets/src/mage/sets/KhansOfTarkir.java +++ b/Mage.Sets/src/mage/sets/KhansOfTarkir.java @@ -40,10 +40,10 @@ import mage.cards.CardGraphicInfo; public class KhansOfTarkir extends ExpansionSet { - private static final KhansOfTarkir fINSTANCE = new KhansOfTarkir(); + private static final KhansOfTarkir instance = new KhansOfTarkir(); public static KhansOfTarkir getInstance() { - return fINSTANCE; + return instance; } private KhansOfTarkir() { diff --git a/Mage.Sets/src/mage/sets/KnightsVsDragons.java b/Mage.Sets/src/mage/sets/KnightsVsDragons.java index 1274429a93..64c9e2ecbc 100644 --- a/Mage.Sets/src/mage/sets/KnightsVsDragons.java +++ b/Mage.Sets/src/mage/sets/KnightsVsDragons.java @@ -39,10 +39,10 @@ import mage.cards.CardGraphicInfo; */ public class KnightsVsDragons extends ExpansionSet { - private static final KnightsVsDragons fINSTANCE = new KnightsVsDragons(); + private static final KnightsVsDragons instance = new KnightsVsDragons(); public static KnightsVsDragons getInstance() { - return fINSTANCE; + return instance; } private KnightsVsDragons() { diff --git a/Mage.Sets/src/mage/sets/LaunchParty.java b/Mage.Sets/src/mage/sets/LaunchParty.java index b288168811..0fb2d13d1a 100644 --- a/Mage.Sets/src/mage/sets/LaunchParty.java +++ b/Mage.Sets/src/mage/sets/LaunchParty.java @@ -38,10 +38,10 @@ import mage.constants.Rarity; */ public class LaunchParty extends ExpansionSet { - private static final LaunchParty fINSTANCE = new LaunchParty(); + private static final LaunchParty instance = new LaunchParty(); public static LaunchParty getInstance() { - return fINSTANCE; + return instance; } private LaunchParty() { diff --git a/Mage.Sets/src/mage/sets/Legends.java b/Mage.Sets/src/mage/sets/Legends.java index 34a65acb7e..e1910f5f27 100644 --- a/Mage.Sets/src/mage/sets/Legends.java +++ b/Mage.Sets/src/mage/sets/Legends.java @@ -37,10 +37,10 @@ import mage.constants.SetType; */ public class Legends extends ExpansionSet { - private static final Legends fINSTANCE = new Legends(); + private static final Legends instance = new Legends(); public static Legends getInstance() { - return fINSTANCE; + return instance; } private Legends() { diff --git a/Mage.Sets/src/mage/sets/Legions.java b/Mage.Sets/src/mage/sets/Legions.java index aad668e264..012d3efddb 100644 --- a/Mage.Sets/src/mage/sets/Legions.java +++ b/Mage.Sets/src/mage/sets/Legions.java @@ -37,10 +37,10 @@ import mage.constants.SetType; */ public class Legions extends ExpansionSet { - private static final Legions fINSTANCE = new Legions(); + private static final Legions instance = new Legions(); public static Legions getInstance() { - return fINSTANCE; + return instance; } private Legions() { diff --git a/Mage.Sets/src/mage/sets/LimitedEditionAlpha.java b/Mage.Sets/src/mage/sets/LimitedEditionAlpha.java index fc8932374f..697d8a5625 100644 --- a/Mage.Sets/src/mage/sets/LimitedEditionAlpha.java +++ b/Mage.Sets/src/mage/sets/LimitedEditionAlpha.java @@ -11,10 +11,10 @@ import mage.constants.SetType; */ public class LimitedEditionAlpha extends ExpansionSet { - private static final LimitedEditionAlpha fINSTANCE = new LimitedEditionAlpha(); + private static final LimitedEditionAlpha instance = new LimitedEditionAlpha(); public static LimitedEditionAlpha getInstance() { - return fINSTANCE; + return instance; } private LimitedEditionAlpha() { diff --git a/Mage.Sets/src/mage/sets/LimitedEditionBeta.java b/Mage.Sets/src/mage/sets/LimitedEditionBeta.java index cc95e865cf..c79fe5d381 100644 --- a/Mage.Sets/src/mage/sets/LimitedEditionBeta.java +++ b/Mage.Sets/src/mage/sets/LimitedEditionBeta.java @@ -11,10 +11,10 @@ import mage.constants.SetType; */ public class LimitedEditionBeta extends ExpansionSet { - private static final LimitedEditionBeta fINSTANCE = new LimitedEditionBeta(); + private static final LimitedEditionBeta instance = new LimitedEditionBeta(); public static LimitedEditionBeta getInstance() { - return fINSTANCE; + return instance; } private LimitedEditionBeta() { diff --git a/Mage.Sets/src/mage/sets/Lorwyn.java b/Mage.Sets/src/mage/sets/Lorwyn.java index 89aac18df3..666c5772db 100644 --- a/Mage.Sets/src/mage/sets/Lorwyn.java +++ b/Mage.Sets/src/mage/sets/Lorwyn.java @@ -38,10 +38,10 @@ import mage.constants.SetType; */ public class Lorwyn extends ExpansionSet { - private static final Lorwyn fINSTANCE = new Lorwyn(); + private static final Lorwyn instance = new Lorwyn(); public static Lorwyn getInstance() { - return fINSTANCE; + return instance; } private Lorwyn() { diff --git a/Mage.Sets/src/mage/sets/Magic2010.java b/Mage.Sets/src/mage/sets/Magic2010.java index c3c7aab982..7cf1bd5a45 100644 --- a/Mage.Sets/src/mage/sets/Magic2010.java +++ b/Mage.Sets/src/mage/sets/Magic2010.java @@ -38,10 +38,10 @@ import mage.constants.SetType; */ public class Magic2010 extends ExpansionSet { - private static final Magic2010 fINSTANCE = new Magic2010(); + private static final Magic2010 instance = new Magic2010(); public static Magic2010 getInstance() { - return fINSTANCE; + return instance; } private Magic2010() { diff --git a/Mage.Sets/src/mage/sets/Magic2011.java b/Mage.Sets/src/mage/sets/Magic2011.java index c8222aab5d..96279d9277 100644 --- a/Mage.Sets/src/mage/sets/Magic2011.java +++ b/Mage.Sets/src/mage/sets/Magic2011.java @@ -38,10 +38,10 @@ import mage.constants.SetType; */ public class Magic2011 extends ExpansionSet { - private static final Magic2011 fINSTANCE = new Magic2011(); + private static final Magic2011 instance = new Magic2011(); public static Magic2011 getInstance() { - return fINSTANCE; + return instance; } private Magic2011() { diff --git a/Mage.Sets/src/mage/sets/Magic2012.java b/Mage.Sets/src/mage/sets/Magic2012.java index 11162c672e..96683d4bd3 100644 --- a/Mage.Sets/src/mage/sets/Magic2012.java +++ b/Mage.Sets/src/mage/sets/Magic2012.java @@ -39,10 +39,10 @@ import mage.constants.SetType; */ public class Magic2012 extends ExpansionSet { - private static final Magic2012 fINSTANCE = new Magic2012(); + private static final Magic2012 instance = new Magic2012(); public static Magic2012 getInstance() { - return fINSTANCE; + return instance; } private Magic2012() { diff --git a/Mage.Sets/src/mage/sets/Magic2013.java b/Mage.Sets/src/mage/sets/Magic2013.java index ae12e6846d..1186894913 100644 --- a/Mage.Sets/src/mage/sets/Magic2013.java +++ b/Mage.Sets/src/mage/sets/Magic2013.java @@ -38,10 +38,10 @@ import mage.constants.SetType; */ public class Magic2013 extends ExpansionSet { - private static final Magic2013 fINSTANCE = new Magic2013(); + private static final Magic2013 instance = new Magic2013(); public static Magic2013 getInstance() { - return fINSTANCE; + return instance; } private Magic2013() { diff --git a/Mage.Sets/src/mage/sets/Magic2014.java b/Mage.Sets/src/mage/sets/Magic2014.java index 55a1b7af6d..ae86c59ba8 100644 --- a/Mage.Sets/src/mage/sets/Magic2014.java +++ b/Mage.Sets/src/mage/sets/Magic2014.java @@ -38,10 +38,10 @@ import mage.cards.CardGraphicInfo; */ public class Magic2014 extends ExpansionSet { - private static final Magic2014 fINSTANCE = new Magic2014(); + private static final Magic2014 instance = new Magic2014(); public static Magic2014 getInstance() { - return fINSTANCE; + return instance; } private Magic2014() { diff --git a/Mage.Sets/src/mage/sets/Magic2015.java b/Mage.Sets/src/mage/sets/Magic2015.java index e1774e7cc7..6226014def 100644 --- a/Mage.Sets/src/mage/sets/Magic2015.java +++ b/Mage.Sets/src/mage/sets/Magic2015.java @@ -38,10 +38,10 @@ import mage.cards.CardGraphicInfo; */ public class Magic2015 extends ExpansionSet { - private static final Magic2015 fINSTANCE = new Magic2015(); + private static final Magic2015 instance = new Magic2015(); public static Magic2015 getInstance() { - return fINSTANCE; + return instance; } private Magic2015() { diff --git a/Mage.Sets/src/mage/sets/MagicOrigins.java b/Mage.Sets/src/mage/sets/MagicOrigins.java index 0fa55a43ff..ab45377667 100644 --- a/Mage.Sets/src/mage/sets/MagicOrigins.java +++ b/Mage.Sets/src/mage/sets/MagicOrigins.java @@ -38,10 +38,10 @@ import mage.cards.CardGraphicInfo; */ public class MagicOrigins extends ExpansionSet { - private static final MagicOrigins fINSTANCE = new MagicOrigins(); + private static final MagicOrigins instance = new MagicOrigins(); public static MagicOrigins getInstance() { - return fINSTANCE; + return instance; } private MagicOrigins() { diff --git a/Mage.Sets/src/mage/sets/MagicPlayerRewards.java b/Mage.Sets/src/mage/sets/MagicPlayerRewards.java index 02d6a2b24c..138820e72f 100644 --- a/Mage.Sets/src/mage/sets/MagicPlayerRewards.java +++ b/Mage.Sets/src/mage/sets/MagicPlayerRewards.java @@ -35,10 +35,10 @@ import mage.constants.SetType; public class MagicPlayerRewards extends ExpansionSet { - private static final MagicPlayerRewards fINSTANCE = new MagicPlayerRewards(); + private static final MagicPlayerRewards instance = new MagicPlayerRewards(); public static MagicPlayerRewards getInstance() { - return fINSTANCE; + return instance; } private MagicPlayerRewards() { diff --git a/Mage.Sets/src/mage/sets/MasterpieceSeries.java b/Mage.Sets/src/mage/sets/MasterpieceSeries.java index 756a7ffd28..16996b9491 100644 --- a/Mage.Sets/src/mage/sets/MasterpieceSeries.java +++ b/Mage.Sets/src/mage/sets/MasterpieceSeries.java @@ -39,10 +39,10 @@ import mage.constants.SetType; */ public class MasterpieceSeries extends ExpansionSet { - private static final MasterpieceSeries fINSTANCE = new MasterpieceSeries(); + private static final MasterpieceSeries instance = new MasterpieceSeries(); public static MasterpieceSeries getInstance() { - return fINSTANCE; + return instance; } private MasterpieceSeries() { diff --git a/Mage.Sets/src/mage/sets/MastersEdition.java b/Mage.Sets/src/mage/sets/MastersEdition.java index ce9fbd305a..54995bdd0e 100644 --- a/Mage.Sets/src/mage/sets/MastersEdition.java +++ b/Mage.Sets/src/mage/sets/MastersEdition.java @@ -50,10 +50,10 @@ import mage.cards.CardGraphicInfo; */ public class MastersEdition extends ExpansionSet { - private static final MastersEdition fINSTANCE = new MastersEdition(); + private static final MastersEdition instance = new MastersEdition(); public static MastersEdition getInstance() { - return fINSTANCE; + return instance; } private MastersEdition() { diff --git a/Mage.Sets/src/mage/sets/MastersEditionII.java b/Mage.Sets/src/mage/sets/MastersEditionII.java index a6202cc8f1..b6c629f95c 100644 --- a/Mage.Sets/src/mage/sets/MastersEditionII.java +++ b/Mage.Sets/src/mage/sets/MastersEditionII.java @@ -49,10 +49,10 @@ import mage.constants.Rarity; */ public class MastersEditionII extends ExpansionSet { - private static final MastersEditionII fINSTANCE = new MastersEditionII(); + private static final MastersEditionII instance = new MastersEditionII(); public static MastersEditionII getInstance() { - return fINSTANCE; + return instance; } private MastersEditionII() { diff --git a/Mage.Sets/src/mage/sets/MastersEditionIII.java b/Mage.Sets/src/mage/sets/MastersEditionIII.java index b40b3bab75..0d36ff0f39 100644 --- a/Mage.Sets/src/mage/sets/MastersEditionIII.java +++ b/Mage.Sets/src/mage/sets/MastersEditionIII.java @@ -39,10 +39,10 @@ import mage.cards.CardGraphicInfo; */ public class MastersEditionIII extends ExpansionSet { - private static final MastersEditionIII fINSTANCE = new MastersEditionIII(); + private static final MastersEditionIII instance = new MastersEditionIII(); public static MastersEditionIII getInstance() { - return fINSTANCE; + return instance; } private MastersEditionIII() { diff --git a/Mage.Sets/src/mage/sets/MastersEditionIV.java b/Mage.Sets/src/mage/sets/MastersEditionIV.java index 73ac2e4dd7..46d047be1f 100644 --- a/Mage.Sets/src/mage/sets/MastersEditionIV.java +++ b/Mage.Sets/src/mage/sets/MastersEditionIV.java @@ -40,10 +40,10 @@ import mage.constants.Rarity; public class MastersEditionIV extends ExpansionSet { - private static final MastersEditionIV fINSTANCE = new MastersEditionIV(); + private static final MastersEditionIV instance = new MastersEditionIV(); public static MastersEditionIV getInstance() { - return fINSTANCE; + return instance; } private MastersEditionIV() { diff --git a/Mage.Sets/src/mage/sets/MediaInserts.java b/Mage.Sets/src/mage/sets/MediaInserts.java index 14461663c9..9a0d085ff7 100644 --- a/Mage.Sets/src/mage/sets/MediaInserts.java +++ b/Mage.Sets/src/mage/sets/MediaInserts.java @@ -35,10 +35,10 @@ import mage.constants.SetType; public class MediaInserts extends ExpansionSet { - private static final MediaInserts fINSTANCE = new MediaInserts(); + private static final MediaInserts instance = new MediaInserts(); public static MediaInserts getInstance() { - return fINSTANCE; + return instance; } private MediaInserts() { diff --git a/Mage.Sets/src/mage/sets/MercadianMasques.java b/Mage.Sets/src/mage/sets/MercadianMasques.java index 8599251f38..2a41ed9a48 100644 --- a/Mage.Sets/src/mage/sets/MercadianMasques.java +++ b/Mage.Sets/src/mage/sets/MercadianMasques.java @@ -38,10 +38,10 @@ import mage.cards.CardGraphicInfo; */ public class MercadianMasques extends ExpansionSet { - private static final MercadianMasques fINSTANCE = new MercadianMasques(); + private static final MercadianMasques instance = new MercadianMasques(); public static MercadianMasques getInstance() { - return fINSTANCE; + return instance; } private MercadianMasques() { diff --git a/Mage.Sets/src/mage/sets/MindVsMight.java b/Mage.Sets/src/mage/sets/MindVsMight.java index a173595446..85917b2091 100644 --- a/Mage.Sets/src/mage/sets/MindVsMight.java +++ b/Mage.Sets/src/mage/sets/MindVsMight.java @@ -15,10 +15,10 @@ import mage.constants.SetType; */ public class MindVsMight extends ExpansionSet { - private static final MindVsMight fINSTANCE = new MindVsMight(); + private static final MindVsMight instance = new MindVsMight(); public static MindVsMight getInstance() { - return fINSTANCE; + return instance; } private MindVsMight() { diff --git a/Mage.Sets/src/mage/sets/Mirage.java b/Mage.Sets/src/mage/sets/Mirage.java index b8f4790032..f87acb37e5 100644 --- a/Mage.Sets/src/mage/sets/Mirage.java +++ b/Mage.Sets/src/mage/sets/Mirage.java @@ -37,10 +37,10 @@ import mage.cards.CardGraphicInfo; * @author North */ public class Mirage extends ExpansionSet { - private static final Mirage fINSTANCE = new Mirage(); + private static final Mirage instance = new Mirage(); public static Mirage getInstance() { - return fINSTANCE; + return instance; } private Mirage() { diff --git a/Mage.Sets/src/mage/sets/Mirrodin.java b/Mage.Sets/src/mage/sets/Mirrodin.java index 4536953e91..1cc14bfb61 100644 --- a/Mage.Sets/src/mage/sets/Mirrodin.java +++ b/Mage.Sets/src/mage/sets/Mirrodin.java @@ -7,10 +7,10 @@ import mage.constants.Rarity; import mage.cards.CardGraphicInfo; public class Mirrodin extends ExpansionSet { - private static final Mirrodin fINSTANCE = new Mirrodin(); + private static final Mirrodin instance = new Mirrodin(); public static Mirrodin getInstance() { - return fINSTANCE; + return instance; } private Mirrodin() { diff --git a/Mage.Sets/src/mage/sets/MirrodinBesieged.java b/Mage.Sets/src/mage/sets/MirrodinBesieged.java index d09690def7..e0022b9d8e 100644 --- a/Mage.Sets/src/mage/sets/MirrodinBesieged.java +++ b/Mage.Sets/src/mage/sets/MirrodinBesieged.java @@ -39,10 +39,10 @@ import mage.cards.CardGraphicInfo; */ public class MirrodinBesieged extends ExpansionSet { - private static final MirrodinBesieged fINSTANCE = new MirrodinBesieged(); + private static final MirrodinBesieged instance = new MirrodinBesieged(); public static MirrodinBesieged getInstance() { - return fINSTANCE; + return instance; } private MirrodinBesieged() { diff --git a/Mage.Sets/src/mage/sets/ModernMasters.java b/Mage.Sets/src/mage/sets/ModernMasters.java index f4656440ce..b34969203c 100644 --- a/Mage.Sets/src/mage/sets/ModernMasters.java +++ b/Mage.Sets/src/mage/sets/ModernMasters.java @@ -38,10 +38,10 @@ import mage.constants.Rarity; */ public class ModernMasters extends ExpansionSet { - private static final ModernMasters fINSTANCE = new ModernMasters(); + private static final ModernMasters instance = new ModernMasters(); public static ModernMasters getInstance() { - return fINSTANCE; + return instance; } private ModernMasters() { diff --git a/Mage.Sets/src/mage/sets/ModernMasters2015.java b/Mage.Sets/src/mage/sets/ModernMasters2015.java index 632816327b..42d5229435 100644 --- a/Mage.Sets/src/mage/sets/ModernMasters2015.java +++ b/Mage.Sets/src/mage/sets/ModernMasters2015.java @@ -38,10 +38,10 @@ import mage.constants.Rarity; */ public class ModernMasters2015 extends ExpansionSet { - private static final ModernMasters2015 fINSTANCE = new ModernMasters2015(); + private static final ModernMasters2015 instance = new ModernMasters2015(); public static ModernMasters2015 getInstance() { - return fINSTANCE; + return instance; } private ModernMasters2015() { diff --git a/Mage.Sets/src/mage/sets/ModernMasters2017.java b/Mage.Sets/src/mage/sets/ModernMasters2017.java index 3268d8b64b..483bfc4307 100644 --- a/Mage.Sets/src/mage/sets/ModernMasters2017.java +++ b/Mage.Sets/src/mage/sets/ModernMasters2017.java @@ -37,10 +37,10 @@ import mage.constants.SetType; */ public class ModernMasters2017 extends ExpansionSet { - private static final ModernMasters2017 fINSTANCE = new ModernMasters2017(); + private static final ModernMasters2017 instance = new ModernMasters2017(); public static ModernMasters2017 getInstance() { - return fINSTANCE; + return instance; } private ModernMasters2017() { diff --git a/Mage.Sets/src/mage/sets/Morningtide.java b/Mage.Sets/src/mage/sets/Morningtide.java index e83235a820..585ab547a5 100644 --- a/Mage.Sets/src/mage/sets/Morningtide.java +++ b/Mage.Sets/src/mage/sets/Morningtide.java @@ -37,10 +37,10 @@ import mage.constants.Rarity; */ public class Morningtide extends ExpansionSet { - private static final Morningtide fINSTANCE = new Morningtide(); + private static final Morningtide instance = new Morningtide(); public static Morningtide getInstance() { - return fINSTANCE; + return instance; } private Morningtide() { diff --git a/Mage.Sets/src/mage/sets/Nemesis.java b/Mage.Sets/src/mage/sets/Nemesis.java index b52b409257..2a01e357a0 100644 --- a/Mage.Sets/src/mage/sets/Nemesis.java +++ b/Mage.Sets/src/mage/sets/Nemesis.java @@ -37,10 +37,10 @@ import mage.constants.SetType; */ public class Nemesis extends ExpansionSet { - private static final Nemesis fINSTANCE = new Nemesis(); + private static final Nemesis instance = new Nemesis(); public static Nemesis getInstance() { - return fINSTANCE; + return instance; } private Nemesis() { diff --git a/Mage.Sets/src/mage/sets/NewPhyrexia.java b/Mage.Sets/src/mage/sets/NewPhyrexia.java index adf5a1b643..d1da556e4e 100644 --- a/Mage.Sets/src/mage/sets/NewPhyrexia.java +++ b/Mage.Sets/src/mage/sets/NewPhyrexia.java @@ -6,10 +6,10 @@ import mage.constants.Rarity; import mage.cards.CardGraphicInfo; public class NewPhyrexia extends ExpansionSet { - private static final NewPhyrexia fINSTANCE = new NewPhyrexia(); + private static final NewPhyrexia instance = new NewPhyrexia(); public static NewPhyrexia getInstance() { - return fINSTANCE; + return instance; } private NewPhyrexia() { diff --git a/Mage.Sets/src/mage/sets/NinthEdition.java b/Mage.Sets/src/mage/sets/NinthEdition.java index 6f74a56c04..7eff94893e 100644 --- a/Mage.Sets/src/mage/sets/NinthEdition.java +++ b/Mage.Sets/src/mage/sets/NinthEdition.java @@ -9,10 +9,10 @@ import mage.cards.CardGraphicInfo; public class NinthEdition extends ExpansionSet { - private static final NinthEdition fINSTANCE = new NinthEdition(); + private static final NinthEdition instance = new NinthEdition(); public static NinthEdition getInstance() { - return fINSTANCE; + return instance; } private NinthEdition() { diff --git a/Mage.Sets/src/mage/sets/NissaVsObNixilis.java b/Mage.Sets/src/mage/sets/NissaVsObNixilis.java index a581c99d26..48d4a937ee 100644 --- a/Mage.Sets/src/mage/sets/NissaVsObNixilis.java +++ b/Mage.Sets/src/mage/sets/NissaVsObNixilis.java @@ -38,10 +38,10 @@ import mage.constants.SetType; */ public class NissaVsObNixilis extends ExpansionSet { - private static final NissaVsObNixilis fINSTANCE = new NissaVsObNixilis(); + private static final NissaVsObNixilis instance = new NissaVsObNixilis(); public static NissaVsObNixilis getInstance() { - return fINSTANCE; + return instance; } private NissaVsObNixilis() { diff --git a/Mage.Sets/src/mage/sets/OathOfTheGatewatch.java b/Mage.Sets/src/mage/sets/OathOfTheGatewatch.java index fd9ba8fc68..575d3fec07 100644 --- a/Mage.Sets/src/mage/sets/OathOfTheGatewatch.java +++ b/Mage.Sets/src/mage/sets/OathOfTheGatewatch.java @@ -23,10 +23,10 @@ import mage.constants.SetType; */ public class OathOfTheGatewatch extends ExpansionSet { - private static final OathOfTheGatewatch fINSTANCE = new OathOfTheGatewatch(); + private static final OathOfTheGatewatch instance = new OathOfTheGatewatch(); public static OathOfTheGatewatch getInstance() { - return fINSTANCE; + return instance; } protected final List savedSpecialLand = new ArrayList<>(); diff --git a/Mage.Sets/src/mage/sets/Odyssey.java b/Mage.Sets/src/mage/sets/Odyssey.java index 3ae78d7de9..ca9b9e1624 100644 --- a/Mage.Sets/src/mage/sets/Odyssey.java +++ b/Mage.Sets/src/mage/sets/Odyssey.java @@ -37,10 +37,10 @@ import mage.constants.SetType; * @author North */ public class Odyssey extends ExpansionSet { - private static final Odyssey fINSTANCE = new Odyssey(); + private static final Odyssey instance = new Odyssey(); public static Odyssey getInstance() { - return fINSTANCE; + return instance; } private Odyssey() { diff --git a/Mage.Sets/src/mage/sets/Onslaught.java b/Mage.Sets/src/mage/sets/Onslaught.java index 2805973f89..2da60daa8b 100644 --- a/Mage.Sets/src/mage/sets/Onslaught.java +++ b/Mage.Sets/src/mage/sets/Onslaught.java @@ -8,10 +8,10 @@ import mage.ObjectColor; import mage.cards.CardGraphicInfo; public class Onslaught extends ExpansionSet { - private static final Onslaught fINSTANCE = new Onslaught(); + private static final Onslaught instance = new Onslaught(); public static Onslaught getInstance() { - return fINSTANCE; + return instance; } private Onslaught() { @@ -40,7 +40,7 @@ public class Onslaught extends ExpansionSet { cards.add(new SetCardInfo("Arcanis the Omnipotent", 66, Rarity.RARE, mage.cards.a.ArcanisTheOmnipotent.class)); cards.add(new SetCardInfo("Ascending Aven", 68, Rarity.COMMON, mage.cards.a.AscendingAven.class)); cards.add(new SetCardInfo("Astral Slide", 4, Rarity.UNCOMMON, mage.cards.a.AstralSlide.class)); - cards.add(new SetCardInfo("Aura Extraction", 5, Rarity.UNCOMMON, mage.cards.a.AuraExtraction.class)); + cards.add(new SetCardInfo("Aura Extraction", 5, Rarity.UNCOMMON, mage.cards.a.AuraExtraction.class)); cards.add(new SetCardInfo("Aurification", 6, Rarity.RARE, mage.cards.a.Aurification.class)); cards.add(new SetCardInfo("Avarax", 187, Rarity.UNCOMMON, mage.cards.a.Avarax.class)); cards.add(new SetCardInfo("Aven Brigadier", 7, Rarity.RARE, mage.cards.a.AvenBrigadier.class)); diff --git a/Mage.Sets/src/mage/sets/PDSFireAndLightning.java b/Mage.Sets/src/mage/sets/PDSFireAndLightning.java index 62fe447227..1773ecf3de 100644 --- a/Mage.Sets/src/mage/sets/PDSFireAndLightning.java +++ b/Mage.Sets/src/mage/sets/PDSFireAndLightning.java @@ -38,10 +38,10 @@ import mage.constants.SetType; */ public class PDSFireAndLightning extends ExpansionSet { - private static final PDSFireAndLightning fINSTANCE = new PDSFireAndLightning(); + private static final PDSFireAndLightning instance = new PDSFireAndLightning(); public static PDSFireAndLightning getInstance() { - return fINSTANCE; + return instance; } private PDSFireAndLightning() { diff --git a/Mage.Sets/src/mage/sets/PDSGraveborn.java b/Mage.Sets/src/mage/sets/PDSGraveborn.java index 8e54ee713e..982f7fa277 100644 --- a/Mage.Sets/src/mage/sets/PDSGraveborn.java +++ b/Mage.Sets/src/mage/sets/PDSGraveborn.java @@ -38,10 +38,10 @@ import mage.cards.CardGraphicInfo; * @author fireshoes */ public class PDSGraveborn extends ExpansionSet { - private static final PDSGraveborn fINSTANCE = new PDSGraveborn(); + private static final PDSGraveborn instance = new PDSGraveborn(); public static PDSGraveborn getInstance() { - return fINSTANCE; + return instance; } private PDSGraveborn() { diff --git a/Mage.Sets/src/mage/sets/PDSSlivers.java b/Mage.Sets/src/mage/sets/PDSSlivers.java index 1b08d364b8..da7e2134f7 100644 --- a/Mage.Sets/src/mage/sets/PDSSlivers.java +++ b/Mage.Sets/src/mage/sets/PDSSlivers.java @@ -38,10 +38,10 @@ import mage.cards.CardGraphicInfo; * @author fireshoes */ public class PDSSlivers extends ExpansionSet { - private static final PDSSlivers fINSTANCE = new PDSSlivers(); + private static final PDSSlivers instance = new PDSSlivers(); public static PDSSlivers getInstance() { - return fINSTANCE; + return instance; } private PDSSlivers() { diff --git a/Mage.Sets/src/mage/sets/PhyrexiaVsTheCoalition.java b/Mage.Sets/src/mage/sets/PhyrexiaVsTheCoalition.java index a3f83a8453..cecdaa33a1 100644 --- a/Mage.Sets/src/mage/sets/PhyrexiaVsTheCoalition.java +++ b/Mage.Sets/src/mage/sets/PhyrexiaVsTheCoalition.java @@ -38,10 +38,10 @@ import mage.constants.SetType; */ public class PhyrexiaVsTheCoalition extends ExpansionSet { - private static final PhyrexiaVsTheCoalition fINSTANCE = new PhyrexiaVsTheCoalition(); + private static final PhyrexiaVsTheCoalition instance = new PhyrexiaVsTheCoalition(); public static PhyrexiaVsTheCoalition getInstance() { - return fINSTANCE; + return instance; } private PhyrexiaVsTheCoalition() { diff --git a/Mage.Sets/src/mage/sets/PlanarChaos.java b/Mage.Sets/src/mage/sets/PlanarChaos.java index 1d02a8a859..5b0c74f06f 100644 --- a/Mage.Sets/src/mage/sets/PlanarChaos.java +++ b/Mage.Sets/src/mage/sets/PlanarChaos.java @@ -37,10 +37,10 @@ import mage.constants.Rarity; */ public class PlanarChaos extends ExpansionSet { - private static final PlanarChaos fINSTANCE = new PlanarChaos(); + private static final PlanarChaos instance = new PlanarChaos(); public static PlanarChaos getInstance() { - return fINSTANCE; + return instance; } private PlanarChaos() { diff --git a/Mage.Sets/src/mage/sets/Planechase.java b/Mage.Sets/src/mage/sets/Planechase.java index 3b67d5da14..070e4e04aa 100644 --- a/Mage.Sets/src/mage/sets/Planechase.java +++ b/Mage.Sets/src/mage/sets/Planechase.java @@ -39,10 +39,10 @@ import mage.cards.CardGraphicInfo; */ public class Planechase extends ExpansionSet { - private static final Planechase fINSTANCE = new Planechase(); + private static final Planechase instance = new Planechase(); public static Planechase getInstance() { - return fINSTANCE; + return instance; } private Planechase() { diff --git a/Mage.Sets/src/mage/sets/Planechase2012.java b/Mage.Sets/src/mage/sets/Planechase2012.java index f193adad00..39ab1ff613 100644 --- a/Mage.Sets/src/mage/sets/Planechase2012.java +++ b/Mage.Sets/src/mage/sets/Planechase2012.java @@ -39,10 +39,10 @@ import mage.cards.CardGraphicInfo; */ public class Planechase2012 extends ExpansionSet { - private static final Planechase2012 fINSTANCE = new Planechase2012(); + private static final Planechase2012 instance = new Planechase2012(); public static Planechase2012 getInstance() { - return fINSTANCE; + return instance; } private Planechase2012() { diff --git a/Mage.Sets/src/mage/sets/PlanechaseAnthology.java b/Mage.Sets/src/mage/sets/PlanechaseAnthology.java index f5b7f67cf7..282446ed50 100644 --- a/Mage.Sets/src/mage/sets/PlanechaseAnthology.java +++ b/Mage.Sets/src/mage/sets/PlanechaseAnthology.java @@ -36,10 +36,10 @@ import mage.constants.SetType; */ public class PlanechaseAnthology extends ExpansionSet { - private static final PlanechaseAnthology fINSTANCE = new PlanechaseAnthology(); + private static final PlanechaseAnthology instance = new PlanechaseAnthology(); public static PlanechaseAnthology getInstance() { - return fINSTANCE; + return instance; } private PlanechaseAnthology() { diff --git a/Mage.Sets/src/mage/sets/Planeshift.java b/Mage.Sets/src/mage/sets/Planeshift.java index 26a48fe2a8..0a0f53c08f 100644 --- a/Mage.Sets/src/mage/sets/Planeshift.java +++ b/Mage.Sets/src/mage/sets/Planeshift.java @@ -41,10 +41,10 @@ import mage.cards.CardGraphicInfo; */ public class Planeshift extends ExpansionSet { - private static final Planeshift fINSTANCE = new Planeshift(); + private static final Planeshift instance = new Planeshift(); public static Planeshift getInstance() { - return fINSTANCE; + return instance; } private Planeshift() { @@ -82,7 +82,7 @@ public class Planeshift extends ExpansionSet { cards.add(new SetCardInfo("Disciple of Kangee", 3, Rarity.COMMON, mage.cards.d.DiscipleOfKangee.class)); cards.add(new SetCardInfo("Doomsday Specter", 103, Rarity.RARE, mage.cards.d.DoomsdaySpecter.class)); cards.add(new SetCardInfo("Draco", 131, Rarity.RARE, mage.cards.d.Draco.class)); - cards.add(new SetCardInfo("Dralnu's Crusade", 104, Rarity.RARE, mage.cards.d.DralnusCrusade.class)); + cards.add(new SetCardInfo("Dralnu's Crusade", 104, Rarity.RARE, mage.cards.d.DralnusCrusade.class)); cards.add(new SetCardInfo("Dralnu's Pet", 23, Rarity.RARE, mage.cards.d.DralnusPet.class)); cards.add(new SetCardInfo("Dromar's Cavern", 138, Rarity.UNCOMMON, mage.cards.d.DromarsCavern.class)); cards.add(new SetCardInfo("Dromar's Charm", 105, Rarity.UNCOMMON, mage.cards.d.DromarsCharm.class)); diff --git a/Mage.Sets/src/mage/sets/Portal.java b/Mage.Sets/src/mage/sets/Portal.java index 7a5d483fc6..ec9e5ed50d 100644 --- a/Mage.Sets/src/mage/sets/Portal.java +++ b/Mage.Sets/src/mage/sets/Portal.java @@ -43,14 +43,14 @@ import mage.cards.CardGraphicInfo; public class Portal extends ExpansionSet { - private static final Portal fINSTANCE = new Portal(); + private static final Portal instance = new Portal(); /** * * @return */ public static Portal getInstance() { - return fINSTANCE; + return instance; } private Portal() { diff --git a/Mage.Sets/src/mage/sets/PortalSecondAge.java b/Mage.Sets/src/mage/sets/PortalSecondAge.java index 0f4e18b02d..9588d57792 100644 --- a/Mage.Sets/src/mage/sets/PortalSecondAge.java +++ b/Mage.Sets/src/mage/sets/PortalSecondAge.java @@ -40,14 +40,14 @@ import mage.cards.CardGraphicInfo; public class PortalSecondAge extends ExpansionSet { - private static final PortalSecondAge fINSTANCE = new PortalSecondAge(); + private static final PortalSecondAge instance = new PortalSecondAge(); /** * * @return */ public static PortalSecondAge getInstance() { - return fINSTANCE; + return instance; } private PortalSecondAge() { diff --git a/Mage.Sets/src/mage/sets/PortalThreeKingdoms.java b/Mage.Sets/src/mage/sets/PortalThreeKingdoms.java index 20faf9156a..a68fb16f6d 100644 --- a/Mage.Sets/src/mage/sets/PortalThreeKingdoms.java +++ b/Mage.Sets/src/mage/sets/PortalThreeKingdoms.java @@ -39,10 +39,10 @@ import mage.cards.CardGraphicInfo; */ public class PortalThreeKingdoms extends ExpansionSet { - private static final PortalThreeKingdoms fINSTANCE = new PortalThreeKingdoms(); + private static final PortalThreeKingdoms instance = new PortalThreeKingdoms(); public static PortalThreeKingdoms getInstance() { - return fINSTANCE; + return instance; } private PortalThreeKingdoms() { diff --git a/Mage.Sets/src/mage/sets/PrereleaseEvents.java b/Mage.Sets/src/mage/sets/PrereleaseEvents.java index c862031764..53cc15c0cf 100644 --- a/Mage.Sets/src/mage/sets/PrereleaseEvents.java +++ b/Mage.Sets/src/mage/sets/PrereleaseEvents.java @@ -7,10 +7,10 @@ import mage.constants.Rarity; import mage.cards.CardGraphicInfo; public class PrereleaseEvents extends ExpansionSet { - private static final PrereleaseEvents fINSTANCE = new PrereleaseEvents(); + private static final PrereleaseEvents instance = new PrereleaseEvents(); public static PrereleaseEvents getInstance() { - return fINSTANCE; + return instance; } private PrereleaseEvents() { diff --git a/Mage.Sets/src/mage/sets/Prophecy.java b/Mage.Sets/src/mage/sets/Prophecy.java index 601b124548..4d588bfdc1 100644 --- a/Mage.Sets/src/mage/sets/Prophecy.java +++ b/Mage.Sets/src/mage/sets/Prophecy.java @@ -37,10 +37,10 @@ import mage.constants.SetType; */ public class Prophecy extends ExpansionSet { - private static final Prophecy fINSTANCE = new Prophecy(); + private static final Prophecy instance = new Prophecy(); public static Prophecy getInstance() { - return fINSTANCE; + return instance; } private Prophecy() { diff --git a/Mage.Sets/src/mage/sets/RavnicaCityOfGuilds.java b/Mage.Sets/src/mage/sets/RavnicaCityOfGuilds.java index c70c0efbe4..724a71792c 100644 --- a/Mage.Sets/src/mage/sets/RavnicaCityOfGuilds.java +++ b/Mage.Sets/src/mage/sets/RavnicaCityOfGuilds.java @@ -39,10 +39,10 @@ import mage.cards.CardGraphicInfo; * @author loki */ public class RavnicaCityOfGuilds extends ExpansionSet { - private static final RavnicaCityOfGuilds fINSTANCE = new RavnicaCityOfGuilds(); + private static final RavnicaCityOfGuilds instance = new RavnicaCityOfGuilds(); public static RavnicaCityOfGuilds getInstance() { - return fINSTANCE; + return instance; } private RavnicaCityOfGuilds() { @@ -65,7 +65,7 @@ public class RavnicaCityOfGuilds extends ExpansionSet { cards.add(new SetCardInfo("Blazing Archon", 4, Rarity.RARE, mage.cards.b.BlazingArchon.class)); cards.add(new SetCardInfo("Blockbuster", 115, Rarity.UNCOMMON, mage.cards.b.Blockbuster.class)); cards.add(new SetCardInfo("Blood Funnel", 77, Rarity.RARE, mage.cards.b.BloodFunnel.class)); - cards.add(new SetCardInfo("Bloodbond March", 192, Rarity.RARE, mage.cards.b.BloodbondMarch.class)); + cards.add(new SetCardInfo("Bloodbond March", 192, Rarity.RARE, mage.cards.b.BloodbondMarch.class)); cards.add(new SetCardInfo("Boros Fury-Shield", 5, Rarity.COMMON, mage.cards.b.BorosFuryShield.class)); cards.add(new SetCardInfo("Boros Garrison", 275, Rarity.COMMON, mage.cards.b.BorosGarrison.class)); cards.add(new SetCardInfo("Boros Guildmage", 242, Rarity.UNCOMMON, mage.cards.b.BorosGuildmage.class)); @@ -90,7 +90,7 @@ public class RavnicaCityOfGuilds extends ExpansionSet { cards.add(new SetCardInfo("Clinging Darkness", 80, Rarity.COMMON, mage.cards.c.ClingingDarkness.class)); cards.add(new SetCardInfo("Cloudstone Curio", 257, Rarity.RARE, mage.cards.c.CloudstoneCurio.class)); cards.add(new SetCardInfo("Clutch of the Undercity", 197, Rarity.UNCOMMON, mage.cards.c.ClutchOfTheUndercity.class)); - cards.add(new SetCardInfo("Coalhauler Swine", 119, Rarity.COMMON, mage.cards.c.CoalhaulerSwine.class)); + cards.add(new SetCardInfo("Coalhauler Swine", 119, Rarity.COMMON, mage.cards.c.CoalhaulerSwine.class)); cards.add(new SetCardInfo("Compulsive Research", 40, Rarity.COMMON, mage.cards.c.CompulsiveResearch.class)); cards.add(new SetCardInfo("Concerted Effort", 8, Rarity.RARE, mage.cards.c.ConcertedEffort.class)); cards.add(new SetCardInfo("Conclave Equenaut", 9, Rarity.COMMON, mage.cards.c.ConclaveEquenaut.class)); diff --git a/Mage.Sets/src/mage/sets/ReturnToRavnica.java b/Mage.Sets/src/mage/sets/ReturnToRavnica.java index 8fe6649382..868d399c74 100644 --- a/Mage.Sets/src/mage/sets/ReturnToRavnica.java +++ b/Mage.Sets/src/mage/sets/ReturnToRavnica.java @@ -39,10 +39,10 @@ import mage.cards.CardGraphicInfo; */ public class ReturnToRavnica extends ExpansionSet { - private static final ReturnToRavnica fINSTANCE = new ReturnToRavnica(); + private static final ReturnToRavnica instance = new ReturnToRavnica(); public static ReturnToRavnica getInstance() { - return fINSTANCE; + return instance; } private ReturnToRavnica() { diff --git a/Mage.Sets/src/mage/sets/RevisedEdition.java b/Mage.Sets/src/mage/sets/RevisedEdition.java index db1fd03ab4..e66688be20 100644 --- a/Mage.Sets/src/mage/sets/RevisedEdition.java +++ b/Mage.Sets/src/mage/sets/RevisedEdition.java @@ -11,10 +11,10 @@ import mage.cards.CardGraphicInfo; */ public class RevisedEdition extends ExpansionSet { - private static final RevisedEdition fINSTANCE = new RevisedEdition(); + private static final RevisedEdition instance = new RevisedEdition(); public static RevisedEdition getInstance() { - return fINSTANCE; + return instance; } private RevisedEdition() { diff --git a/Mage.Sets/src/mage/sets/RiseOfTheEldrazi.java b/Mage.Sets/src/mage/sets/RiseOfTheEldrazi.java index 5f555442a7..233e629679 100644 --- a/Mage.Sets/src/mage/sets/RiseOfTheEldrazi.java +++ b/Mage.Sets/src/mage/sets/RiseOfTheEldrazi.java @@ -39,10 +39,10 @@ import mage.cards.CardGraphicInfo; */ public class RiseOfTheEldrazi extends ExpansionSet { - private static final RiseOfTheEldrazi fINSTANCE = new RiseOfTheEldrazi(); + private static final RiseOfTheEldrazi instance = new RiseOfTheEldrazi(); public static RiseOfTheEldrazi getInstance() { - return fINSTANCE; + return instance; } private RiseOfTheEldrazi() { diff --git a/Mage.Sets/src/mage/sets/SaviorsOfKamigawa.java b/Mage.Sets/src/mage/sets/SaviorsOfKamigawa.java index 7dfe4b7093..322e155e36 100644 --- a/Mage.Sets/src/mage/sets/SaviorsOfKamigawa.java +++ b/Mage.Sets/src/mage/sets/SaviorsOfKamigawa.java @@ -37,10 +37,10 @@ import mage.constants.Rarity; */ public class SaviorsOfKamigawa extends ExpansionSet { - private static final SaviorsOfKamigawa fINSTANCE = new SaviorsOfKamigawa(); + private static final SaviorsOfKamigawa instance = new SaviorsOfKamigawa(); public static SaviorsOfKamigawa getInstance() { - return fINSTANCE; + return instance; } private SaviorsOfKamigawa() { diff --git a/Mage.Sets/src/mage/sets/ScarsOfMirrodin.java b/Mage.Sets/src/mage/sets/ScarsOfMirrodin.java index d0550abc01..494766e7c9 100644 --- a/Mage.Sets/src/mage/sets/ScarsOfMirrodin.java +++ b/Mage.Sets/src/mage/sets/ScarsOfMirrodin.java @@ -40,10 +40,10 @@ import mage.cards.CardGraphicInfo; */ public class ScarsOfMirrodin extends ExpansionSet { - private static final ScarsOfMirrodin fINSTANCE = new ScarsOfMirrodin(); + private static final ScarsOfMirrodin instance = new ScarsOfMirrodin(); public static ScarsOfMirrodin getInstance() { - return fINSTANCE; + return instance; } private ScarsOfMirrodin() { diff --git a/Mage.Sets/src/mage/sets/Scourge.java b/Mage.Sets/src/mage/sets/Scourge.java index edbe008030..fe48db6930 100644 --- a/Mage.Sets/src/mage/sets/Scourge.java +++ b/Mage.Sets/src/mage/sets/Scourge.java @@ -37,10 +37,10 @@ import mage.constants.SetType; */ public class Scourge extends ExpansionSet { - private static final Scourge fINSTANCE = new Scourge(); + private static final Scourge instance = new Scourge(); public static Scourge getInstance() { - return fINSTANCE; + return instance; } private Scourge() { diff --git a/Mage.Sets/src/mage/sets/SeventhEdition.java b/Mage.Sets/src/mage/sets/SeventhEdition.java index ba306fa24f..f2985a4bf5 100644 --- a/Mage.Sets/src/mage/sets/SeventhEdition.java +++ b/Mage.Sets/src/mage/sets/SeventhEdition.java @@ -40,10 +40,10 @@ import mage.cards.CardGraphicInfo; */ public class SeventhEdition extends ExpansionSet { - private static final SeventhEdition fINSTANCE = new SeventhEdition(); + private static final SeventhEdition instance = new SeventhEdition(); public static SeventhEdition getInstance() { - return fINSTANCE; + return instance; } private SeventhEdition() { diff --git a/Mage.Sets/src/mage/sets/Shadowmoor.java b/Mage.Sets/src/mage/sets/Shadowmoor.java index 3974daf686..6851420fb5 100644 --- a/Mage.Sets/src/mage/sets/Shadowmoor.java +++ b/Mage.Sets/src/mage/sets/Shadowmoor.java @@ -39,10 +39,10 @@ import mage.cards.CardGraphicInfo; */ public class Shadowmoor extends ExpansionSet { - private static final Shadowmoor fINSTANCE = new Shadowmoor(); + private static final Shadowmoor instance = new Shadowmoor(); public static Shadowmoor getInstance() { - return fINSTANCE; + return instance; } private Shadowmoor() { diff --git a/Mage.Sets/src/mage/sets/ShadowsOverInnistrad.java b/Mage.Sets/src/mage/sets/ShadowsOverInnistrad.java index 0e3b120cca..12076b4d98 100644 --- a/Mage.Sets/src/mage/sets/ShadowsOverInnistrad.java +++ b/Mage.Sets/src/mage/sets/ShadowsOverInnistrad.java @@ -46,10 +46,10 @@ import mage.util.RandomUtil; */ public class ShadowsOverInnistrad extends ExpansionSet { - private static final ShadowsOverInnistrad fINSTANCE = new ShadowsOverInnistrad(); + private static final ShadowsOverInnistrad instance = new ShadowsOverInnistrad(); public static ShadowsOverInnistrad getInstance() { - return fINSTANCE; + return instance; } protected final EnumMap> savedDoubleFacedCards; diff --git a/Mage.Sets/src/mage/sets/ShardsOfAlara.java b/Mage.Sets/src/mage/sets/ShardsOfAlara.java index 06f025ef79..f66e40c035 100644 --- a/Mage.Sets/src/mage/sets/ShardsOfAlara.java +++ b/Mage.Sets/src/mage/sets/ShardsOfAlara.java @@ -39,10 +39,10 @@ import mage.cards.CardGraphicInfo; */ public class ShardsOfAlara extends ExpansionSet { - private static final ShardsOfAlara fINSTANCE = new ShardsOfAlara(); + private static final ShardsOfAlara instance = new ShardsOfAlara(); public static ShardsOfAlara getInstance() { - return fINSTANCE; + return instance; } private ShardsOfAlara() { diff --git a/Mage.Sets/src/mage/sets/SorinVsTibalt.java b/Mage.Sets/src/mage/sets/SorinVsTibalt.java index 968fcd1e18..ab02721d53 100644 --- a/Mage.Sets/src/mage/sets/SorinVsTibalt.java +++ b/Mage.Sets/src/mage/sets/SorinVsTibalt.java @@ -38,10 +38,10 @@ import mage.cards.CardGraphicInfo; */ public class SorinVsTibalt extends ExpansionSet { - private static final SorinVsTibalt fINSTANCE = new SorinVsTibalt(); + private static final SorinVsTibalt instance = new SorinVsTibalt(); public static SorinVsTibalt getInstance() { - return fINSTANCE; + return instance; } private SorinVsTibalt() { diff --git a/Mage.Sets/src/mage/sets/SpeedVsCunning.java b/Mage.Sets/src/mage/sets/SpeedVsCunning.java index c858d3daf4..1acab45019 100644 --- a/Mage.Sets/src/mage/sets/SpeedVsCunning.java +++ b/Mage.Sets/src/mage/sets/SpeedVsCunning.java @@ -38,10 +38,10 @@ import mage.cards.CardGraphicInfo; */ public class SpeedVsCunning extends ExpansionSet { - private static final SpeedVsCunning fINSTANCE = new SpeedVsCunning(); + private static final SpeedVsCunning instance = new SpeedVsCunning(); public static SpeedVsCunning getInstance() { - return fINSTANCE; + return instance; } private SpeedVsCunning() { diff --git a/Mage.Sets/src/mage/sets/StarWars.java b/Mage.Sets/src/mage/sets/StarWars.java index c0e7562633..3e3a693b2f 100644 --- a/Mage.Sets/src/mage/sets/StarWars.java +++ b/Mage.Sets/src/mage/sets/StarWars.java @@ -39,10 +39,10 @@ import mage.constants.SetType; */ public class StarWars extends ExpansionSet { - private static final StarWars fINSTANCE = new StarWars(); + private static final StarWars instance = new StarWars(); public static StarWars getInstance() { - return fINSTANCE; + return instance; } private StarWars() { diff --git a/Mage.Sets/src/mage/sets/Starter1999.java b/Mage.Sets/src/mage/sets/Starter1999.java index c1bcf1a98d..d5c35548c1 100644 --- a/Mage.Sets/src/mage/sets/Starter1999.java +++ b/Mage.Sets/src/mage/sets/Starter1999.java @@ -39,10 +39,10 @@ import mage.cards.CardGraphicInfo; */ public class Starter1999 extends ExpansionSet { - private static final Starter1999 fINSTANCE = new Starter1999(); + private static final Starter1999 instance = new Starter1999(); public static Starter1999 getInstance() { - return fINSTANCE; + return instance; } private Starter1999() { diff --git a/Mage.Sets/src/mage/sets/Starter2000.java b/Mage.Sets/src/mage/sets/Starter2000.java index b1d56c9eb4..dbb0586a65 100644 --- a/Mage.Sets/src/mage/sets/Starter2000.java +++ b/Mage.Sets/src/mage/sets/Starter2000.java @@ -40,14 +40,14 @@ import mage.cards.CardGraphicInfo; public class Starter2000 extends ExpansionSet { - private static final Starter2000 fINSTANCE = new Starter2000(); + private static final Starter2000 instance = new Starter2000(); /** * * @return */ public static Starter2000 getInstance() { - return fINSTANCE; + return instance; } private Starter2000() { diff --git a/Mage.Sets/src/mage/sets/Stronghold.java b/Mage.Sets/src/mage/sets/Stronghold.java index c180b9d87c..0cd07cc3c7 100644 --- a/Mage.Sets/src/mage/sets/Stronghold.java +++ b/Mage.Sets/src/mage/sets/Stronghold.java @@ -37,10 +37,10 @@ import mage.constants.SetType; */ public class Stronghold extends ExpansionSet { - private static final Stronghold fINSTANCE = new Stronghold(); + private static final Stronghold instance = new Stronghold(); public static Stronghold getInstance() { - return fINSTANCE; + return instance; } private Stronghold() { diff --git a/Mage.Sets/src/mage/sets/SuperSeries.java b/Mage.Sets/src/mage/sets/SuperSeries.java index 30f5f5170d..9a72e7f0ad 100644 --- a/Mage.Sets/src/mage/sets/SuperSeries.java +++ b/Mage.Sets/src/mage/sets/SuperSeries.java @@ -39,10 +39,10 @@ import mage.cards.CardGraphicInfo; public class SuperSeries extends ExpansionSet { - private static final SuperSeries fINSTANCE = new SuperSeries(); + private static final SuperSeries instance = new SuperSeries(); public static SuperSeries getInstance() { - return fINSTANCE; + return instance; } private SuperSeries() { diff --git a/Mage.Sets/src/mage/sets/Tempest.java b/Mage.Sets/src/mage/sets/Tempest.java index 9fb03aeec8..f61c0247fd 100644 --- a/Mage.Sets/src/mage/sets/Tempest.java +++ b/Mage.Sets/src/mage/sets/Tempest.java @@ -7,10 +7,10 @@ import mage.constants.SetType; public class Tempest extends ExpansionSet { - private static final Tempest fINSTANCE = new Tempest(); + private static final Tempest instance = new Tempest(); public static Tempest getInstance() { - return fINSTANCE; + return instance; } private Tempest() { diff --git a/Mage.Sets/src/mage/sets/TempestRemastered.java b/Mage.Sets/src/mage/sets/TempestRemastered.java index 7cd0a90216..0c1745f0ae 100644 --- a/Mage.Sets/src/mage/sets/TempestRemastered.java +++ b/Mage.Sets/src/mage/sets/TempestRemastered.java @@ -39,10 +39,10 @@ import mage.cards.CardGraphicInfo; */ public class TempestRemastered extends ExpansionSet { - private static final TempestRemastered fINSTANCE = new TempestRemastered(); + private static final TempestRemastered instance = new TempestRemastered(); public static TempestRemastered getInstance() { - return fINSTANCE; + return instance; } private TempestRemastered() { diff --git a/Mage.Sets/src/mage/sets/TenthEdition.java b/Mage.Sets/src/mage/sets/TenthEdition.java index b62826bde9..16277bfeae 100644 --- a/Mage.Sets/src/mage/sets/TenthEdition.java +++ b/Mage.Sets/src/mage/sets/TenthEdition.java @@ -39,10 +39,10 @@ import mage.cards.CardGraphicInfo; */ public class TenthEdition extends ExpansionSet { - private static final TenthEdition fINSTANCE = new TenthEdition(); + private static final TenthEdition instance = new TenthEdition(); public static TenthEdition getInstance() { - return fINSTANCE; + return instance; } private TenthEdition() { diff --git a/Mage.Sets/src/mage/sets/TheDark.java b/Mage.Sets/src/mage/sets/TheDark.java index a753868ffd..d96d9ac3e4 100644 --- a/Mage.Sets/src/mage/sets/TheDark.java +++ b/Mage.Sets/src/mage/sets/TheDark.java @@ -37,10 +37,10 @@ import mage.constants.Rarity; */ public class TheDark extends ExpansionSet { - private static final TheDark fINSTANCE = new TheDark(); + private static final TheDark instance = new TheDark(); public static TheDark getInstance() { - return fINSTANCE; + return instance; } private TheDark() { diff --git a/Mage.Sets/src/mage/sets/Theros.java b/Mage.Sets/src/mage/sets/Theros.java index 21f6097e9b..10968df157 100644 --- a/Mage.Sets/src/mage/sets/Theros.java +++ b/Mage.Sets/src/mage/sets/Theros.java @@ -38,10 +38,10 @@ import mage.cards.CardGraphicInfo; */ public class Theros extends ExpansionSet { - private static final Theros fINSTANCE = new Theros(); + private static final Theros instance = new Theros(); public static Theros getInstance() { - return fINSTANCE; + return instance; } private Theros() { diff --git a/Mage.Sets/src/mage/sets/TimeSpiral.java b/Mage.Sets/src/mage/sets/TimeSpiral.java index f943f5cb34..5bb019c62c 100644 --- a/Mage.Sets/src/mage/sets/TimeSpiral.java +++ b/Mage.Sets/src/mage/sets/TimeSpiral.java @@ -11,10 +11,10 @@ import mage.cards.CardGraphicInfo; public class TimeSpiral extends ExpansionSet { - private static final TimeSpiral fINSTANCE = new TimeSpiral(); + private static final TimeSpiral instance = new TimeSpiral(); public static TimeSpiral getInstance() { - return fINSTANCE; + return instance; } private TimeSpiral() { @@ -130,7 +130,7 @@ public class TimeSpiral extends ExpansionSet { cards.add(new SetCardInfo("Haunting Hymn", 112, Rarity.UNCOMMON, mage.cards.h.HauntingHymn.class)); cards.add(new SetCardInfo("Havenwood Wurm", 199, Rarity.COMMON, mage.cards.h.HavenwoodWurm.class)); cards.add(new SetCardInfo("Herd Gnarr", 200, Rarity.COMMON, mage.cards.h.HerdGnarr.class)); - cards.add(new SetCardInfo("Hivestone", 256, Rarity.RARE, mage.cards.h.Hivestone.class)); + cards.add(new SetCardInfo("Hivestone", 256, Rarity.RARE, mage.cards.h.Hivestone.class)); cards.add(new SetCardInfo("Hypergenesis", 201, Rarity.RARE, mage.cards.h.Hypergenesis.class)); cards.add(new SetCardInfo("Ib Halfheart, Goblin Tactician", 163, Rarity.RARE, mage.cards.i.IbHalfheartGoblinTactician.class)); cards.add(new SetCardInfo("Icatian Crier", 23, Rarity.COMMON, mage.cards.i.IcatianCrier.class)); diff --git a/Mage.Sets/src/mage/sets/TimeSpiralTimeshifted.java b/Mage.Sets/src/mage/sets/TimeSpiralTimeshifted.java index deba2b69bd..fcd6214bcd 100644 --- a/Mage.Sets/src/mage/sets/TimeSpiralTimeshifted.java +++ b/Mage.Sets/src/mage/sets/TimeSpiralTimeshifted.java @@ -39,10 +39,10 @@ import mage.constants.Rarity; */ public class TimeSpiralTimeshifted extends ExpansionSet { - private static final TimeSpiralTimeshifted fINSTANCE = new TimeSpiralTimeshifted(); + private static final TimeSpiralTimeshifted instance = new TimeSpiralTimeshifted(); public static TimeSpiralTimeshifted getInstance() { - return fINSTANCE; + return instance; } private TimeSpiralTimeshifted() { diff --git a/Mage.Sets/src/mage/sets/Torment.java b/Mage.Sets/src/mage/sets/Torment.java index bb21ca0ce6..0441b83e05 100644 --- a/Mage.Sets/src/mage/sets/Torment.java +++ b/Mage.Sets/src/mage/sets/Torment.java @@ -37,10 +37,10 @@ import mage.constants.SetType; */ public class Torment extends ExpansionSet { - private static final Torment fINSTANCE = new Torment(); + private static final Torment instance = new Torment(); public static Torment getInstance() { - return fINSTANCE; + return instance; } private Torment() { diff --git a/Mage.Sets/src/mage/sets/UginsFate.java b/Mage.Sets/src/mage/sets/UginsFate.java index 51a4ba5354..417a2e2883 100644 --- a/Mage.Sets/src/mage/sets/UginsFate.java +++ b/Mage.Sets/src/mage/sets/UginsFate.java @@ -38,10 +38,10 @@ import mage.constants.Rarity; public class UginsFate extends ExpansionSet { - private static final UginsFate fINSTANCE = new UginsFate(); + private static final UginsFate instance = new UginsFate(); public static UginsFate getInstance() { - return fINSTANCE; + return instance; } private UginsFate() { diff --git a/Mage.Sets/src/mage/sets/Unglued.java b/Mage.Sets/src/mage/sets/Unglued.java index 5ed2a561ec..83fd56458d 100644 --- a/Mage.Sets/src/mage/sets/Unglued.java +++ b/Mage.Sets/src/mage/sets/Unglued.java @@ -12,10 +12,10 @@ import mage.cards.FrameStyle; * @author lopho */ public class Unglued extends ExpansionSet { - private static final Unglued fINSTANCE = new Unglued(); + private static final Unglued instance = new Unglued(); public static Unglued getInstance() { - return fINSTANCE; + return instance; } private Unglued() { diff --git a/Mage.Sets/src/mage/sets/Unhinged.java b/Mage.Sets/src/mage/sets/Unhinged.java index feee56a700..9571281c87 100644 --- a/Mage.Sets/src/mage/sets/Unhinged.java +++ b/Mage.Sets/src/mage/sets/Unhinged.java @@ -12,10 +12,10 @@ import mage.cards.FrameStyle; * @author magenoxx */ public class Unhinged extends ExpansionSet { - private static final Unhinged fINSTANCE = new Unhinged(); + private static final Unhinged instance = new Unhinged(); public static Unhinged getInstance() { - return fINSTANCE; + return instance; } private Unhinged() { diff --git a/Mage.Sets/src/mage/sets/UnlimitedEdition.java b/Mage.Sets/src/mage/sets/UnlimitedEdition.java index a33f4d1557..fcd252d29d 100644 --- a/Mage.Sets/src/mage/sets/UnlimitedEdition.java +++ b/Mage.Sets/src/mage/sets/UnlimitedEdition.java @@ -11,10 +11,10 @@ import mage.cards.CardGraphicInfo; */ public class UnlimitedEdition extends ExpansionSet { - private static final UnlimitedEdition fINSTANCE = new UnlimitedEdition(); + private static final UnlimitedEdition instance = new UnlimitedEdition(); public static UnlimitedEdition getInstance() { - return fINSTANCE; + return instance; } private UnlimitedEdition() { diff --git a/Mage.Sets/src/mage/sets/UrzasDestiny.java b/Mage.Sets/src/mage/sets/UrzasDestiny.java index 7e70e0b1fc..0ccf844f02 100644 --- a/Mage.Sets/src/mage/sets/UrzasDestiny.java +++ b/Mage.Sets/src/mage/sets/UrzasDestiny.java @@ -37,10 +37,10 @@ import mage.constants.SetType; */ public class UrzasDestiny extends ExpansionSet { - private static final UrzasDestiny fINSTANCE = new UrzasDestiny(); + private static final UrzasDestiny instance = new UrzasDestiny(); public static UrzasDestiny getInstance() { - return fINSTANCE; + return instance; } private UrzasDestiny() { @@ -72,7 +72,7 @@ public class UrzasDestiny extends ExpansionSet { cards.add(new SetCardInfo("Capashen Knight", 3, Rarity.COMMON, mage.cards.c.CapashenKnight.class)); cards.add(new SetCardInfo("Capashen Standard", 4, Rarity.COMMON, mage.cards.c.CapashenStandard.class)); cards.add(new SetCardInfo("Capashen Templar", 5, Rarity.COMMON, mage.cards.c.CapashenTemplar.class)); - cards.add(new SetCardInfo("Carnival of Souls", 55, Rarity.RARE, mage.cards.c.CarnivalOfSouls.class)); + cards.add(new SetCardInfo("Carnival of Souls", 55, Rarity.RARE, mage.cards.c.CarnivalOfSouls.class)); cards.add(new SetCardInfo("Colos Yearling", 79, Rarity.COMMON, mage.cards.c.ColosYearling.class)); cards.add(new SetCardInfo("Compost", 102, Rarity.UNCOMMON, mage.cards.c.Compost.class)); cards.add(new SetCardInfo("Covetous Dragon", 80, Rarity.RARE, mage.cards.c.CovetousDragon.class)); @@ -88,7 +88,7 @@ public class UrzasDestiny extends ExpansionSet { cards.add(new SetCardInfo("False Prophet", 6, Rarity.RARE, mage.cards.f.FalseProphet.class)); cards.add(new SetCardInfo("Field Surgeon", 8, Rarity.COMMON, mage.cards.f.FieldSurgeon.class)); cards.add(new SetCardInfo("Flame Jet", 81, Rarity.COMMON, mage.cards.f.FlameJet.class)); - cards.add(new SetCardInfo("Fledgling Osprey", 33, Rarity.COMMON, mage.cards.f.FledglingOsprey.class)); + cards.add(new SetCardInfo("Fledgling Osprey", 33, Rarity.COMMON, mage.cards.f.FledglingOsprey.class)); cards.add(new SetCardInfo("Flicker", 9, Rarity.RARE, mage.cards.f.Flicker.class)); cards.add(new SetCardInfo("Fodder Cannon", 131, Rarity.UNCOMMON, mage.cards.f.FodderCannon.class)); cards.add(new SetCardInfo("Gamekeeper", 106, Rarity.UNCOMMON, mage.cards.g.Gamekeeper.class)); diff --git a/Mage.Sets/src/mage/sets/UrzasLegacy.java b/Mage.Sets/src/mage/sets/UrzasLegacy.java index 084526038a..af856f22ba 100644 --- a/Mage.Sets/src/mage/sets/UrzasLegacy.java +++ b/Mage.Sets/src/mage/sets/UrzasLegacy.java @@ -37,10 +37,10 @@ import mage.constants.SetType; */ public class UrzasLegacy extends ExpansionSet { - private static final UrzasLegacy fINSTANCE = new UrzasLegacy(); + private static final UrzasLegacy instance = new UrzasLegacy(); public static UrzasLegacy getInstance() { - return fINSTANCE; + return instance; } private UrzasLegacy() { diff --git a/Mage.Sets/src/mage/sets/UrzasSaga.java b/Mage.Sets/src/mage/sets/UrzasSaga.java index 318c9ab9d9..79e51e8da1 100644 --- a/Mage.Sets/src/mage/sets/UrzasSaga.java +++ b/Mage.Sets/src/mage/sets/UrzasSaga.java @@ -38,10 +38,10 @@ import mage.constants.SetType; */ public class UrzasSaga extends ExpansionSet { - private static final UrzasSaga fINSTANCE = new UrzasSaga(); + private static final UrzasSaga instance = new UrzasSaga(); public static UrzasSaga getInstance() { - return fINSTANCE; + return instance; } private UrzasSaga() { diff --git a/Mage.Sets/src/mage/sets/VenserVsKoth.java b/Mage.Sets/src/mage/sets/VenserVsKoth.java index 3c86e8e3d9..aa6fdb52be 100644 --- a/Mage.Sets/src/mage/sets/VenserVsKoth.java +++ b/Mage.Sets/src/mage/sets/VenserVsKoth.java @@ -39,10 +39,10 @@ import mage.cards.CardGraphicInfo; */ public class VenserVsKoth extends ExpansionSet { - private static final VenserVsKoth fINSTANCE = new VenserVsKoth(); + private static final VenserVsKoth instance = new VenserVsKoth(); public static VenserVsKoth getInstance() { - return fINSTANCE; + return instance; } private VenserVsKoth() { diff --git a/Mage.Sets/src/mage/sets/VintageMasters.java b/Mage.Sets/src/mage/sets/VintageMasters.java index fca554c3d0..74905543cd 100644 --- a/Mage.Sets/src/mage/sets/VintageMasters.java +++ b/Mage.Sets/src/mage/sets/VintageMasters.java @@ -44,10 +44,10 @@ import mage.constants.SetType; */ public class VintageMasters extends ExpansionSet { - private static final VintageMasters fINSTANCE = new VintageMasters(); + private static final VintageMasters instance = new VintageMasters(); public static VintageMasters getInstance() { - return fINSTANCE; + return instance; } private VintageMasters() { diff --git a/Mage.Sets/src/mage/sets/Visions.java b/Mage.Sets/src/mage/sets/Visions.java index 21c171445c..9616a3b771 100644 --- a/Mage.Sets/src/mage/sets/Visions.java +++ b/Mage.Sets/src/mage/sets/Visions.java @@ -37,10 +37,10 @@ import mage.constants.SetType; */ public class Visions extends ExpansionSet { - private static final Visions fINSTANCE = new Visions(); + private static final Visions instance = new Visions(); public static Visions getInstance() { - return fINSTANCE; + return instance; } private Visions() { diff --git a/Mage.Sets/src/mage/sets/WPNGateway.java b/Mage.Sets/src/mage/sets/WPNGateway.java index 47e5e5b89b..aef2cd535a 100644 --- a/Mage.Sets/src/mage/sets/WPNGateway.java +++ b/Mage.Sets/src/mage/sets/WPNGateway.java @@ -16,10 +16,10 @@ import mage.constants.Rarity; */ public class WPNGateway extends ExpansionSet { - private static final WPNGateway fINSTANCE = new WPNGateway(); + private static final WPNGateway instance = new WPNGateway(); public static WPNGateway getInstance() { - return fINSTANCE; + return instance; } private WPNGateway() { diff --git a/Mage.Sets/src/mage/sets/Weatherlight.java b/Mage.Sets/src/mage/sets/Weatherlight.java index dc08d0cf5e..1507c4ad68 100644 --- a/Mage.Sets/src/mage/sets/Weatherlight.java +++ b/Mage.Sets/src/mage/sets/Weatherlight.java @@ -39,10 +39,10 @@ import mage.constants.Rarity; */ public class Weatherlight extends ExpansionSet { - private static final Weatherlight fINSTANCE = new Weatherlight(); + private static final Weatherlight instance = new Weatherlight(); public static Weatherlight getInstance() { - return fINSTANCE; + return instance; } private Weatherlight() { diff --git a/Mage.Sets/src/mage/sets/WelcomeDeck2016.java b/Mage.Sets/src/mage/sets/WelcomeDeck2016.java index 45483e39c5..5e12a55174 100644 --- a/Mage.Sets/src/mage/sets/WelcomeDeck2016.java +++ b/Mage.Sets/src/mage/sets/WelcomeDeck2016.java @@ -37,10 +37,10 @@ import mage.constants.Rarity; * @author escplan9 (Derek Monturo - dmontur1 at gmail dot com) */ public class WelcomeDeck2016 extends ExpansionSet { - private static final WelcomeDeck2016 fINSTANCE = new WelcomeDeck2016(); + private static final WelcomeDeck2016 instance = new WelcomeDeck2016(); public static WelcomeDeck2016 getInstance() { - return fINSTANCE; + return instance; } private WelcomeDeck2016() { diff --git a/Mage.Sets/src/mage/sets/WorldMagicCupQualifier.java b/Mage.Sets/src/mage/sets/WorldMagicCupQualifier.java index 6f2831ce4b..1a39a5a78a 100644 --- a/Mage.Sets/src/mage/sets/WorldMagicCupQualifier.java +++ b/Mage.Sets/src/mage/sets/WorldMagicCupQualifier.java @@ -38,10 +38,10 @@ import mage.constants.Rarity; */ public class WorldMagicCupQualifier extends ExpansionSet { - private static final WorldMagicCupQualifier fINSTANCE = new WorldMagicCupQualifier(); + private static final WorldMagicCupQualifier instance = new WorldMagicCupQualifier(); public static WorldMagicCupQualifier getInstance() { - return fINSTANCE; + return instance; } private WorldMagicCupQualifier() { diff --git a/Mage.Sets/src/mage/sets/Worldwake.java b/Mage.Sets/src/mage/sets/Worldwake.java index 498ecc6eda..b426f3d701 100644 --- a/Mage.Sets/src/mage/sets/Worldwake.java +++ b/Mage.Sets/src/mage/sets/Worldwake.java @@ -37,10 +37,10 @@ import mage.constants.SetType; */ public class Worldwake extends ExpansionSet { - private static final Worldwake fINSTANCE = new Worldwake(); + private static final Worldwake instance = new Worldwake(); public static Worldwake getInstance() { - return fINSTANCE; + return instance; } private Worldwake() { diff --git a/Mage.Sets/src/mage/sets/Zendikar.java b/Mage.Sets/src/mage/sets/Zendikar.java index 3ced2a5111..be510378d1 100644 --- a/Mage.Sets/src/mage/sets/Zendikar.java +++ b/Mage.Sets/src/mage/sets/Zendikar.java @@ -41,10 +41,10 @@ import mage.cards.FrameStyle; */ public class Zendikar extends ExpansionSet { - private static final Zendikar fINSTANCE = new Zendikar(); + private static final Zendikar instance = new Zendikar(); public static Zendikar getInstance() { - return fINSTANCE; + return instance; } private Zendikar() { diff --git a/Mage.Sets/src/mage/sets/ZendikarExpeditions.java b/Mage.Sets/src/mage/sets/ZendikarExpeditions.java index 07ec5698ab..8df1a16625 100644 --- a/Mage.Sets/src/mage/sets/ZendikarExpeditions.java +++ b/Mage.Sets/src/mage/sets/ZendikarExpeditions.java @@ -37,10 +37,10 @@ import mage.constants.Rarity; */ public class ZendikarExpeditions extends ExpansionSet { - private static final ZendikarExpeditions fINSTANCE = new ZendikarExpeditions(); + private static final ZendikarExpeditions instance = new ZendikarExpeditions(); public static ZendikarExpeditions getInstance() { - return fINSTANCE; + return instance; } private ZendikarExpeditions() { diff --git a/Mage.Sets/src/mage/sets/ZendikarVsEldrazi.java b/Mage.Sets/src/mage/sets/ZendikarVsEldrazi.java index 25c39c545a..81ef015aa1 100644 --- a/Mage.Sets/src/mage/sets/ZendikarVsEldrazi.java +++ b/Mage.Sets/src/mage/sets/ZendikarVsEldrazi.java @@ -39,10 +39,10 @@ import mage.cards.CardGraphicInfo; */ public class ZendikarVsEldrazi extends ExpansionSet { - private static final ZendikarVsEldrazi fINSTANCE = new ZendikarVsEldrazi(); + private static final ZendikarVsEldrazi instance = new ZendikarVsEldrazi(); public static ZendikarVsEldrazi getInstance() { - return fINSTANCE; + return instance; } private ZendikarVsEldrazi() { diff --git a/Mage.Tests/src/frozen/org/mage/test/clientside/base/MageBase.java b/Mage.Tests/src/frozen/org/mage/test/clientside/base/MageBase.java index e5721a4b38..ff7a6990ad 100644 --- a/Mage.Tests/src/frozen/org/mage/test/clientside/base/MageBase.java +++ b/Mage.Tests/src/frozen/org/mage/test/clientside/base/MageBase.java @@ -33,7 +33,7 @@ public class MageBase { /** * MageBase single instance */ - private static MageBase fInstance = new MageBase(); + private static MageBase instance = new MageBase(); /** * Default logger @@ -41,7 +41,7 @@ public class MageBase { private static Logger logger = Logging.getLogger(MageBase.class.getName()); public static MageBase getInstance() { - return fInstance; + return instance; } private static UUID sessionId; diff --git a/Mage.Tests/src/test/java/org/mage/test/load/LoadPhaseManager.java b/Mage.Tests/src/test/java/org/mage/test/load/LoadPhaseManager.java index 78f3978e60..3d651c3144 100644 --- a/Mage.Tests/src/test/java/org/mage/test/load/LoadPhaseManager.java +++ b/Mage.Tests/src/test/java/org/mage/test/load/LoadPhaseManager.java @@ -9,7 +9,7 @@ import java.util.UUID; public class LoadPhaseManager { - private static final LoadPhaseManager fInstance = new LoadPhaseManager(); + private static final LoadPhaseManager instance = new LoadPhaseManager(); public static String DEFAULT_PLAYER_NAME = "player"; @@ -52,7 +52,7 @@ public class LoadPhaseManager { }}; public static LoadPhaseManager getInstance() { - return fInstance; + return instance; } public boolean isSkip(GameView gameView, String message, UUID playerId) { diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestBase.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestBase.java index 472db3d0bc..05b3c73d0e 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestBase.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestBase.java @@ -101,7 +101,7 @@ public abstract class MageTestBase { logger.info("Starting MAGE tests"); logger.info("Logging level: " + logger.getLevel()); deleteSavedGames(); - ConfigSettings config = ConfigSettings.getInstance(); + ConfigSettings config = ConfigSettings.instance; for (GamePlugin plugin : config.getGameTypes()) { GameFactory.getInstance().addGameType(plugin.getName(), loadGameType(plugin), loadPlugin(plugin)); } diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestPlayerBase.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestPlayerBase.java index f97664b789..51932f83f0 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestPlayerBase.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestPlayerBase.java @@ -96,7 +96,7 @@ public abstract class MageTestPlayerBase { logger.debug("Starting MAGE tests"); logger.debug("Logging level: " + logger.getLevel()); deleteSavedGames(); - ConfigSettings config = ConfigSettings.getInstance(); + ConfigSettings config = ConfigSettings.instance; for (GamePlugin plugin : config.getGameTypes()) { GameFactory.getInstance().addGameType(plugin.getName(), loadGameType(plugin), loadPlugin(plugin)); } diff --git a/Mage/src/main/java/mage/abilities/common/CanBeYourCommanderAbility.java b/Mage/src/main/java/mage/abilities/common/CanBeYourCommanderAbility.java index 08269c9df1..a621f50d81 100644 --- a/Mage/src/main/java/mage/abilities/common/CanBeYourCommanderAbility.java +++ b/Mage/src/main/java/mage/abilities/common/CanBeYourCommanderAbility.java @@ -40,14 +40,14 @@ import mage.constants.Zone; public class CanBeYourCommanderAbility extends StaticAbility implements MageSingleton { - private static final CanBeYourCommanderAbility fINSTANCE = new CanBeYourCommanderAbility(); + private static final CanBeYourCommanderAbility instance = new CanBeYourCommanderAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static CanBeYourCommanderAbility getInstance() { - return fINSTANCE; + return instance; } private CanBeYourCommanderAbility() { @@ -56,7 +56,7 @@ public class CanBeYourCommanderAbility extends StaticAbility implements MageSing @Override public CanBeYourCommanderAbility copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/common/DamageAsThoughNotBlockedAbility.java b/Mage/src/main/java/mage/abilities/common/DamageAsThoughNotBlockedAbility.java index 821c9e5c3a..4529ddd287 100644 --- a/Mage/src/main/java/mage/abilities/common/DamageAsThoughNotBlockedAbility.java +++ b/Mage/src/main/java/mage/abilities/common/DamageAsThoughNotBlockedAbility.java @@ -40,14 +40,14 @@ import mage.constants.Zone; */ public class DamageAsThoughNotBlockedAbility extends StaticAbility implements MageSingleton { - private static final DamageAsThoughNotBlockedAbility fINSTANCE = new DamageAsThoughNotBlockedAbility(); + private static final DamageAsThoughNotBlockedAbility instance = new DamageAsThoughNotBlockedAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static DamageAsThoughNotBlockedAbility getInstance() { - return fINSTANCE; + return instance; } private DamageAsThoughNotBlockedAbility() { @@ -61,7 +61,7 @@ public class DamageAsThoughNotBlockedAbility extends StaticAbility implements Ma @Override public DamageAsThoughNotBlockedAbility copy() { - return fINSTANCE; + return instance; } } \ No newline at end of file diff --git a/Mage/src/main/java/mage/abilities/condition/common/AfterBlockersAreDeclaredCondition.java b/Mage/src/main/java/mage/abilities/condition/common/AfterBlockersAreDeclaredCondition.java index 46118efa63..f4b682f306 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/AfterBlockersAreDeclaredCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/AfterBlockersAreDeclaredCondition.java @@ -16,13 +16,9 @@ import mage.game.Game; * * @author LevelX2 */ -public class AfterBlockersAreDeclaredCondition implements Condition { +public enum AfterBlockersAreDeclaredCondition implements Condition { - private static final AfterBlockersAreDeclaredCondition fInstance = new AfterBlockersAreDeclaredCondition(); - - public static Condition getInstance() { - return fInstance; - } + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/AfterUpkeepStepCondtion.java b/Mage/src/main/java/mage/abilities/condition/common/AfterUpkeepStepCondtion.java index b3c60a479e..34e628e587 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/AfterUpkeepStepCondtion.java +++ b/Mage/src/main/java/mage/abilities/condition/common/AfterUpkeepStepCondtion.java @@ -13,15 +13,11 @@ import mage.game.Game; /** * @author LevelX2 */ -public class AfterUpkeepStepCondtion implements Condition { - - private static final AfterUpkeepStepCondtion fInstance = new AfterUpkeepStepCondtion(); - - public static Condition getInstance() { - return fInstance; - } +public enum AfterUpkeepStepCondtion implements Condition { + instance; @Override + public boolean apply(Game game, Ability source) { return game.getStep().getType().isAfter(PhaseStep.UPKEEP); } diff --git a/Mage/src/main/java/mage/abilities/condition/common/AttachedCondition.java b/Mage/src/main/java/mage/abilities/condition/common/AttachedCondition.java index 4020fe4097..afeec586b5 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/AttachedCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/AttachedCondition.java @@ -9,13 +9,9 @@ import mage.game.permanent.Permanent; * * @author Quercitron */ -public class AttachedCondition implements Condition { +public enum AttachedCondition implements Condition { - private static final AttachedCondition fInstance = new AttachedCondition(); - - public static AttachedCondition getInstance() { - return fInstance; - } + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/AttachedToTappedCondition.java b/Mage/src/main/java/mage/abilities/condition/common/AttachedToTappedCondition.java index 6650fd62d2..74df540f61 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/AttachedToTappedCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/AttachedToTappedCondition.java @@ -34,16 +34,11 @@ import mage.game.Game; import mage.game.permanent.Permanent; /** - * * @author LevelX2 */ -public class AttachedToTappedCondition implements Condition { +public enum AttachedToTappedCondition implements Condition { + instance; - private static final AttachedToTappedCondition fInstance = new AttachedToTappedCondition(); - - public static AttachedToTappedCondition getInstance() { - return fInstance; - } @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/AttackedOrBlockedThisCombatSourceCondition.java b/Mage/src/main/java/mage/abilities/condition/common/AttackedOrBlockedThisCombatSourceCondition.java index 81878af71a..a224b3071c 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/AttackedOrBlockedThisCombatSourceCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/AttackedOrBlockedThisCombatSourceCondition.java @@ -16,13 +16,9 @@ import mage.watchers.common.AttackedOrBlockedThisCombatWatcher; * * @author LevelX2 */ -public class AttackedOrBlockedThisCombatSourceCondition implements Condition { +public enum AttackedOrBlockedThisCombatSourceCondition implements Condition { - private static final AttackedOrBlockedThisCombatSourceCondition fInstance = new AttackedOrBlockedThisCombatSourceCondition(); - - public static Condition getInstance() { - return fInstance; - } + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/BeforeAttackersAreDeclaredCondition.java b/Mage/src/main/java/mage/abilities/condition/common/BeforeAttackersAreDeclaredCondition.java index 7fb426c493..08b515ec81 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/BeforeAttackersAreDeclaredCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/BeforeAttackersAreDeclaredCondition.java @@ -13,14 +13,9 @@ import mage.game.Game; * * @author LevelX2 */ -public class BeforeAttackersAreDeclaredCondition implements Condition { - - private static final BeforeAttackersAreDeclaredCondition fInstance = new BeforeAttackersAreDeclaredCondition(); - - public static Condition getInstance() { - return fInstance; - } +public enum BeforeAttackersAreDeclaredCondition implements Condition { + instance; @Override public boolean apply(Game game, Ability source) { return !game.getTurn().isDeclareAttackersStepStarted(); diff --git a/Mage/src/main/java/mage/abilities/condition/common/BeforeBlockersAreDeclaredCondition.java b/Mage/src/main/java/mage/abilities/condition/common/BeforeBlockersAreDeclaredCondition.java index c7f30b3fea..352e1506d5 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/BeforeBlockersAreDeclaredCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/BeforeBlockersAreDeclaredCondition.java @@ -18,10 +18,10 @@ import mage.game.Game; */ public class BeforeBlockersAreDeclaredCondition implements Condition { - private static final BeforeBlockersAreDeclaredCondition fInstance = new BeforeBlockersAreDeclaredCondition(); + private static final BeforeBlockersAreDeclaredCondition instance = new BeforeBlockersAreDeclaredCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/condition/common/CommanderInPlayCondition.java b/Mage/src/main/java/mage/abilities/condition/common/CommanderInPlayCondition.java index 5907f4ac8b..a6ba1a0972 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/CommanderInPlayCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/CommanderInPlayCondition.java @@ -41,16 +41,16 @@ import mage.players.Player; */ public class CommanderInPlayCondition implements Condition { - private static CommanderInPlayCondition fInstance = null; + private static CommanderInPlayCondition instance = null; private CommanderInPlayCondition() { } public static Condition getInstance() { - if (fInstance == null) { - fInstance = new CommanderInPlayCondition(); + if (instance == null) { + instance = new CommanderInPlayCondition(); } - return fInstance; + return instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/condition/common/ControlsCreatureGreatestPowerCondition.java b/Mage/src/main/java/mage/abilities/condition/common/ControlsCreatureGreatestPowerCondition.java index c7a2fc65bd..43cef51ab9 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/ControlsCreatureGreatestPowerCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/ControlsCreatureGreatestPowerCondition.java @@ -43,15 +43,11 @@ import mage.game.permanent.Permanent; * * @author noxx */ -public class ControlsCreatureGreatestPowerCondition implements Condition { - - private static final ControlsCreatureGreatestPowerCondition fInstance = new ControlsCreatureGreatestPowerCondition(); +public enum ControlsCreatureGreatestPowerCondition implements Condition { + instance; private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); - public static Condition getInstance() { - return fInstance; - } @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/ControlsCreatureGreatestToughnessCondition.java b/Mage/src/main/java/mage/abilities/condition/common/ControlsCreatureGreatestToughnessCondition.java index c8ec230329..7c40aeb5c3 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/ControlsCreatureGreatestToughnessCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/ControlsCreatureGreatestToughnessCondition.java @@ -43,16 +43,11 @@ import mage.game.permanent.Permanent; * * @author LevelX2 */ -public class ControlsCreatureGreatestToughnessCondition implements Condition { - - private static final ControlsCreatureGreatestToughnessCondition fInstance = new ControlsCreatureGreatestToughnessCondition(); +public enum ControlsCreatureGreatestToughnessCondition implements Condition { + instance; private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); - public static Condition getInstance() { - return fInstance; - } - @Override public boolean apply(Game game, Ability source) { Set controllers = new HashSet<>(); diff --git a/Mage/src/main/java/mage/abilities/condition/common/DashedCondition.java b/Mage/src/main/java/mage/abilities/condition/common/DashedCondition.java index 1578eff74e..bbf1157f6d 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/DashedCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/DashedCondition.java @@ -34,30 +34,20 @@ import mage.cards.Card; import mage.game.Game; /** - * * @author LevelX2 */ -public class DashedCondition implements Condition { +public enum DashedCondition implements Condition { - private static DashedCondition fInstance = null; - - private DashedCondition() {} - - public static Condition getInstance() { - if (fInstance == null) { - fInstance = new DashedCondition(); - } - return fInstance; - } + instance; @Override public boolean apply(Game game, Ability source) { Card card = game.getCard(source.getSourceId()); if (card != null) { - for (Ability ability: card.getAbilities()) { + for (Ability ability : card.getAbilities()) { if (ability instanceof DashAbility) { - if(((DashAbility) ability).isActivated(source, game)) { + if (((DashAbility) ability).isActivated(source, game)) { return true; } } diff --git a/Mage/src/main/java/mage/abilities/condition/common/DeliriumCondition.java b/Mage/src/main/java/mage/abilities/condition/common/DeliriumCondition.java index f555dacc3c..1c53500544 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/DeliriumCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/DeliriumCondition.java @@ -27,6 +27,7 @@ */ package mage.abilities.condition.common; +import java.util.EnumSet; import java.util.HashSet; import mage.abilities.Ability; import mage.abilities.condition.Condition; @@ -40,24 +41,19 @@ import mage.players.Player; * * @author fireshoes */ -public class DeliriumCondition implements Condition { +public enum DeliriumCondition implements Condition { - private final static DeliriumCondition INSTANCE = new DeliriumCondition(); - - public static Condition getInstance() { - return INSTANCE; - } + instance; @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - HashSet foundCardTypes = new HashSet<>(); + EnumSet foundCardTypes = EnumSet.noneOf(CardType.class); for (Card card : controller.getGraveyard().getCards(game)) { foundCardTypes.addAll(card.getCardType()); } - int number = foundCardTypes.size(); - return number > 3; + return foundCardTypes.size() >= 4; } return false; } diff --git a/Mage/src/main/java/mage/abilities/condition/common/EnchantedTargetCondition.java b/Mage/src/main/java/mage/abilities/condition/common/EnchantedTargetCondition.java index ef1e957f5c..663160ea4f 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/EnchantedTargetCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/EnchantedTargetCondition.java @@ -1,6 +1,7 @@ package mage.abilities.condition.common; import java.util.UUID; + import mage.abilities.Ability; import mage.abilities.condition.Condition; import mage.constants.CardType; @@ -9,16 +10,11 @@ import mage.game.permanent.Permanent; import mage.target.Target; /** - * * @author Jeff */ -public class EnchantedTargetCondition implements Condition { +public enum EnchantedTargetCondition implements Condition { - private static final EnchantedTargetCondition fInstance = new EnchantedTargetCondition(); - - public static Condition getInstance() { - return fInstance; - } + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/EquipmentAttachedCondition.java b/Mage/src/main/java/mage/abilities/condition/common/EquipmentAttachedCondition.java index dc6071c974..29cb42e2ab 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/EquipmentAttachedCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/EquipmentAttachedCondition.java @@ -38,13 +38,9 @@ import mage.game.permanent.Permanent; * * @author LevelX2 */ -public class EquipmentAttachedCondition implements Condition { +public enum EquipmentAttachedCondition implements Condition { - private static final EquipmentAttachedCondition fInstance = new EquipmentAttachedCondition(); - - public static Condition getInstance() { - return fInstance; - } + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/EquippedSourceCondition.java b/Mage/src/main/java/mage/abilities/condition/common/EquippedSourceCondition.java index 22badda22c..8c7fb5e645 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/EquippedSourceCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/EquippedSourceCondition.java @@ -40,10 +40,10 @@ import mage.game.permanent.Permanent; */ public class EquippedSourceCondition implements Condition { - private static final EquippedSourceCondition fInstance = new EquippedSourceCondition(); + private static final EquippedSourceCondition instance = new EquippedSourceCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/condition/common/EvokedCondition.java b/Mage/src/main/java/mage/abilities/condition/common/EvokedCondition.java index fe3b60d223..dc1da194f0 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/EvokedCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/EvokedCondition.java @@ -40,18 +40,9 @@ import mage.game.Game; * @author LevelX2 */ -public class EvokedCondition implements Condition { +public enum EvokedCondition implements Condition { - private static EvokedCondition fInstance = null; - - private EvokedCondition() {} - - public static Condition getInstance() { - if (fInstance == null) { - fInstance = new EvokedCondition(); - } - return fInstance; - } + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/FaceDownSourceCondition.java b/Mage/src/main/java/mage/abilities/condition/common/FaceDownSourceCondition.java index 39c39f2197..25b3309f4d 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/FaceDownSourceCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/FaceDownSourceCondition.java @@ -39,13 +39,9 @@ import mage.game.permanent.Permanent; * @author LevelX2 */ -public class FaceDownSourceCondition implements Condition { +public enum FaceDownSourceCondition implements Condition { - private final static FaceDownSourceCondition fInstance = new FaceDownSourceCondition(); - - public static Condition getInstance() { - return fInstance; - } + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/FatefulHourCondition.java b/Mage/src/main/java/mage/abilities/condition/common/FatefulHourCondition.java index f697781a95..1224aa1660 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/FatefulHourCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/FatefulHourCondition.java @@ -8,12 +8,8 @@ import mage.players.Player; /** * @author Loki */ -public class FatefulHourCondition implements Condition { - private static FatefulHourCondition fInstance = new FatefulHourCondition(); - - public static Condition getInstance() { - return fInstance; - } +public enum FatefulHourCondition implements Condition { + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/FerociousCondition.java b/Mage/src/main/java/mage/abilities/condition/common/FerociousCondition.java index c0a93cd97a..3a2df9c78b 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/FerociousCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/FerociousCondition.java @@ -36,24 +36,16 @@ import mage.filter.predicate.mageobject.PowerPredicate; import mage.game.Game; /** - * * @author LevelX2 */ -public class FerociousCondition implements Condition { - +public enum FerociousCondition implements Condition { + instance; private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); static { filter.add(new PowerPredicate(Filter.ComparisonType.GreaterThan, 3)); } - private static final FerociousCondition fInstance = new FerociousCondition(); - - private FerociousCondition() {} - - public static FerociousCondition getInstance() { - return fInstance; - } @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/FlippedCondition.java b/Mage/src/main/java/mage/abilities/condition/common/FlippedCondition.java index 3e269e0ec7..85c9dbebd9 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/FlippedCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/FlippedCondition.java @@ -34,10 +34,10 @@ import mage.game.permanent.Permanent; public class FlippedCondition implements Condition { - private static FlippedCondition fInstance = new FlippedCondition(); + private static FlippedCondition instance = new FlippedCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/condition/common/FormidableCondition.java b/Mage/src/main/java/mage/abilities/condition/common/FormidableCondition.java index b36bcd6067..d025bf06ec 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/FormidableCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/FormidableCondition.java @@ -38,15 +38,12 @@ import mage.game.permanent.Permanent; * @author LevelX2 */ -public class FormidableCondition implements Condition { +public enum FormidableCondition implements Condition { - private static final FormidableCondition fInstance = new FormidableCondition(); + instance; private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); - public static Condition getInstance() { - return fInstance; - } @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/HateCondition.java b/Mage/src/main/java/mage/abilities/condition/common/HateCondition.java index f8ebbe51f8..fbaa76e892 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/HateCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/HateCondition.java @@ -38,19 +38,9 @@ import mage.watchers.common.LifeLossOtherFromCombatWatcher; * * @author Styxo */ -public class HateCondition implements Condition { +public enum HateCondition implements Condition { - private static HateCondition fInstance = null; - - public static Condition getInstance() { - if (fInstance == null) { - fInstance = new HateCondition(); - } - return fInstance; - } - - private HateCondition() { - } + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/HellbentCondition.java b/Mage/src/main/java/mage/abilities/condition/common/HellbentCondition.java index fb2f226684..fa60645d7e 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/HellbentCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/HellbentCondition.java @@ -31,13 +31,9 @@ import mage.abilities.Ability; import mage.abilities.condition.Condition; import mage.game.Game; -public class HellbentCondition implements Condition { +public enum HellbentCondition implements Condition { - private static HellbentCondition fInstance = new HellbentCondition(); - - public static Condition getInstance() { - return fInstance; - } + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/KickedCondition.java b/Mage/src/main/java/mage/abilities/condition/common/KickedCondition.java index 0af2f42f40..bba8de1399 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/KickedCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/KickedCondition.java @@ -40,18 +40,9 @@ import mage.game.Game; * * @author LevelX2 */ -public class KickedCondition implements Condition { +public enum KickedCondition implements Condition { - private static KickedCondition fInstance = null; - - private KickedCondition() {} - - public static Condition getInstance() { - if (fInstance == null) { - fInstance = new KickedCondition(); - } - return fInstance; - } + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/LastTimeCounterRemovedCondition.java b/Mage/src/main/java/mage/abilities/condition/common/LastTimeCounterRemovedCondition.java index a68e20036f..fb2bf28163 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/LastTimeCounterRemovedCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/LastTimeCounterRemovedCondition.java @@ -10,14 +10,9 @@ import mage.game.permanent.Permanent; /** * Created by glerman on 20/6/15. */ -public class LastTimeCounterRemovedCondition implements Condition{ +public enum LastTimeCounterRemovedCondition implements Condition{ - - private static final LastTimeCounterRemovedCondition fInstance = new LastTimeCounterRemovedCondition(); - - public static LastTimeCounterRemovedCondition getInstance() { - return fInstance; - } +instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/MetalcraftCondition.java b/Mage/src/main/java/mage/abilities/condition/common/MetalcraftCondition.java index 5f974a62a0..e47ec4ac70 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/MetalcraftCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/MetalcraftCondition.java @@ -12,19 +12,14 @@ import mage.game.Game; * * @author nantuko */ -public class MetalcraftCondition implements Condition { - +public enum MetalcraftCondition implements Condition { + instance; private static final FilterPermanent filter = new FilterPermanent("artifact"); static { filter.add(new CardTypePredicate(CardType.ARTIFACT)); } - private static final MetalcraftCondition fInstance = new MetalcraftCondition(); - - public static Condition getInstance() { - return fInstance; - } @Override public boolean apply(Game game, Ability source) { @@ -35,5 +30,5 @@ public class MetalcraftCondition implements Condition { public String toString() { return "you control three or more artifacts"; } - + } diff --git a/Mage/src/main/java/mage/abilities/condition/common/MonarchIsSourceControllerCondition.java b/Mage/src/main/java/mage/abilities/condition/common/MonarchIsSourceControllerCondition.java index a7c6910f3b..40fca1d93a 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/MonarchIsSourceControllerCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/MonarchIsSourceControllerCondition.java @@ -37,10 +37,10 @@ import mage.game.Game; */ public class MonarchIsSourceControllerCondition implements Condition { - private final static MonarchIsSourceControllerCondition fInstance = new MonarchIsSourceControllerCondition(); + private final static MonarchIsSourceControllerCondition instance = new MonarchIsSourceControllerCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/condition/common/MonstrousCondition.java b/Mage/src/main/java/mage/abilities/condition/common/MonstrousCondition.java index d927ee2530..8815797b5a 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/MonstrousCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/MonstrousCondition.java @@ -39,19 +39,9 @@ import mage.game.permanent.Permanent; * * @author LevelX2 */ -public class MonstrousCondition implements Condition { - - private static MonstrousCondition fInstance = null; - - private MonstrousCondition() {} - - public static Condition getInstance() { - if (fInstance == null) { - fInstance = new MonstrousCondition(); - } - return fInstance; - } +public enum MonstrousCondition implements Condition { + instance; @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); diff --git a/Mage/src/main/java/mage/abilities/condition/common/MorbidCondition.java b/Mage/src/main/java/mage/abilities/condition/common/MorbidCondition.java index 5148dd620c..a03c56e163 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/MorbidCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/MorbidCondition.java @@ -35,13 +35,9 @@ import mage.watchers.Watcher; /** * @author nantuko */ -public class MorbidCondition implements Condition { +public enum MorbidCondition implements Condition { - private static final MorbidCondition fInstance = new MorbidCondition(); - - public static Condition getInstance() { - return fInstance; - } + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/MyMainPhaseCondition.java b/Mage/src/main/java/mage/abilities/condition/common/MyMainPhaseCondition.java index 1a2d858e3b..f09a6d7795 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/MyMainPhaseCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/MyMainPhaseCondition.java @@ -27,30 +27,23 @@ */ package mage.abilities.condition.common; +import java.util.EnumSet; import java.util.HashSet; import java.util.Set; + import mage.constants.TurnPhase; import mage.abilities.Ability; import mage.abilities.condition.Condition; import mage.game.Game; /** - * * @author LevelX2 */ -public class MyMainPhaseCondition implements Condition { +public enum MyMainPhaseCondition implements Condition { - private static final MyMainPhaseCondition fInstance = new MyMainPhaseCondition(); - - private static final Set turnPhases = new HashSet() {{ - add(TurnPhase.PRECOMBAT_MAIN); - add(TurnPhase.POSTCOMBAT_MAIN); - }}; - - public static Condition getInstance() { - return fInstance; - } + instance; + private static final Set turnPhases = EnumSet.of(TurnPhase.PRECOMBAT_MAIN, TurnPhase.POSTCOMBAT_MAIN); @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/MyTurnBeforeAttackersDeclaredCondition.java b/Mage/src/main/java/mage/abilities/condition/common/MyTurnBeforeAttackersDeclaredCondition.java index cb5d6b37f8..edfab63c3d 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/MyTurnBeforeAttackersDeclaredCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/MyTurnBeforeAttackersDeclaredCondition.java @@ -38,10 +38,10 @@ import mage.game.Game; * @author LevelX2 */ public class MyTurnBeforeAttackersDeclaredCondition implements Condition { - private static final MyTurnBeforeAttackersDeclaredCondition fInstance = new MyTurnBeforeAttackersDeclaredCondition(); + private static final MyTurnBeforeAttackersDeclaredCondition instance = new MyTurnBeforeAttackersDeclaredCondition(); public static Condition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/condition/common/MyTurnCondition.java b/Mage/src/main/java/mage/abilities/condition/common/MyTurnCondition.java index 3f987a8bd4..5123105e41 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/MyTurnCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/MyTurnCondition.java @@ -31,12 +31,8 @@ import mage.abilities.Ability; import mage.abilities.condition.Condition; import mage.game.Game; -public class MyTurnCondition implements Condition { - private final static MyTurnCondition fInstance = new MyTurnCondition(); - - public static Condition getInstance() { - return fInstance; - } +public enum MyTurnCondition implements Condition { + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/NoSpellsWereCastLastTurnCondition.java b/Mage/src/main/java/mage/abilities/condition/common/NoSpellsWereCastLastTurnCondition.java index d721c0e030..bbd489f907 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/NoSpellsWereCastLastTurnCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/NoSpellsWereCastLastTurnCondition.java @@ -35,13 +35,11 @@ import mage.watchers.common.CastSpellLastTurnWatcher; /** * @author nantuko */ -public class NoSpellsWereCastLastTurnCondition implements Condition { +public enum NoSpellsWereCastLastTurnCondition implements Condition { + + instance; - private static NoSpellsWereCastLastTurnCondition fInstance = new NoSpellsWereCastLastTurnCondition(); - public static Condition getInstance() { - return fInstance; - } @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/NotMyTurnCondition.java b/Mage/src/main/java/mage/abilities/condition/common/NotMyTurnCondition.java index ef91096a5f..227db396b9 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/NotMyTurnCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/NotMyTurnCondition.java @@ -32,13 +32,9 @@ import mage.abilities.Ability; import mage.abilities.condition.Condition; import mage.game.Game; -public class NotMyTurnCondition implements Condition { +public enum NotMyTurnCondition implements Condition { - private static final NotMyTurnCondition fInstance = new NotMyTurnCondition(); - - public static Condition getInstance() { - return fInstance; - } + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/OnOpponentsTurnCondition.java b/Mage/src/main/java/mage/abilities/condition/common/OnOpponentsTurnCondition.java index 3dd27a0c3b..0c5704b3f6 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/OnOpponentsTurnCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/OnOpponentsTurnCondition.java @@ -13,13 +13,9 @@ import mage.game.Game; * * @author LevelX2 */ -public class OnOpponentsTurnCondition implements Condition { +public enum OnOpponentsTurnCondition implements Condition { - private static final OnOpponentsTurnCondition F_INSTANCE = new OnOpponentsTurnCondition(); - - public static Condition getInstance() { - return F_INSTANCE; - } + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/ProwlCondition.java b/Mage/src/main/java/mage/abilities/condition/common/ProwlCondition.java index 18bcaa9fc2..f5b88e122d 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/ProwlCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/ProwlCondition.java @@ -38,19 +38,9 @@ import mage.game.Game; * * @author LevelX2 */ -public class ProwlCondition implements Condition { +public enum ProwlCondition implements Condition { - private static ProwlCondition fInstance = null; - - private ProwlCondition() { - } - - public static Condition getInstance() { - if (fInstance == null) { - fInstance = new ProwlCondition(); - } - return fInstance; - } + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/RaidCondition.java b/Mage/src/main/java/mage/abilities/condition/common/RaidCondition.java index 965b27895c..fb3490b67e 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/RaidCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/RaidCondition.java @@ -34,21 +34,11 @@ import mage.game.Game; import mage.watchers.common.PlayerAttackedWatcher; /** - * * @author LevelX2 */ -public class RaidCondition implements Condition { +public enum RaidCondition implements Condition { - private static RaidCondition fInstance = null; - - public static Condition getInstance() { - if (fInstance == null) { - fInstance = new RaidCondition(); - } - return fInstance; - } - - private RaidCondition() {} + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/RenownedSourceCondition.java b/Mage/src/main/java/mage/abilities/condition/common/RenownedSourceCondition.java index 7ab4e3e953..47dc9f3a22 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/RenownedSourceCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/RenownedSourceCondition.java @@ -16,19 +16,9 @@ import mage.game.permanent.Permanent; * @author LevelX2 */ -public class RenownedSourceCondition implements Condition { - - private static RenownedSourceCondition fInstance = null; - - private RenownedSourceCondition() {} - - public static RenownedSourceCondition getInstance() { - if (fInstance == null) { - fInstance = new RenownedSourceCondition(); - } - return fInstance; - } +public enum RenownedSourceCondition implements Condition { + instance; @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); diff --git a/Mage/src/main/java/mage/abilities/condition/common/RenownedTargetCondition.java b/Mage/src/main/java/mage/abilities/condition/common/RenownedTargetCondition.java index 24efcff97a..3aa31557fd 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/RenownedTargetCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/RenownedTargetCondition.java @@ -38,16 +38,16 @@ import mage.game.permanent.Permanent; */ public class RenownedTargetCondition implements Condition { - private static RenownedTargetCondition fInstance = null; + private static RenownedTargetCondition instance = null; private RenownedTargetCondition() { } public static RenownedTargetCondition getInstance() { - if (fInstance == null) { - fInstance = new RenownedTargetCondition(); + if (instance == null) { + instance = new RenownedTargetCondition(); } - return fInstance; + return instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/condition/common/RevoltCondition.java b/Mage/src/main/java/mage/abilities/condition/common/RevoltCondition.java index 33d1ce9744..c0ce944719 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/RevoltCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/RevoltCondition.java @@ -35,13 +35,9 @@ import mage.watchers.common.RevoltWatcher; /** * @author emerald000 */ -public class RevoltCondition implements Condition { +public enum RevoltCondition implements Condition { - private static final RevoltCondition fInstance = new RevoltCondition(); - - public static Condition getInstance() { - return fInstance; - } + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/SourceAttackingCondition.java b/Mage/src/main/java/mage/abilities/condition/common/SourceAttackingCondition.java index 5d5041548f..a20648cecc 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/SourceAttackingCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/SourceAttackingCondition.java @@ -39,10 +39,10 @@ import mage.game.permanent.Permanent; public class SourceAttackingCondition implements Condition { - private static final SourceAttackingCondition fInstance = new SourceAttackingCondition(); + private static final SourceAttackingCondition instance = new SourceAttackingCondition(); public static SourceAttackingCondition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/condition/common/SourceIsSpellCondition.java b/Mage/src/main/java/mage/abilities/condition/common/SourceIsSpellCondition.java index 42d964d1ef..51a31399db 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/SourceIsSpellCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/SourceIsSpellCondition.java @@ -38,13 +38,9 @@ import mage.game.Game; * @author LevelX2 */ -public class SourceIsSpellCondition implements Condition { +public enum SourceIsSpellCondition implements Condition { - private static final SourceIsSpellCondition fInstance = new SourceIsSpellCondition(); - - public static Condition getInstance() { - return fInstance; - } +instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/SourceOnBattlefieldCondition.java b/Mage/src/main/java/mage/abilities/condition/common/SourceOnBattlefieldCondition.java index 737a6215ad..544e6e38dd 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/SourceOnBattlefieldCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/SourceOnBattlefieldCondition.java @@ -40,10 +40,10 @@ import mage.game.Game; */ public class SourceOnBattlefieldCondition implements Condition { - private static final SourceOnBattlefieldCondition fInstance = new SourceOnBattlefieldCondition(); + private static final SourceOnBattlefieldCondition instance = new SourceOnBattlefieldCondition(); public static SourceOnBattlefieldCondition getInstance() { - return fInstance; + return instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/condition/common/SourceTappedBeforeUntapStepCondition.java b/Mage/src/main/java/mage/abilities/condition/common/SourceTappedBeforeUntapStepCondition.java index 6a6f28bfe5..7a082493bc 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/SourceTappedBeforeUntapStepCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/SourceTappedBeforeUntapStepCondition.java @@ -44,14 +44,14 @@ import mage.game.turn.Step; public class SourceTappedBeforeUntapStepCondition implements Condition { - private static final SourceTappedBeforeUntapStepCondition fInstance = new SourceTappedBeforeUntapStepCondition(); + private static final SourceTappedBeforeUntapStepCondition instance = new SourceTappedBeforeUntapStepCondition(); UUID permanentId = null; boolean permanentWasTappedBeforeUntapStep = false; int lastTurnNum = -1; public static SourceTappedBeforeUntapStepCondition getInstance() { - return fInstance; + return instance; } public void setPermanentId(UUID permanentId) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/SourceTappedCondition.java b/Mage/src/main/java/mage/abilities/condition/common/SourceTappedCondition.java index e4167036d4..0bd6c01b52 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/SourceTappedCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/SourceTappedCondition.java @@ -39,13 +39,9 @@ import mage.game.permanent.Permanent; */ -public class SourceTappedCondition implements Condition { +public enum SourceTappedCondition implements Condition { - private static final SourceTappedCondition fInstance = new SourceTappedCondition(); - - public static SourceTappedCondition getInstance() { - return fInstance; - } + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/SpellMasteryCondition.java b/Mage/src/main/java/mage/abilities/condition/common/SpellMasteryCondition.java index 48755fcb65..be61dc648d 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/SpellMasteryCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/SpellMasteryCondition.java @@ -19,25 +19,15 @@ import mage.players.Player; * @author LevelX2 */ -public class SpellMasteryCondition implements Condition { +public enum SpellMasteryCondition implements Condition { + instance; private static final FilterCard filter = new FilterCard(); static { filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY))); } - - private static SpellMasteryCondition fInstance = null; - public static SpellMasteryCondition getInstance() { - if (fInstance == null) { - fInstance = new SpellMasteryCondition(); - } - return fInstance; - } - - private SpellMasteryCondition() {} - @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); diff --git a/Mage/src/main/java/mage/abilities/condition/common/SurgedCondition.java b/Mage/src/main/java/mage/abilities/condition/common/SurgedCondition.java index 609b14dd82..be6f0d6366 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/SurgedCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/SurgedCondition.java @@ -38,19 +38,9 @@ import mage.game.Game; * * @author LevelX2 */ -public class SurgedCondition implements Condition { +public enum SurgedCondition implements Condition { - private static SurgedCondition fInstance = null; - - private SurgedCondition() { - } - - public static Condition getInstance() { - if (fInstance == null) { - fInstance = new SurgedCondition(); - } - return fInstance; - } + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/SuspendedCondition.java b/Mage/src/main/java/mage/abilities/condition/common/SuspendedCondition.java index f4418d394c..44e2ba7aaf 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/SuspendedCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/SuspendedCondition.java @@ -47,15 +47,15 @@ import mage.game.Game; public class SuspendedCondition implements Condition { - private static SuspendedCondition fInstance = null; + private static SuspendedCondition instance = null; private SuspendedCondition() {} public static Condition getInstance() { - if (fInstance == null) { - fInstance = new SuspendedCondition(); + if (instance == null) { + instance = new SuspendedCondition(); } - return fInstance; + return instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/condition/common/TargetAttackedThisTurnCondition.java b/Mage/src/main/java/mage/abilities/condition/common/TargetAttackedThisTurnCondition.java index 83f599ab1b..dfd46e14f4 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/TargetAttackedThisTurnCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/TargetAttackedThisTurnCondition.java @@ -34,10 +34,10 @@ import mage.game.permanent.Permanent; import mage.watchers.common.AttackedThisTurnWatcher; /** - * * @author MTGfan */ -public class TargetAttackedThisTurnCondition implements Condition { +public enum TargetAttackedThisTurnCondition implements Condition { + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/TributeNotPaidCondition.java b/Mage/src/main/java/mage/abilities/condition/common/TributeNotPaidCondition.java index df8de81d5e..a5c0cb1007 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/TributeNotPaidCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/TributeNotPaidCondition.java @@ -36,19 +36,9 @@ import mage.game.Game; * * @author LevelX2 */ -public class TributeNotPaidCondition implements Condition { +public enum TributeNotPaidCondition implements Condition { - private static TributeNotPaidCondition fInstance = null; - - private TributeNotPaidCondition() { - } - - public static Condition getInstance() { - if (fInstance == null) { - fInstance = new TributeNotPaidCondition(); - } - return fInstance; - } + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/TwoOrMoreSpellsWereCastLastTurnCondition.java b/Mage/src/main/java/mage/abilities/condition/common/TwoOrMoreSpellsWereCastLastTurnCondition.java index a2bfe32774..a2a9ea8d19 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/TwoOrMoreSpellsWereCastLastTurnCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/TwoOrMoreSpellsWereCastLastTurnCondition.java @@ -35,13 +35,9 @@ import mage.watchers.common.CastSpellLastTurnWatcher; /** * @author nantuko */ -public class TwoOrMoreSpellsWereCastLastTurnCondition implements Condition { +public enum TwoOrMoreSpellsWereCastLastTurnCondition implements Condition { - private static TwoOrMoreSpellsWereCastLastTurnCondition fInstance = new TwoOrMoreSpellsWereCastLastTurnCondition(); - - public static Condition getInstance() { - return fInstance; - } + instance; @Override public boolean apply(Game game, Ability source) { diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/ColorsOfManaSpentToCastCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/ColorsOfManaSpentToCastCount.java index 2beb2dbe64..497b4e02de 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/ColorsOfManaSpentToCastCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/ColorsOfManaSpentToCastCount.java @@ -21,14 +21,14 @@ import mage.game.stack.Spell; */ public class ColorsOfManaSpentToCastCount implements DynamicValue { - private static final ColorsOfManaSpentToCastCount fINSTANCE = new ColorsOfManaSpentToCastCount(); + private static final ColorsOfManaSpentToCastCount instance = new ColorsOfManaSpentToCastCount(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static ColorsOfManaSpentToCastCount getInstance() { - return fINSTANCE; + return instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/ParleyCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/ParleyCount.java index cbb533f2ae..4a40e33d6c 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/ParleyCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/ParleyCount.java @@ -47,14 +47,14 @@ import mage.players.Player; */ public class ParleyCount implements DynamicValue, MageSingleton { - private static final ParleyCount fINSTANCE = new ParleyCount(); + private static final ParleyCount instance = new ParleyCount(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static ParleyCount getInstance() { - return fINSTANCE; + return instance; } @Override @@ -82,7 +82,7 @@ public class ParleyCount implements DynamicValue, MageSingleton { @Override public ParleyCount copy() { - return fINSTANCE; + return instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/SourcePermanentToughnessValue.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/SourcePermanentToughnessValue.java index 9a51bae3c6..be94a28ace 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/SourcePermanentToughnessValue.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/SourcePermanentToughnessValue.java @@ -44,14 +44,14 @@ import java.io.ObjectStreamException; public class SourcePermanentToughnessValue implements DynamicValue { - private static final SourcePermanentToughnessValue fINSTANCE = new SourcePermanentToughnessValue(); + private static final SourcePermanentToughnessValue instance = new SourcePermanentToughnessValue(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static SourcePermanentToughnessValue getInstance() { - return fINSTANCE; + return instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/TargetPermanenToughnessValue.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/TargetPermanenToughnessValue.java index d70242d6f1..775ad75adc 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/TargetPermanenToughnessValue.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/TargetPermanenToughnessValue.java @@ -44,14 +44,14 @@ import java.io.ObjectStreamException; public class TargetPermanenToughnessValue implements DynamicValue { - private static final TargetPermanenToughnessValue fINSTANCE = new TargetPermanenToughnessValue(); + private static final TargetPermanenToughnessValue instance = new TargetPermanenToughnessValue(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static TargetPermanenToughnessValue getInstance() { - return fINSTANCE; + return instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/effects/common/ClashEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ClashEffect.java index c112eba43a..2eb12ec5e1 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ClashEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ClashEffect.java @@ -83,10 +83,10 @@ import mage.target.common.TargetOpponent; */ public class ClashEffect extends OneShotEffect implements MageSingleton { - private static final ClashEffect fINSTANCE = new ClashEffect(); + private static final ClashEffect instance = new ClashEffect(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } private ClashEffect() { @@ -95,7 +95,7 @@ public class ClashEffect extends OneShotEffect implements MageSingleton { } public static ClashEffect getInstance() { - return fINSTANCE; + return instance; } public ClashEffect(final ClashEffect effect) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/ClashWinReturnToHandSpellEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ClashWinReturnToHandSpellEffect.java index fafa73d836..fbe9168aba 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ClashWinReturnToHandSpellEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ClashWinReturnToHandSpellEffect.java @@ -42,10 +42,10 @@ import mage.players.Player; */ public class ClashWinReturnToHandSpellEffect extends OneShotEffect implements MageSingleton { - private static final ClashWinReturnToHandSpellEffect fINSTANCE = new ClashWinReturnToHandSpellEffect(); + private static final ClashWinReturnToHandSpellEffect instance = new ClashWinReturnToHandSpellEffect(); public static ClashWinReturnToHandSpellEffect getInstance() { - return fINSTANCE; + return instance; } private ClashWinReturnToHandSpellEffect() { @@ -70,6 +70,6 @@ public class ClashWinReturnToHandSpellEffect extends OneShotEffect implements Ma @Override public ClashWinReturnToHandSpellEffect copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/DontUntapAsLongAsSourceTappedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DontUntapAsLongAsSourceTappedEffect.java index 553a2ea964..214074d926 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DontUntapAsLongAsSourceTappedEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DontUntapAsLongAsSourceTappedEffect.java @@ -43,7 +43,7 @@ import mage.game.events.GameEvent; public class DontUntapAsLongAsSourceTappedEffect extends ConditionalContinuousRuleModifyingEffect { public DontUntapAsLongAsSourceTappedEffect() { - super(new DontUntapInControllersUntapStepTargetEffect(Duration.Custom), SourceTappedCondition.getInstance()); + super(new DontUntapInControllersUntapStepTargetEffect(Duration.Custom), SourceTappedCondition.instance); staticText = "It doesn't untap during its controller's untap step for as long as {source} remains tapped."; } diff --git a/Mage/src/main/java/mage/abilities/effects/common/ExileSpellEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ExileSpellEffect.java index dc53188563..c1e3cad401 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ExileSpellEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ExileSpellEffect.java @@ -43,10 +43,10 @@ import mage.players.Player; */ public class ExileSpellEffect extends OneShotEffect implements MageSingleton { - private static final ExileSpellEffect fINSTANCE = new ExileSpellEffect(); + private static final ExileSpellEffect instance = new ExileSpellEffect(); public static ExileSpellEffect getInstance() { - return fINSTANCE; + return instance; } private ExileSpellEffect() { @@ -56,7 +56,7 @@ public class ExileSpellEffect extends OneShotEffect implements MageSingleton { @Override public ExileSpellEffect copy() { - return fINSTANCE; + return instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandSpellEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandSpellEffect.java index f19f56f863..107b5b1211 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandSpellEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandSpellEffect.java @@ -15,10 +15,10 @@ import mage.players.Player; */ public class ReturnToHandSpellEffect extends OneShotEffect implements MageSingleton { - private static final ReturnToHandSpellEffect fINSTANCE = new ReturnToHandSpellEffect(); + private static final ReturnToHandSpellEffect instance = new ReturnToHandSpellEffect(); public static ReturnToHandSpellEffect getInstance() { - return fINSTANCE; + return instance; } private ReturnToHandSpellEffect() { @@ -39,6 +39,6 @@ public class ReturnToHandSpellEffect extends OneShotEffect implements MageSingle @Override public ReturnToHandSpellEffect copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/ShuffleSpellEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ShuffleSpellEffect.java index c1e0e79bcc..f5b83a7ecb 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ShuffleSpellEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ShuffleSpellEffect.java @@ -42,10 +42,10 @@ import mage.players.Player; */ public class ShuffleSpellEffect extends OneShotEffect implements MageSingleton { - private static final ShuffleSpellEffect fINSTANCE = new ShuffleSpellEffect(); + private static final ShuffleSpellEffect instance = new ShuffleSpellEffect(); public static ShuffleSpellEffect getInstance() { - return fINSTANCE; + return instance; } private ShuffleSpellEffect() { @@ -75,6 +75,6 @@ public class ShuffleSpellEffect extends OneShotEffect implements MageSingleton { @Override public ShuffleSpellEffect copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/CastFromHandWithoutPayingManaCostEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/CastFromHandWithoutPayingManaCostEffect.java index e71c15fd29..dcd3f9695e 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/CastFromHandWithoutPayingManaCostEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/CastFromHandWithoutPayingManaCostEffect.java @@ -38,7 +38,7 @@ public class CastFromHandWithoutPayingManaCostEffect extends ContinuousEffectImp Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { controller.getAlternativeSourceCosts().add(new AlternativeCostSourceAbility( - null, new CompoundCondition(SourceIsSpellCondition.getInstance(), new IsBeingCastFromHandCondition()), null, new FilterNonlandCard(), true)); + null, new CompoundCondition(SourceIsSpellCondition.instance, new IsBeingCastFromHandCondition()), null, new FilterNonlandCard(), true)); return true; } return false; diff --git a/Mage/src/main/java/mage/abilities/keyword/AttacksThisTurnMarkerAbility.java b/Mage/src/main/java/mage/abilities/keyword/AttacksThisTurnMarkerAbility.java index 2186846bc9..5bf664457d 100644 --- a/Mage/src/main/java/mage/abilities/keyword/AttacksThisTurnMarkerAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/AttacksThisTurnMarkerAbility.java @@ -42,14 +42,14 @@ import java.io.ObjectStreamException; */ public class AttacksThisTurnMarkerAbility extends StaticAbility implements MageSingleton { - private static final AttacksThisTurnMarkerAbility fINSTANCE = new AttacksThisTurnMarkerAbility(); + private static final AttacksThisTurnMarkerAbility instance = new AttacksThisTurnMarkerAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static AttacksThisTurnMarkerAbility getInstance() { - return fINSTANCE; + return instance; } private AttacksThisTurnMarkerAbility() { @@ -63,7 +63,7 @@ public class AttacksThisTurnMarkerAbility extends StaticAbility implements MageS @Override public AttacksThisTurnMarkerAbility copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/BlocksThisTurnMarkerAbility.java b/Mage/src/main/java/mage/abilities/keyword/BlocksThisTurnMarkerAbility.java index 14367db063..9b8abc104b 100644 --- a/Mage/src/main/java/mage/abilities/keyword/BlocksThisTurnMarkerAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/BlocksThisTurnMarkerAbility.java @@ -42,14 +42,14 @@ import java.io.ObjectStreamException; */ public class BlocksThisTurnMarkerAbility extends StaticAbility implements MageSingleton { - private static final BlocksThisTurnMarkerAbility fINSTANCE = new BlocksThisTurnMarkerAbility(); + private static final BlocksThisTurnMarkerAbility instance = new BlocksThisTurnMarkerAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static BlocksThisTurnMarkerAbility getInstance() { - return fINSTANCE; + return instance; } private BlocksThisTurnMarkerAbility() { @@ -63,7 +63,7 @@ public class BlocksThisTurnMarkerAbility extends StaticAbility implements MageSi @Override public BlocksThisTurnMarkerAbility copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/CanBlockSpaceflightAbility.java b/Mage/src/main/java/mage/abilities/keyword/CanBlockSpaceflightAbility.java index b65edc6129..68138e2f0f 100644 --- a/Mage/src/main/java/mage/abilities/keyword/CanBlockSpaceflightAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/CanBlockSpaceflightAbility.java @@ -16,14 +16,14 @@ import mage.constants.Zone; */ public class CanBlockSpaceflightAbility extends StaticAbility implements MageSingleton { - private static final CanBlockSpaceflightAbility fINSTANCE = new CanBlockSpaceflightAbility(); + private static final CanBlockSpaceflightAbility instance = new CanBlockSpaceflightAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static CanBlockSpaceflightAbility getInstance() { - return fINSTANCE; + return instance; } private CanBlockSpaceflightAbility() { @@ -37,7 +37,7 @@ public class CanBlockSpaceflightAbility extends StaticAbility implements MageSin @Override public CanBlockSpaceflightAbility copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/CantBlockAloneAbility.java b/Mage/src/main/java/mage/abilities/keyword/CantBlockAloneAbility.java index 8b4b316e36..3ce090656b 100644 --- a/Mage/src/main/java/mage/abilities/keyword/CantBlockAloneAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/CantBlockAloneAbility.java @@ -39,14 +39,14 @@ import java.io.ObjectStreamException; */ public class CantBlockAloneAbility extends StaticAbility implements MageSingleton { - private static final CantBlockAloneAbility fINSTANCE = new CantBlockAloneAbility(); + private static final CantBlockAloneAbility instance = new CantBlockAloneAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static CantBlockAloneAbility getInstance() { - return fINSTANCE; + return instance; } private CantBlockAloneAbility() { @@ -60,7 +60,7 @@ public class CantBlockAloneAbility extends StaticAbility implements MageSingleto @Override public CantBlockAloneAbility copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/ChangelingAbility.java b/Mage/src/main/java/mage/abilities/keyword/ChangelingAbility.java index bc90a8764c..f5fd5047c3 100644 --- a/Mage/src/main/java/mage/abilities/keyword/ChangelingAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/ChangelingAbility.java @@ -45,14 +45,14 @@ import mage.constants.Zone; */ public class ChangelingAbility extends StaticAbility implements MageSingleton { public static final String ALL_CREATURE_TYPE = "All Creature Type"; - private static final ChangelingAbility fINSTANCE = new ChangelingAbility(); + private static final ChangelingAbility instance = new ChangelingAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static ChangelingAbility getInstance() { - return fINSTANCE; + return instance; } private ChangelingAbility() { @@ -66,6 +66,6 @@ public class ChangelingAbility extends StaticAbility implements MageSingleton { @Override public ChangelingAbility copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/DashAbility.java b/Mage/src/main/java/mage/abilities/keyword/DashAbility.java index 20a087dd96..93a7f9fe42 100644 --- a/Mage/src/main/java/mage/abilities/keyword/DashAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/DashAbility.java @@ -76,7 +76,7 @@ public class DashAbility extends StaticAbility implements AlternativeSourceCosts this.addDashCost(manaString); Ability ability = new EntersBattlefieldAbility( new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.Custom, false), - DashedCondition.getInstance(), "", ""); + DashedCondition.instance, "", ""); ability.addEffect(new DashAddDelayedTriggeredAbilityEffect()); addSubAbility(ability); diff --git a/Mage/src/main/java/mage/abilities/keyword/DeathtouchAbility.java b/Mage/src/main/java/mage/abilities/keyword/DeathtouchAbility.java index 2fbebd9025..514a4e3370 100644 --- a/Mage/src/main/java/mage/abilities/keyword/DeathtouchAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/DeathtouchAbility.java @@ -40,14 +40,14 @@ import java.io.ObjectStreamException; */ public class DeathtouchAbility extends StaticAbility implements MageSingleton { - private static final DeathtouchAbility fINSTANCE = new DeathtouchAbility(); + private static final DeathtouchAbility instance = new DeathtouchAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static DeathtouchAbility getInstance() { - return fINSTANCE; + return instance; } private DeathtouchAbility() { @@ -61,7 +61,7 @@ public class DeathtouchAbility extends StaticAbility implements MageSingleton { @Override public DeathtouchAbility copy() { - return fINSTANCE; + return instance; } diff --git a/Mage/src/main/java/mage/abilities/keyword/DefenderAbility.java b/Mage/src/main/java/mage/abilities/keyword/DefenderAbility.java index 88f9dc8d93..293ad9adb2 100644 --- a/Mage/src/main/java/mage/abilities/keyword/DefenderAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/DefenderAbility.java @@ -40,14 +40,14 @@ import java.io.ObjectStreamException; */ public class DefenderAbility extends StaticAbility implements MageSingleton { - private static final DefenderAbility fINSTANCE = new DefenderAbility(); + private static final DefenderAbility instance = new DefenderAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static DefenderAbility getInstance() { - return fINSTANCE; + return instance; } private DefenderAbility() { @@ -61,7 +61,7 @@ public class DefenderAbility extends StaticAbility implements MageSingleton { @Override public DefenderAbility copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/DoubleStrikeAbility.java b/Mage/src/main/java/mage/abilities/keyword/DoubleStrikeAbility.java index ab99217ac2..7eeb71613f 100644 --- a/Mage/src/main/java/mage/abilities/keyword/DoubleStrikeAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/DoubleStrikeAbility.java @@ -38,14 +38,14 @@ import mage.constants.Zone; */ public class DoubleStrikeAbility extends StaticAbility implements MageSingleton { - private static final DoubleStrikeAbility fINSTANCE = new DoubleStrikeAbility(); + private static final DoubleStrikeAbility instance = new DoubleStrikeAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static DoubleStrikeAbility getInstance() { - return fINSTANCE; + return instance; } private DoubleStrikeAbility() { @@ -59,7 +59,7 @@ public class DoubleStrikeAbility extends StaticAbility implements MageSingleton @Override public DoubleStrikeAbility copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/EvokeAbility.java b/Mage/src/main/java/mage/abilities/keyword/EvokeAbility.java index 8253232c6e..1b4d95d151 100644 --- a/Mage/src/main/java/mage/abilities/keyword/EvokeAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/EvokeAbility.java @@ -68,7 +68,7 @@ public class EvokeAbility extends StaticAbility implements AlternativeSourceCost super(Zone.ALL, null); name = EVOKE_KEYWORD; this.addEvokeCost(manaString); - Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceEffect()), EvokedCondition.getInstance(), "Sacrifice {this} when it enters the battlefield and was evoked."); + Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceEffect()), EvokedCondition.instance, "Sacrifice {this} when it enters the battlefield and was evoked."); ability.setRuleVisible(false); addSubAbility(ability); diff --git a/Mage/src/main/java/mage/abilities/keyword/FearAbility.java b/Mage/src/main/java/mage/abilities/keyword/FearAbility.java index 970232efcf..e730552c9d 100644 --- a/Mage/src/main/java/mage/abilities/keyword/FearAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/FearAbility.java @@ -45,14 +45,14 @@ import java.io.ObjectStreamException; */ public class FearAbility extends EvasionAbility implements MageSingleton { - private static final FearAbility fINSTANCE = new FearAbility(); + private static final FearAbility instance = new FearAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static FearAbility getInstance() { - return fINSTANCE; + return instance; } private FearAbility() { @@ -66,7 +66,7 @@ public class FearAbility extends EvasionAbility implements MageSingleton { @Override public FearAbility copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/FirstStrikeAbility.java b/Mage/src/main/java/mage/abilities/keyword/FirstStrikeAbility.java index c1485c345d..5dfdf7cb1a 100644 --- a/Mage/src/main/java/mage/abilities/keyword/FirstStrikeAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/FirstStrikeAbility.java @@ -38,14 +38,14 @@ import mage.constants.Zone; */ public class FirstStrikeAbility extends StaticAbility implements MageSingleton { - private static final FirstStrikeAbility fINSTANCE = new FirstStrikeAbility(); + private static final FirstStrikeAbility instance = new FirstStrikeAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static FirstStrikeAbility getInstance() { - return fINSTANCE; + return instance; } private FirstStrikeAbility() { @@ -59,7 +59,7 @@ public class FirstStrikeAbility extends StaticAbility implements MageSingleton { @Override public FirstStrikeAbility copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/FlashAbility.java b/Mage/src/main/java/mage/abilities/keyword/FlashAbility.java index 41f89de06a..e7ea3fa3ed 100644 --- a/Mage/src/main/java/mage/abilities/keyword/FlashAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/FlashAbility.java @@ -39,14 +39,14 @@ import mage.constants.Zone; */ public class FlashAbility extends StaticAbility implements MageSingleton { - private static final FlashAbility fINSTANCE = new FlashAbility(); + private static final FlashAbility instance = new FlashAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static FlashAbility getInstance() { - return fINSTANCE; + return instance; } private FlashAbility() { @@ -60,7 +60,7 @@ public class FlashAbility extends StaticAbility implements MageSingleton { @Override public FlashAbility copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/FlyingAbility.java b/Mage/src/main/java/mage/abilities/keyword/FlyingAbility.java index 9b9422c20f..fd14febbe8 100644 --- a/Mage/src/main/java/mage/abilities/keyword/FlyingAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/FlyingAbility.java @@ -45,14 +45,14 @@ import mage.constants.AsThoughEffectType; */ public class FlyingAbility extends EvasionAbility implements MageSingleton { - private static final FlyingAbility fINSTANCE = new FlyingAbility(); + private static final FlyingAbility instance = new FlyingAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static FlyingAbility getInstance() { - return fINSTANCE; + return instance; } private FlyingAbility() { @@ -66,7 +66,7 @@ public class FlyingAbility extends EvasionAbility implements MageSingleton { @Override public FlyingAbility copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/HasteAbility.java b/Mage/src/main/java/mage/abilities/keyword/HasteAbility.java index 58f4281ab7..5775e28086 100644 --- a/Mage/src/main/java/mage/abilities/keyword/HasteAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/HasteAbility.java @@ -38,14 +38,14 @@ import mage.constants.Zone; */ public class HasteAbility extends StaticAbility implements MageSingleton { - private static final HasteAbility fINSTANCE = new HasteAbility(); + private static final HasteAbility instance = new HasteAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static HasteAbility getInstance() { - return fINSTANCE; + return instance; } private HasteAbility() { @@ -59,7 +59,7 @@ public class HasteAbility extends StaticAbility implements MageSingleton { @Override public HasteAbility copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/HexproofAbility.java b/Mage/src/main/java/mage/abilities/keyword/HexproofAbility.java index 255781973c..1395823500 100644 --- a/Mage/src/main/java/mage/abilities/keyword/HexproofAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/HexproofAbility.java @@ -13,18 +13,18 @@ import mage.constants.Zone; */ public class HexproofAbility extends SimpleStaticAbility implements MageSingleton { - private static final HexproofAbility fINSTANCE; + private static final HexproofAbility instance; static { - fINSTANCE = new HexproofAbility(); + instance = new HexproofAbility(); } private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static HexproofAbility getInstance() { - return fINSTANCE; + return instance; } private HexproofAbility() { @@ -33,7 +33,7 @@ public class HexproofAbility extends SimpleStaticAbility implements MageSingleto @Override public HexproofAbility copy() { - return fINSTANCE; + return instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/keyword/HorsemanshipAbility.java b/Mage/src/main/java/mage/abilities/keyword/HorsemanshipAbility.java index e609068ec1..ed6f3afec5 100644 --- a/Mage/src/main/java/mage/abilities/keyword/HorsemanshipAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/HorsemanshipAbility.java @@ -43,14 +43,14 @@ import mage.game.permanent.Permanent; */ public class HorsemanshipAbility extends EvasionAbility implements MageSingleton { - private static final HorsemanshipAbility fINSTANCE = new HorsemanshipAbility(); + private static final HorsemanshipAbility instance = new HorsemanshipAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static HorsemanshipAbility getInstance() { - return fINSTANCE; + return instance; } private HorsemanshipAbility() { @@ -64,7 +64,7 @@ public class HorsemanshipAbility extends EvasionAbility implements MageSingleton @Override public HorsemanshipAbility copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/IndestructibleAbility.java b/Mage/src/main/java/mage/abilities/keyword/IndestructibleAbility.java index 5f3c97cf34..d5a09f1629 100644 --- a/Mage/src/main/java/mage/abilities/keyword/IndestructibleAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/IndestructibleAbility.java @@ -54,18 +54,18 @@ import mage.abilities.StaticAbility; public class IndestructibleAbility extends StaticAbility { - private static final IndestructibleAbility fINSTANCE; + private static final IndestructibleAbility instance; static { - fINSTANCE = new IndestructibleAbility(); + instance = new IndestructibleAbility(); } private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static IndestructibleAbility getInstance() { - return fINSTANCE; + return instance; } private IndestructibleAbility() { @@ -74,7 +74,7 @@ public class IndestructibleAbility extends StaticAbility { @Override public IndestructibleAbility copy() { - return fINSTANCE; + return instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/keyword/InfectAbility.java b/Mage/src/main/java/mage/abilities/keyword/InfectAbility.java index 438f48471d..48c4f0681f 100644 --- a/Mage/src/main/java/mage/abilities/keyword/InfectAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/InfectAbility.java @@ -59,14 +59,14 @@ import java.io.ObjectStreamException; */ public class InfectAbility extends StaticAbility implements MageSingleton { - private static final InfectAbility fINSTANCE = new InfectAbility(); + private static final InfectAbility instance = new InfectAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static InfectAbility getInstance() { - return fINSTANCE; + return instance; } private InfectAbility() { @@ -80,7 +80,7 @@ public class InfectAbility extends StaticAbility implements MageSingleton { @Override public InfectAbility copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/IntimidateAbility.java b/Mage/src/main/java/mage/abilities/keyword/IntimidateAbility.java index 6808338952..e510c857ea 100644 --- a/Mage/src/main/java/mage/abilities/keyword/IntimidateAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/IntimidateAbility.java @@ -23,10 +23,10 @@ import mage.game.permanent.Permanent; * */ public class IntimidateAbility extends EvasionAbility implements MageSingleton { - private static final IntimidateAbility fInstance = new IntimidateAbility(); + private static final IntimidateAbility instance = new IntimidateAbility(); public static IntimidateAbility getInstance() { - return fInstance; + return instance; } private IntimidateAbility() { @@ -40,7 +40,7 @@ public class IntimidateAbility extends EvasionAbility implements MageSingleton @Override public IntimidateAbility copy() { - return fInstance; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/LeylineAbility.java b/Mage/src/main/java/mage/abilities/keyword/LeylineAbility.java index 77d83180e1..63702fe8b8 100644 --- a/Mage/src/main/java/mage/abilities/keyword/LeylineAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/LeylineAbility.java @@ -43,14 +43,14 @@ import mage.players.Player; */ public class LeylineAbility extends StaticAbility implements MageSingleton, OpeningHandAction { - private static final LeylineAbility fINSTANCE = new LeylineAbility(); + private static final LeylineAbility instance = new LeylineAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static LeylineAbility getInstance() { - return fINSTANCE; + return instance; } private LeylineAbility() { @@ -64,7 +64,7 @@ public class LeylineAbility extends StaticAbility implements MageSingleton, Open @Override public LeylineAbility copy() { - return fINSTANCE; + return instance; } @Override diff --git a/Mage/src/main/java/mage/abilities/keyword/LifelinkAbility.java b/Mage/src/main/java/mage/abilities/keyword/LifelinkAbility.java index 8378973caf..c22dde451a 100644 --- a/Mage/src/main/java/mage/abilities/keyword/LifelinkAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/LifelinkAbility.java @@ -40,14 +40,14 @@ import java.io.ObjectStreamException; */ public class LifelinkAbility extends StaticAbility implements MageSingleton { - private static final LifelinkAbility fINSTANCE = new LifelinkAbility(); + private static final LifelinkAbility instance = new LifelinkAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static LifelinkAbility getInstance() { - return fINSTANCE; + return instance; } private LifelinkAbility() { @@ -61,7 +61,7 @@ public class LifelinkAbility extends StaticAbility implements MageSingleton { @Override public LifelinkAbility copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/MadnessAbility.java b/Mage/src/main/java/mage/abilities/keyword/MadnessAbility.java index 010126bd44..aa24ffb848 100644 --- a/Mage/src/main/java/mage/abilities/keyword/MadnessAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/MadnessAbility.java @@ -67,7 +67,7 @@ public class MadnessAbility extends StaticAbility { } public static Condition GetCondition() { - return MadnessCondition.getInstance(); + return MadnessCondition.instance; } @Override @@ -248,19 +248,9 @@ class MadnessCastEffect extends OneShotEffect { } } -class MadnessCondition implements Condition { +enum MadnessCondition implements Condition { - private static MadnessCondition fInstance = null; - - private MadnessCondition() { - } - - public static Condition getInstance() { - if (fInstance == null) { - fInstance = new MadnessCondition(); - } - return fInstance; - } + instance; @Override public boolean apply(Game game, Ability source) { @@ -268,7 +258,7 @@ class MadnessCondition implements Condition { if (card != null) { for (Ability ability : card.getAbilities()) { if (ability instanceof MadnessTriggeredAbility) { - if (((MadnessTriggeredAbility) ability).isActivated()) { + if (ability.isActivated()) { return true; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/PartnerAbility.java b/Mage/src/main/java/mage/abilities/keyword/PartnerAbility.java index 6b41ed71c1..936aa998e6 100644 --- a/Mage/src/main/java/mage/abilities/keyword/PartnerAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/PartnerAbility.java @@ -16,14 +16,14 @@ import mage.constants.Zone; */ public class PartnerAbility extends StaticAbility implements MageSingleton { - private static final PartnerAbility fINSTANCE = new PartnerAbility(); + private static final PartnerAbility instance = new PartnerAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static PartnerAbility getInstance() { - return fINSTANCE; + return instance; } private PartnerAbility() { @@ -37,7 +37,7 @@ public class PartnerAbility extends StaticAbility implements MageSingleton { @Override public PartnerAbility copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/PhasingAbility.java b/Mage/src/main/java/mage/abilities/keyword/PhasingAbility.java index 7dbb750975..a9eaeae124 100644 --- a/Mage/src/main/java/mage/abilities/keyword/PhasingAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/PhasingAbility.java @@ -39,14 +39,14 @@ import mage.constants.Zone; */ public class PhasingAbility extends StaticAbility implements MageSingleton { - private static final PhasingAbility fINSTANCE = new PhasingAbility(); + private static final PhasingAbility instance = new PhasingAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static PhasingAbility getInstance() { - return fINSTANCE; + return instance; } private PhasingAbility() { @@ -60,7 +60,7 @@ public class PhasingAbility extends StaticAbility implements MageSingleton { @Override public PhasingAbility copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/ReachAbility.java b/Mage/src/main/java/mage/abilities/keyword/ReachAbility.java index dffd66784e..88e97204f6 100644 --- a/Mage/src/main/java/mage/abilities/keyword/ReachAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/ReachAbility.java @@ -40,14 +40,14 @@ import java.io.ObjectStreamException; */ public class ReachAbility extends StaticAbility implements MageSingleton { - private static final ReachAbility fINSTANCE = new ReachAbility(); + private static final ReachAbility instance = new ReachAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static ReachAbility getInstance() { - return fINSTANCE; + return instance; } private ReachAbility() { @@ -61,7 +61,7 @@ public class ReachAbility extends StaticAbility implements MageSingleton { @Override public ReachAbility copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/ReboundAbility.java b/Mage/src/main/java/mage/abilities/keyword/ReboundAbility.java index 6ae658ce79..5e3baf1d3d 100644 --- a/Mage/src/main/java/mage/abilities/keyword/ReboundAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/ReboundAbility.java @@ -168,7 +168,7 @@ class ReboundEffectCastFromExileDelayedTrigger extends DelayedTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { - return MyTurnCondition.getInstance().apply(game, this); + return MyTurnCondition.instance.apply(game, this); } @Override diff --git a/Mage/src/main/java/mage/abilities/keyword/ShadowAbility.java b/Mage/src/main/java/mage/abilities/keyword/ShadowAbility.java index 57b41e1b34..667e4aa22f 100644 --- a/Mage/src/main/java/mage/abilities/keyword/ShadowAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/ShadowAbility.java @@ -15,14 +15,14 @@ import mage.game.permanent.Permanent; * @author Loki */ public class ShadowAbility extends EvasionAbility implements MageSingleton { - private static final ShadowAbility fINSTANCE = new ShadowAbility(); + private static final ShadowAbility instance = new ShadowAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static ShadowAbility getInstance() { - return fINSTANCE; + return instance; } private ShadowAbility() { @@ -36,7 +36,7 @@ public class ShadowAbility extends EvasionAbility implements MageSingleton { @Override public ShadowAbility copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/ShroudAbility.java b/Mage/src/main/java/mage/abilities/keyword/ShroudAbility.java index f796e2a8db..53e32db450 100644 --- a/Mage/src/main/java/mage/abilities/keyword/ShroudAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/ShroudAbility.java @@ -40,14 +40,14 @@ import java.io.ObjectStreamException; */ public class ShroudAbility extends StaticAbility implements MageSingleton { - private static final ShroudAbility fINSTANCE = new ShroudAbility(); + private static final ShroudAbility instance = new ShroudAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static ShroudAbility getInstance() { - return fINSTANCE; + return instance; } private ShroudAbility() { @@ -61,7 +61,7 @@ public class ShroudAbility extends StaticAbility implements MageSingleton { @Override public ShroudAbility copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/SpaceflightAbility.java b/Mage/src/main/java/mage/abilities/keyword/SpaceflightAbility.java index f4a84542c0..961f8c2ae9 100644 --- a/Mage/src/main/java/mage/abilities/keyword/SpaceflightAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/SpaceflightAbility.java @@ -42,14 +42,14 @@ import mage.game.permanent.Permanent; */ public class SpaceflightAbility extends EvasionAbility implements MageSingleton { - private static final SpaceflightAbility fINSTANCE = new SpaceflightAbility(); + private static final SpaceflightAbility instance = new SpaceflightAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static SpaceflightAbility getInstance() { - return fINSTANCE; + return instance; } private SpaceflightAbility() { @@ -63,7 +63,7 @@ public class SpaceflightAbility extends EvasionAbility implements MageSingleton @Override public SpaceflightAbility copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/TrampleAbility.java b/Mage/src/main/java/mage/abilities/keyword/TrampleAbility.java index 20827ee62f..ceffd46ff2 100644 --- a/Mage/src/main/java/mage/abilities/keyword/TrampleAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/TrampleAbility.java @@ -38,14 +38,14 @@ import mage.constants.Zone; */ public class TrampleAbility extends StaticAbility implements MageSingleton { - private static final TrampleAbility fINSTANCE = new TrampleAbility(); + private static final TrampleAbility instance = new TrampleAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static TrampleAbility getInstance() { - return fINSTANCE; + return instance; } private TrampleAbility() { @@ -59,7 +59,7 @@ public class TrampleAbility extends StaticAbility implements MageSingleton { @Override public TrampleAbility copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/VigilanceAbility.java b/Mage/src/main/java/mage/abilities/keyword/VigilanceAbility.java index 44291510b0..a4d5f29d5a 100644 --- a/Mage/src/main/java/mage/abilities/keyword/VigilanceAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/VigilanceAbility.java @@ -40,14 +40,14 @@ import java.io.ObjectStreamException; */ public class VigilanceAbility extends StaticAbility implements MageSingleton { - private static final VigilanceAbility fINSTANCE = new VigilanceAbility(); + private static final VigilanceAbility instance = new VigilanceAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static VigilanceAbility getInstance() { - return fINSTANCE; + return instance; } private VigilanceAbility() { @@ -61,7 +61,7 @@ public class VigilanceAbility extends StaticAbility implements MageSingleton { @Override public VigilanceAbility copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/abilities/keyword/WitherAbility.java b/Mage/src/main/java/mage/abilities/keyword/WitherAbility.java index 2dc2c5d8c8..a88922d345 100644 --- a/Mage/src/main/java/mage/abilities/keyword/WitherAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/WitherAbility.java @@ -49,14 +49,14 @@ import java.io.ObjectStreamException; */ public class WitherAbility extends StaticAbility implements MageSingleton { - private static final WitherAbility fINSTANCE = new WitherAbility(); + private static final WitherAbility instance = new WitherAbility(); private Object readResolve() throws ObjectStreamException { - return fINSTANCE; + return instance; } public static WitherAbility getInstance() { - return fINSTANCE; + return instance; } private WitherAbility() { @@ -70,7 +70,7 @@ public class WitherAbility extends StaticAbility implements MageSingleton { @Override public WitherAbility copy() { - return fINSTANCE; + return instance; } } diff --git a/Mage/src/main/java/mage/cards/Sets.java b/Mage/src/main/java/mage/cards/Sets.java index afa3a1d565..32084e9731 100644 --- a/Mage/src/main/java/mage/cards/Sets.java +++ b/Mage/src/main/java/mage/cards/Sets.java @@ -50,10 +50,10 @@ import java.util.*; public class Sets extends HashMap { private static final Logger logger = Logger.getLogger(Sets.class); - private static final Sets fINSTANCE = new Sets(); + private static final Sets instance = new Sets(); public static Sets getInstance() { - return fINSTANCE; + return instance; } private Set customSets = new HashSet<>(); @@ -136,8 +136,8 @@ public class Sets extends HashMap { } public static ExpansionSet findSet(String code) { - if (fINSTANCE.containsKey(code)) { - return fINSTANCE.get(code); + if (instance.containsKey(code)) { + return instance.get(code); } return null; } diff --git a/Mage/src/main/java/mage/game/GameOptions.java b/Mage/src/main/java/mage/game/GameOptions.java index abda1dabb4..1739fe0e2f 100644 --- a/Mage/src/main/java/mage/game/GameOptions.java +++ b/Mage/src/main/java/mage/game/GameOptions.java @@ -11,10 +11,10 @@ import mage.constants.PhaseStep; */ public class GameOptions implements Serializable { - private static final GameOptions defInstance = new GameOptions(); + private static final GameOptions deinstance = new GameOptions(); public static GameOptions getDefault() { - return defInstance; + return deinstance; } /**